Skip to content

Commit b880760

Browse files
committed
Auto merge of rust-lang#137237 - cuviper:stage0, r=Mark-Simulacrum
Master bootstrap update https://forge.rust-lang.org/release/process.html#master-bootstrap-update-tuesday r? `@Mark-Simulacrum`
2 parents 1805b33 + e61cac2 commit b880760

File tree

47 files changed

+543
-1102
lines changed

Some content is hidden

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

47 files changed

+543
-1102
lines changed

compiler/rustc_data_structures/src/flock.rs

-25
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,6 @@
44
//! green/native threading. This is just a bare-bones enough solution for
55
//! librustdoc, it is not production quality at all.
66
7-
#[cfg(bootstrap)]
8-
cfg_match! {
9-
cfg(target_os = "linux") => {
10-
mod linux;
11-
use linux as imp;
12-
}
13-
cfg(target_os = "redox") => {
14-
mod linux;
15-
use linux as imp;
16-
}
17-
cfg(unix) => {
18-
mod unix;
19-
use unix as imp;
20-
}
21-
cfg(windows) => {
22-
mod windows;
23-
use self::windows as imp;
24-
}
25-
_ => {
26-
mod unsupported;
27-
use unsupported as imp;
28-
}
29-
}
30-
31-
#[cfg(not(bootstrap))]
327
cfg_match! {
338
target_os = "linux" => {
349
mod linux;

compiler/rustc_data_structures/src/profiling.rs

-63
Original file line numberDiff line numberDiff line change
@@ -860,69 +860,6 @@ fn get_thread_id() -> u32 {
860860
}
861861

862862
// Memory reporting
863-
#[cfg(bootstrap)]
864-
cfg_match! {
865-
cfg(windows) => {
866-
pub fn get_resident_set_size() -> Option<usize> {
867-
use std::mem;
868-
869-
use windows::{
870-
Win32::System::ProcessStatus::{K32GetProcessMemoryInfo, PROCESS_MEMORY_COUNTERS},
871-
Win32::System::Threading::GetCurrentProcess,
872-
};
873-
874-
let mut pmc = PROCESS_MEMORY_COUNTERS::default();
875-
let pmc_size = mem::size_of_val(&pmc);
876-
unsafe {
877-
K32GetProcessMemoryInfo(
878-
GetCurrentProcess(),
879-
&mut pmc,
880-
pmc_size as u32,
881-
)
882-
}
883-
.ok()
884-
.ok()?;
885-
886-
Some(pmc.WorkingSetSize)
887-
}
888-
}
889-
cfg(target_os = "macos") => {
890-
pub fn get_resident_set_size() -> Option<usize> {
891-
use libc::{c_int, c_void, getpid, proc_pidinfo, proc_taskinfo, PROC_PIDTASKINFO};
892-
use std::mem;
893-
const PROC_TASKINFO_SIZE: c_int = mem::size_of::<proc_taskinfo>() as c_int;
894-
895-
unsafe {
896-
let mut info: proc_taskinfo = mem::zeroed();
897-
let info_ptr = &mut info as *mut proc_taskinfo as *mut c_void;
898-
let pid = getpid() as c_int;
899-
let ret = proc_pidinfo(pid, PROC_PIDTASKINFO, 0, info_ptr, PROC_TASKINFO_SIZE);
900-
if ret == PROC_TASKINFO_SIZE {
901-
Some(info.pti_resident_size as usize)
902-
} else {
903-
None
904-
}
905-
}
906-
}
907-
}
908-
cfg(unix) => {
909-
pub fn get_resident_set_size() -> Option<usize> {
910-
let field = 1;
911-
let contents = fs::read("/proc/self/statm").ok()?;
912-
let contents = String::from_utf8(contents).ok()?;
913-
let s = contents.split_whitespace().nth(field)?;
914-
let npages = s.parse::<usize>().ok()?;
915-
Some(npages * 4096)
916-
}
917-
}
918-
_ => {
919-
pub fn get_resident_set_size() -> Option<usize> {
920-
None
921-
}
922-
}
923-
}
924-
925-
#[cfg(not(bootstrap))]
926863
cfg_match! {
927864
windows => {
928865
pub fn get_resident_set_size() -> Option<usize> {

compiler/rustc_feature/src/accepted.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ declare_features! (
387387
/// Allows `#[target_feature(...)]`.
388388
(accepted, target_feature, "1.27.0", None),
389389
/// Allows the use of `#[target_feature]` on safe functions.
390-
(accepted, target_feature_11, "CURRENT_RUSTC_VERSION", Some(69098)),
390+
(accepted, target_feature_11, "1.86.0", Some(69098)),
391391
/// Allows `fn main()` with return types which implements `Termination` (RFC 1937).
392392
(accepted, termination_trait, "1.26.0", Some(43301)),
393393
/// Allows `#[test]` functions where the return type implements `Termination` (RFC 1937).
@@ -401,7 +401,7 @@ declare_features! (
401401
(accepted, track_caller, "1.46.0", Some(47809)),
402402
/// Allows dyn upcasting trait objects via supertraits.
403403
/// Dyn upcasting is casting, e.g., `dyn Foo -> dyn Bar` where `Foo: Bar`.
404-
(accepted, trait_upcasting, "CURRENT_RUSTC_VERSION", Some(65991)),
404+
(accepted, trait_upcasting, "1.86.0", Some(65991)),
405405
/// Allows #[repr(transparent)] on univariant enums (RFC 2645).
406406
(accepted, transparent_enums, "1.42.0", Some(60405)),
407407
/// Allows indexing tuples.

compiler/rustc_feature/src/unstable.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ declare_features! (
203203
/// Allows using anonymous lifetimes in argument-position impl-trait.
204204
(unstable, anonymous_lifetime_in_impl_trait, "1.63.0", None),
205205
/// Allows access to the emscripten_wasm_eh config, used by panic_unwind and unwind
206-
(internal, cfg_emscripten_wasm_eh, "CURRENT_RUSTC_VERSION", None),
206+
(internal, cfg_emscripten_wasm_eh, "1.86.0", None),
207207
/// Allows identifying the `compiler_builtins` crate.
208208
(internal, compiler_builtins, "1.13.0", None),
209209
/// Allows writing custom MIR
@@ -358,7 +358,7 @@ declare_features! (
358358
/// Allows `extern "C-cmse-nonsecure-call" fn()`.
359359
(unstable, abi_c_cmse_nonsecure_call, "1.51.0", Some(81391)),
360360
/// Allows `extern "gpu-kernel" fn()`.
361-
(unstable, abi_gpu_kernel, "CURRENT_RUSTC_VERSION", Some(135467)),
361+
(unstable, abi_gpu_kernel, "1.86.0", Some(135467)),
362362
/// Allows `extern "msp430-interrupt" fn()`.
363363
(unstable, abi_msp430_interrupt, "1.16.0", Some(38487)),
364364
/// Allows `extern "ptx-*" fn()`.
@@ -402,7 +402,7 @@ declare_features! (
402402
/// Allows the use of `#[cfg(<true/false>)]`.
403403
(unstable, cfg_boolean_literals, "1.83.0", Some(131204)),
404404
/// Allows the use of `#[cfg(contract_checks)` to check if contract checks are enabled.
405-
(unstable, cfg_contract_checks, "CURRENT_RUSTC_VERSION", Some(128044)),
405+
(unstable, cfg_contract_checks, "1.86.0", Some(128044)),
406406
/// Allows the use of `#[cfg(overflow_checks)` to check if integer overflow behaviour.
407407
(unstable, cfg_overflow_checks, "1.71.0", Some(111466)),
408408
/// Provides the relocation model information as cfg entry
@@ -446,9 +446,9 @@ declare_features! (
446446
/// Allows the `?` operator in const contexts.
447447
(unstable, const_try, "1.56.0", Some(74935)),
448448
/// Allows use of contracts attributes.
449-
(incomplete, contracts, "CURRENT_RUSTC_VERSION", Some(128044)),
449+
(incomplete, contracts, "1.86.0", Some(128044)),
450450
/// Allows access to internal machinery used to implement contracts.
451-
(internal, contracts_internals, "CURRENT_RUSTC_VERSION", Some(128044)),
451+
(internal, contracts_internals, "1.86.0", Some(128044)),
452452
/// Allows coroutines to be cloned.
453453
(unstable, coroutine_clone, "1.65.0", Some(95360)),
454454
/// Allows defining coroutines.
@@ -489,7 +489,7 @@ declare_features! (
489489
/// for functions with varargs.
490490
(unstable, extended_varargs_abi_support, "1.65.0", Some(100189)),
491491
/// Allows using `system` as a calling convention with varargs.
492-
(unstable, extern_system_varargs, "CURRENT_RUSTC_VERSION", Some(136946)),
492+
(unstable, extern_system_varargs, "1.86.0", Some(136946)),
493493
/// Allows defining `extern type`s.
494494
(unstable, extern_types, "1.23.0", Some(43467)),
495495
/// Allow using 128-bit (quad precision) floating point numbers.
@@ -517,7 +517,7 @@ declare_features! (
517517
/// Allows generic parameters and where-clauses on free & associated const items.
518518
(incomplete, generic_const_items, "1.73.0", Some(113521)),
519519
/// Allows any generic constants being used as pattern type range ends
520-
(incomplete, generic_pattern_types, "CURRENT_RUSTC_VERSION", Some(136574)),
520+
(incomplete, generic_pattern_types, "1.86.0", Some(136574)),
521521
/// Allows registering static items globally, possibly across crates, to iterate over at runtime.
522522
(unstable, global_registration, "1.80.0", Some(125119)),
523523
/// Allows using guards in patterns.
@@ -533,15 +533,15 @@ declare_features! (
533533
/// Allows `impl Trait` as output type in `Fn` traits in return position of functions.
534534
(unstable, impl_trait_in_fn_trait_return, "1.64.0", Some(99697)),
535535
/// Allows `use` associated functions from traits.
536-
(unstable, import_trait_associated_functions, "CURRENT_RUSTC_VERSION", Some(134691)),
536+
(unstable, import_trait_associated_functions, "1.86.0", Some(134691)),
537537
/// Allows associated types in inherent impls.
538538
(incomplete, inherent_associated_types, "1.52.0", Some(8995)),
539539
/// Allow anonymous constants from an inline `const` block in pattern position
540540
(unstable, inline_const_pat, "1.58.0", Some(76001)),
541541
/// Allows using `pointer` and `reference` in intra-doc links
542542
(unstable, intra_doc_pointers, "1.51.0", Some(80896)),
543543
// Allows using the `kl` and `widekl` target features and the associated intrinsics
544-
(unstable, keylocker_x86, "CURRENT_RUSTC_VERSION", Some(134813)),
544+
(unstable, keylocker_x86, "1.86.0", Some(134813)),
545545
// Allows setting the threshold for the `large_assignments` lint.
546546
(unstable, large_assignments, "1.52.0", Some(83518)),
547547
/// Allow to have type alias types for inter-crate use.
@@ -582,7 +582,7 @@ declare_features! (
582582
/// Allows diverging expressions to fall back to `!` rather than `()`.
583583
(unstable, never_type_fallback, "1.41.0", Some(65992)),
584584
/// Switch `..` syntax to use the new (`Copy + IntoIterator`) range types.
585-
(unstable, new_range, "CURRENT_RUSTC_VERSION", Some(123741)),
585+
(unstable, new_range, "1.86.0", Some(123741)),
586586
/// Allows `#![no_core]`.
587587
(unstable, no_core, "1.3.0", Some(29639)),
588588
/// Allows the use of `no_sanitize` attribute.
@@ -634,7 +634,7 @@ declare_features! (
634634
/// Allows string patterns to dereference values to match them.
635635
(unstable, string_deref_patterns, "1.67.0", Some(87121)),
636636
/// Allows subtrait items to shadow supertrait items.
637-
(unstable, supertrait_item_shadowing, "CURRENT_RUSTC_VERSION", Some(89151)),
637+
(unstable, supertrait_item_shadowing, "1.86.0", Some(89151)),
638638
/// Allows using `#[thread_local]` on `static` items.
639639
(unstable, thread_local, "1.0.0", Some(29594)),
640640
/// Allows defining `trait X = A + B;` alias items.

compiler/rustc_lint/src/deref_into_dyn_supertrait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ declare_lint! {
1212
/// for `dyn SubTrait` with a `dyn SuperTrait` type as the `Output` type.
1313
///
1414
/// These implementations are "shadowed" by trait upcasting (stabilized since
15-
/// CURRENT_RUSTC_VERSION). The `deref` functions is no longer called implicitly, which might
15+
/// 1.86.0). The `deref` functions is no longer called implicitly, which might
1616
/// change behavior compared to previous rustc versions.
1717
///
1818
/// ### Example

compiler/rustc_lint/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
2222
// tidy-alphabetical-start
2323
#![allow(internal_features)]
24-
#![cfg_attr(bootstrap, feature(trait_upcasting))]
2524
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
2625
#![doc(rust_logo)]
2726
#![feature(array_windows)]

compiler/rustc_middle/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#![allow(rustc::diagnostic_outside_of_impl)]
3030
#![allow(rustc::potential_query_instability)]
3131
#![allow(rustc::untranslatable_diagnostic)]
32-
#![cfg_attr(bootstrap, feature(trait_upcasting))]
3332
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
3433
#![doc(rust_logo)]
3534
#![feature(allocator_api)]

compiler/rustc_span/src/analyze_source_file.rs

-126
Original file line numberDiff line numberDiff line change
@@ -29,132 +29,6 @@ pub(crate) fn analyze_source_file(src: &str) -> (Vec<RelativeBytePos>, Vec<Multi
2929
(lines, multi_byte_chars)
3030
}
3131

32-
#[cfg(bootstrap)]
33-
cfg_match! {
34-
cfg(any(target_arch = "x86", target_arch = "x86_64")) => {
35-
fn analyze_source_file_dispatch(
36-
src: &str,
37-
lines: &mut Vec<RelativeBytePos>,
38-
multi_byte_chars: &mut Vec<MultiByteChar>,
39-
) {
40-
if is_x86_feature_detected!("sse2") {
41-
unsafe {
42-
analyze_source_file_sse2(src, lines, multi_byte_chars);
43-
}
44-
} else {
45-
analyze_source_file_generic(
46-
src,
47-
src.len(),
48-
RelativeBytePos::from_u32(0),
49-
lines,
50-
multi_byte_chars,
51-
);
52-
}
53-
}
54-
55-
/// Checks 16 byte chunks of text at a time. If the chunk contains
56-
/// something other than printable ASCII characters and newlines, the
57-
/// function falls back to the generic implementation. Otherwise it uses
58-
/// SSE2 intrinsics to quickly find all newlines.
59-
#[target_feature(enable = "sse2")]
60-
unsafe fn analyze_source_file_sse2(
61-
src: &str,
62-
lines: &mut Vec<RelativeBytePos>,
63-
multi_byte_chars: &mut Vec<MultiByteChar>,
64-
) {
65-
#[cfg(target_arch = "x86")]
66-
use std::arch::x86::*;
67-
#[cfg(target_arch = "x86_64")]
68-
use std::arch::x86_64::*;
69-
70-
const CHUNK_SIZE: usize = 16;
71-
72-
let src_bytes = src.as_bytes();
73-
74-
let chunk_count = src.len() / CHUNK_SIZE;
75-
76-
// This variable keeps track of where we should start decoding a
77-
// chunk. If a multi-byte character spans across chunk boundaries,
78-
// we need to skip that part in the next chunk because we already
79-
// handled it.
80-
let mut intra_chunk_offset = 0;
81-
82-
for chunk_index in 0..chunk_count {
83-
let ptr = src_bytes.as_ptr() as *const __m128i;
84-
// We don't know if the pointer is aligned to 16 bytes, so we
85-
// use `loadu`, which supports unaligned loading.
86-
let chunk = unsafe { _mm_loadu_si128(ptr.add(chunk_index)) };
87-
88-
// For character in the chunk, see if its byte value is < 0, which
89-
// indicates that it's part of a UTF-8 char.
90-
let multibyte_test = unsafe { _mm_cmplt_epi8(chunk, _mm_set1_epi8(0)) };
91-
// Create a bit mask from the comparison results.
92-
let multibyte_mask = unsafe { _mm_movemask_epi8(multibyte_test) };
93-
94-
// If the bit mask is all zero, we only have ASCII chars here:
95-
if multibyte_mask == 0 {
96-
assert!(intra_chunk_offset == 0);
97-
98-
// Check for newlines in the chunk
99-
let newlines_test = unsafe { _mm_cmpeq_epi8(chunk, _mm_set1_epi8(b'\n' as i8)) };
100-
let mut newlines_mask = unsafe { _mm_movemask_epi8(newlines_test) };
101-
102-
let output_offset = RelativeBytePos::from_usize(chunk_index * CHUNK_SIZE + 1);
103-
104-
while newlines_mask != 0 {
105-
let index = newlines_mask.trailing_zeros();
106-
107-
lines.push(RelativeBytePos(index) + output_offset);
108-
109-
// Clear the bit, so we can find the next one.
110-
newlines_mask &= newlines_mask - 1;
111-
}
112-
} else {
113-
// The slow path.
114-
// There are multibyte chars in here, fallback to generic decoding.
115-
let scan_start = chunk_index * CHUNK_SIZE + intra_chunk_offset;
116-
intra_chunk_offset = analyze_source_file_generic(
117-
&src[scan_start..],
118-
CHUNK_SIZE - intra_chunk_offset,
119-
RelativeBytePos::from_usize(scan_start),
120-
lines,
121-
multi_byte_chars,
122-
);
123-
}
124-
}
125-
126-
// There might still be a tail left to analyze
127-
let tail_start = chunk_count * CHUNK_SIZE + intra_chunk_offset;
128-
if tail_start < src.len() {
129-
analyze_source_file_generic(
130-
&src[tail_start..],
131-
src.len() - tail_start,
132-
RelativeBytePos::from_usize(tail_start),
133-
lines,
134-
multi_byte_chars,
135-
);
136-
}
137-
}
138-
}
139-
_ => {
140-
// The target (or compiler version) does not support SSE2 ...
141-
fn analyze_source_file_dispatch(
142-
src: &str,
143-
lines: &mut Vec<RelativeBytePos>,
144-
multi_byte_chars: &mut Vec<MultiByteChar>,
145-
) {
146-
analyze_source_file_generic(
147-
src,
148-
src.len(),
149-
RelativeBytePos::from_u32(0),
150-
lines,
151-
multi_byte_chars,
152-
);
153-
}
154-
}
155-
}
156-
157-
#[cfg(not(bootstrap))]
15832
cfg_match! {
15933
any(target_arch = "x86", target_arch = "x86_64") => {
16034
fn analyze_source_file_dispatch(

library/alloc/src/boxed.rs

-10
Original file line numberDiff line numberDiff line change
@@ -237,23 +237,13 @@ pub struct Box<
237237
/// the newly allocated memory. This is an intrinsic to avoid unnecessary copies.
238238
///
239239
/// This is the surface syntax for `box <expr>` expressions.
240-
#[cfg(not(bootstrap))]
241240
#[rustc_intrinsic]
242241
#[rustc_intrinsic_must_be_overridden]
243242
#[unstable(feature = "liballoc_internals", issue = "none")]
244243
pub fn box_new<T>(_x: T) -> Box<T> {
245244
unreachable!()
246245
}
247246

248-
/// Transition function for the next bootstrap bump.
249-
#[cfg(bootstrap)]
250-
#[unstable(feature = "liballoc_internals", issue = "none")]
251-
#[inline(always)]
252-
pub fn box_new<T>(x: T) -> Box<T> {
253-
#[rustc_box]
254-
Box::new(x)
255-
}
256-
257247
impl<T> Box<T> {
258248
/// Allocates memory on the heap and then places `x` into it.
259249
///

0 commit comments

Comments
 (0)