Skip to content

Commit ac1c40a

Browse files
authored
Merge pull request rust-lang#2236 from rust-lang/rustc-pull
2 parents e406ada + 3827ff0 commit ac1c40a

File tree

1,343 files changed

+22625
-10439
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,343 files changed

+22625
-10439
lines changed

Cargo.lock

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,7 +1859,6 @@ checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f"
18591859
dependencies = [
18601860
"equivalent",
18611861
"hashbrown 0.15.2",
1862-
"rustc-rayon",
18631862
"serde",
18641863
]
18651864

@@ -3240,11 +3239,12 @@ dependencies = [
32403239

32413240
[[package]]
32423241
name = "rustc-rayon"
3243-
version = "0.5.0"
3242+
version = "0.5.1"
32443243
source = "registry+https://github.com/rust-lang/crates.io-index"
3245-
checksum = "eb81aadc8837ca6ecebe0fe1353f15df83b3b3cc2cf7a8afd571bc22aa121710"
3244+
checksum = "2cd9fb077db982d7ceb42a90471e5a69a990b58f71e06f0d8340bb2cf35eb751"
32463245
dependencies = [
32473246
"either",
3247+
"indexmap",
32483248
"rustc-rayon-core",
32493249
]
32503250

@@ -4234,6 +4234,7 @@ name = "rustc_monomorphize"
42344234
version = "0.0.0"
42354235
dependencies = [
42364236
"rustc_abi",
4237+
"rustc_ast",
42374238
"rustc_attr_parsing",
42384239
"rustc_data_structures",
42394240
"rustc_errors",
@@ -4243,6 +4244,7 @@ dependencies = [
42434244
"rustc_middle",
42444245
"rustc_session",
42454246
"rustc_span",
4247+
"rustc_symbol_mangling",
42464248
"rustc_target",
42474249
"serde",
42484250
"serde_json",

RELEASES.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
1+
Version 1.84.1 (2025-01-30)
2+
==========================
3+
4+
<a id="1.84.1"></a>
5+
6+
- [Fix ICE 132920 in duplicate-crate diagnostics.](https://github.com/rust-lang/rust/pull/133304/)
7+
- [Fix errors for overlapping impls in incremental rebuilds.](https://github.com/rust-lang/rust/pull/133828/)
8+
- [Fix slow compilation related to the next-generation trait solver.](https://github.com/rust-lang/rust/pull/135618/)
9+
- [Fix debuginfo when LLVM's location discriminator value limit is exceeded.](https://github.com/rust-lang/rust/pull/135643/)
10+
- Fixes for building Rust from source:
11+
- [Only try to distribute `llvm-objcopy` if llvm tools are enabled.](https://github.com/rust-lang/rust/pull/134240/)
12+
- [Add Profile Override for Non-Git Sources.](https://github.com/rust-lang/rust/pull/135433/)
13+
- [Resolve symlinks of LLVM tool binaries before copying them.](https://github.com/rust-lang/rust/pull/135585/)
14+
- [Make it possible to use ci-rustc on tarball sources.](https://github.com/rust-lang/rust/pull/135722/)
15+
116
Version 1.84.0 (2025-01-09)
217
==========================
318

4-
<a id="
5-
Language"></a>
19+
<a id="1.84.0-Language"></a>
620

721
Language
822
--------

REUSE.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ SPDX-FileCopyrightText = "2015 Anders Kaseorg <andersk@mit.edu>"
9292
SPDX-License-Identifier = "MIT"
9393

9494
[[annotations]]
95-
path = "src/librustdoc/html/static/fonts/FiraSans**"
95+
path = "src/librustdoc/html/static/fonts/Fira**"
9696
precedence = "override"
9797
SPDX-FileCopyrightText = ["2014, Mozilla Foundation", "2014, Telefonica S.A."]
9898
SPDX-License-Identifier = "OFL-1.1"

compiler/rustc_ast/src/expand/autodiff_attrs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ pub struct AutoDiffItem {
7979
pub target: String,
8080
pub attrs: AutoDiffAttrs,
8181
}
82+
8283
#[derive(Clone, Eq, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)]
8384
pub struct AutoDiffAttrs {
8485
/// Conceptually either forward or reverse mode AD, as described in various autodiff papers and
@@ -231,7 +232,7 @@ impl AutoDiffAttrs {
231232
self.ret_activity == DiffActivity::ActiveOnly
232233
}
233234

234-
pub fn error() -> Self {
235+
pub const fn error() -> Self {
235236
AutoDiffAttrs {
236237
mode: DiffMode::Error,
237238
ret_activity: DiffActivity::None,

compiler/rustc_ast/src/mut_visit.rs

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -954,8 +954,14 @@ fn walk_coroutine_kind<T: MutVisitor>(vis: &mut T, coroutine_kind: &mut Coroutin
954954

955955
fn walk_fn<T: MutVisitor>(vis: &mut T, kind: FnKind<'_>) {
956956
match kind {
957-
FnKind::Fn(_ctxt, _ident, FnSig { header, decl, span }, _visibility, generics, body) => {
957+
FnKind::Fn(
958+
_ctxt,
959+
_ident,
960+
_vis,
961+
Fn { defaultness, generics, body, sig: FnSig { header, decl, span } },
962+
) => {
958963
// Identifier and visibility are visited as a part of the item.
964+
visit_defaultness(vis, defaultness);
959965
vis.visit_fn_header(header);
960966
vis.visit_generics(generics);
961967
vis.visit_fn_decl(decl);
@@ -1205,13 +1211,8 @@ impl WalkItemKind for ItemKind {
12051211
ItemKind::Const(item) => {
12061212
visit_const_item(item, vis);
12071213
}
1208-
ItemKind::Fn(box Fn { defaultness, generics, sig, body }) => {
1209-
visit_defaultness(vis, defaultness);
1210-
vis.visit_fn(
1211-
FnKind::Fn(FnCtxt::Free, ident, sig, visibility, generics, body),
1212-
span,
1213-
id,
1214-
);
1214+
ItemKind::Fn(func) => {
1215+
vis.visit_fn(FnKind::Fn(FnCtxt::Free, ident, visibility, &mut *func), span, id);
12151216
}
12161217
ItemKind::Mod(safety, mod_kind) => {
12171218
visit_safety(vis, safety);
@@ -1329,10 +1330,9 @@ impl WalkItemKind for AssocItemKind {
13291330
AssocItemKind::Const(item) => {
13301331
visit_const_item(item, visitor);
13311332
}
1332-
AssocItemKind::Fn(box Fn { defaultness, generics, sig, body }) => {
1333-
visit_defaultness(visitor, defaultness);
1333+
AssocItemKind::Fn(func) => {
13341334
visitor.visit_fn(
1335-
FnKind::Fn(FnCtxt::Assoc(ctxt), ident, sig, visibility, generics, body),
1335+
FnKind::Fn(FnCtxt::Assoc(ctxt), ident, visibility, &mut *func),
13361336
span,
13371337
id,
13381338
);
@@ -1476,10 +1476,9 @@ impl WalkItemKind for ForeignItemKind {
14761476
visitor.visit_ty(ty);
14771477
visit_opt(expr, |expr| visitor.visit_expr(expr));
14781478
}
1479-
ForeignItemKind::Fn(box Fn { defaultness, generics, sig, body }) => {
1480-
visit_defaultness(visitor, defaultness);
1479+
ForeignItemKind::Fn(func) => {
14811480
visitor.visit_fn(
1482-
FnKind::Fn(FnCtxt::Foreign, ident, sig, visibility, generics, body),
1481+
FnKind::Fn(FnCtxt::Foreign, ident, visibility, &mut *func),
14831482
span,
14841483
id,
14851484
);
@@ -1965,14 +1964,7 @@ impl<N: DummyAstNode, T: DummyAstNode> DummyAstNode for crate::ast_traits::AstNo
19651964
#[derive(Debug)]
19661965
pub enum FnKind<'a> {
19671966
/// E.g., `fn foo()`, `fn foo(&self)`, or `extern "Abi" fn foo()`.
1968-
Fn(
1969-
FnCtxt,
1970-
&'a mut Ident,
1971-
&'a mut FnSig,
1972-
&'a mut Visibility,
1973-
&'a mut Generics,
1974-
&'a mut Option<P<Block>>,
1975-
),
1967+
Fn(FnCtxt, &'a mut Ident, &'a mut Visibility, &'a mut Fn),
19761968

19771969
/// E.g., `|x, y| body`.
19781970
Closure(

compiler/rustc_ast/src/token.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -527,13 +527,13 @@ impl TokenKind {
527527

528528
/// Returns tokens that are likely to be typed accidentally instead of the current token.
529529
/// Enables better error recovery when the wrong token is found.
530-
pub fn similar_tokens(&self) -> Option<Vec<TokenKind>> {
531-
match *self {
532-
Comma => Some(vec![Dot, Lt, Semi]),
533-
Semi => Some(vec![Colon, Comma]),
534-
Colon => Some(vec![Semi]),
535-
FatArrow => Some(vec![Eq, RArrow, Ge, Gt]),
536-
_ => None,
530+
pub fn similar_tokens(&self) -> &[TokenKind] {
531+
match self {
532+
Comma => &[Dot, Lt, Semi],
533+
Semi => &[Colon, Comma],
534+
Colon => &[Semi],
535+
FatArrow => &[Eq, RArrow, Ge, Gt],
536+
_ => &[],
537537
}
538538
}
539539

compiler/rustc_ast/src/visit.rs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl BoundKind {
6565
#[derive(Copy, Clone, Debug)]
6666
pub enum FnKind<'a> {
6767
/// E.g., `fn foo()`, `fn foo(&self)`, or `extern "Abi" fn foo()`.
68-
Fn(FnCtxt, &'a Ident, &'a FnSig, &'a Visibility, &'a Generics, &'a Option<P<Block>>),
68+
Fn(FnCtxt, &'a Ident, &'a Visibility, &'a Fn),
6969

7070
/// E.g., `|x, y| body`.
7171
Closure(&'a ClosureBinder, &'a Option<CoroutineKind>, &'a FnDecl, &'a Expr),
@@ -74,7 +74,7 @@ pub enum FnKind<'a> {
7474
impl<'a> FnKind<'a> {
7575
pub fn header(&self) -> Option<&'a FnHeader> {
7676
match *self {
77-
FnKind::Fn(_, _, sig, _, _, _) => Some(&sig.header),
77+
FnKind::Fn(_, _, _, Fn { sig, .. }) => Some(&sig.header),
7878
FnKind::Closure(..) => None,
7979
}
8080
}
@@ -88,7 +88,7 @@ impl<'a> FnKind<'a> {
8888

8989
pub fn decl(&self) -> &'a FnDecl {
9090
match self {
91-
FnKind::Fn(_, _, sig, _, _, _) => &sig.decl,
91+
FnKind::Fn(_, _, _, Fn { sig, .. }) => &sig.decl,
9292
FnKind::Closure(_, _, decl, _) => decl,
9393
}
9494
}
@@ -374,8 +374,8 @@ impl WalkItemKind for ItemKind {
374374
try_visit!(visitor.visit_ty(ty));
375375
visit_opt!(visitor, visit_expr, expr);
376376
}
377-
ItemKind::Fn(box Fn { defaultness: _, generics, sig, body }) => {
378-
let kind = FnKind::Fn(FnCtxt::Free, ident, sig, vis, generics, body);
377+
ItemKind::Fn(func) => {
378+
let kind = FnKind::Fn(FnCtxt::Free, ident, vis, &*func);
379379
try_visit!(visitor.visit_fn(kind, span, id));
380380
}
381381
ItemKind::Mod(_unsafety, mod_kind) => match mod_kind {
@@ -715,8 +715,8 @@ impl WalkItemKind for ForeignItemKind {
715715
try_visit!(visitor.visit_ty(ty));
716716
visit_opt!(visitor, visit_expr, expr);
717717
}
718-
ForeignItemKind::Fn(box Fn { defaultness: _, generics, sig, body }) => {
719-
let kind = FnKind::Fn(FnCtxt::Foreign, ident, sig, vis, generics, body);
718+
ForeignItemKind::Fn(func) => {
719+
let kind = FnKind::Fn(FnCtxt::Foreign, ident, vis, &*func);
720720
try_visit!(visitor.visit_fn(kind, span, id));
721721
}
722722
ForeignItemKind::TyAlias(box TyAlias {
@@ -858,7 +858,12 @@ pub fn walk_fn_decl<'a, V: Visitor<'a>>(
858858

859859
pub fn walk_fn<'a, V: Visitor<'a>>(visitor: &mut V, kind: FnKind<'a>) -> V::Result {
860860
match kind {
861-
FnKind::Fn(_ctxt, _ident, FnSig { header, decl, span: _ }, _vis, generics, body) => {
861+
FnKind::Fn(
862+
_ctxt,
863+
_ident,
864+
_vis,
865+
Fn { defaultness: _, sig: FnSig { header, decl, span: _ }, generics, body },
866+
) => {
862867
// Identifier and visibility are visited as a part of the item.
863868
try_visit!(visitor.visit_fn_header(header));
864869
try_visit!(visitor.visit_generics(generics));
@@ -892,8 +897,8 @@ impl WalkItemKind for AssocItemKind {
892897
try_visit!(visitor.visit_ty(ty));
893898
visit_opt!(visitor, visit_expr, expr);
894899
}
895-
AssocItemKind::Fn(box Fn { defaultness: _, generics, sig, body }) => {
896-
let kind = FnKind::Fn(FnCtxt::Assoc(ctxt), ident, sig, vis, generics, body);
900+
AssocItemKind::Fn(func) => {
901+
let kind = FnKind::Fn(FnCtxt::Assoc(ctxt), ident, vis, &*func);
897902
try_visit!(visitor.visit_fn(kind, span, id));
898903
}
899904
AssocItemKind::Type(box TyAlias {

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,11 @@ impl<'hir> LoweringContext<'_, 'hir> {
13911391
None,
13921392
);
13931393
// Destructure like a unit struct.
1394-
let unit_struct_pat = hir::PatKind::Path(qpath);
1394+
let unit_struct_pat = hir::PatKind::Expr(self.arena.alloc(hir::PatExpr {
1395+
kind: hir::PatExprKind::Path(qpath),
1396+
hir_id: self.next_id(),
1397+
span: self.lower_span(lhs.span),
1398+
}));
13951399
return self.pat_without_dbm(lhs.span, unit_struct_pat);
13961400
}
13971401
}
@@ -2125,7 +2129,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
21252129
self.arena.alloc(self.expr_call_mut(span, e, args))
21262130
}
21272131

2128-
fn expr_call_lang_item_fn_mut(
2132+
pub(super) fn expr_call_lang_item_fn_mut(
21292133
&mut self,
21302134
span: Span,
21312135
lang_item: hir::LangItem,
@@ -2135,7 +2139,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
21352139
self.expr_call_mut(span, path, args)
21362140
}
21372141

2138-
fn expr_call_lang_item_fn(
2142+
pub(super) fn expr_call_lang_item_fn(
21392143
&mut self,
21402144
span: Span,
21412145
lang_item: hir::LangItem,

compiler/rustc_ast_lowering/src/pat.rs

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,16 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
6969
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
7070
None,
7171
);
72-
break hir::PatKind::Path(qpath);
72+
let kind = hir::PatExprKind::Path(qpath);
73+
let span = self.lower_span(pattern.span);
74+
let expr = hir::PatExpr { hir_id: pat_hir_id, span, kind };
75+
let expr = self.arena.alloc(expr);
76+
return hir::Pat {
77+
hir_id: self.next_id(),
78+
kind: hir::PatKind::Expr(expr),
79+
span,
80+
default_binding_modes: true,
81+
};
7382
}
7483
PatKind::Struct(qself, path, fields, etc) => {
7584
let qpath = self.lower_qpath(
@@ -304,16 +313,20 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
304313
)
305314
}
306315
Some(res) => {
307-
let hir_id = self.next_id();
308316
let res = self.lower_res(res);
309-
hir::PatKind::Path(hir::QPath::Resolved(
310-
None,
311-
self.arena.alloc(hir::Path {
312-
span: self.lower_span(ident.span),
313-
res,
314-
segments: arena_vec![self; hir::PathSegment::new(self.lower_ident(ident), hir_id, res)],
315-
}),
316-
))
317+
let span = self.lower_span(ident.span);
318+
hir::PatKind::Expr(self.arena.alloc(hir::PatExpr {
319+
kind: hir::PatExprKind::Path(hir::QPath::Resolved(
320+
None,
321+
self.arena.alloc(hir::Path {
322+
span,
323+
res,
324+
segments: arena_vec![self; hir::PathSegment::new(self.lower_ident(ident), self.next_id(), res)],
325+
}),
326+
)),
327+
hir_id: self.next_id(),
328+
span,
329+
}))
317330
}
318331
}
319332
}

0 commit comments

Comments
 (0)