Skip to content

Commit 0b643df

Browse files
authored
Merge pull request #4226 from rust-lang/rustup-2025-03-14
Automatic Rustup
2 parents 3d01217 + 51fd358 commit 0b643df

File tree

1,250 files changed

+10361
-7664
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,250 files changed

+10361
-7664
lines changed

.github/workflows/post-merge.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
cd src/ci/citool
3737
3838
echo "Post-merge analysis result" > output.log
39-
cargo run --release post-merge-analysis ${PARENT_COMMIT} ${{ github.sha }} >> output.log
39+
cargo run --release post-merge-report ${PARENT_COMMIT} ${{ github.sha }} >> output.log
4040
cat output.log
4141
4242
gh pr comment ${HEAD_PR} -F output.log

Cargo.lock

+3-7
Original file line numberDiff line numberDiff line change
@@ -1491,6 +1491,7 @@ version = "0.15.2"
14911491
source = "registry+https://github.com/rust-lang/crates.io-index"
14921492
checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
14931493
dependencies = [
1494+
"allocator-api2",
14941495
"foldhash",
14951496
"serde",
14961497
]
@@ -3044,13 +3045,6 @@ dependencies = [
30443045
"serde",
30453046
]
30463047

3047-
[[package]]
3048-
name = "rls"
3049-
version = "2.0.0"
3050-
dependencies = [
3051-
"serde_json",
3052-
]
3053-
30543048
[[package]]
30553049
name = "run_make_support"
30563050
version = "0.2.0"
@@ -3492,6 +3486,7 @@ dependencies = [
34923486
"either",
34933487
"elsa",
34943488
"ena",
3489+
"hashbrown 0.15.2",
34953490
"indexmap",
34963491
"jobserver",
34973492
"libc",
@@ -4529,6 +4524,7 @@ version = "0.0.0"
45294524
dependencies = [
45304525
"itertools",
45314526
"rustc_abi",
4527+
"rustc_attr_parsing",
45324528
"rustc_data_structures",
45334529
"rustc_errors",
45344530
"rustc_fluent_macro",

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ members = [
2424
"src/tools/remote-test-server",
2525
"src/tools/rust-installer",
2626
"src/tools/rustdoc",
27-
"src/tools/rls",
2827
"src/tools/rustfmt",
2928
"src/tools/miri",
3029
"src/tools/miri/cargo-miri",

compiler/rustc_abi/src/lib.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#![cfg_attr(feature = "nightly", feature(rustc_attrs))]
66
#![cfg_attr(feature = "nightly", feature(rustdoc_internals))]
77
#![cfg_attr(feature = "nightly", feature(step_trait))]
8-
#![warn(unreachable_pub)]
98
// tidy-alphabetical-end
109

1110
/*! ABI handling for rustc
@@ -803,7 +802,7 @@ impl Align {
803802
}
804803

805804
#[inline]
806-
pub fn bytes(self) -> u64 {
805+
pub const fn bytes(self) -> u64 {
807806
1 << self.pow2
808807
}
809808

@@ -813,7 +812,7 @@ impl Align {
813812
}
814813

815814
#[inline]
816-
pub fn bits(self) -> u64 {
815+
pub const fn bits(self) -> u64 {
817816
self.bytes() * 8
818817
}
819818

compiler/rustc_arena/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#![feature(maybe_uninit_slice)]
2424
#![feature(rustc_attrs)]
2525
#![feature(rustdoc_internals)]
26-
#![warn(unreachable_pub)]
2726
// tidy-alphabetical-end
2827

2928
use std::alloc::Layout;

compiler/rustc_ast/src/ast.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3466,6 +3466,7 @@ pub struct Fn {
34663466
pub generics: Generics,
34673467
pub sig: FnSig,
34683468
pub contract: Option<P<FnContract>>,
3469+
pub define_opaque: Option<ThinVec<(NodeId, Path)>>,
34693470
pub body: Option<P<Block>>,
34703471
}
34713472

@@ -3763,7 +3764,7 @@ mod size_asserts {
37633764
static_assert_size!(Block, 32);
37643765
static_assert_size!(Expr, 72);
37653766
static_assert_size!(ExprKind, 40);
3766-
static_assert_size!(Fn, 168);
3767+
static_assert_size!(Fn, 176);
37673768
static_assert_size!(ForeignItem, 88);
37683769
static_assert_size!(ForeignItemKind, 16);
37693770
static_assert_size!(GenericArg, 24);

compiler/rustc_ast/src/format.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ pub enum FormatAlignment {
266266
#[derive(Clone, Encodable, Decodable, Debug, PartialEq, Eq)]
267267
pub enum FormatCount {
268268
/// `{:5}` or `{:.5}`
269-
Literal(usize),
269+
Literal(u16),
270270
/// `{:.*}`, `{:.5$}`, or `{:a$}`, etc.
271271
Argument(FormatArgPosition),
272272
}

compiler/rustc_ast/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#![feature(never_type)]
2121
#![feature(rustdoc_internals)]
2222
#![feature(stmt_expr_attributes)]
23-
#![warn(unreachable_pub)]
2423
// tidy-alphabetical-end
2524

2625
pub mod util {

compiler/rustc_ast/src/mut_visit.rs

+14-2
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,14 @@ fn walk_fn<T: MutVisitor>(vis: &mut T, kind: FnKind<'_>) {
961961
_ctxt,
962962
_ident,
963963
_vis,
964-
Fn { defaultness, generics, contract, body, sig: FnSig { header, decl, span } },
964+
Fn {
965+
defaultness,
966+
generics,
967+
contract,
968+
body,
969+
sig: FnSig { header, decl, span },
970+
define_opaque,
971+
},
965972
) => {
966973
// Identifier and visibility are visited as a part of the item.
967974
visit_defaultness(vis, defaultness);
@@ -975,6 +982,11 @@ fn walk_fn<T: MutVisitor>(vis: &mut T, kind: FnKind<'_>) {
975982
vis.visit_block(body);
976983
}
977984
vis.visit_span(span);
985+
986+
for (id, path) in define_opaque.iter_mut().flatten() {
987+
vis.visit_id(id);
988+
vis.visit_path(path)
989+
}
978990
}
979991
FnKind::Closure(binder, coroutine_kind, decl, body) => {
980992
vis.visit_closure_binder(binder);
@@ -1924,7 +1936,7 @@ impl DummyAstNode for Item {
19241936
span: Default::default(),
19251937
tokens: Default::default(),
19261938
},
1927-
ident: Ident::empty(),
1939+
ident: Ident::dummy(),
19281940
kind: ItemKind::ExternCrate(None),
19291941
tokens: Default::default(),
19301942
}

compiler/rustc_ast/src/visit.rs

+12-2
Original file line numberDiff line numberDiff line change
@@ -892,14 +892,24 @@ pub fn walk_fn<'a, V: Visitor<'a>>(visitor: &mut V, kind: FnKind<'a>) -> V::Resu
892892
_ctxt,
893893
_ident,
894894
_vis,
895-
Fn { defaultness: _, sig: FnSig { header, decl, span: _ }, generics, contract, body },
895+
Fn {
896+
defaultness: _,
897+
sig: FnSig { header, decl, span: _ },
898+
generics,
899+
contract,
900+
body,
901+
define_opaque,
902+
},
896903
) => {
897904
// Identifier and visibility are visited as a part of the item.
898905
try_visit!(visitor.visit_fn_header(header));
899906
try_visit!(visitor.visit_generics(generics));
900907
try_visit!(visitor.visit_fn_decl(decl));
901908
visit_opt!(visitor, visit_contract, contract);
902909
visit_opt!(visitor, visit_block, body);
910+
for (id, path) in define_opaque.iter().flatten() {
911+
try_visit!(visitor.visit_path(path, *id))
912+
}
903913
}
904914
FnKind::Closure(binder, coroutine_kind, decl, body) => {
905915
try_visit!(visitor.visit_closure_binder(binder));
@@ -1203,7 +1213,7 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) -> V
12031213
FnKind::Closure(binder, coroutine_kind, fn_decl, body),
12041214
*span,
12051215
*id
1206-
))
1216+
));
12071217
}
12081218
ExprKind::Block(block, opt_label) => {
12091219
visit_opt!(visitor, visit_label, opt_label);

compiler/rustc_ast_ir/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#![cfg_attr(feature = "nightly", allow(internal_features))]
1010
#![cfg_attr(feature = "nightly", feature(never_type))]
1111
#![cfg_attr(feature = "nightly", feature(rustc_attrs))]
12-
#![warn(unreachable_pub)]
1312
// tidy-alphabetical-end
1413

1514
#[cfg(feature = "nightly")]

compiler/rustc_ast_lowering/src/asm.rs

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
3838
}
3939
if let Some(asm_arch) = asm_arch {
4040
// Inline assembly is currently only stable for these architectures.
41+
// (See also compiletest's `has_asm_support`.)
4142
let is_stable = matches!(
4243
asm_arch,
4344
asm::InlineAsmArch::X86

compiler/rustc_ast_lowering/src/delegation.rs

+11-5
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,19 @@ impl<'hir> LoweringContext<'_, 'hir> {
190190
) -> hir::FnSig<'hir> {
191191
let header = if let Some(local_sig_id) = sig_id.as_local() {
192192
match self.resolver.delegation_fn_sigs.get(&local_sig_id) {
193-
Some(sig) => self.lower_fn_header(
194-
sig.header,
193+
Some(sig) => {
194+
let parent = self.tcx.parent(sig_id);
195195
// HACK: we override the default safety instead of generating attributes from the ether.
196196
// We are not forwarding the attributes, as the delegation fn sigs are collected on the ast,
197197
// and here we need the hir attributes.
198-
if sig.target_feature { hir::Safety::Unsafe } else { hir::Safety::Safe },
199-
&[],
200-
),
198+
let default_safety =
199+
if sig.target_feature || self.tcx.def_kind(parent) == DefKind::ForeignMod {
200+
hir::Safety::Unsafe
201+
} else {
202+
hir::Safety::Safe
203+
};
204+
self.lower_fn_header(sig.header, default_safety, &[])
205+
}
201206
None => self.generate_header_error(),
202207
}
203208
} else {
@@ -330,6 +335,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
330335
.unwrap_or_default()
331336
&& delegation.qself.is_none()
332337
&& !has_generic_args
338+
&& !args.is_empty()
333339
{
334340
let ast_segment = delegation.path.segments.last().unwrap();
335341
let segment = self.lower_path_segment(

compiler/rustc_ast_lowering/src/expr.rs

+11-13
Original file line numberDiff line numberDiff line change
@@ -2130,26 +2130,24 @@ impl<'hir> LoweringContext<'_, 'hir> {
21302130
self.arena.alloc(self.expr(sp, hir::ExprKind::Tup(&[])))
21312131
}
21322132

2133-
pub(super) fn expr_usize(&mut self, sp: Span, value: usize) -> hir::Expr<'hir> {
2133+
fn expr_uint(&mut self, sp: Span, ty: ast::UintTy, value: u128) -> hir::Expr<'hir> {
21342134
let lit = self.arena.alloc(hir::Lit {
21352135
span: sp,
2136-
node: ast::LitKind::Int(
2137-
(value as u128).into(),
2138-
ast::LitIntType::Unsigned(ast::UintTy::Usize),
2139-
),
2136+
node: ast::LitKind::Int(value.into(), ast::LitIntType::Unsigned(ty)),
21402137
});
21412138
self.expr(sp, hir::ExprKind::Lit(lit))
21422139
}
21432140

2141+
pub(super) fn expr_usize(&mut self, sp: Span, value: usize) -> hir::Expr<'hir> {
2142+
self.expr_uint(sp, ast::UintTy::Usize, value as u128)
2143+
}
2144+
21442145
pub(super) fn expr_u32(&mut self, sp: Span, value: u32) -> hir::Expr<'hir> {
2145-
let lit = self.arena.alloc(hir::Lit {
2146-
span: sp,
2147-
node: ast::LitKind::Int(
2148-
u128::from(value).into(),
2149-
ast::LitIntType::Unsigned(ast::UintTy::U32),
2150-
),
2151-
});
2152-
self.expr(sp, hir::ExprKind::Lit(lit))
2146+
self.expr_uint(sp, ast::UintTy::U32, value as u128)
2147+
}
2148+
2149+
pub(super) fn expr_u16(&mut self, sp: Span, value: u16) -> hir::Expr<'hir> {
2150+
self.expr_uint(sp, ast::UintTy::U16, value as u128)
21532151
}
21542152

21552153
pub(super) fn expr_char(&mut self, sp: Span, value: char) -> hir::Expr<'hir> {

compiler/rustc_ast_lowering/src/format.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ fn make_count<'hir>(
292292
hir::LangItem::FormatCount,
293293
sym::Is,
294294
));
295-
let value = ctx.arena.alloc_from_iter([ctx.expr_usize(sp, *n)]);
295+
let value = ctx.arena.alloc_from_iter([ctx.expr_u16(sp, *n)]);
296296
ctx.expr_call_mut(sp, count_is, value)
297297
}
298298
Some(FormatCount::Argument(arg)) => {

0 commit comments

Comments
 (0)