Skip to content

Commit 315ab95

Browse files
committed
Auto merge of #61150 - Centril:rollup-wmm7qga, r=Centril
Rollup of 13 pull requests Successful merges: - #61026 (Tweak macro parse errors when reaching EOF during macro call parse) - #61095 (Update cargo) - #61096 (tidy: don't short-circuit on license error) - #61107 (Fix a couple docs typos) - #61110 (Revert edition-guide toolstate override) - #61111 (Fixed type-alias-bounds lint doc) - #61113 (Deprecate `FnBox`. `Box<dyn FnOnce()>` can be called directly, since 1.35) - #61116 (Remove the incorrect warning from README.md) - #61118 (Dont ICE on an attempt to use GAT without feature gate) - #61121 (improve debug-printing of scalars) - #61125 (Updated my mailmap entry) - #61134 (Annotate each `reverse_bits` with `#[must_use]`) - #61138 (Move async/await tests to their own folder) Failed merges: r? @ghost
2 parents 5245803 + 19b5a10 commit 315ab95

File tree

154 files changed

+465
-187
lines changed

Some content is hidden

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

154 files changed

+465
-187
lines changed

.mailmap

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77

88
Aaron Todd <[email protected]>
9-
Aaron Power <[email protected]>
9+
Aaron Power <[email protected]> Erin Power <[email protected]>
1010
Abhishek Chanda <[email protected]> Abhishek Chanda <[email protected]>
1111
Adolfo Ochagavía <[email protected]>
1212
Adrien Tétar <[email protected]>

Cargo.lock

+42-7
Original file line numberDiff line numberDiff line change
@@ -253,15 +253,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
253253

254254
[[package]]
255255
name = "cargo"
256-
version = "0.37.0"
256+
version = "0.38.0"
257257
dependencies = [
258258
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
259259
"bufstream 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
260260
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
261261
"bytesize 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
262262
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
263263
"core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
264-
"crates-io 0.25.0",
264+
"crates-io 0.26.0",
265265
"crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
266266
"crypto-hash 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
267267
"curl 0.4.21 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -278,7 +278,7 @@ dependencies = [
278278
"hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
279279
"home 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
280280
"ignore 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
281-
"im-rc 12.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
281+
"im-rc 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
282282
"jobserver 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
283283
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
284284
"lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -300,6 +300,7 @@ dependencies = [
300300
"serde_ignored 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
301301
"serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
302302
"shell-escape 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
303+
"strip-ansi-escapes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
303304
"tar 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)",
304305
"tempfile 3.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
305306
"termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -537,7 +538,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
537538

538539
[[package]]
539540
name = "crates-io"
540-
version = "0.25.0"
541+
version = "0.26.0"
541542
dependencies = [
542543
"curl 0.4.21 (registry+https://github.com/rust-lang/crates.io-index)",
543544
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1163,10 +1164,11 @@ dependencies = [
11631164

11641165
[[package]]
11651166
name = "im-rc"
1166-
version = "12.3.0"
1167+
version = "13.0.0"
11671168
source = "registry+https://github.com/rust-lang/crates.io-index"
11681169
dependencies = [
11691170
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
1171+
"sized-chunks 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
11701172
"typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
11711173
]
11721174

@@ -2239,7 +2241,7 @@ dependencies = [
22392241
name = "rls"
22402242
version = "1.36.0"
22412243
dependencies = [
2242-
"cargo 0.37.0",
2244+
"cargo 0.38.0",
22432245
"cargo_metadata 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
22442246
"clippy_lints 0.0.212",
22452247
"crossbeam-channel 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3263,6 +3265,14 @@ name = "siphasher"
32633265
version = "0.2.2"
32643266
source = "registry+https://github.com/rust-lang/crates.io-index"
32653267

3268+
[[package]]
3269+
name = "sized-chunks"
3270+
version = "0.3.0"
3271+
source = "registry+https://github.com/rust-lang/crates.io-index"
3272+
dependencies = [
3273+
"typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
3274+
]
3275+
32663276
[[package]]
32673277
name = "slab"
32683278
version = "0.4.2"
@@ -3348,6 +3358,14 @@ name = "string_cache_shared"
33483358
version = "0.3.0"
33493359
source = "registry+https://github.com/rust-lang/crates.io-index"
33503360

3361+
[[package]]
3362+
name = "strip-ansi-escapes"
3363+
version = "0.1.0"
3364+
source = "registry+https://github.com/rust-lang/crates.io-index"
3365+
dependencies = [
3366+
"vte 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
3367+
]
3368+
33513369
[[package]]
33523370
name = "strsim"
33533371
version = "0.7.0"
@@ -3924,6 +3942,11 @@ name = "utf8-ranges"
39243942
version = "1.0.2"
39253943
source = "registry+https://github.com/rust-lang/crates.io-index"
39263944

3945+
[[package]]
3946+
name = "utf8parse"
3947+
version = "0.1.1"
3948+
source = "registry+https://github.com/rust-lang/crates.io-index"
3949+
39273950
[[package]]
39283951
name = "vcpkg"
39293952
version = "0.2.6"
@@ -3954,6 +3977,14 @@ name = "void"
39543977
version = "1.0.2"
39553978
source = "registry+https://github.com/rust-lang/crates.io-index"
39563979

3980+
[[package]]
3981+
name = "vte"
3982+
version = "0.3.3"
3983+
source = "registry+https://github.com/rust-lang/crates.io-index"
3984+
dependencies = [
3985+
"utf8parse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
3986+
]
3987+
39573988
[[package]]
39583989
name = "wait-timeout"
39593990
version = "0.1.5"
@@ -4158,7 +4189,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
41584189
"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e"
41594190
"checksum if_chain 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4bac95d9aa0624e7b78187d6fb8ab012b41d9f6f54b1bcb61e61c4845f8357ec"
41604191
"checksum ignore 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8dc57fa12805f367736a38541ac1a9fc6a52812a0ca959b1d4d4b640a89eb002"
4161-
"checksum im-rc 12.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9460397452f537fd51808056ff209f4c4c4c9d20d42ae952f517708726284972"
4192+
"checksum im-rc 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0a0197597d095c0d11107975d3175173f810ee572c2501ff4de64f4f3f119806"
41624193
"checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08"
41634194
"checksum is-match 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7e5b386aef33a1c677be65237cb9d32c3f3ef56bd035949710c4bb13083eb053"
41644195
"checksum itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)" = "f58856976b776fedd95533137617a02fb25719f40e7d9b01c7043cd65474f450"
@@ -4309,13 +4340,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
43094340
"checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2"
43104341
"checksum signal-hook 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1f272d1b7586bec132ed427f532dd418d8beca1ca7f2caf7df35569b1415a4b4"
43114342
"checksum siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0df90a788073e8d0235a67e50441d47db7c8ad9debd91cbf43736a2a92d36537"
4343+
"checksum sized-chunks 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a2a2eb3fe454976eefb479f78f9b394d34d661b647c6326a3a6e66f68bb12c26"
43124344
"checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
43134345
"checksum smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b73ea3738b47563803ef814925e69be00799a8c07420be8b996f8e98fb2336db"
43144346
"checksum socket2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c4d11a52082057d87cb5caa31ad812f4504b97ab44732cd8359df2e9ff9f48e7"
43154347
"checksum stable_deref_trait 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ffbc596e092fe5f598b12ef46cc03754085ac2f4d8c739ad61c4ae266cc3b3fa"
43164348
"checksum string_cache 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "25d70109977172b127fe834e5449e5ab1740b9ba49fa18a2020f509174f25423"
43174349
"checksum string_cache_codegen 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1eea1eee654ef80933142157fdad9dd8bc43cf7c74e999e369263496f04ff4da"
43184350
"checksum string_cache_shared 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b1884d1bc09741d466d9b14e6d37ac89d6909cbcac41dd9ae982d4d063bbedfc"
4351+
"checksum strip-ansi-escapes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d63676e2abafa709460982ddc02a3bb586b6d15a49b75c212e06edd3933acee"
43194352
"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
43204353
"checksum strum 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f6c3a2071519ab6a48f465808c4c1ffdd00dfc8e93111d02b4fc5abab177676e"
43214354
"checksum strum_macros 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8baacebd7b7c9b864d83a6ba7a246232983e277b86fa5cdec77f565715a4b136"
@@ -4368,11 +4401,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
43684401
"checksum url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "74e7d099f1ee52f823d4bdd60c93c3602043c728f5db3b97bdb548467f7bddea"
43694402
"checksum utf-8 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1262dfab4c30d5cb7c07026be00ee343a6cf5027fdc0104a9160f354e5db75c"
43704403
"checksum utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737"
4404+
"checksum utf8parse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8772a4ccbb4e89959023bc5b7cb8623a795caa7092d99f3aa9501b9484d4557d"
43714405
"checksum vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "def296d3eb3b12371b2c7d0e83bfe1403e4db2d7a0bba324a12b21c4ee13143d"
43724406
"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
43734407
"checksum vergen 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6aba5e34f93dc7051dfad05b98a18e9156f27e7b431fe1d2398cb6061c0a1dba"
43744408
"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
43754409
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
4410+
"checksum vte 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4f42f536e22f7fcbb407639765c8fd78707a33109301f834a594758bedd6e8cf"
43764411
"checksum wait-timeout 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b9f3bf741a801531993db6478b95682117471f76916f5e690dd8d45395b09349"
43774412
"checksum walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9d9d7ed3431229a144296213105a390676cc49c9b6a72bd19f3176c98e129fa1"
43784413
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"

README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,8 @@ MSVC builds of Rust additionally require an installation of Visual Studio 2017
134134

135135
[Visual Studio Build Tools]: https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019
136136

137-
At last check (cmake 3.14.3 and msvc 16.0.3) using the 2019 tools fails to
138-
build the in-tree LLVM build with a CMake error, so use 2017 instead by
139-
including the “MSVC v141 – VS 2017 C++ x64/x86 build tools (v14.16)” component.
137+
(If you're installing cmake yourself, be careful that “C++ CMake tools for
138+
Windows” doesn't get included under “Individual components”.)
140139

141140
With these dependencies installed, you can build the compiler in a `cmd.exe`
142141
shell with:
@@ -151,7 +150,7 @@ then you may need to force rustbuild to use an older version. This can be done
151150
by manually calling the appropriate vcvars file before running the bootstrap.
152151

153152
```batch
154-
> CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
153+
> CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
155154
> python x.py build
156155
```
157156

src/ci/docker/x86_64-gnu-tools/checktools.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ status_check() {
7474
check_dispatch $1 beta nomicon src/doc/nomicon
7575
check_dispatch $1 beta reference src/doc/reference
7676
check_dispatch $1 beta rust-by-example src/doc/rust-by-example
77-
# Temporarily disabled until
78-
# https://github.com/rust-lang/rust/issues/60459 is fixed.
79-
# check_dispatch $1 beta edition-guide src/doc/edition-guide
77+
check_dispatch $1 beta edition-guide src/doc/edition-guide
8078
check_dispatch $1 beta rls src/tools/rls
8179
check_dispatch $1 beta rustfmt src/tools/rustfmt
8280
check_dispatch $1 beta clippy-driver src/tools/clippy

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

+7-4
Original file line numberDiff line numberDiff line change
@@ -529,18 +529,21 @@ This lint detects bounds in type aliases. These are not currently enforced.
529529
Some example code that triggers this lint:
530530

531531
```rust
532+
#[allow(dead_code)]
532533
type SendVec<T: Send> = Vec<T>;
533534
```
534535

535536
This will produce:
536537

537538
```text
538-
warning: type alias is never used: `SendVec`
539-
--> src/main.rs:1:1
539+
warning: bounds on generic parameters are not enforced in type aliases
540+
--> src/lib.rs:2:17
540541
|
541-
1 | type SendVec<T: Send> = Vec<T>;
542-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
542+
2 | type SendVec<T: Send> = Vec<T>;
543+
| ^^^^
543544
|
545+
= note: #[warn(type_alias_bounds)] on by default
546+
= help: the bound will not be checked when the type alias is used, and should be removed
544547
```
545548

546549
## tyvar-behind-raw-pointer

src/liballoc/boxed.rs

+33-9
Original file line numberDiff line numberDiff line change
@@ -759,13 +759,14 @@ impl<A, F: Fn<A> + ?Sized> Fn<A> for Box<F> {
759759
}
760760
}
761761

762+
/// `FnBox` is deprecated and will be removed.
763+
/// `Box<dyn FnOnce()>` can be called directly, since Rust 1.35.0.
764+
///
762765
/// `FnBox` is a version of the `FnOnce` intended for use with boxed
763-
/// closure objects. The idea is that where one would normally store a
764-
/// `Box<dyn FnOnce()>` in a data structure, you should use
766+
/// closure objects. The idea was that where one would normally store a
767+
/// `Box<dyn FnOnce()>` in a data structure, you whould use
765768
/// `Box<dyn FnBox()>`. The two traits behave essentially the same, except
766-
/// that a `FnBox` closure can only be called if it is boxed. (Note
767-
/// that `FnBox` may be deprecated in the future if `Box<dyn FnOnce()>`
768-
/// closures become directly usable.)
769+
/// that a `FnBox` closure can only be called if it is boxed.
769770
///
770771
/// # Examples
771772
///
@@ -777,6 +778,7 @@ impl<A, F: Fn<A> + ?Sized> Fn<A> for Box<F> {
777778
///
778779
/// ```
779780
/// #![feature(fnbox)]
781+
/// #![allow(deprecated)]
780782
///
781783
/// use std::boxed::FnBox;
782784
/// use std::collections::HashMap;
@@ -796,16 +798,38 @@ impl<A, F: Fn<A> + ?Sized> Fn<A> for Box<F> {
796798
/// }
797799
/// }
798800
/// ```
801+
///
802+
/// In Rust 1.35.0 or later, use `FnOnce`, `FnMut`, or `Fn` instead:
803+
///
804+
/// ```
805+
/// use std::collections::HashMap;
806+
///
807+
/// fn make_map() -> HashMap<i32, Box<dyn FnOnce() -> i32>> {
808+
/// let mut map: HashMap<i32, Box<dyn FnOnce() -> i32>> = HashMap::new();
809+
/// map.insert(1, Box::new(|| 22));
810+
/// map.insert(2, Box::new(|| 44));
811+
/// map
812+
/// }
813+
///
814+
/// fn main() {
815+
/// let mut map = make_map();
816+
/// for i in &[1, 2] {
817+
/// let f = map.remove(&i).unwrap();
818+
/// assert_eq!(f(), i * 22);
819+
/// }
820+
/// }
821+
/// ```
799822
#[rustc_paren_sugar]
800-
#[unstable(feature = "fnbox",
801-
reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")]
823+
#[unstable(feature = "fnbox", issue = "28796")]
824+
#[rustc_deprecated(reason = "use `FnOnce`, `FnMut`, or `Fn` instead", since = "1.37.0")]
802825
pub trait FnBox<A>: FnOnce<A> {
803826
/// Performs the call operation.
804827
fn call_box(self: Box<Self>, args: A) -> Self::Output;
805828
}
806829

807-
#[unstable(feature = "fnbox",
808-
reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")]
830+
#[unstable(feature = "fnbox", issue = "28796")]
831+
#[rustc_deprecated(reason = "use `FnOnce`, `FnMut`, or `Fn` instead", since = "1.37.0")]
832+
#[allow(deprecated, deprecated_in_future)]
809833
impl<A, F> FnBox<A> for F
810834
where F: FnOnce<A>
811835
{

src/libcore/cell.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! mutate it.
1212
//!
1313
//! Shareable mutable containers exist to permit mutability in a controlled manner, even in the
14-
//! presence of aliasing. Both `Cell<T>` and `RefCell<T>` allows to do this in a single threaded
14+
//! presence of aliasing. Both `Cell<T>` and `RefCell<T>` allow doing this in a single-threaded
1515
//! way. However, neither `Cell<T>` nor `RefCell<T>` are thread safe (they do not implement
1616
//! `Sync`). If you need to do aliasing and mutation between multiple threads it is possible to
1717
//! use [`Mutex`](../../std/sync/struct.Mutex.html),

src/libcore/num/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ assert_eq!(m, ", $reversed, ");
473473
#[unstable(feature = "reverse_bits", issue = "48763")]
474474
#[rustc_const_unstable(feature = "const_int_conversion")]
475475
#[inline]
476+
#[must_use]
476477
pub const fn reverse_bits(self) -> Self {
477478
(self as $UnsignedT).reverse_bits() as Self
478479
}
@@ -2522,6 +2523,7 @@ assert_eq!(m, ", $reversed, ");
25222523
```"),
25232524
#[unstable(feature = "reverse_bits", issue = "48763")]
25242525
#[inline]
2526+
#[must_use]
25252527
pub const fn reverse_bits(self) -> Self {
25262528
intrinsics::bitreverse(self as $ActualT) as Self
25272529
}

src/libcore/num/wrapping.rs

+1
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ assert_eq!(n.trailing_zeros(), 3);
524524
/// ```
525525
#[unstable(feature = "reverse_bits", issue = "48763")]
526526
#[inline]
527+
#[must_use]
527528
pub const fn reverse_bits(self) -> Self {
528529
Wrapping(self.0.reverse_bits())
529530
}

src/librustc/middle/region.rs

+9-6
Original file line numberDiff line numberDiff line change
@@ -658,12 +658,15 @@ impl<'tcx> ScopeTree {
658658
// The lifetime was defined on node that doesn't own a body,
659659
// which in practice can only mean a trait or an impl, that
660660
// is the parent of a method, and that is enforced below.
661-
assert_eq!(Some(param_owner_id), self.root_parent,
662-
"free_scope: {:?} not recognized by the \
663-
region scope tree for {:?} / {:?}",
664-
param_owner,
665-
self.root_parent.map(|id| tcx.hir().local_def_id_from_hir_id(id)),
666-
self.root_body.map(|hir_id| DefId::local(hir_id.owner)));
661+
if Some(param_owner_id) != self.root_parent {
662+
tcx.sess.delay_span_bug(
663+
DUMMY_SP,
664+
&format!("free_scope: {:?} not recognized by the \
665+
region scope tree for {:?} / {:?}",
666+
param_owner,
667+
self.root_parent.map(|id| tcx.hir().local_def_id_from_hir_id(id)),
668+
self.root_body.map(|hir_id| DefId::local(hir_id.owner))));
669+
}
667670

668671
// The trait/impl lifetime is in scope for the method's body.
669672
self.root_body.unwrap().local_id

src/librustc/mir/interpret/pointer.rs

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::fmt;
2+
13
use crate::mir;
24
use crate::ty::layout::{self, HasDataLayout, Size};
35
use rustc_macros::HashStable;
@@ -70,7 +72,7 @@ impl<T: layout::HasDataLayout> PointerArithmetic for T {}
7072
///
7173
/// Pointer is also generic over the `Tag` associated with each pointer,
7274
/// which is used to do provenance tracking during execution.
73-
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd,
75+
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd,
7476
RustcEncodable, RustcDecodable, Hash, HashStable)]
7577
pub struct Pointer<Tag=(),Id=AllocId> {
7678
pub alloc_id: Id,
@@ -80,6 +82,18 @@ pub struct Pointer<Tag=(),Id=AllocId> {
8082

8183
static_assert_size!(Pointer, 16);
8284

85+
impl<Tag: fmt::Debug, Id: fmt::Debug> fmt::Debug for Pointer<Tag, Id> {
86+
default fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
87+
write!(f, "{:?}.{:#x}[{:?}]", self.alloc_id, self.offset.bytes(), self.tag)
88+
}
89+
}
90+
// Specialization for no tag
91+
impl<Id: fmt::Debug> fmt::Debug for Pointer<(), Id> {
92+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
93+
write!(f, "{:?}.{:#x}", self.alloc_id, self.offset.bytes())
94+
}
95+
}
96+
8397
/// Produces a `Pointer` which points to the beginning of the Allocation
8498
impl From<AllocId> for Pointer {
8599
#[inline(always)]

0 commit comments

Comments
 (0)