Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 70fc632

Browse files
committed
Auto merge of rust-lang#119899 - onur-ozkan:redesign-stage0-std, r=<try>
redesign stage 0 std This is intended to update bootstrap to use the beta standard library on stage 0, rather than compiling it from source (see the motivation at rust-lang/compiler-team#619). ~~Blocked on rust-lang#122709 try-job: mingw-check
2 parents 961351c + 0d757b2 commit 70fc632

File tree

30 files changed

+116
-116
lines changed

30 files changed

+116
-116
lines changed

compiler/rustc_lint/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
2222
// tidy-alphabetical-start
2323
#![allow(internal_features)]
24+
#![cfg_attr(bootstrap, feature(extract_if))]
2425
#![cfg_attr(doc, recursion_limit = "256")] // FIXME(nnethercote): will be removed by #124141
2526
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
2627
#![doc(rust_logo)]

compiler/rustc_metadata/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// tidy-alphabetical-start
22
#![allow(internal_features)]
3+
#![cfg_attr(bootstrap, feature(extract_if))]
34
#![cfg_attr(doc, recursion_limit = "256")] // FIXME(nnethercote): will be removed by #124141
45
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
56
#![doc(rust_logo)]

compiler/rustc_middle/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#![allow(rustc::diagnostic_outside_of_impl)]
3030
#![allow(rustc::potential_query_instability)]
3131
#![allow(rustc::untranslatable_diagnostic)]
32+
#![cfg_attr(bootstrap, feature(extract_if))]
3233
#![cfg_attr(doc, recursion_limit = "256")] // FIXME(nnethercote): will be removed by #124141
3334
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
3435
#![doc(rust_logo)]

compiler/rustc_resolve/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#![allow(rustc::diagnostic_outside_of_impl)]
1212
#![allow(rustc::potential_query_instability)]
1313
#![allow(rustc::untranslatable_diagnostic)]
14+
#![cfg_attr(bootstrap, feature(extract_if))]
1415
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
1516
#![doc(rust_logo)]
1617
#![feature(assert_matches)]

compiler/rustc_serialize/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// tidy-alphabetical-start
44
#![allow(internal_features)]
55
#![allow(rustc::internal)]
6+
#![cfg_attr(bootstrap, feature(ptr_sub_ptr))]
67
#![cfg_attr(test, feature(test))]
78
#![doc(
89
html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",

compiler/rustc_serialize/src/opaque.rs

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,13 +280,27 @@ impl<'a> MemDecoder<'a> {
280280
#[inline]
281281
pub fn len(&self) -> usize {
282282
// SAFETY: This recovers the length of the original slice, only using members we never modify.
283-
unsafe { self.end.offset_from_unsigned(self.start) }
283+
#[cfg(bootstrap)]
284+
unsafe {
285+
return self.end.sub_ptr(self.start);
286+
}
287+
#[cfg(not(bootstrap))]
288+
unsafe {
289+
self.end.offset_from_unsigned(self.start)
290+
}
284291
}
285292

286293
#[inline]
287294
pub fn remaining(&self) -> usize {
288295
// SAFETY: This type guarantees current <= end.
289-
unsafe { self.end.offset_from_unsigned(self.current) }
296+
#[cfg(bootstrap)]
297+
unsafe {
298+
return self.end.sub_ptr(self.current);
299+
}
300+
#[cfg(not(bootstrap))]
301+
unsafe {
302+
self.end.offset_from_unsigned(self.current)
303+
}
290304
}
291305

292306
#[cold]
@@ -400,7 +414,14 @@ impl<'a> Decoder for MemDecoder<'a> {
400414
#[inline]
401415
fn position(&self) -> usize {
402416
// SAFETY: This type guarantees start <= current
403-
unsafe { self.current.offset_from_unsigned(self.start) }
417+
#[cfg(bootstrap)]
418+
unsafe {
419+
return self.current.sub_ptr(self.start);
420+
}
421+
#[cfg(not(bootstrap))]
422+
unsafe {
423+
self.current.offset_from_unsigned(self.start)
424+
}
404425
}
405426
}
406427

compiler/rustc_span/src/analyze_source_file.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,30 @@ cfg_match! {
8383

8484
// For character in the chunk, see if its byte value is < 0, which
8585
// indicates that it's part of a UTF-8 char.
86+
#[cfg(bootstrap)]
87+
let multibyte_test = unsafe { _mm_cmplt_epi8(chunk, _mm_set1_epi8(0)) };
88+
#[cfg(not(bootstrap))]
8689
let multibyte_test = _mm_cmplt_epi8(chunk, _mm_set1_epi8(0));
90+
8791
// Create a bit mask from the comparison results.
92+
#[cfg(bootstrap)]
93+
let multibyte_mask = unsafe { _mm_movemask_epi8(multibyte_test) };
94+
#[cfg(not(bootstrap))]
8895
let multibyte_mask = _mm_movemask_epi8(multibyte_test);
8996

9097
// If the bit mask is all zero, we only have ASCII chars here:
9198
if multibyte_mask == 0 {
9299
assert!(intra_chunk_offset == 0);
93100

94101
// Check for newlines in the chunk
102+
#[cfg(bootstrap)]
103+
let newlines_test = unsafe { _mm_cmpeq_epi8(chunk, _mm_set1_epi8(b'\n' as i8)) };
104+
#[cfg(not(bootstrap))]
95105
let newlines_test = _mm_cmpeq_epi8(chunk, _mm_set1_epi8(b'\n' as i8));
106+
107+
#[cfg(bootstrap)]
108+
let mut newlines_mask = unsafe { _mm_movemask_epi8(newlines_test) };
109+
#[cfg(not(bootstrap))]
96110
let mut newlines_mask = _mm_movemask_epi8(newlines_test);
97111

98112
let output_offset = RelativeBytePos::from_usize(chunk_index * CHUNK_SIZE + 1);

compiler/rustc_trait_selection/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#![allow(internal_features)]
1515
#![allow(rustc::diagnostic_outside_of_impl)]
1616
#![allow(rustc::untranslatable_diagnostic)]
17+
#![cfg_attr(bootstrap, feature(extract_if))]
1718
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
1819
#![doc(rust_logo)]
1920
#![feature(assert_matches)]

library/alloc/src/collections/btree/set_val.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub(super) struct SetValZST;
99
/// Returns `true` only for type `SetValZST`, `false` for all other types (blanket implementation).
1010
/// `TypeId` requires a `'static` lifetime, use of this trait avoids that restriction.
1111
///
12-
/// [`TypeId`]: std::any::TypeId
12+
/// [`TypeId`]: core::any::TypeId
1313
pub(super) trait IsSetVal {
1414
fn is_set_val() -> bool;
1515
}

library/core/src/clone.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ pub macro Clone($item:item) {
216216
/// Use closures allow captured values to be automatically used.
217217
/// This is similar to have a closure that you would call `.use` over each captured value.
218218
#[unstable(feature = "ergonomic_clones", issue = "132290")]
219-
#[cfg_attr(not(bootstrap), lang = "use_cloned")]
219+
#[lang = "use_cloned"]
220220
pub trait UseCloned: Clone {
221221
// Empty.
222222
}

0 commit comments

Comments
 (0)