Skip to content

Commit 5a11197

Browse files
authored
Merge pull request rust-lang#2200 from Kobzol/rustc-pull
Rustc pull
2 parents d91316e + 2f3ee5d commit 5a11197

File tree

631 files changed

+37436
-7971
lines changed

Some content is hidden

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

631 files changed

+37436
-7971
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ tracking issue or there are none, feel free to ignore this.
77
This PR will get automatically assigned to a reviewer. In case you would like
88
a specific user to review your work, you can assign it to them by using
99
10-
r\? <reviewer name> (with the `\` removed)
10+
r? <reviewer name>
1111
-->
1212
<!-- homu-ignore:end -->

Cargo.lock

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,6 @@ name = "anyhow"
185185
version = "1.0.95"
186186
source = "registry+https://github.com/rust-lang/crates.io-index"
187187
checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04"
188-
dependencies = [
189-
"backtrace",
190-
]
191188

192189
[[package]]
193190
name = "ar_archive_writer"
@@ -3499,6 +3496,7 @@ name = "rustc_codegen_llvm"
34993496
version = "0.0.0"
35003497
dependencies = [
35013498
"bitflags",
3499+
"gimli 0.30.0",
35023500
"itertools",
35033501
"libc",
35043502
"measureme",
@@ -4117,7 +4115,6 @@ name = "rustc_middle"
41174115
version = "0.0.0"
41184116
dependencies = [
41194117
"bitflags",
4120-
"derive-where",
41214118
"either",
41224119
"field-offset",
41234120
"gsgdt",

RELEASES.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,119 @@
1+
Version 1.84.0 (2025-01-09)
2+
==========================
3+
4+
<a id="
5+
Language"></a>
6+
7+
Language
8+
--------
9+
- [Allow `#[deny]` inside `#[forbid]` as a no-op](https://github.com/rust-lang/rust/pull/121560/)
10+
- [Show a warning when `-Ctarget-feature` is used to toggle features that can lead to unsoundness due to ABI mismatches](https://github.com/rust-lang/rust/pull/129884)
11+
- [Use the next-generation trait solver in coherence](https://github.com/rust-lang/rust/pull/130654)
12+
- [Allow coercions to drop the principal of trait objects](https://github.com/rust-lang/rust/pull/131857)
13+
- [Support `/` as the path separator for `include!()` in all cases on Windows](https://github.com/rust-lang/rust/pull/125205)
14+
- [Taking a raw ref (`raw (const|mut)`) of a deref of a pointer (`*ptr`) is now safe](https://github.com/rust-lang/rust/pull/129248)
15+
- [Stabilize s390x inline assembly](https://github.com/rust-lang/rust/pull/131258)
16+
- [Stabilize Arm64EC inline assembly](https://github.com/rust-lang/rust/pull/131781)
17+
- [Lint against creating pointers to immediately dropped temporaries](https://github.com/rust-lang/rust/pull/128985)
18+
- [Execute drop glue when unwinding in an `extern "C"` function](https://github.com/rust-lang/rust/pull/129582)
19+
20+
<a id="1.84.0-Compiler"></a>
21+
22+
Compiler
23+
--------
24+
- [Add `--print host-tuple` flag to print the host target tuple and affirm the "target tuple" terminology over "target triple"](https://github.com/rust-lang/rust/pull/125579)
25+
- [Declaring functions with a calling convention not supported on the current target now triggers a hard error](https://github.com/rust-lang/rust/pull/129935)
26+
- [Set up indirect access to external data for `loongarch64-unknown-linux-{musl,ohos}`](https://github.com/rust-lang/rust/pull/131583)
27+
- [Enable XRay instrumentation for LoongArch Linux targets](https://github.com/rust-lang/rust/pull/131818)
28+
- [Extend the `unexpected_cfgs` lint to also warn in external macros](https://github.com/rust-lang/rust/pull/132577)
29+
- [Stabilize WebAssembly `multivalue`, `reference-types`, and `tail-call` target features](https://github.com/rust-lang/rust/pull/131080)
30+
- [Added Tier 2 support for the `wasm32v1-none` target](https://github.com/rust-lang/rust/pull/131487)
31+
32+
<a id="1.84.0-Libraries"></a>
33+
34+
Libraries
35+
---------
36+
- [Implement `From<&mut {slice}>` for `Box/Rc/Arc<{slice}>`](https://github.com/rust-lang/rust/pull/129329)
37+
- [Move `<float>::copysign`, `<float>::abs`, `<float>::signum` to `core`](https://github.com/rust-lang/rust/pull/131304)
38+
- [Add `LowerExp` and `UpperExp` implementations to `NonZero`](https://github.com/rust-lang/rust/pull/131377)
39+
- [Implement `FromStr` for `CString` and `TryFrom<CString>` for `String`](https://github.com/rust-lang/rust/pull/130608)
40+
- [`std::os::darwin` has been made public](https://github.com/rust-lang/rust/pull/130635)
41+
42+
<a id="1.84.0-Stabilized-APIs"></a>
43+
44+
Stabilized APIs
45+
---------------
46+
47+
- [`Ipv6Addr::is_unique_local`](https://doc.rust-lang.org/stable/core/net/struct.Ipv6Addr.html#method.is_unique_local)
48+
- [`Ipv6Addr::is_unicast_link_local`](https://doc.rust-lang.org/stable/core/net/struct.Ipv6Addr.html#method.is_unicast_link_local)
49+
- [`core::ptr::with_exposed_provenance`](https://doc.rust-lang.org/stable/core/ptr/fn.with_exposed_provenance.html)
50+
- [`core::ptr::with_exposed_provenance_mut`](https://doc.rust-lang.org/stable/core/ptr/fn.with_exposed_provenance_mut.html)
51+
- [`<ptr>::addr`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.addr)
52+
- [`<ptr>::expose_provenance`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.expose_provenance)
53+
- [`<ptr>::with_addr`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.with_addr)
54+
- [`<ptr>::map_addr`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.map_addr)
55+
- [`<int>::isqrt`](https://doc.rust-lang.org/stable/core/primitive.i32.html#method.isqrt)
56+
- [`<int>::checked_isqrt`](https://doc.rust-lang.org/stable/core/primitive.i32.html#method.checked_isqrt)
57+
- [`<uint>::isqrt`](https://doc.rust-lang.org/stable/core/primitive.u32.html#method.isqrt)
58+
- [`NonZero::isqrt`](https://doc.rust-lang.org/stable/core/num/struct.NonZero.html#impl-NonZero%3Cu128%3E/method.isqrt)
59+
- [`core::ptr::without_provenance`](https://doc.rust-lang.org/stable/core/ptr/fn.without_provenance.html)
60+
- [`core::ptr::without_provenance_mut`](https://doc.rust-lang.org/stable/core/ptr/fn.without_provenance_mut.html)
61+
- [`core::ptr::dangling`](https://doc.rust-lang.org/stable/core/ptr/fn.dangling.html)
62+
- [`core::ptr::dangling_mut`](https://doc.rust-lang.org/stable/core/ptr/fn.dangling_mut.html)
63+
64+
These APIs are now stable in const contexts
65+
66+
- [`AtomicBool::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicBool.html#method.from_ptr)
67+
- [`AtomicPtr::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicPtr.html#method.from_ptr)
68+
- [`AtomicU8::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU8.html#method.from_ptr)
69+
- [`AtomicU16::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU16.html#method.from_ptr)
70+
- [`AtomicU32::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU32.html#method.from_ptr)
71+
- [`AtomicU64::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU64.html#method.from_ptr)
72+
- [`AtomicUsize::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicUsize.html#method.from_ptr)
73+
- [`AtomicI8::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicI8.html#method.from_ptr)
74+
- [`AtomicI16::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicI16.html#method.from_ptr)
75+
- [`AtomicI32::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicI32.html#method.from_ptr)
76+
- [`AtomicI64::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicI64.html#method.from_ptr)
77+
- [`AtomicIsize::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicIsize.html#method.from_ptr)
78+
- [`<ptr>::is_null`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_null-1)
79+
- [`<ptr>::as_ref`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.as_ref-1)
80+
- [`<ptr>::as_mut`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.as_mut)
81+
- [`Pin::new`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.new)
82+
- [`Pin::new_unchecked`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.new_unchecked)
83+
- [`Pin::get_ref`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.get_ref)
84+
- [`Pin::into_ref`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.into_ref)
85+
- [`Pin::get_mut`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.get_mut)
86+
- [`Pin::get_unchecked_mut`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.get_unchecked_mut)
87+
- [`Pin::static_ref`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.static_ref)
88+
- [`Pin::static_mut`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.static_mut)
89+
90+
<a id="1.84.0-Cargo"></a>
91+
92+
Cargo
93+
-----
94+
- [Stabilize MSRV-aware resolver config](https://github.com/rust-lang/cargo/pull/14639/)
95+
- [Stabilize resolver v3](https://github.com/rust-lang/cargo/pull/14754/)
96+
97+
<a id="1.84-Rustdoc"></a>
98+
99+
Rustdoc
100+
-------
101+
102+
- [rustdoc-search: improve type-driven search](https://github.com/rust-lang/rust/pull/127589)
103+
104+
<a id="1.84.0-Compatibility-Notes"></a>
105+
106+
Compatibility Notes
107+
-------------------
108+
- [Enable by default the `LSX` target feature for LoongArch Linux targets](https://github.com/rust-lang/rust/pull/132140)
109+
- [The unstable `-Zprofile` flag (“gcov-style” coverage instrumentation) has been removed.](https://github.com/rust-lang/rust/pull/131829) This does not affect the stable flags for coverage instrumentation (`-Cinstrument-coverage`) and profile-guided optimization (`-Cprofile-generate`, `-Cprofile-use`), which are unrelated and remain available.
110+
- Support for the target named `wasm32-wasi` has been removed as the target is now named `wasm32-wasip1`. This completes the [transition](https://github.com/rust-lang/compiler-team/issues/607) [plan](https://github.com/rust-lang/compiler-team/issues/695) for this target following [the introduction of `wasm32-wasip1`](https://github.com/rust-lang/rust/pull/120468) in Rust 1.78. Compiler warnings on [use of `wasm32-wasi`](https://github.com/rust-lang/rust/pull/126662) introduced in Rust 1.81 are now gone as well as the target is removed.
111+
- [The syntax `&pin (mut|const) T` is now parsed as a type which in theory could affect macro expansion results in some edge cases](https://github.com/rust-lang/rust/pull/130635#issuecomment-2375462821)
112+
- [Legacy syntax for calling `std::arch` functions is no longer permitted to declare items or bodies (such as closures, inline consts, or async blocks).](https://github.com/rust-lang/rust/pull/130443#issuecomment-2445678945)
113+
- The `wasm32-unknown-emscripten` target's binary release of the standard library is now [built with the latest emsdk 3.1.68](https://github.com/rust-lang/rust/pull/131533), which fixes an ABI-incompatibility with Emscripten >= 3.1.42. If you are locally using a version of emsdk with an incompatible ABI (e.g. before 3.1.42 or a future one), you should build your code with `-Zbuild-std` to ensure that `std` uses the correct ABI.
114+
- [Declaring functions with a calling convention not supported on the current target now triggers a hard error](https://github.com/rust-lang/rust/pull/129935)
115+
- [The next-generation trait solver is now enabled for coherence, fixing multiple soundness issues](https://github.com/rust-lang/rust/pull/130654)
116+
1117
Version 1.83.0 (2024-11-28)
2118
==========================
3119

compiler/rustc_ast_lowering/src/pat.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
120120
self.lower_range_end(end, e2.is_some()),
121121
);
122122
}
123-
// FIXME(guard_patterns): lower pattern guards to HIR
124-
PatKind::Guard(inner, _) => pattern = inner,
123+
PatKind::Guard(inner, cond) => {
124+
break hir::PatKind::Guard(self.lower_pat(inner), self.lower_expr(cond));
125+
}
125126
PatKind::Slice(pats) => break self.lower_pat_slice(pats),
126127
PatKind::Rest => {
127128
// If we reach here the `..` pattern is not semantically allowed.

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
242242
}
243243
}
244244

245-
ast::ItemKind::Struct(..) => {
245+
ast::ItemKind::Struct(..) | ast::ItemKind::Enum(..) | ast::ItemKind::Union(..) => {
246246
for attr in attr::filter_by_name(&i.attrs, sym::repr) {
247247
for item in attr.meta_item_list().unwrap_or_else(ThinVec::new) {
248248
if item.has_name(sym::simd) {

compiler/rustc_attr_data_structures/src/stability.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ use crate::RustcVersion;
99
/// `since` field of the `#[stable]` attribute.
1010
///
1111
/// For more, see [this pull request](https://github.com/rust-lang/rust/pull/100591).
12-
pub const VERSION_PLACEHOLDER: &str = "CURRENT_RUSTC_VERSION";
12+
pub const VERSION_PLACEHOLDER: &str = concat!("CURRENT_RUSTC_VERSIO", "N");
13+
// Note that the `concat!` macro above prevents `src/tools/replace-version-placeholder` from
14+
// replacing the constant with the current version. Hardcoding the tool to skip this file doesn't
15+
// work as the file can (and at some point will) be moved around.
16+
//
17+
// Turning the `concat!` macro into a string literal will make Pietro cry. That'd be sad :(
1318

1419
/// Represents the following attributes:
1520
///

compiler/rustc_borrowck/messages.ftl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ borrowck_suggest_create_fresh_reborrow =
213213
borrowck_suggest_iterate_over_slice =
214214
consider iterating over a slice of the `{$ty}`'s content to avoid moving into the `for` loop
215215
216+
borrowck_tail_expr_drop_order = relative drop order changing in Rust 2024
217+
.label = this temporary value will be dropped at the end of the block
218+
.note = consider using a `let` binding to ensure the value will live long enough
219+
216220
borrowck_ty_no_impl_copy =
217221
{$is_partial_move ->
218222
[true] partial move

compiler/rustc_borrowck/src/borrow_set.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use rustc_mir_dataflow::move_paths::MoveData;
1111
use tracing::debug;
1212

1313
use crate::BorrowIndex;
14-
use crate::path_utils::allow_two_phase_borrow;
1514
use crate::place_ext::PlaceExt;
1615

1716
pub struct BorrowSet<'tcx> {
@@ -350,7 +349,7 @@ impl<'a, 'tcx> GatherBorrows<'a, 'tcx> {
350349
start_location, assigned_place, borrow_index,
351350
);
352351

353-
if !allow_two_phase_borrow(kind) {
352+
if !kind.allows_two_phase_borrow() {
354353
debug!(" -> {:?}", start_location);
355354
return;
356355
}

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 9 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,15 +1516,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
15161516
});
15171517

15181518
self.explain_why_borrow_contains_point(location, borrow, None)
1519-
.add_explanation_to_diagnostic(
1520-
self.infcx.tcx,
1521-
self.body,
1522-
&self.local_names,
1523-
&mut err,
1524-
"",
1525-
Some(borrow_span),
1526-
None,
1527-
);
1519+
.add_explanation_to_diagnostic(&self, &mut err, "", Some(borrow_span), None);
15281520
self.suggest_copy_for_type_in_cloned_ref(&mut err, place);
15291521
let typeck_results = self.infcx.tcx.typeck(self.mir_def_id());
15301522
if let Some(expr) = self.find_expr(borrow_span) {
@@ -1591,15 +1583,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
15911583
});
15921584

15931585
self.explain_why_borrow_contains_point(location, borrow, None)
1594-
.add_explanation_to_diagnostic(
1595-
self.infcx.tcx,
1596-
self.body,
1597-
&self.local_names,
1598-
&mut err,
1599-
"",
1600-
None,
1601-
None,
1602-
);
1586+
.add_explanation_to_diagnostic(&self, &mut err, "", None, None);
16031587
err
16041588
}
16051589

@@ -1886,9 +1870,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
18861870
}
18871871

18881872
explanation.add_explanation_to_diagnostic(
1889-
self.infcx.tcx,
1890-
self.body,
1891-
&self.local_names,
1873+
&self,
18921874
&mut err,
18931875
first_borrow_desc,
18941876
None,
@@ -3046,15 +3028,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
30463028

30473029
if let BorrowExplanation::MustBeValidFor { .. } = explanation {
30483030
} else {
3049-
explanation.add_explanation_to_diagnostic(
3050-
self.infcx.tcx,
3051-
self.body,
3052-
&self.local_names,
3053-
&mut err,
3054-
"",
3055-
None,
3056-
None,
3057-
);
3031+
explanation.add_explanation_to_diagnostic(&self, &mut err, "", None, None);
30583032
}
30593033
} else {
30603034
err.span_label(borrow_span, "borrowed value does not live long enough");
@@ -3067,15 +3041,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
30673041
}
30683042
});
30693043

3070-
explanation.add_explanation_to_diagnostic(
3071-
self.infcx.tcx,
3072-
self.body,
3073-
&self.local_names,
3074-
&mut err,
3075-
"",
3076-
Some(borrow_span),
3077-
None,
3078-
);
3044+
explanation.add_explanation_to_diagnostic(&self, &mut err, "", Some(borrow_span), None);
30793045
}
30803046

30813047
err
@@ -3128,15 +3094,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
31283094
_ => {}
31293095
}
31303096

3131-
explanation.add_explanation_to_diagnostic(
3132-
self.infcx.tcx,
3133-
self.body,
3134-
&self.local_names,
3135-
&mut err,
3136-
"",
3137-
None,
3138-
None,
3139-
);
3097+
explanation.add_explanation_to_diagnostic(&self, &mut err, "", None, None);
31403098

31413099
self.buffer_error(err);
31423100
}
@@ -3309,15 +3267,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
33093267
}
33103268
_ => {}
33113269
}
3312-
explanation.add_explanation_to_diagnostic(
3313-
self.infcx.tcx,
3314-
self.body,
3315-
&self.local_names,
3316-
&mut err,
3317-
"",
3318-
None,
3319-
None,
3320-
);
3270+
explanation.add_explanation_to_diagnostic(&self, &mut err, "", None, None);
33213271

33223272
borrow_spans.args_subdiag(&mut err, |args_span| {
33233273
crate::session_diagnostics::CaptureArgLabel::Capture {
@@ -3808,15 +3758,8 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
38083758
}
38093759
});
38103760

3811-
self.explain_why_borrow_contains_point(location, loan, None).add_explanation_to_diagnostic(
3812-
self.infcx.tcx,
3813-
self.body,
3814-
&self.local_names,
3815-
&mut err,
3816-
"",
3817-
None,
3818-
None,
3819-
);
3761+
self.explain_why_borrow_contains_point(location, loan, None)
3762+
.add_explanation_to_diagnostic(&self, &mut err, "", None, None);
38203763

38213764
self.explain_deref_coercion(loan, &mut err);
38223765

0 commit comments

Comments
 (0)