Skip to content

Commit f9a322a

Browse files
committed
Auto merge of #76678 - jonas-schievink:rollup-vzl9yhx, r=jonas-schievink
Rollup of 12 pull requests Successful merges: - #75559 (unions: test move behavior of non-Copy fields) - #76441 (Note that parallel-compiler = true causes tests to fail) - #76527 (Remove internal and unstable MaybeUninit::UNINIT.) - #76629 (Simplify iter zip struct doc) - #76640 (Simplify SyncOnceCell's `take` and `drop`.) - #76646 (Add mailmap entry) - #76651 (Remove Windows details from Unix and VmWorks symlink() docstrings) - #76663 (Simplify iter chain struct doc) - #76665 (slice::from_raw_parts: explicitly mention that data must be initialized) - #76667 (Fix CI LLVM to work on NixOS out of the box) - #76668 (Add visualization of rustc span in doc) - #76677 (note that test_stable_pointers does not reflect a stable guarantee) Failed merges: r? `@ghost`
2 parents 7402a39 + fe716d0 commit f9a322a

File tree

18 files changed

+148
-69
lines changed

18 files changed

+148
-69
lines changed

.mailmap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ Chris C Cerami <chrisccerami@users.noreply.github.com> Chris C Cerami <chrisccer
5555
Chris Pressey <cpressey@gmail.com>
5656
Chris Thorn <chris@thorn.co> Chris Thorn <thorn@thoughtbot.com>
5757
Chris Vittal <christopher.vittal@gmail.com> Christopher Vittal <christopher.vittal@gmail.com>
58+
Christiaan Dirkx <christiaan@dirkx.email> <christiaan@dirkx.com>
59+
Christiaan Dirkx <christiaan@dirkx.email> CDirkx <christiaan@dirkx.com>
60+
Christiaan Dirkx <christiaan@dirkx.email> CDirkx <christiaan@dirkx.email>
5861
Christian Poveda <git@christianpoveda.xyz> <christianpoveda@protonmail.com>
5962
Christian Poveda <git@christianpoveda.xyz> <cn.poveda.ruiz@gmail.com>
6063
Christian Poveda <git@christianpoveda.xyz> <z1mvader@protonmail.com>

compiler/rustc_span/src/lib.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,12 @@ impl Span {
544544
}
545545

546546
/// Returns a `Span` that would enclose both `self` and `end`.
547+
///
548+
/// ```text
549+
/// ____ ___
550+
/// self lorem ipsum end
551+
/// ^^^^^^^^^^^^^^^^^^^^
552+
/// ```
547553
pub fn to(self, end: Span) -> Span {
548554
let span_data = self.data();
549555
let end_data = end.data();
@@ -567,6 +573,12 @@ impl Span {
567573
}
568574

569575
/// Returns a `Span` between the end of `self` to the beginning of `end`.
576+
///
577+
/// ```text
578+
/// ____ ___
579+
/// self lorem ipsum end
580+
/// ^^^^^^^^^^^^^
581+
/// ```
570582
pub fn between(self, end: Span) -> Span {
571583
let span = self.data();
572584
let end = end.data();
@@ -577,7 +589,13 @@ impl Span {
577589
)
578590
}
579591

580-
/// Returns a `Span` between the beginning of `self` to the beginning of `end`.
592+
/// Returns a `Span` from the beginning of `self` until the beginning of `end`.
593+
///
594+
/// ```text
595+
/// ____ ___
596+
/// self lorem ipsum end
597+
/// ^^^^^^^^^^^^^^^^^
598+
/// ```
581599
pub fn until(self, end: Span) -> Span {
582600
let span = self.data();
583601
let end = end.data();

config.toml.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@
393393
#incremental = false
394394

395395
# Build a multi-threaded rustc
396+
# FIXME(#75760): Some UI tests fail when this option is enabled.
396397
#parallel-compiler = false
397398

398399
# The default linker that will be hard-coded into the generated compiler for

library/alloc/src/collections/btree/node.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ impl<K, V> LeafNode<K, V> {
7878
LeafNode {
7979
// As a general policy, we leave fields uninitialized if they can be, as this should
8080
// be both slightly faster and easier to track in Valgrind.
81-
keys: [MaybeUninit::UNINIT; CAPACITY],
82-
vals: [MaybeUninit::UNINIT; CAPACITY],
81+
keys: MaybeUninit::uninit_array(),
82+
vals: MaybeUninit::uninit_array(),
8383
parent: ptr::null(),
8484
parent_idx: MaybeUninit::uninit(),
8585
len: 0,
@@ -111,7 +111,7 @@ impl<K, V> InternalNode<K, V> {
111111
/// `len` of 0), there must be one initialized and valid edge. This function does not set up
112112
/// such an edge.
113113
unsafe fn new() -> Self {
114-
InternalNode { data: unsafe { LeafNode::new() }, edges: [MaybeUninit::UNINIT; 2 * B] }
114+
InternalNode { data: unsafe { LeafNode::new() }, edges: MaybeUninit::uninit_array() }
115115
}
116116
}
117117

library/alloc/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@
100100
#![feature(fn_traits)]
101101
#![feature(fundamental)]
102102
#![feature(inplace_iteration)]
103-
#![feature(internal_uninit_const)]
104103
#![feature(lang_items)]
105104
#![feature(layout_for_ptr)]
106105
#![feature(libc)]
@@ -135,7 +134,7 @@
135134
#![feature(unsized_locals)]
136135
#![feature(allocator_internals)]
137136
#![feature(slice_partition_dedup)]
138-
#![feature(maybe_uninit_extra, maybe_uninit_slice)]
137+
#![feature(maybe_uninit_extra, maybe_uninit_slice, maybe_uninit_uninit_array)]
139138
#![feature(alloc_layout_extra)]
140139
#![feature(trusted_random_access)]
141140
#![feature(try_trait)]

library/alloc/tests/vec.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,6 +1511,9 @@ fn test_stable_pointers() {
15111511
// Test that, if we reserved enough space, adding and removing elements does not
15121512
// invalidate references into the vector (such as `v0`). This test also
15131513
// runs in Miri, which would detect such problems.
1514+
// Note that this test does *not* constitute a stable guarantee that all these functions do not
1515+
// reallocate! Only what is explicitly documented at
1516+
// <https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#guarantees> is stably guaranteed.
15141517
let mut v = Vec::with_capacity(128);
15151518
v.push(13);
15161519

library/core/src/iter/adapters/chain.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ use crate::usize;
44

55
/// An iterator that links two iterators together, in a chain.
66
///
7-
/// This `struct` is created by the [`chain`] method on [`Iterator`]. See its
8-
/// documentation for more.
9-
///
10-
/// [`chain`]: trait.Iterator.html#method.chain
11-
/// [`Iterator`]: trait.Iterator.html
7+
/// This `struct` is created by [`Iterator::chain`]. See its documentation
8+
/// for more.
129
#[derive(Clone, Debug)]
1310
#[must_use = "iterators are lazy and do nothing unless consumed"]
1411
#[stable(feature = "rust1", since = "1.0.0")]

library/core/src/iter/adapters/zip.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@ use super::super::{
88

99
/// An iterator that iterates two other iterators simultaneously.
1010
///
11-
/// This `struct` is created by the [`zip`] method on [`Iterator`]. See its
12-
/// documentation for more.
13-
///
14-
/// [`zip`]: trait.Iterator.html#method.zip
15-
/// [`Iterator`]: trait.Iterator.html
11+
/// This `struct` is created by [`Iterator::zip`]. See its documentation
12+
/// for more.
1613
#[derive(Clone)]
1714
#[must_use = "iterators are lazy and do nothing unless consumed"]
1815
#[stable(feature = "rust1", since = "1.0.0")]

library/core/src/mem/maybe_uninit.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -306,14 +306,6 @@ impl<T> MaybeUninit<T> {
306306
unsafe { MaybeUninit::<[MaybeUninit<T>; LEN]>::uninit().assume_init() }
307307
}
308308

309-
/// A promotable constant, equivalent to `uninit()`.
310-
#[unstable(
311-
feature = "internal_uninit_const",
312-
issue = "none",
313-
reason = "hack to work around promotability"
314-
)]
315-
pub const UNINIT: Self = Self::uninit();
316-
317309
/// Creates a new `MaybeUninit<T>` in an uninitialized state, with the memory being
318310
/// filled with `0` bytes. It depends on `T` whether that already makes for
319311
/// proper initialization. For example, `MaybeUninit<usize>::zeroed()` is initialized,

library/core/src/slice/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6680,6 +6680,8 @@ unsafe impl<'a, T> TrustedRandomAccess for RChunksExactMut<'a, T> {
66806680
/// them from other data. You can obtain a pointer that is usable as `data`
66816681
/// for zero-length slices using [`NonNull::dangling()`].
66826682
///
6683+
/// * `data` must point to `len` consecutive properly initialized values of type `T`.
6684+
///
66836685
/// * The memory referenced by the returned slice must not be mutated for the duration
66846686
/// of lifetime `'a`, except inside an `UnsafeCell`.
66856687
///
@@ -6767,6 +6769,8 @@ pub unsafe fn from_raw_parts<'a, T>(data: *const T, len: usize) -> &'a [T] {
67676769
/// them from other data. You can obtain a pointer that is usable as `data`
67686770
/// for zero-length slices using [`NonNull::dangling()`].
67696771
///
6772+
/// * `data` must point to `len` consecutive properly initialized values of type `T`.
6773+
///
67706774
/// * The memory referenced by the returned slice must not be accessed through any other pointer
67716775
/// (not derived from the return value) for the duration of lifetime `'a`.
67726776
/// Both read and write accesses are forbidden.

0 commit comments

Comments
 (0)