Skip to content

Commit ac10c03

Browse files
committed
chore: import rustc 1.81.0
1 parent 63dbe2c commit ac10c03

File tree

45,204 files changed

+10336999
-1181027
lines changed

Some content is hidden

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

45,204 files changed

+10336999
-1181027
lines changed

Cargo.lock

Lines changed: 428 additions & 296 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ members = [
2323
"src/tools/remote-test-client",
2424
"src/tools/remote-test-server",
2525
"src/tools/rust-installer",
26-
"src/tools/rust-demangler",
2726
"src/tools/rustdoc",
2827
"src/tools/rls",
2928
"src/tools/rustfmt",
@@ -45,6 +44,8 @@ members = [
4544
"src/tools/rustdoc-gui-test",
4645
"src/tools/opt-dist",
4746
"src/tools/coverage-dump",
47+
"src/tools/rustc-perf-wrapper",
48+
"src/tools/wasm-component-ld",
4849
]
4950

5051
exclude = [
@@ -104,6 +105,9 @@ rustc-demangle.debug = 0
104105
[profile.release.package.lld-wrapper]
105106
debug = 0
106107
strip = true
108+
[profile.release.package.wasm-component-ld-wrapper]
109+
debug = 0
110+
strip = true
107111

108112
[patch.crates-io]
109113
# See comments in `library/rustc-std-workspace-core/README.md` for what's going on

RELEASES.md

Lines changed: 129 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,130 @@
1-
Version 1.80 (2024-07-25)
1+
Version 1.81.0 (2024-09-05)
2+
==========================
3+
4+
<a id="1.81.0-Language"></a>
5+
6+
Language
7+
--------
8+
9+
- [Abort on uncaught panics in `extern "C"` functions.](https://github.com/rust-lang/rust/pull/116088/)
10+
- [Fix ambiguous cases of multiple `&` in elided self lifetimes.](https://github.com/rust-lang/rust/pull/117967/)
11+
- [Stabilize `#[expect]` for lints (RFC 2383),](https://github.com/rust-lang/rust/pull/120924/) like `#[allow]` with a warning if the lint is _not_ fulfilled.
12+
- [Change method resolution to constrain hidden types instead of rejecting method candidates.](https://github.com/rust-lang/rust/pull/123962/)
13+
- [Bump `elided_lifetimes_in_associated_constant` to deny.](https://github.com/rust-lang/rust/pull/124211/)
14+
- [`offset_from`: always allow pointers to point to the same address.](https://github.com/rust-lang/rust/pull/124921/)
15+
- [Allow constraining opaque types during subtyping in the trait system.](https://github.com/rust-lang/rust/pull/125447/)
16+
- [Allow constraining opaque types during various unsizing casts.](https://github.com/rust-lang/rust/pull/125610/)
17+
- [Deny keyword lifetimes pre-expansion.](https://github.com/rust-lang/rust/pull/126762/)
18+
19+
<a id="1.81.0-Compiler"></a>
20+
21+
Compiler
22+
--------
23+
24+
- [Make casts of pointers to trait objects stricter.](https://github.com/rust-lang/rust/pull/120248/)
25+
- [Check alias args for well-formedness even if they have escaping bound vars.](https://github.com/rust-lang/rust/pull/123737/)
26+
- [Deprecate no-op codegen option `-Cinline-threshold=...`.](https://github.com/rust-lang/rust/pull/124712/)
27+
- [Re-implement a type-size based limit.](https://github.com/rust-lang/rust/pull/125507/)
28+
- [Properly account for alignment in `transmute` size checks.](https://github.com/rust-lang/rust/pull/125740/)
29+
- [Remove the `box_pointers` lint.](https://github.com/rust-lang/rust/pull/126018/)
30+
- [Ensure the interpreter checks bool/char for validity when they are used in a cast.](https://github.com/rust-lang/rust/pull/126265/)
31+
- [Improve coverage instrumentation for functions containing nested items.](https://github.com/rust-lang/rust/pull/127199/)
32+
- Target changes:
33+
- [Add Tier 3 `no_std` Xtensa targets:](https://github.com/rust-lang/rust/pull/125141/) `xtensa-esp32-none-elf`, `xtensa-esp32s2-none-elf`, `xtensa-esp32s3-none-elf`
34+
- [Add Tier 3 `std` Xtensa targets:](https://github.com/rust-lang/rust/pull/126380/) `xtensa-esp32-espidf`, `xtensa-esp32s2-espidf`, `xtensa-esp32s3-espidf`
35+
- [Add Tier 3 i686 Redox OS target:](https://github.com/rust-lang/rust/pull/126192/) `i686-unknown-redox`
36+
- [Promote `arm64ec-pc-windows-msvc` to Tier 2.](https://github.com/rust-lang/rust/pull/126039/)
37+
- [Promote `wasm32-wasip2` to Tier 2.](https://github.com/rust-lang/rust/pull/126967/)
38+
- [Promote `loongarch64-unknown-linux-musl` to Tier 2 with host tools.](https://github.com/rust-lang/rust/pull/126298/)
39+
- [Enable full tools and profiler for LoongArch Linux targets.](https://github.com/rust-lang/rust/pull/127078/)
40+
- [Unconditionally warn on usage of `wasm32-wasi`.](https://github.com/rust-lang/rust/pull/126662/) (see compatibility note below)
41+
- Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.
42+
43+
<a id="1.81.0-Libraries"></a>
44+
45+
Libraries
46+
---------
47+
48+
- [Split core's `PanicInfo` and std's `PanicInfo`.](https://github.com/rust-lang/rust/pull/115974/) (see compatibility note below)
49+
- [Generalize `{Rc,Arc}::make_mut()` to unsized types.](https://github.com/rust-lang/rust/pull/116113/)
50+
- [Replace sort implementations with stable `driftsort` and unstable `ipnsort`.](https://github.com/rust-lang/rust/pull/124032/) All `slice::sort*` and `slice::select_nth*` methods are expected to see significant performance improvements. See the [research project](https://github.com/Voultapher/sort-research-rs) for more details.
51+
- [Document behavior of `create_dir_all` with respect to empty paths.](https://github.com/rust-lang/rust/pull/125112/)
52+
- [Fix interleaved output in the default panic hook when multiple threads panic simultaneously.](https://github.com/rust-lang/rust/pull/127397/)
53+
- Fix `Command`'s batch files argument escaping not working when file name has trailing whitespace or periods (CVE-2024-43402).
54+
55+
<a id="1.81.0-Stabilized-APIs"></a>
56+
57+
Stabilized APIs
58+
---------------
59+
60+
- [`core::error`](https://doc.rust-lang.org/stable/core/error/index.html)
61+
- [`hint::assert_unchecked`](https://doc.rust-lang.org/stable/core/hint/fn.assert_unchecked.html)
62+
- [`fs::exists`](https://doc.rust-lang.org/stable/std/fs/fn.exists.html)
63+
- [`AtomicBool::fetch_not`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicBool.html#method.fetch_not)
64+
- [`Duration::abs_diff`](https://doc.rust-lang.org/stable/core/time/struct.Duration.html#method.abs_diff)
65+
- [`IoSlice::advance`](https://doc.rust-lang.org/stable/std/io/struct.IoSlice.html#method.advance)
66+
- [`IoSlice::advance_slices`](https://doc.rust-lang.org/stable/std/io/struct.IoSlice.html#method.advance_slices)
67+
- [`IoSliceMut::advance`](https://doc.rust-lang.org/stable/std/io/struct.IoSliceMut.html#method.advance)
68+
- [`IoSliceMut::advance_slices`](https://doc.rust-lang.org/stable/std/io/struct.IoSliceMut.html#method.advance_slices)
69+
- [`PanicHookInfo`](https://doc.rust-lang.org/stable/std/panic/struct.PanicHookInfo.html)
70+
- [`PanicInfo::message`](https://doc.rust-lang.org/stable/core/panic/struct.PanicInfo.html#method.message)
71+
- [`PanicMessage`](https://doc.rust-lang.org/stable/core/panic/struct.PanicMessage.html)
72+
73+
These APIs are now stable in const contexts:
74+
75+
- [`char::from_u32_unchecked`](https://doc.rust-lang.org/stable/core/char/fn.from_u32_unchecked.html) (function)
76+
- [`char::from_u32_unchecked`](https://doc.rust-lang.org/stable/core/primitive.char.html#method.from_u32_unchecked) (method)
77+
- [`CStr::count_bytes`](https://doc.rust-lang.org/stable/core/ffi/c_str/struct.CStr.html#method.count_bytes)
78+
- [`CStr::from_ptr`](https://doc.rust-lang.org/stable/core/ffi/c_str/struct.CStr.html#method.from_ptr)
79+
80+
<a id="1.81.0-Cargo"></a>
81+
82+
Cargo
83+
-----
84+
85+
- [Generated `.cargo_vcs_info.json` is always included, even when `--allow-dirty` is passed.](https://github.com/rust-lang/cargo/pull/13960/)
86+
- [Disallow `package.license-file` and `package.readme` pointing to non-existent files during packaging.](https://github.com/rust-lang/cargo/pull/13921/)
87+
- [Disallow passing `--release`/`--debug` flag along with the `--profile` flag.](https://github.com/rust-lang/cargo/pull/13971/)
88+
- [Remove `lib.plugin` key support in `Cargo.toml`. Rust plugin support has been deprecated for four years and was removed in 1.75.0.](https://github.com/rust-lang/cargo/pull/13902/)
89+
90+
<a id="1.81.0-Compatibility-Notes"></a>
91+
92+
Compatibility Notes
93+
-------------------
94+
95+
* Usage of the `wasm32-wasi` target will now issue a compiler warning and request users switch to the `wasm32-wasip1` target instead. Both targets are the same, `wasm32-wasi` is only being renamed, and this [change to the WASI target](https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html) is being done to enable removing `wasm32-wasi` in January 2025.
96+
97+
* We have renamed `std::panic::PanicInfo` to `std::panic::PanicHookInfo`. The old name will continue to work as an alias, but will result in a deprecation warning starting in Rust 1.82.0.
98+
99+
`core::panic::PanicInfo` will remain unchanged, however, as this is now a *different type*.
100+
101+
The reason is that these types have different roles: `std::panic::PanicHookInfo` is the argument to the [panic hook](https://doc.rust-lang.org/stable/std/panic/fn.set_hook.html) in std context (where panics can have an arbitrary payload), while `core::panic::PanicInfo` is the argument to the [`#[panic_handler]`](https://doc.rust-lang.org/nomicon/panic-handler.html) in no_std context (where panics always carry a formatted *message*). Separating these types allows us to add more useful methods to these types, such as `std::panic::PanicHookInfo::payload_as_str()` and `core::panic::PanicInfo::message()`.
102+
103+
* The new sort implementations may panic if a type's implementation of [`Ord`](https://doc.rust-lang.org/std/cmp/trait.Ord.html) (or the given comparison function) does not implement a [total order](https://en.wikipedia.org/wiki/Total_order) as the trait requires. `Ord`'s supertraits (`PartialOrd`, `Eq`, and `PartialEq`) must also be consistent. The previous implementations would not "notice" any problem, but the new implementations have a good chance of detecting inconsistencies, throwing a panic rather than returning knowingly unsorted data.
104+
* [In very rare cases, a change in the internal evaluation order of the trait
105+
solver may result in new fatal overflow errors.](https://github.com/rust-lang/rust/pull/126128)
106+
107+
108+
<a id="1.81.0-Internal-Changes"></a>
109+
110+
Internal Changes
111+
----------------
112+
113+
These changes do not affect any public interfaces of Rust, but they represent
114+
significant improvements to the performance or internals of rustc and related
115+
tools.
116+
117+
- [Add a Rust-for Linux `auto` CI job to check kernel builds.](https://github.com/rust-lang/rust/pull/125209/)
118+
119+
Version 1.80.1 (2024-08-08)
120+
===========================
121+
122+
<a id="1.80.1"></a>
123+
124+
- [Fix miscompilation in the jump threading MIR optimization when comparing floats](https://github.com/rust-lang/rust/pull/128271)
125+
- [Revert changes to the `dead_code` lint from 1.80.0](https://github.com/rust-lang/rust/pull/128618)
126+
127+
Version 1.80.0 (2024-07-25)
2128
==========================
3129

4130
<a id="1.80-Language"></a>
@@ -143,6 +269,8 @@ Compatibility Notes
143269
- [Turn `proc_macro_back_compat` lint into a hard error.](https://github.com/rust-lang/rust/pull/125596/)
144270
- [Detect unused structs even when implementing private traits](https://github.com/rust-lang/rust/pull/122382/)
145271
- [`std::sync::ReentrantLockGuard<T>` is no longer `Sync` if `T: !Sync`](https://github.com/rust-lang/rust/pull/125527) which means [`std::io::StdoutLock` and `std::io::StderrLock` are no longer Sync](https://github.com/rust-lang/rust/issues/127340)
272+
- [Type inference will fail in some cases due to new implementations of `FromIterator for Box<str>`.](https://github.com/rust-lang/rust/pull/99969/)
273+
Notably, this breaks versions of the `time` crate before 0.3.35, due to no longer inferring the implementation for `Box<[_]>`.
146274

147275
<a id="1.80-Internal-Changes"></a>
148276

compiler/rustc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ features = ['unprefixed_malloc_on_supported_platforms']
2727

2828
[features]
2929
# tidy-alphabetical-start
30-
jemalloc = ['jemalloc-sys']
30+
jemalloc = ['dep:jemalloc-sys']
3131
llvm = ['rustc_driver_impl/llvm']
3232
max_level_info = ['rustc_driver_impl/max_level_info']
3333
rustc_use_parallel_compiler = ['rustc_driver_impl/rustc_use_parallel_compiler']

compiler/rustc/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
fn main() {
3636
// See the comment at the top of this file for an explanation of this.
37-
#[cfg(feature = "jemalloc-sys")]
37+
#[cfg(feature = "jemalloc")]
3838
{
3939
use std::os::raw::{c_int, c_void};
4040

compiler/rustc_abi/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ default = ["nightly", "randomize"]
2121
# rust-analyzer depends on this crate and we therefore require it to built on a stable toolchain
2222
# without depending on rustc_data_structures, rustc_macros and rustc_serialize
2323
nightly = [
24-
"rustc_data_structures",
24+
"dep:rustc_data_structures",
25+
"dep:rustc_macros",
26+
"dep:rustc_serialize",
2527
"rustc_index/nightly",
26-
"rustc_macros",
27-
"rustc_serialize",
2828
]
29-
randomize = ["rand", "rand_xoshiro", "nightly"]
29+
randomize = ["dep:rand", "dep:rand_xoshiro", "nightly"]
3030
# tidy-alphabetical-end

compiler/rustc_abi/src/layout.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ pub trait LayoutCalculator {
186186
let (present_first, present_second) = {
187187
let mut present_variants = variants
188188
.iter_enumerated()
189-
.filter_map(|(i, v)| if absent(v) { None } else { Some(i) });
189+
.filter_map(|(i, v)| if !repr.c() && absent(v) { None } else { Some(i) });
190190
(present_variants.next(), present_variants.next())
191191
};
192192
let present_first = match present_first {
@@ -621,7 +621,7 @@ where
621621
let discr_type = repr.discr_type();
622622
let bits = Integer::from_attr(dl, discr_type).size().bits();
623623
for (i, mut val) in discriminants {
624-
if variants[i].iter().any(|f| f.abi.is_uninhabited()) {
624+
if !repr.c() && variants[i].iter().any(|f| f.abi.is_uninhabited()) {
625625
continue;
626626
}
627627
if discr_type.is_signed() {

compiler/rustc_abi/src/lib.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
#![cfg_attr(feature = "nightly", feature(step_trait))]
1+
// tidy-alphabetical-start
22
#![cfg_attr(feature = "nightly", allow(internal_features))]
33
#![cfg_attr(feature = "nightly", doc(rust_logo))]
44
#![cfg_attr(feature = "nightly", feature(rustdoc_internals))]
5+
#![cfg_attr(feature = "nightly", feature(step_trait))]
6+
// tidy-alphabetical-end
57

68
use std::fmt;
79
use std::num::{NonZeroUsize, ParseIntError};
@@ -425,11 +427,13 @@ pub struct Size {
425427
raw: u64,
426428
}
427429

428-
// Safety: Ord is implement as just comparing numerical values and numerical values
429-
// are not changed by (de-)serialization.
430430
#[cfg(feature = "nightly")]
431-
unsafe impl StableOrd for Size {
431+
impl StableOrd for Size {
432432
const CAN_USE_UNSTABLE_SORT: bool = true;
433+
434+
// `Ord` is implemented as just comparing numerical values and numerical values
435+
// are not changed by (de-)serialization.
436+
const THIS_IMPLEMENTATION_HAS_BEEN_TRIPLE_CHECKED: () = ();
433437
}
434438

435439
// This is debug-printed a lot in larger structs, don't waste too much space there
@@ -623,7 +627,7 @@ impl Step for Size {
623627

624628
#[inline]
625629
unsafe fn forward_unchecked(start: Self, count: usize) -> Self {
626-
Self::from_bytes(u64::forward_unchecked(start.bytes(), count))
630+
Self::from_bytes(unsafe { u64::forward_unchecked(start.bytes(), count) })
627631
}
628632

629633
#[inline]
@@ -638,7 +642,7 @@ impl Step for Size {
638642

639643
#[inline]
640644
unsafe fn backward_unchecked(start: Self, count: usize) -> Self {
641-
Self::from_bytes(u64::backward_unchecked(start.bytes(), count))
645+
Self::from_bytes(unsafe { u64::backward_unchecked(start.bytes(), count) })
642646
}
643647
}
644648

@@ -1425,7 +1429,7 @@ pub enum Variants<FieldIdx: Idx, VariantIdx: Idx> {
14251429
/// Single enum variants, structs/tuples, unions, and all non-ADTs.
14261430
Single { index: VariantIdx },
14271431

1428-
/// Enum-likes with more than one inhabited variant: each variant comes with
1432+
/// Enum-likes with more than one variant: each variant comes with
14291433
/// a *discriminant* (usually the same as the variant index but the user can
14301434
/// assign explicit discriminant values). That discriminant is encoded
14311435
/// as a *tag* on the machine. The layout of each variant is

compiler/rustc_arena/src/lib.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,25 @@
77
//!
88
//! This crate implements several kinds of arena.
99
10+
// tidy-alphabetical-start
11+
#![allow(clippy::mut_from_ref)] // Arena allocators are one place where this pattern is fine.
12+
#![allow(internal_features)]
13+
#![cfg_attr(test, feature(test))]
14+
#![deny(unsafe_op_in_unsafe_fn)]
1015
#![doc(
1116
html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
1217
test(no_crate_inject, attr(deny(warnings)))
1318
)]
1419
#![doc(rust_logo)]
15-
#![feature(rustdoc_internals)]
1620
#![feature(core_intrinsics)]
21+
#![feature(decl_macro)]
1722
#![feature(dropck_eyepatch)]
18-
#![feature(new_uninit)]
1923
#![feature(maybe_uninit_slice)]
20-
#![feature(decl_macro)]
24+
#![feature(new_uninit)]
2125
#![feature(rustc_attrs)]
22-
#![cfg_attr(test, feature(test))]
26+
#![feature(rustdoc_internals)]
2327
#![feature(strict_provenance)]
24-
#![deny(unsafe_op_in_unsafe_fn)]
25-
#![allow(internal_features)]
26-
#![allow(clippy::mut_from_ref)] // Arena allocators are one of the places where this pattern is fine.
28+
// tidy-alphabetical-end
2729

2830
use smallvec::SmallVec;
2931

0 commit comments

Comments
 (0)