Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ad97f8b

Browse files
Mark-Simulacrumalexcrichton
authored andcommittedJun 30, 2018
Bootstrap from 1.28.0-beta.3
1 parent 5d95db3 commit ad97f8b

File tree

23 files changed

+53
-342
lines changed

23 files changed

+53
-342
lines changed
 

‎src/Cargo.lock

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
191191

192192
[[package]]
193193
name = "cargo"
194-
version = "0.29.0"
194+
version = "0.30.0"
195195
dependencies = [
196196
"atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
197197
"bufstream 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
198198
"clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)",
199199
"core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
200-
"crates-io 0.17.0",
200+
"crates-io 0.18.0",
201201
"crossbeam 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
202202
"crypto-hash 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
203203
"curl 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -232,6 +232,7 @@ dependencies = [
232232
"tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
233233
"termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
234234
"toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
235+
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
235236
"url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
236237
"winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
237238
]
@@ -299,7 +300,7 @@ dependencies = [
299300
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
300301
"strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
301302
"textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
302-
"unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
303+
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
303304
"vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
304305
"yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
305306
]
@@ -472,7 +473,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
472473

473474
[[package]]
474475
name = "crates-io"
475-
version = "0.17.0"
476+
version = "0.18.0"
476477
dependencies = [
477478
"curl 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)",
478479
"failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1683,7 +1684,7 @@ dependencies = [
16831684
name = "rls"
16841685
version = "0.128.0"
16851686
dependencies = [
1686-
"cargo 0.29.0",
1687+
"cargo 0.30.0",
16871688
"cargo_metadata 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
16881689
"clippy_lints 0.0.205 (registry+https://github.com/rust-lang/crates.io-index)",
16891690
"env_logger 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1882,7 +1883,7 @@ dependencies = [
18821883
"rustc-ap-serialize 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
18831884
"rustc-ap-syntax_pos 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
18841885
"termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
1885-
"unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
1886+
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
18861887
]
18871888

18881889
[[package]]
@@ -1895,7 +1896,7 @@ dependencies = [
18951896
"rustc-ap-serialize 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
18961897
"rustc-ap-syntax_pos 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
18971898
"termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
1898-
"unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
1899+
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
18991900
]
19001901

19011902
[[package]]
@@ -1969,7 +1970,7 @@ dependencies = [
19691970
"rustc-ap-rustc_data_structures 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
19701971
"rustc-ap-serialize 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
19711972
"scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
1972-
"unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
1973+
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
19731974
]
19741975

19751976
[[package]]
@@ -1981,7 +1982,7 @@ dependencies = [
19811982
"rustc-ap-rustc_data_structures 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
19821983
"rustc-ap-serialize 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
19831984
"scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
1984-
"unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
1985+
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
19851986
]
19861987

19871988
[[package]]
@@ -2192,7 +2193,7 @@ dependencies = [
21922193
"serialize 0.0.0",
21932194
"syntax_pos 0.0.0",
21942195
"termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
2195-
"unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
2196+
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
21962197
]
21972198

21982199
[[package]]
@@ -2783,7 +2784,7 @@ dependencies = [
27832784
"rustc_data_structures 0.0.0",
27842785
"scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
27852786
"serialize 0.0.0",
2786-
"unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
2787+
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
27872788
]
27882789

27892790
[[package]]
@@ -2908,7 +2909,7 @@ name = "textwrap"
29082909
version = "0.9.0"
29092910
source = "registry+https://github.com/rust-lang/crates.io-index"
29102911
dependencies = [
2911-
"unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
2912+
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
29122913
]
29132914

29142915
[[package]]
@@ -2984,7 +2985,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
29842985

29852986
[[package]]
29862987
name = "unicode-width"
2987-
version = "0.1.4"
2988+
version = "0.1.5"
29882989
source = "registry+https://github.com/rust-lang/crates.io-index"
29892990

29902991
[[package]]
@@ -3388,7 +3389,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
33883389
"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5"
33893390
"checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f"
33903391
"checksum unicode-segmentation 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a8083c594e02b8ae1654ae26f0ade5158b119bd88ad0e8227a5d8fcd72407946"
3391-
"checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f"
3392+
"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526"
33923393
"checksum unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "36dff09cafb4ec7c8cf0023eb0b686cb6ce65499116a12201c9e11840ca01beb"
33933394
"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
33943395
"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"

‎src/bootstrap/channel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use Build;
2424
use config::Config;
2525

2626
// The version number
27-
pub const CFG_RELEASE_NUM: &str = "1.28.0";
27+
pub const CFG_RELEASE_NUM: &str = "1.29.0";
2828

2929
pub struct GitInfo {
3030
inner: Option<Info>,

‎src/liballoc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@
105105
#![feature(pin)]
106106
#![feature(ptr_internals)]
107107
#![feature(ptr_offset_from)]
108-
#![cfg_attr(stage0, feature(repr_transparent))]
109108
#![feature(rustc_attrs)]
110109
#![feature(specialization)]
111110
#![feature(split_ascii_whitespace)]

‎src/libcore/intrinsics.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,10 +1364,6 @@ extern "rust-intrinsic" {
13641364
/// source as well as std's catch implementation.
13651365
pub fn try(f: fn(*mut u8), data: *mut u8, local_ptr: *mut u8) -> i32;
13661366

1367-
#[cfg(stage0)]
1368-
/// docs my friends, its friday!
1369-
pub fn align_offset(ptr: *const (), align: usize) -> usize;
1370-
13711367
/// Emits a `!nontemporal` store according to LLVM (see their docs).
13721368
/// Probably will never become stable.
13731369
pub fn nontemporal_store<T>(ptr: *mut T, val: T);

‎src/libcore/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@
100100
#![feature(optin_builtin_traits)]
101101
#![feature(prelude_import)]
102102
#![feature(repr_simd, platform_intrinsics)]
103-
#![cfg_attr(stage0, feature(repr_transparent))]
104103
#![feature(rustc_attrs)]
105104
#![feature(rustc_const_unstable)]
106105
#![feature(simd_ffi)]

‎src/libcore/num/mod.rs

Lines changed: 0 additions & 192 deletions
Large diffs are not rendered by default.

‎src/libcore/num/wrapping.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,6 @@ assert_eq!(n.trailing_zeros(), 3);
531531
/// assert_eq!(m, Wrapping(-22016));
532532
/// ```
533533
#[unstable(feature = "reverse_bits", issue = "48763")]
534-
#[cfg(not(stage0))]
535534
#[inline]
536535
pub fn reverse_bits(self) -> Self {
537536
Wrapping(self.0.reverse_bits())

‎src/libcore/panic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use fmt;
3535
///
3636
/// panic!("Normal panic");
3737
/// ```
38-
#[cfg_attr(not(stage0), lang = "panic_info")]
38+
#[lang = "panic_info"]
3939
#[stable(feature = "panic_hooks", since = "1.10.0")]
4040
#[derive(Debug)]
4141
pub struct PanicInfo<'a> {

‎src/libcore/panicking.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
issue = "0")]
3838

3939
use fmt;
40-
#[cfg(not(stage0))]
4140
use panic::{Location, PanicInfo};
4241

4342
#[cold] #[inline(never)] // this is the slow path, always
@@ -61,20 +60,6 @@ fn panic_bounds_check(file_line_col: &(&'static str, u32, u32),
6160
len, index), file_line_col)
6261
}
6362

64-
#[cfg(stage0)]
65-
#[cold] #[inline(never)]
66-
pub fn panic_fmt(fmt: fmt::Arguments, file_line_col: &(&'static str, u32, u32)) -> ! {
67-
#[allow(improper_ctypes)]
68-
extern {
69-
#[lang = "panic_fmt"]
70-
#[unwind(allowed)]
71-
fn panic_impl(fmt: fmt::Arguments, file: &'static str, line: u32, col: u32) -> !;
72-
}
73-
let (file, line, col) = *file_line_col;
74-
unsafe { panic_impl(fmt, file, line, col) }
75-
}
76-
77-
#[cfg(not(stage0))]
7863
#[cold] #[inline(never)]
7964
pub fn panic_fmt(fmt: fmt::Arguments, file_line_col: &(&'static str, u32, u32)) -> ! {
8065
// NOTE This function never crosses the FFI boundary; it's a Rust-to-Rust call

‎src/libcore/ptr.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,6 @@ impl<T: ?Sized> *const T {
12431243
/// # } }
12441244
/// ```
12451245
#[unstable(feature = "align_offset", issue = "44488")]
1246-
#[cfg(not(stage0))]
12471246
pub fn align_offset(self, align: usize) -> usize where T: Sized {
12481247
if !align.is_power_of_two() {
12491248
panic!("align_offset: align is not a power-of-two");
@@ -1252,18 +1251,6 @@ impl<T: ?Sized> *const T {
12521251
align_offset(self, align)
12531252
}
12541253
}
1255-
1256-
/// definitely docs.
1257-
#[unstable(feature = "align_offset", issue = "44488")]
1258-
#[cfg(stage0)]
1259-
pub fn align_offset(self, align: usize) -> usize where T: Sized {
1260-
if !align.is_power_of_two() {
1261-
panic!("align_offset: align is not a power-of-two");
1262-
}
1263-
unsafe {
1264-
intrinsics::align_offset(self as *const (), align)
1265-
}
1266-
}
12671254
}
12681255

12691256

@@ -2308,7 +2295,6 @@ impl<T: ?Sized> *mut T {
23082295
/// # } }
23092296
/// ```
23102297
#[unstable(feature = "align_offset", issue = "44488")]
2311-
#[cfg(not(stage0))]
23122298
pub fn align_offset(self, align: usize) -> usize where T: Sized {
23132299
if !align.is_power_of_two() {
23142300
panic!("align_offset: align is not a power-of-two");
@@ -2317,18 +2303,6 @@ impl<T: ?Sized> *mut T {
23172303
align_offset(self, align)
23182304
}
23192305
}
2320-
2321-
/// definitely docs.
2322-
#[unstable(feature = "align_offset", issue = "44488")]
2323-
#[cfg(stage0)]
2324-
pub fn align_offset(self, align: usize) -> usize where T: Sized {
2325-
if !align.is_power_of_two() {
2326-
panic!("align_offset: align is not a power-of-two");
2327-
}
2328-
unsafe {
2329-
intrinsics::align_offset(self as *const (), align)
2330-
}
2331-
}
23322306
}
23332307

23342308
/// Align pointer `p`.
@@ -2346,7 +2320,6 @@ impl<T: ?Sized> *mut T {
23462320
///
23472321
/// Any questions go to @nagisa.
23482322
#[lang="align_offset"]
2349-
#[cfg(not(stage0))]
23502323
pub(crate) unsafe fn align_offset<T: Sized>(p: *const T, a: usize) -> usize {
23512324
/// Calculate multiplicative modular inverse of `x` modulo `m`.
23522325
///

‎src/libcore/slice/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,7 +1708,6 @@ impl<T> [T] {
17081708
}
17091709

17101710
/// Function to calculate lenghts of the middle and trailing slice for `align_to{,_mut}`.
1711-
#[cfg(not(stage0))]
17121711
fn align_to_offsets<U>(&self) -> (usize, usize) {
17131712
// What we gonna do about `rest` is figure out what multiple of `U`s we can put in a
17141713
// lowest number of `T`s. And how many `T`s we need for each such "multiple".
@@ -1798,7 +1797,6 @@ impl<T> [T] {
17981797
/// }
17991798
/// ```
18001799
#[unstable(feature = "slice_align_to", issue = "44488")]
1801-
#[cfg(not(stage0))]
18021800
pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T]) {
18031801
// Note that most of this function will be constant-evaluated,
18041802
if ::mem::size_of::<U>() == 0 || ::mem::size_of::<T>() == 0 {
@@ -1851,7 +1849,6 @@ impl<T> [T] {
18511849
/// }
18521850
/// ```
18531851
#[unstable(feature = "slice_align_to", issue = "44488")]
1854-
#[cfg(not(stage0))]
18551852
pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T]) {
18561853
// Note that most of this function will be constant-evaluated,
18571854
if ::mem::size_of::<U>() == 0 || ::mem::size_of::<T>() == 0 {

‎src/librustc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
#![feature(fs_read_write)]
5050
#![feature(iterator_find_map)]
5151
#![cfg_attr(windows, feature(libc))]
52-
#![cfg_attr(stage0, feature(macro_lifetime_matcher))]
5352
#![feature(macro_vis_matcher)]
5453
#![feature(never_type)]
5554
#![feature(exhaustive_patterns)]

‎src/librustc_asan/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
#![sanitizer_runtime]
1212
#![feature(alloc_system)]
13-
#![cfg_attr(stage0, feature(global_allocator))]
1413
#![feature(sanitizer_runtime)]
1514
#![feature(staged_api)]
1615
#![no_std]

‎src/librustc_lsan/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
#![sanitizer_runtime]
1212
#![feature(alloc_system)]
13-
#![cfg_attr(stage0, feature(global_allocator))]
1413
#![feature(sanitizer_runtime)]
1514
#![feature(staged_api)]
1615
#![no_std]

‎src/librustc_metadata/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#![feature(fs_read_write)]
1717
#![feature(libc)]
1818
#![feature(macro_at_most_once_rep)]
19-
#![cfg_attr(stage0, feature(macro_lifetime_matcher))]
2019
#![feature(proc_macro_internals)]
2120
#![feature(quote)]
2221
#![feature(rustc_diagnostic_macros)]

‎src/librustc_msan/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
#![sanitizer_runtime]
1212
#![feature(alloc_system)]
13-
#![cfg_attr(stage0, feature(global_allocator))]
1413
#![feature(sanitizer_runtime)]
1514
#![feature(staged_api)]
1615
#![no_std]

‎src/librustc_save_analysis/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
1313
html_root_url = "https://doc.rust-lang.org/nightly/")]
1414
#![feature(custom_attribute)]
15-
#![cfg_attr(stage0, feature(macro_lifetime_matcher))]
1615
#![allow(unused_attributes)]
1716

1817
#![recursion_limit="256"]

‎src/librustc_tsan/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
#![sanitizer_runtime]
1212
#![feature(alloc_system)]
13-
#![cfg_attr(stage0, feature(global_allocator))]
1413
#![feature(sanitizer_runtime)]
1514
#![feature(staged_api)]
1615
#![no_std]

‎src/libstd/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@
322322
#![feature(doc_keyword)]
323323
#![feature(float_internals)]
324324
#![feature(panic_info_message)]
325-
#![cfg_attr(not(stage0), feature(panic_implementation))]
325+
#![feature(panic_implementation)]
326326

327327
#![default_lib_allocator]
328328

@@ -332,9 +332,6 @@
332332
// `force_alloc_system` is *only* intended as a workaround for local rebuilds
333333
// with a rustc without jemalloc.
334334
// FIXME(#44236) shouldn't need MSVC logic
335-
#![cfg_attr(all(not(target_env = "msvc"),
336-
any(all(stage0, not(test)), feature = "force_alloc_system")),
337-
feature(global_allocator))]
338335
#[cfg(all(not(target_env = "msvc"),
339336
any(all(stage0, not(test)), feature = "force_alloc_system")))]
340337
#[global_allocator]

‎src/libstd/panicking.rs

Lines changed: 32 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -319,18 +319,6 @@ pub fn panicking() -> bool {
319319

320320
/// Entry point of panic from the libcore crate.
321321
#[cfg(not(test))]
322-
#[cfg(stage0)]
323-
#[lang = "panic_fmt"]
324-
pub extern fn rust_begin_panic(msg: fmt::Arguments,
325-
file: &'static str,
326-
line: u32,
327-
col: u32) -> ! {
328-
begin_panic_fmt(&msg, &(file, line, col))
329-
}
330-
331-
/// Entry point of panic from the libcore crate.
332-
#[cfg(not(test))]
333-
#[cfg(not(stage0))]
334322
#[panic_implementation]
335323
#[unwind(allowed)]
336324
pub fn rust_begin_panic(info: &PanicInfo) -> ! {
@@ -343,78 +331,54 @@ pub fn rust_begin_panic(info: &PanicInfo) -> ! {
343331
/// site as much as possible (so that `panic!()` has as low an impact
344332
/// on (e.g.) the inlining of other functions as possible), by moving
345333
/// the actual formatting into this shared place.
346-
#[cfg(stage0)]
347334
#[unstable(feature = "libstd_sys_internals",
348335
reason = "used by the panic! macro",
349336
issue = "0")]
350337
#[inline(never)] #[cold]
351338
pub fn begin_panic_fmt(msg: &fmt::Arguments,
352339
file_line_col: &(&'static str, u32, u32)) -> ! {
353-
// We do two allocations here, unfortunately. But (a) they're
354-
// required with the current scheme, and (b) we don't handle
355-
// panic + OOM properly anyway (see comment in begin_panic
356-
// below).
357-
358-
rust_panic_with_hook(&mut PanicPayload::new(msg), Some(msg), file_line_col);
359-
}
360-
361-
// NOTE(stage0) move into `continue_panic_fmt` on next stage0 update
362-
struct PanicPayload<'a> {
363-
inner: &'a fmt::Arguments<'a>,
364-
string: Option<String>,
340+
let (file, line, col) = *file_line_col;
341+
let info = PanicInfo::internal_constructor(
342+
Some(msg),
343+
Location::internal_constructor(file, line, col),
344+
);
345+
continue_panic_fmt(&info)
365346
}
366347

367-
impl<'a> PanicPayload<'a> {
368-
fn new(inner: &'a fmt::Arguments<'a>) -> PanicPayload<'a> {
369-
PanicPayload { inner, string: None }
348+
fn continue_panic_fmt(info: &PanicInfo) -> ! {
349+
struct PanicPayload<'a> {
350+
inner: &'a fmt::Arguments<'a>,
351+
string: Option<String>,
370352
}
371353

372-
fn fill(&mut self) -> &mut String {
373-
use fmt::Write;
354+
impl<'a> PanicPayload<'a> {
355+
fn new(inner: &'a fmt::Arguments<'a>) -> PanicPayload<'a> {
356+
PanicPayload { inner, string: None }
357+
}
374358

375-
let inner = self.inner;
376-
self.string.get_or_insert_with(|| {
377-
let mut s = String::new();
378-
drop(s.write_fmt(*inner));
379-
s
380-
})
381-
}
382-
}
359+
fn fill(&mut self) -> &mut String {
360+
use fmt::Write;
383361

384-
unsafe impl<'a> BoxMeUp for PanicPayload<'a> {
385-
fn box_me_up(&mut self) -> *mut (Any + Send) {
386-
let contents = mem::replace(self.fill(), String::new());
387-
Box::into_raw(Box::new(contents))
362+
let inner = self.inner;
363+
self.string.get_or_insert_with(|| {
364+
let mut s = String::new();
365+
drop(s.write_fmt(*inner));
366+
s
367+
})
368+
}
388369
}
389370

390-
fn get(&mut self) -> &(Any + Send) {
391-
self.fill()
392-
}
393-
}
371+
unsafe impl<'a> BoxMeUp for PanicPayload<'a> {
372+
fn box_me_up(&mut self) -> *mut (Any + Send) {
373+
let contents = mem::replace(self.fill(), String::new());
374+
Box::into_raw(Box::new(contents))
375+
}
394376

395-
/// The entry point for panicking with a formatted message.
396-
///
397-
/// This is designed to reduce the amount of code required at the call
398-
/// site as much as possible (so that `panic!()` has as low an impact
399-
/// on (e.g.) the inlining of other functions as possible), by moving
400-
/// the actual formatting into this shared place.
401-
#[cfg(not(stage0))]
402-
#[unstable(feature = "libstd_sys_internals",
403-
reason = "used by the panic! macro",
404-
issue = "0")]
405-
#[inline(never)] #[cold]
406-
pub fn begin_panic_fmt(msg: &fmt::Arguments,
407-
file_line_col: &(&'static str, u32, u32)) -> ! {
408-
let (file, line, col) = *file_line_col;
409-
let info = PanicInfo::internal_constructor(
410-
Some(msg),
411-
Location::internal_constructor(file, line, col),
412-
);
413-
continue_panic_fmt(&info)
414-
}
377+
fn get(&mut self) -> &(Any + Send) {
378+
self.fill()
379+
}
380+
}
415381

416-
#[cfg(not(stage0))]
417-
fn continue_panic_fmt(info: &PanicInfo) -> ! {
418382
// We do two allocations here, unfortunately. But (a) they're
419383
// required with the current scheme, and (b) we don't handle
420384
// panic + OOM properly anyway (see comment in begin_panic

‎src/stage0.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# source tarball for a stable release you'll likely see `1.x.0` for rustc and
1313
# `0.x.0` for Cargo where they were released on `date`.
1414

15-
date: 2018-05-10
15+
date: 2018-06-30
1616
rustc: beta
1717
cargo: beta
1818

0 commit comments

Comments
 (0)
Please sign in to comment.