Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 0c3a4ea

Browse files
committed
Auto merge of rust-lang#131630 - tgross35:rollup-2feqbwv, r=tgross35
Rollup of 7 pull requests Successful merges: - rust-lang#131120 (Stabilize `const_option`) - rust-lang#131207 (ci: aarch64-gnu-debug job) - rust-lang#131334 (Enable sanitizers for loongarch64-unknown-*) - rust-lang#131358 (force "HEAD" for non-CI and `git_upstream_merge_base` for CI environment) - rust-lang#131418 (Use throw intrinsic from stdarch in wasm libunwind) - rust-lang#131579 (Remap path prefix in the panic message of `tests/ui/meta/revision-bad.rs`) - rust-lang#131591 (add latest crash tests) r? `@ghost` `@rustbot` modify labels: rollup
2 parents ef4e825 + e1b21ce commit 0c3a4ea

File tree

36 files changed

+263
-51
lines changed

36 files changed

+263
-51
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ jobs:
122122
# which then uses log commands to actually set them.
123123
EXTRA_VARIABLES: ${{ toJson(matrix.env) }}
124124

125+
- name: setup upstream remote
126+
run: src/ci/scripts/setup-upstream-remote.sh
127+
125128
- name: ensure the channel matches the target branch
126129
run: src/ci/scripts/verify-channel.sh
127130

compiler/rustc_middle/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#![feature(box_as_ptr)]
3838
#![feature(box_patterns)]
3939
#![feature(closure_track_caller)]
40-
#![feature(const_option)]
4140
#![feature(const_type_name)]
4241
#![feature(core_intrinsics)]
4342
#![feature(coroutines)]

compiler/rustc_serialize/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
test(attr(allow(unused_variables), deny(warnings)))
1111
)]
1212
#![doc(rust_logo)]
13-
#![feature(const_option)]
1413
#![feature(core_intrinsics)]
1514
#![feature(min_specialization)]
1615
#![feature(never_type)]

compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_gnu.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::spec::{CodeModel, Target, TargetOptions, base};
1+
use crate::spec::{CodeModel, SanitizerSet, Target, TargetOptions, base};
22

33
pub(crate) fn target() -> Target {
44
Target {
@@ -18,6 +18,11 @@ pub(crate) fn target() -> Target {
1818
features: "+f,+d".into(),
1919
llvm_abiname: "lp64d".into(),
2020
max_atomic_width: Some(64),
21+
supported_sanitizers: SanitizerSet::ADDRESS
22+
| SanitizerSet::CFI
23+
| SanitizerSet::LEAK
24+
| SanitizerSet::MEMORY
25+
| SanitizerSet::THREAD,
2126
direct_access_external_data: Some(false),
2227
..base::linux_gnu::opts()
2328
},

compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_musl.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::spec::{CodeModel, Target, TargetOptions, base};
1+
use crate::spec::{CodeModel, SanitizerSet, Target, TargetOptions, base};
22

33
pub(crate) fn target() -> Target {
44
Target {
@@ -19,6 +19,11 @@ pub(crate) fn target() -> Target {
1919
llvm_abiname: "lp64d".into(),
2020
max_atomic_width: Some(64),
2121
crt_static_default: false,
22+
supported_sanitizers: SanitizerSet::ADDRESS
23+
| SanitizerSet::CFI
24+
| SanitizerSet::LEAK
25+
| SanitizerSet::MEMORY
26+
| SanitizerSet::THREAD,
2227
..base::linux_musl::opts()
2328
},
2429
}

compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_ohos.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::spec::{Target, TargetOptions, base};
1+
use crate::spec::{SanitizerSet, Target, TargetOptions, base};
22

33
pub(crate) fn target() -> Target {
44
Target {
@@ -17,6 +17,11 @@ pub(crate) fn target() -> Target {
1717
features: "+f,+d".into(),
1818
llvm_abiname: "lp64d".into(),
1919
max_atomic_width: Some(64),
20+
supported_sanitizers: SanitizerSet::ADDRESS
21+
| SanitizerSet::CFI
22+
| SanitizerSet::LEAK
23+
| SanitizerSet::MEMORY
24+
| SanitizerSet::THREAD,
2025
..base::linux_ohos::opts()
2126
},
2227
}

library/alloc/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@
111111
#![feature(const_eval_select)]
112112
#![feature(const_heap)]
113113
#![feature(const_maybe_uninit_write)]
114-
#![feature(const_option)]
115114
#![feature(const_pin)]
116115
#![feature(const_size_of_val)]
117116
#![feature(const_vec_string_slice)]

library/core/src/array/ascii.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ impl<const N: usize> [u8; N] {
99
///
1010
/// ```
1111
/// #![feature(ascii_char)]
12-
/// #![feature(const_option)]
1312
///
1413
/// const HEX_DIGITS: [std::ascii::Char; 16] =
1514
/// *b"0123456789abcdef".as_ascii().unwrap();

library/core/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@
131131
#![feature(const_maybe_uninit_assume_init)]
132132
#![feature(const_nonnull_new)]
133133
#![feature(const_num_midpoint)]
134-
#![feature(const_option)]
135134
#![feature(const_option_ext)]
136135
#![feature(const_pin)]
137136
#![feature(const_pointer_is_aligned)]

library/core/src/option.rs

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,8 @@ impl<T> Option<T> {
723723
/// ```
724724
#[inline]
725725
#[stable(feature = "rust1", since = "1.0.0")]
726-
#[rustc_const_unstable(feature = "const_option", issue = "67441")]
726+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
727+
#[rustc_const_stable(feature = "const_option", since = "CURRENT_RUSTC_VERSION")]
727728
pub const fn as_mut(&mut self) -> Option<&mut T> {
728729
match *self {
729730
Some(ref mut x) => Some(x),
@@ -924,7 +925,8 @@ impl<T> Option<T> {
924925
#[track_caller]
925926
#[stable(feature = "rust1", since = "1.0.0")]
926927
#[cfg_attr(not(test), rustc_diagnostic_item = "option_expect")]
927-
#[rustc_const_unstable(feature = "const_option", issue = "67441")]
928+
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
929+
#[rustc_const_stable(feature = "const_option", since = "CURRENT_RUSTC_VERSION")]
928930
pub const fn expect(self, msg: &str) -> T {
929931
match self {
930932
Some(val) => val,
@@ -962,7 +964,8 @@ impl<T> Option<T> {
962964
#[track_caller]
963965
#[stable(feature = "rust1", since = "1.0.0")]
964966
#[cfg_attr(not(test), rustc_diagnostic_item = "option_unwrap")]
965-
#[rustc_const_unstable(feature = "const_option", issue = "67441")]
967+
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
968+
#[rustc_const_stable(feature = "const_option", since = "CURRENT_RUSTC_VERSION")]
966969
pub const fn unwrap(self) -> T {
967970
match self {
968971
Some(val) => val,
@@ -1069,7 +1072,8 @@ impl<T> Option<T> {
10691072
#[inline]
10701073
#[track_caller]
10711074
#[stable(feature = "option_result_unwrap_unchecked", since = "1.58.0")]
1072-
#[rustc_const_unstable(feature = "const_option", issue = "67441")]
1075+
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
1076+
#[rustc_const_stable(feature = "const_option", since = "CURRENT_RUSTC_VERSION")]
10731077
pub const unsafe fn unwrap_unchecked(self) -> T {
10741078
match self {
10751079
Some(val) => val,
@@ -1712,7 +1716,8 @@ impl<T> Option<T> {
17121716
/// ```
17131717
#[inline]
17141718
#[stable(feature = "rust1", since = "1.0.0")]
1715-
#[rustc_const_unstable(feature = "const_option", issue = "67441")]
1719+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
1720+
#[rustc_const_stable(feature = "const_option", since = "CURRENT_RUSTC_VERSION")]
17161721
pub const fn take(&mut self) -> Option<T> {
17171722
// FIXME(const-hack) replace `mem::replace` by `mem::take` when the latter is const ready
17181723
mem::replace(self, None)
@@ -1769,8 +1774,9 @@ impl<T> Option<T> {
17691774
/// assert_eq!(old, None);
17701775
/// ```
17711776
#[inline]
1772-
#[rustc_const_unstable(feature = "const_option", issue = "67441")]
17731777
#[stable(feature = "option_replace", since = "1.31.0")]
1778+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
1779+
#[rustc_const_stable(feature = "const_option", since = "CURRENT_RUSTC_VERSION")]
17741780
pub const fn replace(&mut self, value: T) -> Option<T> {
17751781
mem::replace(self, Some(value))
17761782
}
@@ -1878,7 +1884,7 @@ impl<T> Option<&T> {
18781884
/// ```
18791885
#[must_use = "`self` will be dropped if the result is not used"]
18801886
#[stable(feature = "copied", since = "1.35.0")]
1881-
#[rustc_const_unstable(feature = "const_option", issue = "67441")]
1887+
#[rustc_const_stable(feature = "const_option", since = "CURRENT_RUSTC_VERSION")]
18821888
pub const fn copied(self) -> Option<T>
18831889
where
18841890
T: Copy,
@@ -1931,7 +1937,8 @@ impl<T> Option<&mut T> {
19311937
/// ```
19321938
#[must_use = "`self` will be dropped if the result is not used"]
19331939
#[stable(feature = "copied", since = "1.35.0")]
1934-
#[rustc_const_unstable(feature = "const_option", issue = "67441")]
1940+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
1941+
#[rustc_const_stable(feature = "const_option", since = "CURRENT_RUSTC_VERSION")]
19351942
pub const fn copied(self) -> Option<T>
19361943
where
19371944
T: Copy,
@@ -1986,7 +1993,8 @@ impl<T, E> Option<Result<T, E>> {
19861993
/// ```
19871994
#[inline]
19881995
#[stable(feature = "transpose_result", since = "1.33.0")]
1989-
#[rustc_const_unstable(feature = "const_option", issue = "67441")]
1996+
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
1997+
#[rustc_const_stable(feature = "const_option", since = "CURRENT_RUSTC_VERSION")]
19901998
pub const fn transpose(self) -> Result<Option<T>, E> {
19911999
match self {
19922000
Some(Ok(x)) => Ok(Some(x)),
@@ -2009,7 +2017,6 @@ const fn unwrap_failed() -> ! {
20092017
#[cfg_attr(feature = "panic_immediate_abort", inline)]
20102018
#[cold]
20112019
#[track_caller]
2012-
#[rustc_const_unstable(feature = "const_option", issue = "67441")]
20132020
const fn expect_failed(msg: &str) -> ! {
20142021
panic_display(&msg)
20152022
}
@@ -2534,7 +2541,8 @@ impl<T> Option<Option<T>> {
25342541
/// ```
25352542
#[inline]
25362543
#[stable(feature = "option_flattening", since = "1.40.0")]
2537-
#[rustc_const_unstable(feature = "const_option", issue = "67441")]
2544+
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
2545+
#[rustc_const_stable(feature = "const_option", since = "CURRENT_RUSTC_VERSION")]
25382546
pub const fn flatten(self) -> Option<T> {
25392547
// FIXME(const-hack): could be written with `and_then`
25402548
match self {

0 commit comments

Comments
 (0)