Skip to content

Commit ddbce11

Browse files
committed
Auto merge of #27380 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #27102, #27286, #27313, #27325, #27326, #27327, #27341, #27342, #27343, #27345, #27350, #27355, #27374, #27375, #27379 - Failed merges:
2 parents ddc2829 + 5944303 commit ddbce11

File tree

103 files changed

+653
-399
lines changed

Some content is hidden

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

103 files changed

+653
-399
lines changed

configure

+2-4
Original file line numberDiff line numberDiff line change
@@ -1005,11 +1005,9 @@ then
10051005
(''|*clang)
10061006
CFG_CLANG_REPORTED_VERSION=$($CFG_CC --version | grep version)
10071007

1008-
if [[ $CFG_CLANG_REPORTED_VERSION == *"(based on LLVM "* ]]
1009-
then
1008+
if echo $CFG_CLANG_REPORTED_VERSION | grep -q "(based on LLVM "; then
10101009
CFG_CLANG_VERSION=$(echo $CFG_CLANG_REPORTED_VERSION | sed 's/.*(based on LLVM \(.*\))/\1/')
1011-
elif [[ $CFG_CLANG_REPORTED_VERSION == "Apple LLVM"* ]]
1012-
then
1010+
elif echo $CFG_CLANG_REPORTED_VERSION | grep -q "Apple LLVM"; then
10131011
CFG_OSX_CLANG_VERSION=$(echo $CFG_CLANG_REPORTED_VERSION | sed 's/.*version \(.*\) .*/\1/')
10141012
else
10151013
CFG_CLANG_VERSION=$(echo $CFG_CLANG_REPORTED_VERSION | sed 's/.*version \(.*\) .*/\1/')

src/doc/trpl/choosing-your-guarantees.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ allowed to share references to this by the regular borrowing rules, checked at c
4242

4343
## `&T` and `&mut T`
4444

45-
These are immutable and mutable references respectively. They follow the &lquo;read-write lock&rquo;
45+
These are immutable and mutable references respectively. They follow the “read-write lock”
4646
pattern, such that one may either have only one mutable reference to some data, or any number of
4747
immutable ones, but not both. This guarantee is enforced at compile time, and has no visible cost at
4848
runtime. In most cases these two pointer types suffice for sharing cheap references between sections
@@ -108,7 +108,7 @@ increment the inner reference count and return a copy of the `Rc<T>`.
108108

109109
# Cell types
110110

111-
&lquo;Cell&rquo;s provide interior mutability. In other words, they contain data which can be manipulated even
111+
`Cell`s provide interior mutability. In other words, they contain data which can be manipulated even
112112
if the type cannot be obtained in a mutable form (for example, when it is behind an `&`-ptr or
113113
`Rc<T>`).
114114

@@ -127,7 +127,8 @@ If a field is wrapped in `Cell`, it's a nice indicator that the chunk of data is
127127
stay the same between the time you first read it and when you intend to use it.
128128

129129
```rust
130-
# use std::cell::Cell;
130+
use std::cell::Cell;
131+
131132
let x = Cell::new(1);
132133
let y = &x;
133134
let z = &x;
@@ -185,7 +186,8 @@ any other borrows active when a mutable borrow is active. If the programmer atte
185186
borrow, the thread will panic.
186187

187188
```rust
188-
# use std::cell::RefCell;
189+
use std::cell::RefCell;
190+
189191
let x = RefCell::new(vec![1,2,3,4]);
190192
{
191193
println!("{:?}", *x.borrow())

src/doc/trpl/crates-and-modules.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,10 @@ Hello in English: Hello!
355355
Goodbye in English: Goodbye.
356356
```
357357
358+
`pub` also applies to `struct`s and their member fields. In keeping with Rust’s
359+
tendency toward safety, simply making a `struct` public won't automatically
360+
make its members public: you must mark the fields individually with `pub`.
361+
358362
Now that our functions are public, we can use them. Great! However, typing out
359363
`phrases::english::greetings::hello()` is very long and repetitive. Rust has
360364
another keyword for importing names into the current scope, so that you can
@@ -517,9 +521,6 @@ of `foo` relative to where we are. If that’s prefixed with `::`, as in
517521
`::foo::bar()`, it refers to a different `foo`, an absolute path from your
518522
crate root.
519523
520-
Also, note that we `pub use`d before we declared our `mod`s. Rust requires that
521-
`use` declarations go first.
522-
523524
This will build and run:
524525
525526
```bash

src/doc/trpl/guessing-game.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ generator, which is local to the particular [thread][concurrency] of execution
499499
we’re in. Because we `use rand::Rng`’d above, it has a `gen_range()` method
500500
available. This method takes two arguments, and generates a number between
501501
them. It’s inclusive on the lower bound, but exclusive on the upper bound,
502-
so we need `1` and `101` to get a number between one and a hundred.
502+
so we need `1` and `101` to get a number ranging from one to a hundred.
503503

504504
[concurrency]: concurrency.html
505505

src/doc/trpl/intrinsics.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ perform efficient pointer arithmetic, one would import those functions
1111
via a declaration like
1212

1313
```rust
14-
# #![feature(intrinsics)]
14+
#![feature(intrinsics)]
1515
# fn main() {}
1616

1717
extern "rust-intrinsic" {

src/liballoc/arc.rs

+12-6
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ impl<T: ?Sized> Arc<T> {
200200
/// # Examples
201201
///
202202
/// ```
203-
/// # #![feature(arc_weak)]
203+
/// #![feature(arc_weak)]
204+
///
204205
/// use std::sync::Arc;
205206
///
206207
/// let five = Arc::new(5);
@@ -337,7 +338,8 @@ impl<T: Clone> Arc<T> {
337338
/// # Examples
338339
///
339340
/// ```
340-
/// # #![feature(arc_unique)]
341+
/// #![feature(arc_unique)]
342+
///
341343
/// use std::sync::Arc;
342344
///
343345
/// let mut five = Arc::new(5);
@@ -408,7 +410,8 @@ impl<T: ?Sized> Arc<T> {
408410
/// # Examples
409411
///
410412
/// ```
411-
/// # #![feature(arc_unique, alloc)]
413+
/// #![feature(arc_unique, alloc)]
414+
///
412415
/// extern crate alloc;
413416
/// # fn main() {
414417
/// use alloc::arc::Arc;
@@ -555,7 +558,8 @@ impl<T: ?Sized> Weak<T> {
555558
/// # Examples
556559
///
557560
/// ```
558-
/// # #![feature(arc_weak)]
561+
/// #![feature(arc_weak)]
562+
///
559563
/// use std::sync::Arc;
560564
///
561565
/// let five = Arc::new(5);
@@ -599,7 +603,8 @@ impl<T: ?Sized> Clone for Weak<T> {
599603
/// # Examples
600604
///
601605
/// ```
602-
/// # #![feature(arc_weak)]
606+
/// #![feature(arc_weak)]
607+
///
603608
/// use std::sync::Arc;
604609
///
605610
/// let weak_five = Arc::new(5).downgrade();
@@ -626,7 +631,8 @@ impl<T: ?Sized> Drop for Weak<T> {
626631
/// # Examples
627632
///
628633
/// ```
629-
/// # #![feature(arc_weak)]
634+
/// #![feature(arc_weak)]
635+
///
630636
/// use std::sync::Arc;
631637
///
632638
/// {

src/liballoc/boxed.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ use core::raw::{TraitObject};
7575
/// The following two examples are equivalent:
7676
///
7777
/// ```
78-
/// # #![feature(box_heap)]
78+
/// #![feature(box_heap)]
79+
///
7980
/// #![feature(box_syntax, placement_in_syntax)]
8081
/// use std::boxed::HEAP;
8182
///
@@ -241,7 +242,8 @@ impl<T : ?Sized> Box<T> {
241242
///
242243
/// # Examples
243244
/// ```
244-
/// # #![feature(box_raw)]
245+
/// #![feature(box_raw)]
246+
///
245247
/// let seventeen = Box::new(17u32);
246248
/// let raw = Box::into_raw(seventeen);
247249
/// let boxed_again = unsafe { Box::from_raw(raw) };
@@ -264,7 +266,8 @@ impl<T : ?Sized> Box<T> {
264266
///
265267
/// # Examples
266268
/// ```
267-
/// # #![feature(box_raw)]
269+
/// #![feature(box_raw)]
270+
///
268271
/// use std::boxed;
269272
///
270273
/// let seventeen = Box::new(17u32);
@@ -307,7 +310,8 @@ impl<T: Clone> Clone for Box<T> {
307310
/// # Examples
308311
///
309312
/// ```
310-
/// # #![feature(box_raw)]
313+
/// #![feature(box_raw)]
314+
///
311315
/// let x = Box::new(5);
312316
/// let mut y = Box::new(10);
313317
///

src/liballoc/rc.rs

+24-12
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@
9191
//! documentation for more details on interior mutability.
9292
//!
9393
//! ```rust
94-
//! # #![feature(rc_weak)]
94+
//! #![feature(rc_weak)]
95+
//!
9596
//! use std::rc::Rc;
9697
//! use std::rc::Weak;
9798
//! use std::cell::RefCell;
@@ -227,7 +228,8 @@ impl<T> Rc<T> {
227228
/// # Examples
228229
///
229230
/// ```
230-
/// # #![feature(rc_unique)]
231+
/// #![feature(rc_unique)]
232+
///
231233
/// use std::rc::Rc;
232234
///
233235
/// let x = Rc::new(3);
@@ -262,7 +264,8 @@ impl<T: ?Sized> Rc<T> {
262264
/// # Examples
263265
///
264266
/// ```
265-
/// # #![feature(rc_weak)]
267+
/// #![feature(rc_weak)]
268+
///
266269
/// use std::rc::Rc;
267270
///
268271
/// let five = Rc::new(5);
@@ -292,7 +295,8 @@ impl<T: ?Sized> Rc<T> {
292295
/// # Examples
293296
///
294297
/// ```
295-
/// # #![feature(rc_unique)]
298+
/// #![feature(rc_unique)]
299+
///
296300
/// use std::rc::Rc;
297301
///
298302
/// let five = Rc::new(5);
@@ -313,7 +317,8 @@ impl<T: ?Sized> Rc<T> {
313317
/// # Examples
314318
///
315319
/// ```
316-
/// # #![feature(rc_unique)]
320+
/// #![feature(rc_unique)]
321+
///
317322
/// use std::rc::Rc;
318323
///
319324
/// let mut x = Rc::new(3);
@@ -353,7 +358,8 @@ pub fn strong_count<T: ?Sized>(this: &Rc<T>) -> usize { Rc::strong_count(this) }
353358
/// # Examples
354359
///
355360
/// ```
356-
/// # #![feature(rc_unique)]
361+
/// #![feature(rc_unique)]
362+
///
357363
/// use std::rc;
358364
/// use std::rc::Rc;
359365
///
@@ -373,7 +379,8 @@ pub fn is_unique<T>(rc: &Rc<T>) -> bool { Rc::is_unique(rc) }
373379
/// # Examples
374380
///
375381
/// ```
376-
/// # #![feature(rc_unique)]
382+
/// #![feature(rc_unique)]
383+
///
377384
/// use std::rc::{self, Rc};
378385
///
379386
/// let x = Rc::new(3);
@@ -395,7 +402,8 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> { Rc::try_unwrap(rc) }
395402
/// # Examples
396403
///
397404
/// ```
398-
/// # #![feature(rc_unique)]
405+
/// #![feature(rc_unique)]
406+
///
399407
/// use std::rc::{self, Rc};
400408
///
401409
/// let mut x = Rc::new(3);
@@ -419,7 +427,8 @@ impl<T: Clone> Rc<T> {
419427
/// # Examples
420428
///
421429
/// ```
422-
/// # #![feature(rc_unique)]
430+
/// #![feature(rc_unique)]
431+
///
423432
/// use std::rc::Rc;
424433
///
425434
/// let mut five = Rc::new(5);
@@ -750,7 +759,8 @@ impl<T: ?Sized> Weak<T> {
750759
/// # Examples
751760
///
752761
/// ```
753-
/// # #![feature(rc_weak)]
762+
/// #![feature(rc_weak)]
763+
///
754764
/// use std::rc::Rc;
755765
///
756766
/// let five = Rc::new(5);
@@ -778,7 +788,8 @@ impl<T: ?Sized> Drop for Weak<T> {
778788
/// # Examples
779789
///
780790
/// ```
781-
/// # #![feature(rc_weak)]
791+
/// #![feature(rc_weak)]
792+
///
782793
/// use std::rc::Rc;
783794
///
784795
/// {
@@ -825,7 +836,8 @@ impl<T: ?Sized> Clone for Weak<T> {
825836
/// # Examples
826837
///
827838
/// ```
828-
/// # #![feature(rc_weak)]
839+
/// #![feature(rc_weak)]
840+
///
829841
/// use std::rc::Rc;
830842
///
831843
/// let weak_five = Rc::new(5).downgrade();

src/libcollections/binary_heap.rs

+16-8
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ impl<T: Ord> BinaryHeap<T> {
216216
/// # Examples
217217
///
218218
/// ```
219-
/// # #![feature(collections)]
219+
/// #![feature(collections)]
220+
///
220221
/// use std::collections::BinaryHeap;
221222
/// let heap = BinaryHeap::from_vec(vec![9, 1, 2, 7, 3, 2]);
222223
/// ```
@@ -236,7 +237,8 @@ impl<T: Ord> BinaryHeap<T> {
236237
/// # Examples
237238
///
238239
/// ```
239-
/// # #![feature(collections)]
240+
/// #![feature(collections)]
241+
///
240242
/// use std::collections::BinaryHeap;
241243
/// let heap = BinaryHeap::from_vec(vec![1, 2, 3, 4]);
242244
///
@@ -341,7 +343,8 @@ impl<T: Ord> BinaryHeap<T> {
341343
/// # Examples
342344
///
343345
/// ```
344-
/// # #![feature(collections)]
346+
/// #![feature(collections)]
347+
///
345348
/// use std::collections::BinaryHeap;
346349
/// let mut heap = BinaryHeap::from_vec(vec![1, 3]);
347350
///
@@ -387,7 +390,8 @@ impl<T: Ord> BinaryHeap<T> {
387390
/// # Examples
388391
///
389392
/// ```
390-
/// # #![feature(collections)]
393+
/// #![feature(collections)]
394+
///
391395
/// use std::collections::BinaryHeap;
392396
/// let mut heap = BinaryHeap::new();
393397
/// heap.push(1);
@@ -419,7 +423,8 @@ impl<T: Ord> BinaryHeap<T> {
419423
/// # Examples
420424
///
421425
/// ```
422-
/// # #![feature(collections)]
426+
/// #![feature(collections)]
427+
///
423428
/// use std::collections::BinaryHeap;
424429
/// let mut heap = BinaryHeap::new();
425430
///
@@ -445,7 +450,8 @@ impl<T: Ord> BinaryHeap<T> {
445450
/// # Examples
446451
///
447452
/// ```
448-
/// # #![feature(collections)]
453+
/// #![feature(collections)]
454+
///
449455
/// use std::collections::BinaryHeap;
450456
/// let heap = BinaryHeap::from_vec(vec![1, 2, 3, 4, 5, 6, 7]);
451457
/// let vec = heap.into_vec();
@@ -463,7 +469,8 @@ impl<T: Ord> BinaryHeap<T> {
463469
/// # Examples
464470
///
465471
/// ```
466-
/// # #![feature(collections)]
472+
/// #![feature(collections)]
473+
///
467474
/// use std::collections::BinaryHeap;
468475
///
469476
/// let mut heap = BinaryHeap::from_vec(vec![1, 2, 4, 5, 7]);
@@ -724,7 +731,8 @@ impl<T: Ord> IntoIterator for BinaryHeap<T> {
724731
/// # Examples
725732
///
726733
/// ```
727-
/// # #![feature(collections)]
734+
/// #![feature(collections)]
735+
///
728736
/// use std::collections::BinaryHeap;
729737
/// let heap = BinaryHeap::from_vec(vec![1, 2, 3, 4]);
730738
///

0 commit comments

Comments
 (0)