Skip to content

Commit 240ee60

Browse files
committed
Auto merge of #62449 - Centril:rollup-fbqhf11, r=Centril
Rollup of 6 pull requests Successful merges: - #60081 (Refactor unicode.py script) - #61862 (Make the Weak::{into,as}_raw methods) - #62243 (Improve documentation for built-in macros) - #62422 (Remove some uses of mem::uninitialized) - #62432 (Update rustfmt to 1.3.2) - #62436 (normalize use of backticks/lowercase in compiler messages for librustc_mir) Failed merges: r? @ghost
2 parents 254f201 + a63886c commit 240ee60

File tree

62 files changed

+1725
-696
lines changed

Some content is hidden

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

62 files changed

+1725
-696
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ __pycache__/
3636
/src/libcore/unicode/Scripts.txt
3737
/src/libcore/unicode/SpecialCasing.txt
3838
/src/libcore/unicode/UnicodeData.txt
39+
/src/libcore/unicode/downloaded
3940
/stage[0-9]+/
4041
/target
4142
target/

Cargo.lock

+16-30
Original file line numberDiff line numberDiff line change
@@ -327,18 +327,6 @@ dependencies = [
327327
"syn 0.15.35 (registry+https://github.com/rust-lang/crates.io-index)",
328328
]
329329

330-
[[package]]
331-
name = "cargo_metadata"
332-
version = "0.7.1"
333-
source = "registry+https://github.com/rust-lang/crates.io-index"
334-
dependencies = [
335-
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
336-
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
337-
"serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
338-
"serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
339-
"serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
340-
]
341-
342330
[[package]]
343331
name = "cargo_metadata"
344332
version = "0.8.0"
@@ -794,12 +782,11 @@ dependencies = [
794782

795783
[[package]]
796784
name = "dirs"
797-
version = "1.0.5"
785+
version = "2.0.1"
798786
source = "registry+https://github.com/rust-lang/crates.io-index"
799787
dependencies = [
800-
"libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)",
801-
"redox_users 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
802-
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
788+
"cfg-if 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
789+
"dirs-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
803790
]
804791

805792
[[package]]
@@ -2386,7 +2373,7 @@ dependencies = [
23862373
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
23872374
"rustc-workspace-hack 1.0.0",
23882375
"rustc_tools_util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
2389-
"rustfmt-nightly 1.3.0",
2376+
"rustfmt-nightly 1.3.2",
23902377
"serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
23912378
"serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
23922379
"serde_ignored 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3212,7 +3199,7 @@ dependencies = [
32123199

32133200
[[package]]
32143201
name = "rustfmt-config_proc_macro"
3215-
version = "0.1.0"
3202+
version = "0.1.2"
32163203
dependencies = [
32173204
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
32183205
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3222,15 +3209,15 @@ dependencies = [
32223209

32233210
[[package]]
32243211
name = "rustfmt-nightly"
3225-
version = "1.3.0"
3212+
version = "1.3.2"
32263213
dependencies = [
32273214
"annotate-snippets 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
32283215
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
32293216
"bytecount 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
3230-
"cargo_metadata 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
3217+
"cargo_metadata 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
32313218
"derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
32323219
"diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
3233-
"dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
3220+
"dirs 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
32343221
"env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
32353222
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
32363223
"getopts 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3243,10 +3230,10 @@ dependencies = [
32433230
"rustc-ap-syntax 491.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
32443231
"rustc-ap-syntax_pos 491.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
32453232
"rustc-workspace-hack 1.0.0",
3246-
"rustfmt-config_proc_macro 0.1.0",
3233+
"rustfmt-config_proc_macro 0.1.2",
32473234
"serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
32483235
"serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
3249-
"structopt 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
3236+
"structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
32503237
"term 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
32513238
"toml 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
32523239
"unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3489,16 +3476,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
34893476

34903477
[[package]]
34913478
name = "structopt"
3492-
version = "0.2.16"
3479+
version = "0.2.18"
34933480
source = "registry+https://github.com/rust-lang/crates.io-index"
34943481
dependencies = [
34953482
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
3496-
"structopt-derive 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
3483+
"structopt-derive 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
34973484
]
34983485

34993486
[[package]]
35003487
name = "structopt-derive"
3501-
version = "0.2.16"
3488+
version = "0.2.18"
35023489
source = "registry+https://github.com/rust-lang/crates.io-index"
35033490
dependencies = [
35043491
"heck 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -4237,7 +4224,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
42374224
"checksum byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "94f88df23a25417badc922ab0f5716cc1330e87f71ddd9203b3a3ccd9cedf75d"
42384225
"checksum bytes 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "40ade3d27603c2cb345eb0912aec461a6dec7e06a4ae48589904e808335c7afa"
42394226
"checksum bytesize 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "716960a18f978640f25101b5cbf1c6f6b0d3192fab36a2d98ca96f0ecbe41010"
4240-
"checksum cargo_metadata 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "585784cac9b05c93a53b17a0b24a5cdd1dfdda5256f030e089b549d2390cc720"
42414227
"checksum cargo_metadata 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "929766d993a2fde7a0ae962ee82429069cd7b68839cd9375b98efd719df65d3a"
42424228
"checksum cc 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)" = "5e5f3fee5eeb60324c2781f1e41286bdee933850fff9b3c672587fed5ec58c83"
42434229
"checksum cfg-if 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "89431bba4e6b7092fb5fcd00a6f6ca596c55cc26b2f1e6dcdd08a1f4933f66b2"
@@ -4277,7 +4263,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
42774263
"checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
42784264
"checksum digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "03b072242a8cbaf9c145665af9d250c59af3b958f83ed6824e13533cf76d5b90"
42794265
"checksum directories 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2ccc83e029c3cebb4c8155c644d34e3a070ccdb4ff90d369c74cd73f7cb3c984"
4280-
"checksum dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901"
4266+
"checksum dirs 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1c4ef5a8b902d393339e2a2c7fe573af92ce7e0ee5a3ff827b4c9ad7e07e4fa1"
42814267
"checksum dirs-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "937756392ec77d1f2dd9dc3ac9d69867d109a2121479d72c364e42f4cab21e2d"
42824268
"checksum dlmalloc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f283302e035e61c23f2b86b3093e8c6273a4c3125742d6087e96ade001ca5e63"
42834269
"checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0"
@@ -4489,8 +4475,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
44894475
"checksum string_cache_shared 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b1884d1bc09741d466d9b14e6d37ac89d6909cbcac41dd9ae982d4d063bbedfc"
44904476
"checksum strip-ansi-escapes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d63676e2abafa709460982ddc02a3bb586b6d15a49b75c212e06edd3933acee"
44914477
"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
4492-
"checksum structopt 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)" = "fa19a5a708e22bb5be31c1b6108a2a902f909c4b9ba85cba44c06632386bc0ff"
4493-
"checksum structopt-derive 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)" = "c6d59d0ae8ef8de16e49e3ca7afa16024a3e0dfd974a75ef93fdc5464e34523f"
4478+
"checksum structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "16c2cdbf9cc375f15d1b4141bc48aeef444806655cd0e904207edc8d68d86ed7"
4479+
"checksum structopt-derive 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "53010261a84b37689f9ed7d395165029f9cc7abb9f56bbfe86bee2597ed25107"
44944480
"checksum strum 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f6c3a2071519ab6a48f465808c4c1ffdd00dfc8e93111d02b4fc5abab177676e"
44954481
"checksum strum_macros 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8baacebd7b7c9b864d83a6ba7a246232983e277b86fa5cdec77f565715a4b136"
44964482
"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad"

src/liballoc/rc.rs

+15-15
Original file line numberDiff line numberDiff line change
@@ -1291,26 +1291,26 @@ impl<T> Weak<T> {
12911291
/// ```
12921292
/// #![feature(weak_into_raw)]
12931293
///
1294-
/// use std::rc::{Rc, Weak};
1294+
/// use std::rc::Rc;
12951295
/// use std::ptr;
12961296
///
12971297
/// let strong = Rc::new("hello".to_owned());
12981298
/// let weak = Rc::downgrade(&strong);
12991299
/// // Both point to the same object
1300-
/// assert!(ptr::eq(&*strong, Weak::as_raw(&weak)));
1300+
/// assert!(ptr::eq(&*strong, weak.as_raw()));
13011301
/// // The strong here keeps it alive, so we can still access the object.
1302-
/// assert_eq!("hello", unsafe { &*Weak::as_raw(&weak) });
1302+
/// assert_eq!("hello", unsafe { &*weak.as_raw() });
13031303
///
13041304
/// drop(strong);
1305-
/// // But not any more. We can do Weak::as_raw(&weak), but accessing the pointer would lead to
1305+
/// // But not any more. We can do weak.as_raw(), but accessing the pointer would lead to
13061306
/// // undefined behaviour.
1307-
/// // assert_eq!("hello", unsafe { &*Weak::as_raw(&weak) });
1307+
/// // assert_eq!("hello", unsafe { &*weak.as_raw() });
13081308
/// ```
13091309
///
13101310
/// [`null`]: ../../std/ptr/fn.null.html
13111311
#[unstable(feature = "weak_into_raw", issue = "60728")]
1312-
pub fn as_raw(this: &Self) -> *const T {
1313-
match this.inner() {
1312+
pub fn as_raw(&self) -> *const T {
1313+
match self.inner() {
13141314
None => ptr::null(),
13151315
Some(inner) => {
13161316
let offset = data_offset_sized::<T>();
@@ -1341,7 +1341,7 @@ impl<T> Weak<T> {
13411341
///
13421342
/// let strong = Rc::new("hello".to_owned());
13431343
/// let weak = Rc::downgrade(&strong);
1344-
/// let raw = Weak::into_raw(weak);
1344+
/// let raw = weak.into_raw();
13451345
///
13461346
/// assert_eq!(1, Rc::weak_count(&strong));
13471347
/// assert_eq!("hello", unsafe { &*raw });
@@ -1353,9 +1353,9 @@ impl<T> Weak<T> {
13531353
/// [`from_raw`]: struct.Weak.html#method.from_raw
13541354
/// [`as_raw`]: struct.Weak.html#method.as_raw
13551355
#[unstable(feature = "weak_into_raw", issue = "60728")]
1356-
pub fn into_raw(this: Self) -> *const T {
1357-
let result = Self::as_raw(&this);
1358-
mem::forget(this);
1356+
pub fn into_raw(self) -> *const T {
1357+
let result = self.as_raw();
1358+
mem::forget(self);
13591359
result
13601360
}
13611361

@@ -1382,18 +1382,18 @@ impl<T> Weak<T> {
13821382
///
13831383
/// let strong = Rc::new("hello".to_owned());
13841384
///
1385-
/// let raw_1 = Weak::into_raw(Rc::downgrade(&strong));
1386-
/// let raw_2 = Weak::into_raw(Rc::downgrade(&strong));
1385+
/// let raw_1 = Rc::downgrade(&strong).into_raw();
1386+
/// let raw_2 = Rc::downgrade(&strong).into_raw();
13871387
///
13881388
/// assert_eq!(2, Rc::weak_count(&strong));
13891389
///
1390-
/// assert_eq!("hello", &*Weak::upgrade(&unsafe { Weak::from_raw(raw_1) }).unwrap());
1390+
/// assert_eq!("hello", &*unsafe { Weak::from_raw(raw_1) }.upgrade().unwrap());
13911391
/// assert_eq!(1, Rc::weak_count(&strong));
13921392
///
13931393
/// drop(strong);
13941394
///
13951395
/// // Decrement the last weak count.
1396-
/// assert!(Weak::upgrade(&unsafe { Weak::from_raw(raw_2) }).is_none());
1396+
/// assert!(unsafe { Weak::from_raw(raw_2) }.upgrade().is_none());
13971397
/// ```
13981398
///
13991399
/// [`null`]: ../../std/ptr/fn.null.html

src/liballoc/sync.rs

+15-15
Original file line numberDiff line numberDiff line change
@@ -1080,26 +1080,26 @@ impl<T> Weak<T> {
10801080
/// ```
10811081
/// #![feature(weak_into_raw)]
10821082
///
1083-
/// use std::sync::{Arc, Weak};
1083+
/// use std::sync::Arc;
10841084
/// use std::ptr;
10851085
///
10861086
/// let strong = Arc::new("hello".to_owned());
10871087
/// let weak = Arc::downgrade(&strong);
10881088
/// // Both point to the same object
1089-
/// assert!(ptr::eq(&*strong, Weak::as_raw(&weak)));
1089+
/// assert!(ptr::eq(&*strong, weak.as_raw()));
10901090
/// // The strong here keeps it alive, so we can still access the object.
1091-
/// assert_eq!("hello", unsafe { &*Weak::as_raw(&weak) });
1091+
/// assert_eq!("hello", unsafe { &*weak.as_raw() });
10921092
///
10931093
/// drop(strong);
1094-
/// // But not any more. We can do Weak::as_raw(&weak), but accessing the pointer would lead to
1094+
/// // But not any more. We can do weak.as_raw(), but accessing the pointer would lead to
10951095
/// // undefined behaviour.
1096-
/// // assert_eq!("hello", unsafe { &*Weak::as_raw(&weak) });
1096+
/// // assert_eq!("hello", unsafe { &*weak.as_raw() });
10971097
/// ```
10981098
///
10991099
/// [`null`]: ../../std/ptr/fn.null.html
11001100
#[unstable(feature = "weak_into_raw", issue = "60728")]
1101-
pub fn as_raw(this: &Self) -> *const T {
1102-
match this.inner() {
1101+
pub fn as_raw(&self) -> *const T {
1102+
match self.inner() {
11031103
None => ptr::null(),
11041104
Some(inner) => {
11051105
let offset = data_offset_sized::<T>();
@@ -1130,7 +1130,7 @@ impl<T> Weak<T> {
11301130
///
11311131
/// let strong = Arc::new("hello".to_owned());
11321132
/// let weak = Arc::downgrade(&strong);
1133-
/// let raw = Weak::into_raw(weak);
1133+
/// let raw = weak.into_raw();
11341134
///
11351135
/// assert_eq!(1, Arc::weak_count(&strong));
11361136
/// assert_eq!("hello", unsafe { &*raw });
@@ -1142,9 +1142,9 @@ impl<T> Weak<T> {
11421142
/// [`from_raw`]: struct.Weak.html#method.from_raw
11431143
/// [`as_raw`]: struct.Weak.html#method.as_raw
11441144
#[unstable(feature = "weak_into_raw", issue = "60728")]
1145-
pub fn into_raw(this: Self) -> *const T {
1146-
let result = Self::as_raw(&this);
1147-
mem::forget(this);
1145+
pub fn into_raw(self) -> *const T {
1146+
let result = self.as_raw();
1147+
mem::forget(self);
11481148
result
11491149
}
11501150

@@ -1172,18 +1172,18 @@ impl<T> Weak<T> {
11721172
///
11731173
/// let strong = Arc::new("hello".to_owned());
11741174
///
1175-
/// let raw_1 = Weak::into_raw(Arc::downgrade(&strong));
1176-
/// let raw_2 = Weak::into_raw(Arc::downgrade(&strong));
1175+
/// let raw_1 = Arc::downgrade(&strong).into_raw();
1176+
/// let raw_2 = Arc::downgrade(&strong).into_raw();
11771177
///
11781178
/// assert_eq!(2, Arc::weak_count(&strong));
11791179
///
1180-
/// assert_eq!("hello", &*Weak::upgrade(&unsafe { Weak::from_raw(raw_1) }).unwrap());
1180+
/// assert_eq!("hello", &*unsafe { Weak::from_raw(raw_1) }.upgrade().unwrap());
11811181
/// assert_eq!(1, Arc::weak_count(&strong));
11821182
///
11831183
/// drop(strong);
11841184
///
11851185
/// // Decrement the last weak count.
1186-
/// assert!(Weak::upgrade(&unsafe { Weak::from_raw(raw_2) }).is_none());
1186+
/// assert!(unsafe { Weak::from_raw(raw_2) }.upgrade().is_none());
11871187
/// ```
11881188
///
11891189
/// [`null`]: ../../std/ptr/fn.null.html

src/libcore/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
#![feature(const_fn)]
7676
#![feature(const_fn_union)]
7777
#![feature(custom_inner_attributes)]
78+
#![feature(decl_macro)]
7879
#![feature(doc_cfg)]
7980
#![feature(doc_spotlight)]
8081
#![feature(extern_types)]

0 commit comments

Comments
 (0)