Skip to content

Commit 03f19f7

Browse files
committed
Auto merge of #62935 - Centril:rollup-hzj9att, r=Centril
Rollup of 10 pull requests Successful merges: - #62641 (Regenerate character tables for Unicode 12.1) - #62716 (state also in the intro that UnsafeCell has no effect on &mut) - #62738 (Remove uses of mem::uninitialized from std::sys::cloudabi) - #62772 (Suggest trait bound on type parameter when it is unconstrained) - #62890 (Normalize use of backticks in compiler messages for libsyntax/*) - #62905 (Normalize use of backticks in compiler messages for doc) - #62916 (Add test `self-in-enum-definition`) - #62917 (Always emit trailing slash error) - #62926 (Fix typo in mem::uninitialized doc) - #62927 (use PanicMessage in MIR, kill InterpError::description) Failed merges: r? @ghost
2 parents 27a6a30 + e27927d commit 03f19f7

Some content is hidden

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

49 files changed

+1308
-1087
lines changed

src/doc/rustc/src/lints/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ warning: unused variable: `x`
1919
2 | let x = 5;
2020
| ^
2121
|
22-
= note: #[warn(unused_variables)] on by default
22+
= note: `#[warn(unused_variables)]` on by default
2323
= note: to avoid this warning, consider using `_x` instead
2424
```
2525

src/doc/rustc/src/lints/levels.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ warning: unused variable: `x`
5353
2 | let x = 5;
5454
| ^
5555
|
56-
= note: #[warn(unused_variables)] on by default
56+
= note: `#[warn(unused_variables)]` on by default
5757
= note: to avoid this warning, consider using `_x` instead
5858
```
5959

@@ -76,7 +76,7 @@ error: bitshift exceeds the type's number of bits
7676
2 | 100u8 << 10;
7777
| ^^^^^^^^^^^
7878
|
79-
= note: #[deny(exceeding_bitshifts)] on by default
79+
= note: `#[deny(exceeding_bitshifts)]` on by default
8080
```
8181
8282
What's the difference between an error from a lint and a regular old error?
@@ -236,7 +236,7 @@ warning: bitshift exceeds the type's number of bits
236236
2 | 100u8 << 10;
237237
| ^^^^^^^^^^^
238238
|
239-
= note: #[warn(exceeding_bitshifts)] on by default
239+
= note: `#[warn(exceeding_bitshifts)]` on by default
240240
241241
warning: this expression will panic at run-time
242242
--> lib.rs:2:5

src/doc/rustc/src/lints/listing/allowed-by-default.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ pub struct Foo;
165165
When set to 'deny', this will produce:
166166

167167
```text
168-
error: type does not implement `fmt::Debug`; consider adding #[derive(Debug)] or a manual implementation
168+
error: type does not implement `fmt::Debug`; consider adding `#[derive(Debug)]` or a manual implementation
169169
--> src/main.rs:3:1
170170
|
171171
3 | pub struct Foo;

src/doc/rustc/src/lints/listing/deny-by-default.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ error: defaults for type parameters are only allowed in `struct`, `enum`, `type`
4040
4 | fn foo<T=i32>(t: T) {}
4141
| ^
4242
|
43-
= note: #[deny(invalid_type_param_default)] on by default
43+
= note: `#[deny(invalid_type_param_default)]` on by default
4444
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
4545
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
4646
```
@@ -74,7 +74,7 @@ error: private struct constructors are not usable through re-exports in outer mo
7474
5 | ::S;
7575
| ^^^
7676
|
77-
= note: #[deny(legacy_constructor_visibility)] on by default
77+
= note: `#[deny(legacy_constructor_visibility)]` on by default
7878
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
7979
= note: for more information, see issue #39207 <https://github.com/rust-lang/rust/issues/39207>
8080
```
@@ -84,9 +84,9 @@ error: private struct constructors are not usable through re-exports in outer mo
8484

8585
The legacy_directory_ownership warning is issued when
8686

87-
* There is a non-inline module with a #[path] attribute (e.g. #[path = "foo.rs"] mod bar;),
87+
* There is a non-inline module with a `#[path]` attribute (e.g. `#[path = "foo.rs"] mod bar;`),
8888
* The module's file ("foo.rs" in the above example) is not named "mod.rs", and
89-
* The module's file contains a non-inline child module without a #[path] attribute.
89+
* The module's file contains a non-inline child module without a `#[path]` attribute.
9090

9191
The warning can be fixed by renaming the parent module to "mod.rs" and moving
9292
it into its own directory if appropriate.
@@ -139,7 +139,7 @@ const FOO: i32 = 5;
139139
This will produce:
140140

141141
```text
142-
error: const items should never be #[no_mangle]
142+
error: const items should never be `#[no_mangle]`
143143
--> src/main.rs:3:1
144144
|
145145
3 | const FOO: i32 = 5;
@@ -187,7 +187,7 @@ error: parenthesized parameters may only be used with a trait
187187
2 | let x = 5 as usize();
188188
| ^^
189189
|
190-
= note: #[deny(parenthesized_params_in_types_and_modules)] on by default
190+
= note: `#[deny(parenthesized_params_in_types_and_modules)]` on by default
191191
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
192192
= note: for more information, see issue #42238 <https://github.com/rust-lang/rust/issues/42238>
193193
```

src/doc/rustc/src/lints/listing/warn-by-default.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ warning: floating-point literals cannot be used in patterns
9090
4 | 5.0 => {},
9191
| ^^^
9292
|
93-
= note: #[warn(illegal_floating_point_literal_pattern)] on by default
93+
= note: `#[warn(illegal_floating_point_literal_pattern)]` on by default
9494
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
9595
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
9696
```
@@ -109,7 +109,7 @@ extern "C" {
109109
This will produce:
110110

111111
```text
112-
warning: found struct without foreign-function-safe representation annotation in foreign module, consider adding a #[repr(C)] attribute to the type
112+
warning: found struct without foreign-function-safe representation annotation in foreign module, consider adding a `#[repr(C)]` attribute to the type
113113
--> src/main.rs:2:20
114114
|
115115
2 | static STATIC: String;
@@ -146,7 +146,7 @@ warning: cannot specify lifetime arguments explicitly if late bound lifetime par
146146
8 | S.late::<'static>(&0, &0);
147147
| ^^^^^^^
148148
|
149-
= note: #[warn(late_bound_lifetime_arguments)] on by default
149+
= note: `#[warn(late_bound_lifetime_arguments)]` on by default
150150
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
151151
= note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868>
152152
```
@@ -327,7 +327,7 @@ warning: patterns aren't allowed in methods without bodies
327327
2 | fn foo(mut arg: u8);
328328
| ^^^^^^^
329329
|
330-
= note: #[warn(patterns_in_fns_without_body)] on by default
330+
= note: `#[warn(patterns_in_fns_without_body)]` on by default
331331
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
332332
= note: for more information, see issue #35203 <https://github.com/rust-lang/rust/issues/35203>
333333
```
@@ -406,7 +406,7 @@ fn foo() {}
406406
This will produce:
407407

408408
```text
409-
warning: function is marked #[no_mangle], but not exported
409+
warning: function is marked `#[no_mangle]`, but not exported
410410
--> src/main.rs:2:1
411411
|
412412
2 | fn foo() {}
@@ -433,7 +433,7 @@ static X: i32 = 4;
433433
This will produce:
434434

435435
```text
436-
warning: static is marked #[no_mangle], but not exported
436+
warning: static is marked `#[no_mangle]`, but not exported
437437
--> src/main.rs:2:1
438438
|
439439
2 | static X: i32 = 4;
@@ -496,7 +496,7 @@ warning: borrow of packed field requires unsafe function or block (error E0133)
496496
11 | let y = &x.data.0;
497497
| ^^^^^^^^^
498498
|
499-
= note: #[warn(safe_packed_borrows)] on by default
499+
= note: `#[warn(safe_packed_borrows)]` on by default
500500
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
501501
= note: for more information, see issue #46043 <https://github.com/rust-lang/rust/issues/46043>
502502
```
@@ -542,7 +542,7 @@ warning: bounds on generic parameters are not enforced in type aliases
542542
2 | type SendVec<T: Send> = Vec<T>;
543543
| ^^^^
544544
|
545-
= note: #[warn(type_alias_bounds)] on by default
545+
= note: `#[warn(type_alias_bounds)]` on by default
546546
= help: the bound will not be checked when the type alias is used, and should be removed
547547
```
548548

@@ -567,7 +567,7 @@ warning: type annotations needed
567567
4 | if data.is_null() {}
568568
| ^^^^^^^
569569
|
570-
= note: #[warn(tyvar_behind_raw_pointer)] on by default
570+
= note: `#[warn(tyvar_behind_raw_pointer)]` on by default
571571
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
572572
= note: for more information, see issue #46906 <https://github.com/rust-lang/rust/issues/46906>
573573
```
@@ -787,7 +787,7 @@ warning: doc comment not used by rustdoc
787787

788788
## unused-features
789789

790-
This lint detects unused or unknown features found in crate-level #[feature] directives.
790+
This lint detects unused or unknown features found in crate-level `#[feature]` directives.
791791
To fix this, simply remove the feature flag.
792792

793793
## unused-imports
@@ -839,7 +839,7 @@ warning: unused macro definition
839839

840840
## unused-must-use
841841

842-
This lint detects unused result of a type flagged as #[must_use]. Some
842+
This lint detects unused result of a type flagged as `#[must_use]`. Some
843843
example code that triggers this lint:
844844

845845
```rust

src/libcore/cell.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1412,8 +1412,9 @@ impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
14121412
/// If you have a reference `&SomeStruct`, then normally in Rust all fields of `SomeStruct` are
14131413
/// immutable. The compiler makes optimizations based on the knowledge that `&T` is not mutably
14141414
/// aliased or mutated, and that `&mut T` is unique. `UnsafeCell<T>` is the only core language
1415-
/// feature to work around this restriction. All other types that allow internal mutability, such as
1416-
/// `Cell<T>` and `RefCell<T>`, use `UnsafeCell` to wrap their internal data.
1415+
/// feature to work around the restriction that `&T` may not be mutated. All other types that
1416+
/// allow internal mutability, such as `Cell<T>` and `RefCell<T>`, use `UnsafeCell` to wrap their
1417+
/// internal data. There is *no* legal way to obtain aliasing `&mut`, not even with `UnsafeCell<T>`.
14171418
///
14181419
/// The `UnsafeCell` API itself is technically very simple: it gives you a raw pointer `*mut T` to
14191420
/// its contents. It is up to _you_ as the abstraction designer to use that raw pointer correctly.

src/libcore/mem/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ pub unsafe fn zeroed<T>() -> T {
456456
/// Bypasses Rust's normal memory-initialization checks by pretending to
457457
/// produce a value of type `T`, while doing nothing at all.
458458
///
459-
/// **This functon is deprecated.** Use [`MaybeUninit<T>`] instead.
459+
/// **This function is deprecated.** Use [`MaybeUninit<T>`] instead.
460460
///
461461
/// The reason for deprecation is that the function basically cannot be used
462462
/// correctly: [the Rust compiler assumes][inv] that values are properly initialized.

src/libcore/unicode/printable.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,17 @@ def compress_normal(normal):
111111
return compressed
112112

113113
def print_singletons(uppers, lowers, uppersname, lowersname):
114-
print("const {}: &'static [(u8, u8)] = &[".format(uppersname))
114+
print("const {}: &[(u8, u8)] = &[".format(uppersname))
115115
for u, c in uppers:
116116
print(" ({:#04x}, {}),".format(u, c))
117117
print("];")
118-
print("const {}: &'static [u8] = &[".format(lowersname))
118+
print("const {}: &[u8] = &[".format(lowersname))
119119
for i in range(0, len(lowers), 8):
120120
print(" {}".format(" ".join("{:#04x},".format(l) for l in lowers[i:i+8])))
121121
print("];")
122122

123123
def print_normal(normal, normalname):
124-
print("const {}: &'static [u8] = &[".format(normalname))
124+
print("const {}: &[u8] = &[".format(normalname))
125125
for v in normal:
126126
print(" {}".format(" ".join("{:#04x},".format(i) for i in v)))
127127
print("];")

0 commit comments

Comments
 (0)