Skip to content

Commit 9584343

Browse files
committed
Auto merge of #160222 - jhpratt:rollup-bWMwb4u, r=<try>
Rollup of 14 pull requests try-job: dist-various-1 try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1 try-job: aarch64-apple try-job: x86_64-mingw-1 try-job: i686-msvc-*
2 parents be3d26d + c33afba commit 9584343

179 files changed

Lines changed: 2579 additions & 2264 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/renovate.json5

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,40 @@
3131
"dependencyDashboardApproval": false
3232
},
3333
{
34-
// Only maintain the Cargo lockfiles managed by update-lockfile.sh.
34+
// Update all Cargo.lock files except library/Cargo.lock in one PR.
3535
"matchManagers": ["cargo"],
3636
"matchUpdateTypes": ["lockFileMaintenance"],
37-
"enabled": false
37+
"groupName": "Cargo lock file maintenance",
38+
"commitMessageAction": "Cargo lock file maintenance"
39+
},
40+
{
41+
// Update library/Cargo.lock in a dedicated PR.
42+
"matchManagers": ["cargo"],
43+
"matchUpdateTypes": ["lockFileMaintenance"],
44+
"matchFileNames": ["library/Cargo.lock"],
45+
"groupName": "library lock file maintenance",
46+
"commitMessageAction": "Library lock file maintenance"
3847
},
3948
{
49+
// These packages don't have a committed Cargo.lock file.
4050
"matchManagers": ["cargo"],
4151
"matchUpdateTypes": ["lockFileMaintenance"],
4252
"matchFileNames": [
43-
"Cargo.toml",
44-
"library/Cargo.toml",
45-
"src/tools/rustbook/Cargo.toml"
53+
"library/rustc-std-workspace-*/Cargo.toml",
4654
],
47-
"enabled": true
55+
"enabled": false
56+
},
57+
{
58+
// Update yarn.lock in a dedicated PR.
59+
"matchManagers": ["npm"],
60+
"matchUpdateTypes": ["lockFileMaintenance"],
61+
"groupName": "Yarn lock file maintenance",
62+
"commitMessageAction": "Yarn lock file maintenance"
4863
}
4964
],
50-
// Don't manage dependencies inside subtrees. They are updated upstream and
51-
// synced in. See `src/doc/rustc-dev-guide/src/external-repos.md` for the list.
5265
"ignorePaths": [
66+
// Don't manage dependencies inside subtrees. They are updated upstream and
67+
// synced in. See `src/doc/rustc-dev-guide/src/external-repos.md` for the list.
5368
"compiler/rustc_codegen_cranelift/**",
5469
"compiler/rustc_codegen_gcc/**",
5570
"library/compiler-builtins/**",
@@ -59,6 +74,10 @@
5974
"src/tools/clippy/**",
6075
"src/tools/miri/**",
6176
"src/tools/rust-analyzer/**",
62-
"src/tools/rustfmt/**"
77+
"src/tools/rustfmt/**",
78+
79+
// Test manifests are fixtures; their versions and lockfiles may
80+
// intentionally be part of the test input.
81+
"tests/**",
6382
]
6483
}

compiler/rustc_ast/src/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3071,7 +3071,7 @@ impl FnDecl {
30713071
} else {
30723072
arg.attrs
30733073
.iter()
3074-
.any(|attr| attr.has_name(sym::splat))
3074+
.any(|attr| attr.has_name(sym::rustc_splat))
30753075
.then_some(u8::try_from(index).unwrap())
30763076
}
30773077
})

compiler/rustc_ast_passes/src/ast_validation.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ enum SelfSemantic {
4646
No,
4747
}
4848

49-
/// Is `#[splat]` allowed semantically in a function or closure?
49+
/// Is `#[rustc_splat]` allowed semantically in a function or closure?
5050
/// Only applies to the function kind and header, the parameters are checked elsewhere.
5151
enum SplatSemantic {
5252
Yes,
@@ -439,7 +439,7 @@ impl<'a> AstValidator<'a> {
439439

440440
/// Emits an error if a function declaration has more than one splatted argument, with a
441441
/// C-variadic parameter, or a splat at an unsupported index (for performance).
442-
/// Example: `fn foo(#[splat] x: (), #[splat] y: ())` will emit an error.
442+
/// Example: `fn foo(#[rustc_splat] x: (), #[rustc_splat] y: ())` will emit an error.
443443
fn check_decl_splatting(
444444
&self,
445445
fn_decl: &FnDecl,
@@ -454,7 +454,7 @@ impl<'a> AstValidator<'a> {
454454
let splat_arg_spans: Vec<Span> = arg
455455
.attrs
456456
.iter()
457-
.filter_map(|attr| attr.has_name(sym::splat).then_some(attr.span))
457+
.filter_map(|attr| attr.has_name(sym::rustc_splat).then_some(attr.span))
458458
.collect();
459459
if splat_arg_spans.is_empty() {
460460
None
@@ -521,8 +521,14 @@ impl<'a> AstValidator<'a> {
521521
.flat_map(|i| i.attrs.as_ref())
522522
.filter(|attr| match &attr.kind {
523523
AttrKind::Normal(normal) => {
524-
let arr =
525-
[sym::allow, sym::deny, sym::expect, sym::forbid, sym::splat, sym::warn];
524+
let arr = [
525+
sym::allow,
526+
sym::deny,
527+
sym::expect,
528+
sym::forbid,
529+
sym::rustc_splat,
530+
sym::warn,
531+
];
526532
!attr.has_any_name(&arr) && rustc_attr_parsing::is_builtin_attr(&normal.item)
527533
}
528534
AttrKind::Synthetic(CfgTrace(_) | CfgAttrTrace(_)) => false,

compiler/rustc_ast_passes/src/diagnostics.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,46 +125,48 @@ pub(crate) struct FnParamCVarArgsNotLast {
125125

126126
#[derive(Diagnostic)]
127127
#[diag(
128-
"`#[splat]` is only supported on argument index {$max_valid_splatted_arg_index} or less, this `#[splat]` is on index {$first_invalid_splatted_arg_index}"
128+
"`#[rustc_splat]` is only supported on argument index {$max_valid_splatted_arg_index} or less, this `#[rustc_splat]` is on index {$first_invalid_splatted_arg_index}"
129+
)]
130+
#[help(
131+
"remove `#[rustc_splat]`, or use it on an argument closer to the start of the argument list"
129132
)]
130-
#[help("remove `#[splat]`, or use it on an argument closer to the start of the argument list")]
131133
pub(crate) struct InvalidSplattedArgs {
132134
pub max_valid_splatted_arg_index: u16,
133135

134136
pub first_invalid_splatted_arg_index: u16,
135137

136138
#[primary_span]
137-
#[label("`#[splat]` is not supported here")]
139+
#[label("`#[rustc_splat]` is not supported here")]
138140
pub spans: Vec<Span>,
139141
}
140142

141143
#[derive(Diagnostic)]
142-
#[diag("multiple `#[splat]`s are not allowed in the same function argument list")]
143-
#[help("remove `#[splat]` from all but one argument")]
144+
#[diag("multiple `#[rustc_splat]`s are not allowed in the same function argument list")]
145+
#[help("remove `#[rustc_splat]` from all but one argument")]
144146
pub(crate) struct DuplicateSplattedArgs {
145147
#[primary_span]
146148
pub spans: Vec<Span>,
147149
}
148150

149151
#[derive(Diagnostic)]
150-
#[diag("`...` and `#[splat]` are not allowed in the same function argument list")]
151-
#[help("remove `#[splat]` or remove `...`")]
152+
#[diag("`...` and `#[rustc_splat]` are not allowed in the same function argument list")]
153+
#[help("remove `#[rustc_splat]` or remove `...`")]
152154
pub(crate) struct CVarArgsAndSplat {
153155
#[primary_span]
154156
pub spans: Vec<Span>,
155157
}
156158

157159
#[derive(Diagnostic)]
158-
#[diag("`#[splat]` is not allowed on closure arguments")]
159-
#[help("remove `#[splat]` or turn the closure into a function")]
160+
#[diag("`#[rustc_splat]` is not allowed on closure arguments")]
161+
#[help("remove `#[rustc_splat]` or turn the closure into a function")]
160162
pub(crate) struct SplatNotAllowedOnClosures {
161163
#[primary_span]
162164
pub spans: Vec<Span>,
163165
}
164166

165167
#[derive(Diagnostic)]
166-
#[diag("`#[splat]` is not allowed in the arguments of functions with the `{$abi}` ABI")]
167-
#[help("remove `#[splat]` or change the ABI")]
168+
#[diag("`#[rustc_splat]` is not allowed in the arguments of functions with the `{$abi}` ABI")]
169+
#[help("remove `#[rustc_splat]` or change the ABI")]
168170
pub(crate) struct SplatNotAllowedOnAbiCall {
169171
#[primary_span]
170172
pub spans: Vec<Span>,

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,11 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
483483
gate_all!(pin_ergonomics, "pinned reference syntax is experimental");
484484
gate_all!(postfix_match, "postfix match is experimental");
485485
gate_all!(return_type_notation, "return type notation is experimental");
486-
gate_all!(splat, "`fn(#[splat] (a, ...))` is incomplete", "call as func((a, ...)) instead");
486+
gate_all!(
487+
splat,
488+
"`fn(#[rustc_splat] (a, ...))` is incomplete",
489+
"call as func((a, ...)) instead"
490+
);
487491
gate_all!(super_let, "`super let` is experimental");
488492
gate_all!(try_blocks_heterogeneous, "`try bikeshed` expression is experimental");
489493
gate_all!(unnamed_enum_variants, "unnamed enum variants are experimental");
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Attribute parsing for the `#[splat]` function argument overloading attribute.
1+
//! Attribute parsing for the `#[rustc_splat]` function argument overloading attribute.
22
//! This attribute modifies typecheck to support overload resolution, then modifies codegen for performance.
33
44
use rustc_feature::AttributeStability;
@@ -8,8 +8,9 @@ use super::prelude::*;
88
pub(crate) struct SplatParser;
99

1010
impl NoArgsAttributeParser for SplatParser {
11-
const PATH: &[Symbol] = &[sym::splat];
11+
const PATH: &[Symbol] = &[sym::rustc_splat];
1212
const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowList(&[Allow(Target::Param)]);
13-
const STABILITY: AttributeStability = unstable!(splat, "the `splat` attribute is experimental");
13+
const STABILITY: AttributeStability =
14+
unstable!(splat, "the `rustc_splat` attribute is experimental");
1415
const CREATE: fn(Span) -> AttributeKind = AttributeKind::Splat;
1516
}

compiler/rustc_codegen_llvm/src/attributes.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,7 @@ pub(crate) fn llfn_attrs_from_instance<'ll, 'tcx>(
530530
to_add.extend(sanitize_attrs(cx, tcx, codegen_fn_attrs.sanitizers));
531531

532532
// For non-naked functions, set branch protection attributes on aarch64.
533-
if let Some(BranchProtection { bti, pac_ret, gcs }) =
534-
sess.opts.unstable_opts.branch_protection
535-
{
533+
if let Some(BranchProtection { bti, pac_ret, gcs }) = sess.branch_protection() {
536534
assert!(sess.target.arch == Arch::AArch64);
537535
if bti {
538536
to_add.push(llvm::CreateAttrString(cx.llcx, "branch-target-enforcement"));

compiler/rustc_codegen_llvm/src/context.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,7 @@ pub(crate) unsafe fn create_module<'ll>(
405405
);
406406
}
407407

408-
if let Some(BranchProtection { bti, pac_ret, gcs }) = sess.opts.unstable_opts.branch_protection
409-
{
408+
if let Some(BranchProtection { bti, pac_ret, gcs }) = sess.branch_protection() {
410409
if sess.target.arch == Arch::AArch64 {
411410
llvm::add_module_flag_u32(
412411
llmod,
@@ -420,7 +419,11 @@ pub(crate) unsafe fn create_module<'ll>(
420419
"sign-return-address",
421420
pac_ret.is_some().into(),
422421
);
423-
let pac_opts = pac_ret.unwrap_or(PacRet { leaf: false, pc: false, key: PAuthKey::A });
422+
let pac_opts = pac_ret.unwrap_or_else(|| {
423+
// Windows on Arm only supports PAC key B.
424+
let key = if sess.target.os == Os::Windows { PAuthKey::B } else { PAuthKey::A };
425+
PacRet { leaf: false, pc: false, key }
426+
});
424427
llvm::add_module_flag_u32(
425428
llmod,
426429
llvm::ModuleFlagMergeBehavior::Min,

compiler/rustc_codegen_ssa/src/back/linker.rs

Lines changed: 0 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,6 @@ pub(crate) fn get_linker<'a>(
137137
// to the linker args construction.
138138
assert!(cmd.get_args().is_empty() || sess.target.cfg_abi == CfgAbi::Uwp);
139139
match flavor {
140-
LinkerFlavor::Unix(Cc::No) if sess.target.os == Os::L4Re => {
141-
Box::new(L4Bender::new(cmd, sess)) as Box<dyn Linker>
142-
}
143140
LinkerFlavor::Unix(Cc::No) if sess.target.os == Os::Aix => {
144141
Box::new(AixLinker::new(cmd, sess)) as Box<dyn Linker>
145142
}
@@ -279,7 +276,6 @@ generate_arg_methods! {
279276
MsvcLinker<'_>
280277
EmLinker<'_>
281278
WasmLd<'_>
282-
L4Bender<'_>
283279
AixLinker<'_>
284280
LlbcLinker<'_>
285281
BpfLinker<'_>
@@ -1468,128 +1464,6 @@ impl<'a> WasmLd<'a> {
14681464
}
14691465
}
14701466

1471-
/// Linker shepherd script for L4Re (Fiasco)
1472-
struct L4Bender<'a> {
1473-
cmd: Command,
1474-
sess: &'a Session,
1475-
hinted_static: bool,
1476-
}
1477-
1478-
impl<'a> Linker for L4Bender<'a> {
1479-
fn cmd(&mut self) -> &mut Command {
1480-
&mut self.cmd
1481-
}
1482-
1483-
fn set_output_kind(
1484-
&mut self,
1485-
_output_kind: LinkOutputKind,
1486-
_crate_type: CrateType,
1487-
_out_filename: &Path,
1488-
) {
1489-
}
1490-
1491-
fn link_staticlib_by_name(&mut self, name: &str, _verbatim: bool, whole_archive: bool) {
1492-
self.hint_static();
1493-
if !whole_archive {
1494-
self.link_arg(format!("-PC{name}"));
1495-
} else {
1496-
self.link_arg("--whole-archive")
1497-
.link_or_cc_arg(format!("-l{name}"))
1498-
.link_arg("--no-whole-archive");
1499-
}
1500-
}
1501-
1502-
fn link_staticlib_by_path(&mut self, path: &Path, whole_archive: bool) {
1503-
self.hint_static();
1504-
if !whole_archive {
1505-
self.link_or_cc_arg(path);
1506-
} else {
1507-
self.link_arg("--whole-archive").link_or_cc_arg(path).link_arg("--no-whole-archive");
1508-
}
1509-
}
1510-
1511-
fn full_relro(&mut self) {
1512-
self.link_args(&["-z", "relro", "-z", "now"]);
1513-
}
1514-
1515-
fn partial_relro(&mut self) {
1516-
self.link_args(&["-z", "relro"]);
1517-
}
1518-
1519-
fn no_relro(&mut self) {
1520-
self.link_args(&["-z", "norelro"]);
1521-
}
1522-
1523-
fn gc_sections(&mut self, keep_metadata: bool) {
1524-
if !keep_metadata {
1525-
self.link_arg("--gc-sections");
1526-
}
1527-
}
1528-
1529-
fn optimize(&mut self) {
1530-
// GNU-style linkers support optimization with -O. GNU ld doesn't
1531-
// need a numeric argument, but other linkers do.
1532-
if self.sess.opts.optimize == config::OptLevel::More
1533-
|| self.sess.opts.optimize == config::OptLevel::Aggressive
1534-
{
1535-
self.link_arg("-O1");
1536-
}
1537-
}
1538-
1539-
fn pgo_gen(&mut self) {}
1540-
1541-
fn debuginfo(&mut self, strip: Strip, _: &[PathBuf]) {
1542-
match strip {
1543-
Strip::None => {}
1544-
Strip::Debuginfo => {
1545-
self.link_arg("--strip-debug");
1546-
}
1547-
Strip::Symbols => {
1548-
self.link_arg("--strip-all");
1549-
}
1550-
}
1551-
}
1552-
1553-
fn no_default_libraries(&mut self) {
1554-
self.cc_arg("-nostdlib");
1555-
}
1556-
1557-
fn export_symbols(&mut self, _: &Path, _: CrateType, _: &[SymbolExport]) {
1558-
// ToDo, not implemented, copy from GCC
1559-
self.sess.dcx().emit_warn(diagnostics::L4BenderExportingSymbolsUnimplemented);
1560-
}
1561-
1562-
fn windows_subsystem(&mut self, subsystem: WindowsSubsystemKind) {
1563-
let subsystem = subsystem.as_str();
1564-
self.link_arg(&format!("--subsystem {subsystem}"));
1565-
}
1566-
1567-
fn reset_per_library_state(&mut self) {
1568-
self.hint_static(); // Reset to default before returning the composed command line.
1569-
}
1570-
1571-
fn linker_plugin_lto(&mut self) {}
1572-
1573-
fn control_flow_guard(&mut self) {}
1574-
1575-
fn ehcont_guard(&mut self) {}
1576-
1577-
fn no_crt_objects(&mut self) {}
1578-
}
1579-
1580-
impl<'a> L4Bender<'a> {
1581-
fn new(cmd: Command, sess: &'a Session) -> L4Bender<'a> {
1582-
L4Bender { cmd, sess, hinted_static: false }
1583-
}
1584-
1585-
fn hint_static(&mut self) {
1586-
if !self.hinted_static {
1587-
self.link_or_cc_arg("-static");
1588-
self.hinted_static = true;
1589-
}
1590-
}
1591-
}
1592-
15931467
/// Linker for AIX.
15941468
struct AixLinker<'a> {
15951469
cmd: Command,

compiler/rustc_codegen_ssa/src/diagnostics.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,6 @@ pub(crate) struct Ld64UnimplementedModifier;
9797
#[diag("`as-needed` modifier not supported for current linker")]
9898
pub(crate) struct LinkerUnsupportedModifier;
9999

100-
#[derive(Diagnostic)]
101-
#[diag("exporting symbols not implemented yet for L4Bender")]
102-
pub(crate) struct L4BenderExportingSymbolsUnimplemented;
103-
104100
#[derive(Diagnostic)]
105101
#[diag("error enumerating natvis directory: {$error}")]
106102
pub(crate) struct NoNatvisDirectory {

0 commit comments

Comments
 (0)