Skip to content

Commit 7c4ac06

Browse files
committed
Auto merge of rust-lang#124752 - GuillaumeGomez:rollup-a4qagbd, r=GuillaumeGomez
Rollup of 6 pull requests Successful merges: - rust-lang#124148 (rustdoc-search: search for references) - rust-lang#124668 (Fix bootstrap panic when build from tarball) - rust-lang#124736 (compiler: upgrade time from 0.3.34 to 0.3.36) - rust-lang#124748 (Fix unwinding on 32-bit watchOS ARM (v2)) - rust-lang#124749 (Stabilize exclusive_range_pattern (v2)) - rust-lang#124750 (Document That `f16` And `f128` Hardware Support is Limited (v2)) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 06e88c3 + 4eedf73 commit 7c4ac06

File tree

98 files changed

+1281
-741
lines changed

Some content is hidden

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

98 files changed

+1281
-741
lines changed

Cargo.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -5597,9 +5597,9 @@ version = "0.1.0"
55975597

55985598
[[package]]
55995599
name = "time"
5600-
version = "0.3.34"
5600+
version = "0.3.36"
56015601
source = "registry+https://github.com/rust-lang/crates.io-index"
5602-
checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749"
5602+
checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
56035603
dependencies = [
56045604
"deranged",
56055605
"itoa",
@@ -5618,9 +5618,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
56185618

56195619
[[package]]
56205620
name = "time-macros"
5621-
version = "0.2.17"
5621+
version = "0.2.18"
56225622
source = "registry+https://github.com/rust-lang/crates.io-index"
5623-
checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774"
5623+
checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
56245624
dependencies = [
56255625
"num-conv",
56265626
"time-core",

compiler/rustc_ast_passes/src/feature_gate.rs

+1-14
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use rustc_ast as ast;
22
use rustc_ast::visit::{self, AssocCtxt, FnCtxt, FnKind, Visitor};
33
use rustc_ast::{attr, AssocConstraint, AssocConstraintKind, NodeId};
4-
use rustc_ast::{token, PatKind, RangeEnd};
4+
use rustc_ast::{token, PatKind};
55
use rustc_feature::{AttributeGate, BuiltinAttribute, Features, GateIssue, BUILTIN_ATTRIBUTE_MAP};
66
use rustc_session::parse::{feature_err, feature_err_issue, feature_warn};
77
use rustc_session::Session;
@@ -418,15 +418,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
418418
PatKind::Box(..) => {
419419
gate!(&self, box_patterns, pattern.span, "box pattern syntax is experimental");
420420
}
421-
PatKind::Range(_, Some(_), Spanned { node: RangeEnd::Excluded, .. }) => {
422-
gate!(
423-
&self,
424-
exclusive_range_pattern,
425-
pattern.span,
426-
"exclusive range pattern syntax is experimental",
427-
"use an inclusive range pattern, like N..=M"
428-
);
429-
}
430421
_ => {}
431422
}
432423
visit::walk_pat(self, pattern)
@@ -619,10 +610,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
619610
// be too.
620611
gate_all_legacy_dont_use!(return_type_notation, "return type notation is experimental");
621612
gate_all_legacy_dont_use!(decl_macro, "`macro` is experimental");
622-
gate_all_legacy_dont_use!(
623-
exclusive_range_pattern,
624-
"exclusive range pattern syntax is experimental"
625-
);
626613
gate_all_legacy_dont_use!(try_blocks, "`try` blocks are unstable");
627614
gate_all_legacy_dont_use!(auto_traits, "`auto` traits are unstable");
628615

compiler/rustc_driver_impl/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ rustc_trait_selection = { path = "../rustc_trait_selection" }
4949
rustc_ty_utils = { path = "../rustc_ty_utils" }
5050
serde_json = "1.0.59"
5151
shlex = "1.0"
52-
time = { version = "0.3", default-features = false, features = ["alloc", "formatting", "parsing", "macros"] }
52+
time = { version = "0.3.36", default-features = false, features = ["alloc", "formatting", "parsing", "macros"] }
5353
tracing = { version = "0.1.35" }
5454
# tidy-alphabetical-end
5555

compiler/rustc_error_codes/src/error_codes/E0579.md

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ A lower range wasn't less than the upper range.
33
Erroneous code example:
44

55
```compile_fail,E0579
6-
#![feature(exclusive_range_pattern)]
76
87
fn main() {
98
match 5u32 {

compiler/rustc_feature/src/accepted.rs

+2
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ declare_features! (
162162
(accepted, drop_types_in_const, "1.22.0", Some(33156)),
163163
/// Allows using `dyn Trait` as a syntax for trait objects.
164164
(accepted, dyn_trait, "1.27.0", Some(44662)),
165+
/// Allows `X..Y` patterns.
166+
(accepted, exclusive_range_pattern, "CURRENT_RUSTC_VERSION", Some(37854)),
165167
/// Allows integer match exhaustiveness checking (RFC 2591).
166168
(accepted, exhaustive_integer_patterns, "1.33.0", Some(50907)),
167169
/// Allows explicit generic arguments specification with `impl Trait` present.

compiler/rustc_feature/src/unstable.rs

-2
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,6 @@ declare_features! (
454454
(incomplete, dyn_star, "1.65.0", Some(102425)),
455455
/// Uses generic effect parameters for ~const bounds
456456
(unstable, effects, "1.72.0", Some(102090)),
457-
/// Allows `X..Y` patterns.
458-
(unstable, exclusive_range_pattern, "1.11.0", Some(37854)),
459457
/// Allows exhaustive pattern matching on types that contain uninhabited types.
460458
(unstable, exhaustive_patterns, "1.13.0", Some(51085)),
461459
/// Allows explicit tail calls via `become` expression.

compiler/rustc_lint_defs/src/builtin.rs

-1
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,6 @@ declare_lint! {
844844
/// ### Example
845845
///
846846
/// ```rust
847-
/// # #![feature(exclusive_range_pattern)]
848847
/// let x = 123u32;
849848
/// match x {
850849
/// 0..100 => { println!("small"); }

compiler/rustc_pattern_analysis/src/usefulness.rs

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
//! This is enough to compute usefulness: a pattern in a `match` expression is redundant iff it is
4343
//! not useful w.r.t. the patterns above it:
4444
//! ```compile_fail,E0004
45-
//! # #![feature(exclusive_range_pattern)]
4645
//! # fn foo() {
4746
//! match Some(0u32) {
4847
//! Some(0..100) => {},

library/alloc/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@
165165
//
166166
// Language features:
167167
// tidy-alphabetical-start
168+
#![cfg_attr(bootstrap, feature(exclusive_range_pattern))]
168169
#![cfg_attr(not(test), feature(coroutine_trait))]
169170
#![cfg_attr(test, feature(panic_update_hook))]
170171
#![cfg_attr(test, feature(test))]
@@ -179,7 +180,6 @@
179180
#![feature(const_try)]
180181
#![feature(decl_macro)]
181182
#![feature(dropck_eyepatch)]
182-
#![feature(exclusive_range_pattern)]
183183
#![feature(fundamental)]
184184
#![feature(hashmap_internals)]
185185
#![feature(lang_items)]

library/core/src/primitive_docs.rs

+12
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,12 @@ impl<T> (T,) {}
11331133
/// bits. Please see [the documentation for [`prim@f32`] or [Wikipedia on
11341134
/// half-precision values][wikipedia] for more information.
11351135
///
1136+
/// Note that most common platforms will not support `f16` in hardware without enabling extra target
1137+
/// features, with the notable exception of Apple Silicon (also known as M1, M2, etc.) processors.
1138+
/// Hardware support on x86-64 requires the avx512fp16 feature, while RISC-V requires Zhf.
1139+
/// Usually the fallback implementation will be to use `f32` hardware if it exists, and convert
1140+
/// between `f16` and `f32` when performing math.
1141+
///
11361142
/// *[See also the `std::f16::consts` module](crate::f16::consts).*
11371143
///
11381144
/// [wikipedia]: https://en.wikipedia.org/wiki/Half-precision_floating-point_format
@@ -1232,6 +1238,12 @@ mod prim_f64 {}
12321238
/// as many bits as `f64`. Please see [the documentation for [`prim@f32`] or [Wikipedia on
12331239
/// quad-precision values][wikipedia] for more information.
12341240
///
1241+
/// Note that no platforms have hardware support for `f128` without enabling target specific features,
1242+
/// as for all instruction set architectures `f128` is considered an optional feature.
1243+
/// Only Power ISA ("PowerPC") and RISCV specify it, and only certain microarchitectures
1244+
/// actually implement it. For x86-64 and AArch64, ISA support is not even specified,
1245+
/// so it will always be a software implementation significantly slower than `f64`.
1246+
///
12351247
/// *[See also the `std::f128::consts` module](crate::f128::consts).*
12361248
///
12371249
/// [wikipedia]: https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format

library/std/src/sys/personality/dwarf/eh.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,14 @@ pub enum EHAction {
5454
Terminate,
5555
}
5656

57-
pub const USING_SJLJ_EXCEPTIONS: bool = cfg!(all(target_os = "ios", target_arch = "arm"));
57+
/// 32-bit Apple ARM uses SjLj exceptions, except for watchOS.
58+
///
59+
/// I.e. iOS and tvOS, as those are the only Apple OSes that used 32-bit ARM
60+
/// devices.
61+
///
62+
/// <https://github.com/llvm/llvm-project/blob/llvmorg-18.1.4/clang/lib/Driver/ToolChains/Darwin.cpp#L3107-L3119>
63+
pub const USING_SJLJ_EXCEPTIONS: bool =
64+
cfg!(all(target_vendor = "apple", not(target_os = "watchos"), target_arch = "arm"));
5865

5966
pub unsafe fn find_eh_action(lsda: *const u8, context: &EHContext<'_>) -> Result<EHAction, ()> {
6067
if lsda.is_null() {

library/std/src/sys/personality/gcc.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,12 @@ const UNWIND_DATA_REG: (i32, i32) = (4, 5); // a0, a1
9292
// https://github.com/gcc-mirror/gcc/blob/trunk/libgcc/unwind-c.c
9393

9494
cfg_if::cfg_if! {
95-
if #[cfg(all(target_arch = "arm", not(target_os = "ios"), not(target_os = "tvos"), not(target_os = "watchos"), not(target_os = "visionos"), not(target_os = "netbsd")))] {
95+
if #[cfg(all(not(all(target_vendor = "apple", not(target_os = "watchos"))), target_arch = "arm", not(target_os = "netbsd")))] {
9696
// ARM EHABI personality routine.
9797
// https://web.archive.org/web/20190728160938/https://infocenter.arm.com/help/topic/com.arm.doc.ihi0038b/IHI0038B_ehabi.pdf
9898
//
99-
// iOS uses the default routine instead since it uses SjLj unwinding.
99+
// Apple 32-bit ARM (but not watchOS) uses the default routine instead
100+
// since it uses SjLj unwinding.
100101
#[lang = "eh_personality"]
101102
unsafe extern "C" fn rust_eh_personality(
102103
state: uw::_Unwind_State,

library/unwind/src/libunwind.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ pub const unwinder_private_data_size: usize = 2;
3333
#[cfg(all(target_arch = "x86_64", target_os = "windows"))]
3434
pub const unwinder_private_data_size: usize = 6;
3535

36-
#[cfg(all(target_arch = "arm", not(any(target_os = "ios", target_os = "watchos"))))]
36+
#[cfg(all(target_arch = "arm", not(all(target_vendor = "apple", not(target_os = "watchos")))))]
3737
pub const unwinder_private_data_size: usize = 20;
3838

39-
#[cfg(all(target_arch = "arm", any(target_os = "ios", target_os = "watchos")))]
39+
#[cfg(all(target_arch = "arm", all(target_vendor = "apple", not(target_os = "watchos"))))]
4040
pub const unwinder_private_data_size: usize = 5;
4141

4242
#[cfg(all(target_arch = "aarch64", target_pointer_width = "64", not(target_os = "windows")))]
@@ -123,7 +123,7 @@ extern "C" {
123123
}
124124

125125
cfg_if::cfg_if! {
126-
if #[cfg(any(target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos", target_os = "netbsd", not(target_arch = "arm")))] {
126+
if #[cfg(any(all(target_vendor = "apple", not(target_os = "watchos")), target_os = "netbsd", not(target_arch = "arm")))] {
127127
// Not ARM EHABI
128128
#[repr(C)]
129129
#[derive(Copy, Clone, PartialEq)]
@@ -258,8 +258,15 @@ if #[cfg(any(target_os = "ios", target_os = "tvos", target_os = "watchos", targe
258258
} // cfg_if!
259259

260260
cfg_if::cfg_if! {
261-
if #[cfg(not(all(target_os = "ios", target_arch = "arm")))] {
262-
// Not 32-bit iOS
261+
if #[cfg(all(target_vendor = "apple", not(target_os = "watchos"), target_arch = "arm"))] {
262+
// 32-bit ARM Apple (except for watchOS) uses SjLj and does not provide
263+
// _Unwind_Backtrace()
264+
extern "C-unwind" {
265+
pub fn _Unwind_SjLj_RaiseException(e: *mut _Unwind_Exception) -> _Unwind_Reason_Code;
266+
}
267+
268+
pub use _Unwind_SjLj_RaiseException as _Unwind_RaiseException;
269+
} else {
263270
#[cfg_attr(
264271
all(feature = "llvm-libunwind", any(target_os = "fuchsia", target_os = "linux", target_os = "xous")),
265272
link(name = "unwind", kind = "static", modifiers = "-bundle")
@@ -276,13 +283,6 @@ if #[cfg(not(all(target_os = "ios", target_arch = "arm")))] {
276283
trace_argument: *mut c_void)
277284
-> _Unwind_Reason_Code;
278285
}
279-
} else {
280-
// 32-bit iOS uses SjLj and does not provide _Unwind_Backtrace()
281-
extern "C-unwind" {
282-
pub fn _Unwind_SjLj_RaiseException(e: *mut _Unwind_Exception) -> _Unwind_Reason_Code;
283-
}
284-
285-
pub use _Unwind_SjLj_RaiseException as _Unwind_RaiseException;
286286
}
287287
} // cfg_if!
288288

src/bootstrap/src/core/builder.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -2221,13 +2221,8 @@ impl<'a> Builder<'a> {
22212221
out
22222222
}
22232223

2224-
/// Return paths of all submodules managed by git.
2225-
/// If the current checkout is not managed by git, returns an empty slice.
2224+
/// Return paths of all submodules.
22262225
pub fn get_all_submodules(&self) -> &[String] {
2227-
if !self.rust_info().is_managed_git_subrepository() {
2228-
return &[];
2229-
}
2230-
22312226
static SUBMODULES_PATHS: OnceLock<Vec<String>> = OnceLock::new();
22322227

22332228
let init_submodules_paths = |src: &PathBuf| {

src/doc/rustdoc/src/read-documentation/search.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ and number of matches. For example, a function with the signature
146146
`fn read_all(&mut self: impl Read) -> Result<Vec<u8>, Error>`
147147
will match these queries:
148148

149+
* `&mut Read -> Result<Vec<u8>, Error>`
149150
* `Read -> Result<Vec<u8>, Error>`
150151
* `Read -> Result<Error, Vec>`
151152
* `Read -> Result<Vec<u8>>`
@@ -166,6 +167,10 @@ but you need to know which one you want.
166167

167168
| Shorthand | Explicit names |
168169
| ---------------- | ------------------------------------------------- |
170+
| `&` | `primitive:reference` |
171+
| `&T` | `primitive:reference<T>` |
172+
| `&mut` | `primitive:reference<keyword:mut>` |
173+
| `&mut T` | `primitive:reference<keyword:mut, T>` |
169174
| `[]` | `primitive:slice` and/or `primitive:array` |
170175
| `[T]` | `primitive:slice<T>` and/or `primitive:array<T>` |
171176
| `()` | `primitive:unit` and/or `primitive:tuple` |
@@ -253,7 +258,8 @@ ident = *(ALPHA / DIGIT / "_")
253258
path = ident *(DOUBLE-COLON ident) [BANG]
254259
slice-like = OPEN-SQUARE-BRACKET [ nonempty-arg-list ] CLOSE-SQUARE-BRACKET
255260
tuple-like = OPEN-PAREN [ nonempty-arg-list ] CLOSE-PAREN
256-
arg = [type-filter *WS COLON *WS] (path [generics] / slice-like / tuple-like)
261+
borrow-ref = AMP *WS [MUT] *WS [arg]
262+
arg = [type-filter *WS COLON *WS] (path [generics] / slice-like / tuple-like / borrow-ref)
257263
type-sep = COMMA/WS *(COMMA/WS)
258264
nonempty-arg-list = *(type-sep) arg *(type-sep arg) *(type-sep) [ return-args ]
259265
generic-arg-list = *(type-sep) arg [ EQUAL arg ] *(type-sep arg [ EQUAL arg ]) *(type-sep)
@@ -310,6 +316,8 @@ COMMA = ","
310316
RETURN-ARROW = "->"
311317
EQUAL = "="
312318
BANG = "!"
319+
AMP = "&"
320+
MUT = "mut"
313321
314322
ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
315323
DIGIT = %x30-39

src/doc/unstable-book/src/language-features/exclusive-range-pattern.md

-26
This file was deleted.

src/doc/unstable-book/src/language-features/half-open-range-patterns-in-slices.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# `half_open_range_patterns_in_slices`
22

33
The tracking issue for this feature is: [#67264]
4-
It is part of the `exclusive_range_pattern` feature,
4+
It is a future part of the `exclusive_range_pattern` feature,
55
tracked at [#37854].
66

77
[#67264]: https://github.com/rust-lang/rust/issues/67264
@@ -12,7 +12,6 @@ This feature allow using top-level half-open range patterns in slices.
1212

1313
```rust
1414
#![feature(half_open_range_patterns_in_slices)]
15-
#![feature(exclusive_range_pattern)]
1615

1716
fn main() {
1817
let xs = [13, 1, 5, 2, 3, 1, 21, 8];

src/librustdoc/html/render/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ pub(crate) enum RenderTypeId {
182182
Primitive(clean::PrimitiveType),
183183
AssociatedType(Symbol),
184184
Index(isize),
185+
Mut,
185186
}
186187

187188
impl RenderTypeId {

0 commit comments

Comments
 (0)