Skip to content

Commit 8ae411e

Browse files
committed
Auto merge of #40206 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 9 pull requests - Successful merges: #40081, #40144, #40168, #40169, #40170, #40173, #40175, #40191, #40194 - Failed merges:
2 parents 2be750b + ad0a356 commit 8ae411e

File tree

11 files changed

+55
-23
lines changed

11 files changed

+55
-23
lines changed

src/doc/book/src/const-and-static.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static N: i32 = 5;
3232
Unlike [`let`][let] bindings, you must annotate the type of a `static`.
3333

3434
Statics live for the entire lifetime of a program, and therefore any
35-
reference stored in a constant has a [`'static` lifetime][lifetimes]:
35+
reference stored in a static has a [`'static` lifetime][lifetimes]:
3636

3737
```rust
3838
static NAME: &'static str = "Steve";

src/doc/book/src/guessing-game.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ and other whitespace. This helps you split up long lines. We _could_ have
255255
done:
256256

257257
```rust,ignore
258-
io::stdin().read_line(&mut guess).expect("failed to read line");
258+
io::stdin().read_line(&mut guess).expect("Failed to read line");
259259
```
260260

261261
But that gets hard to read. So we’ve split it up, two lines for two method
@@ -473,7 +473,7 @@ fn main() {
473473
let mut guess = String::new();
474474
475475
io::stdin().read_line(&mut guess)
476-
.expect("failed to read line");
476+
.expect("Failed to read line");
477477
478478
println!("You guessed: {}", guess);
479479
}
@@ -563,7 +563,7 @@ fn main() {
563563
let mut guess = String::new();
564564
565565
io::stdin().read_line(&mut guess)
566-
.expect("failed to read line");
566+
.expect("Failed to read line");
567567
568568
println!("You guessed: {}", guess);
569569
@@ -678,7 +678,7 @@ fn main() {
678678
let mut guess = String::new();
679679

680680
io::stdin().read_line(&mut guess)
681-
.expect("failed to read line");
681+
.expect("Failed to read line");
682682

683683
let guess: u32 = guess.trim().parse()
684684
.expect("Please type a number!");
@@ -780,7 +780,7 @@ fn main() {
780780
let mut guess = String::new();
781781
782782
io::stdin().read_line(&mut guess)
783-
.expect("failed to read line");
783+
.expect("Failed to read line");
784784
785785
let guess: u32 = guess.trim().parse()
786786
.expect("Please type a number!");
@@ -847,7 +847,7 @@ fn main() {
847847
let mut guess = String::new();
848848
849849
io::stdin().read_line(&mut guess)
850-
.expect("failed to read line");
850+
.expect("Failed to read line");
851851
852852
let guess: u32 = guess.trim().parse()
853853
.expect("Please type a number!");
@@ -892,7 +892,7 @@ fn main() {
892892
let mut guess = String::new();
893893
894894
io::stdin().read_line(&mut guess)
895-
.expect("failed to read line");
895+
.expect("Failed to read line");
896896
897897
let guess: u32 = match guess.trim().parse() {
898898
Ok(num) => num,
@@ -981,7 +981,7 @@ fn main() {
981981
let mut guess = String::new();
982982
983983
io::stdin().read_line(&mut guess)
984-
.expect("failed to read line");
984+
.expect("Failed to read line");
985985
986986
let guess: u32 = match guess.trim().parse() {
987987
Ok(num) => num,

src/doc/book/src/if-let.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# if let
22

3-
`if let` permits [patterns][pattern] matching within the condition of an [if][if] statement.
3+
`if let` permits [patterns][patterns] matching within the condition of an [if][if] statement.
44
This allows us to reduce the overhead of certain kinds of [pattern][patterns] matches
55
and express them in a more convenient way.
66

src/doc/book/src/strings.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ This emphasizes that we have to walk from the beginning of the list of `chars`.
145145

146146
## Slicing
147147

148-
You can get a slice of a string with slicing syntax:
148+
You can get a slice of a string with the slicing syntax:
149149

150150
```rust
151151
let dog = "hachiko";

src/doc/book/src/structs.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,14 @@ rather than positions.
255255

256256
You can define a `struct` with no members at all:
257257

258-
```rust
258+
```rust,compile_fail,E0423
259259
struct Electron {} // Use empty braces...
260260
struct Proton; // ...or just a semicolon.
261261
262-
// Whether you declared the struct with braces or not, do the same when creating one.
262+
// Use the same notation when creating an instance.
263263
let x = Electron {};
264264
let y = Proton;
265+
let z = Electron; // Error
265266
```
266267

267268
Such a `struct` is called ‘unit-like’ because it resembles the empty

src/doc/unstable-book/src/SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- [abi_sysv64](abi-sysv64.md)
66
- [abi_unadjusted](abi-unadjusted.md)
77
- [abi_vectorcall](abi-vectorcall.md)
8+
- [abi_x86_interrupt](abi-x86-interrupt.md)
89
- [advanced_slice_patterns](advanced-slice-patterns.md)
910
- [alloc_jemalloc](alloc-jemalloc.md)
1011
- [alloc_system](alloc-system.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# `abi_x86_interrupt`
2+
3+
The tracking issue for this feature is: [#40180]
4+
5+
[#40180]: https://github.com/rust-lang/rust/issues/40180
6+
7+
------------------------

src/libstd/sys_common/poison.rs

+22-7
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,13 @@ pub struct Guard {
6060

6161
/// A type of error which can be returned whenever a lock is acquired.
6262
///
63-
/// Both Mutexes and RwLocks are poisoned whenever a thread fails while the lock
63+
/// Both [`Mutex`]es and [`RwLock`]s are poisoned whenever a thread fails while the lock
6464
/// is held. The precise semantics for when a lock is poisoned is documented on
6565
/// each lock, but once a lock is poisoned then all future acquisitions will
6666
/// return this error.
67+
///
68+
/// [`Mutex`]: ../../std/sync/struct.Mutex.html
69+
/// [`RwLock`]: ../../std/sync/struct.RwLock.html
6770
#[stable(feature = "rust1", since = "1.0.0")]
6871
pub struct PoisonError<T> {
6972
guard: T,
@@ -85,19 +88,26 @@ pub enum TryLockError<T> {
8588

8689
/// A type alias for the result of a lock method which can be poisoned.
8790
///
88-
/// The `Ok` variant of this result indicates that the primitive was not
89-
/// poisoned, and the `Guard` is contained within. The `Err` variant indicates
90-
/// that the primitive was poisoned. Note that the `Err` variant *also* carries
91-
/// the associated guard, and it can be acquired through the `into_inner`
91+
/// The [`Ok`] variant of this result indicates that the primitive was not
92+
/// poisoned, and the `Guard` is contained within. The [`Err`] variant indicates
93+
/// that the primitive was poisoned. Note that the [`Err`] variant *also* carries
94+
/// the associated guard, and it can be acquired through the [`into_inner`]
9295
/// method.
96+
///
97+
/// [`Ok`]: ../../std/result/enum.Result.html#variant.Ok
98+
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
99+
/// [`into_inner`]: ../../std/sync/struct.Mutex.html#method.into_inner
93100
#[stable(feature = "rust1", since = "1.0.0")]
94101
pub type LockResult<Guard> = Result<Guard, PoisonError<Guard>>;
95102

96103
/// A type alias for the result of a nonblocking locking method.
97104
///
98-
/// For more information, see `LockResult`. A `TryLockResult` doesn't
99-
/// necessarily hold the associated guard in the `Err` type as the lock may not
105+
/// For more information, see [`LockResult`]. A `TryLockResult` doesn't
106+
/// necessarily hold the associated guard in the [`Err`] type as the lock may not
100107
/// have been acquired for other reasons.
108+
///
109+
/// [`LockResult`]: ../../std/sync/type.LockResult.html
110+
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
101111
#[stable(feature = "rust1", since = "1.0.0")]
102112
pub type TryLockResult<Guard> = Result<Guard, TryLockError<Guard>>;
103113

@@ -124,6 +134,11 @@ impl<T> Error for PoisonError<T> {
124134

125135
impl<T> PoisonError<T> {
126136
/// Creates a `PoisonError`.
137+
///
138+
/// This is generally created by methods like [`Mutex::lock`] or [`RwLock::read`].
139+
///
140+
/// [`Mutex::lock`]: ../../std/sync/struct.Mutex.html#method.lock
141+
/// [`RwLock::read`]: ../../std/sync/struct.RwLock.html#method.read
127142
#[stable(feature = "sync_poison", since = "1.2.0")]
128143
pub fn new(guard: T) -> PoisonError<T> {
129144
PoisonError { guard: guard }

src/test/compile-fail/feature-gate-abi.rs

+8
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
// gate-test-intrinsics
1212
// gate-test-platform_intrinsics
1313
// gate-test-abi_vectorcall
14+
// gate-test-abi_ptx
1415

1516
// Functions
1617
extern "rust-intrinsic" fn f1() {} //~ ERROR intrinsics are subject to change
1718
extern "platform-intrinsic" fn f2() {} //~ ERROR platform intrinsics are experimental
1819
extern "vectorcall" fn f3() {} //~ ERROR vectorcall is experimental and subject to change
1920
extern "rust-call" fn f4() {} //~ ERROR rust-call ABI is subject to change
2021
extern "msp430-interrupt" fn f5() {} //~ ERROR msp430-interrupt ABI is experimental
22+
extern "ptx-kernel" fn f6() {} //~ ERROR PTX ABIs are experimental and subject to change
2123

2224
// Methods in trait definition
2325
trait Tr {
@@ -26,12 +28,14 @@ trait Tr {
2628
extern "vectorcall" fn m3(); //~ ERROR vectorcall is experimental and subject to change
2729
extern "rust-call" fn m4(); //~ ERROR rust-call ABI is subject to change
2830
extern "msp430-interrupt" fn m5(); //~ ERROR msp430-interrupt ABI is experimental
31+
extern "ptx-kernel" fn m6(); //~ ERROR PTX ABIs are experimental and subject to change
2932

3033
extern "rust-intrinsic" fn dm1() {} //~ ERROR intrinsics are subject to change
3134
extern "platform-intrinsic" fn dm2() {} //~ ERROR platform intrinsics are experimental
3235
extern "vectorcall" fn dm3() {} //~ ERROR vectorcall is experimental and subject to change
3336
extern "rust-call" fn dm4() {} //~ ERROR rust-call ABI is subject to change
3437
extern "msp430-interrupt" fn dm5() {} //~ ERROR msp430-interrupt ABI is experimental
38+
extern "ptx-kernel" fn dm6() {} //~ ERROR PTX ABIs are experimental and subject to change
3539
}
3640

3741
struct S;
@@ -43,6 +47,7 @@ impl Tr for S {
4347
extern "vectorcall" fn m3() {} //~ ERROR vectorcall is experimental and subject to change
4448
extern "rust-call" fn m4() {} //~ ERROR rust-call ABI is subject to change
4549
extern "msp430-interrupt" fn m5() {} //~ ERROR msp430-interrupt ABI is experimental
50+
extern "ptx-kernel" fn m6() {} //~ ERROR PTX ABIs are experimental and subject to change
4651
}
4752

4853
// Methods in inherent impl
@@ -52,6 +57,7 @@ impl S {
5257
extern "vectorcall" fn im3() {} //~ ERROR vectorcall is experimental and subject to change
5358
extern "rust-call" fn im4() {} //~ ERROR rust-call ABI is subject to change
5459
extern "msp430-interrupt" fn im5() {} //~ ERROR msp430-interrupt ABI is experimental
60+
extern "ptx-kernel" fn im6() {} //~ ERROR PTX ABIs are experimental and subject to change
5561
}
5662

5763
// Function pointer types
@@ -60,12 +66,14 @@ type A2 = extern "platform-intrinsic" fn(); //~ ERROR platform intrinsics are ex
6066
type A3 = extern "vectorcall" fn(); //~ ERROR vectorcall is experimental and subject to change
6167
type A4 = extern "rust-call" fn(); //~ ERROR rust-call ABI is subject to change
6268
type A5 = extern "msp430-interrupt" fn(); //~ ERROR msp430-interrupt ABI is experimental
69+
type A6 = extern "ptx-kernel" fn (); //~ ERROR PTX ABIs are experimental and subject to change
6370

6471
// Foreign modules
6572
extern "rust-intrinsic" {} //~ ERROR intrinsics are subject to change
6673
extern "platform-intrinsic" {} //~ ERROR platform intrinsics are experimental
6774
extern "vectorcall" {} //~ ERROR vectorcall is experimental and subject to change
6875
extern "rust-call" {} //~ ERROR rust-call ABI is subject to change
6976
extern "msp430-interrupt" {} //~ ERROR msp430-interrupt ABI is experimental
77+
extern "ptx-kernel" {} //~ ERROR PTX ABIs are experimental and subject to change
7078

7179
fn main() {}

src/test/run-make/issue-24445/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
ifeq ($(UNAME),Linux)
44
all:
55
$(RUSTC) foo.rs
6-
$(CC) foo.c -lfoo -L $(TMPDIR) -Wl,--gc-sections -lpthread -o $(TMPDIR)/foo
6+
$(CC) foo.c -lfoo -L $(TMPDIR) -Wl,--gc-sections -lpthread -ldl -o $(TMPDIR)/foo
77
$(call RUN,foo)
8-
$(CC) foo.c -lfoo -L $(TMPDIR) -Wl,--gc-sections -lpthread -pie -fPIC -o $(TMPDIR)/foo
8+
$(CC) foo.c -lfoo -L $(TMPDIR) -Wl,--gc-sections -lpthread -ldl -pie -fPIC -o $(TMPDIR)/foo
99
$(call RUN,foo)
1010
else
1111
all:

src/tools/tidy/src/features.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ pub fn check(path: &Path, bad: &mut bool) {
167167

168168
// FIXME get this whitelist empty.
169169
let whitelist = vec![
170-
"abi_ptx", "simd",
170+
"simd",
171171
"stmt_expr_attributes",
172172
"cfg_target_thread_local", "unwind_attributes",
173173
];

0 commit comments

Comments
 (0)