Skip to content

Commit a6f45a6

Browse files
committed
Auto merge of rust-lang#119764 - GuillaumeGomez:rollup-7jb3a5k, r=GuillaumeGomez
Rollup of 7 pull requests Successful merges: - rust-lang#117372 (Update stdarch submodule) - rust-lang#118241 (Making `User<T>` and `User<[T]>` `Send`) - rust-lang#118748 (std: getrandom simplification for freebsd.) - rust-lang#119527 (don't reexport atomic::ordering via rustc_data_structures, use std import) - rust-lang#119699 (Merge dead bb pruning and unreachable bb deduplication.) - rust-lang#119723 (Remove `-Zdont-buffer-diagnostics`.) - rust-lang#119756 (rustdoc-search: reuse individual types in function signatures) r? `@ghost` `@rustbot` modify labels: rollup
2 parents be00c5a + caba673 commit a6f45a6

Some content is hidden

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

43 files changed

+335
-245
lines changed

Cargo.lock

+6-6
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ dependencies = [
3737

3838
[[package]]
3939
name = "ahash"
40-
version = "0.8.6"
40+
version = "0.8.7"
4141
source = "registry+https://github.com/rust-lang/crates.io-index"
42-
checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a"
42+
checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01"
4343
dependencies = [
4444
"cfg-if",
4545
"once_cell",
@@ -6363,18 +6363,18 @@ dependencies = [
63636363

63646364
[[package]]
63656365
name = "zerocopy"
6366-
version = "0.7.28"
6366+
version = "0.7.32"
63676367
source = "registry+https://github.com/rust-lang/crates.io-index"
6368-
checksum = "7d6f15f7ade05d2a4935e34a457b936c23dc70a05cc1d97133dc99e7a3fe0f0e"
6368+
checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be"
63696369
dependencies = [
63706370
"zerocopy-derive",
63716371
]
63726372

63736373
[[package]]
63746374
name = "zerocopy-derive"
6375-
version = "0.7.28"
6375+
version = "0.7.32"
63766376
source = "registry+https://github.com/rust-lang/crates.io-index"
6377-
checksum = "dbbad221e3f78500350ecbd7dfa4e63ef945c05f4c61cb7f4d3f84cd0bba649b"
6377+
checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
63786378
dependencies = [
63796379
"proc-macro2",
63806380
"quote",

compiler/rustc_codegen_cranelift/Cargo.lock

+58-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ version = 3
44

55
[[package]]
66
name = "ahash"
7-
version = "0.8.3"
7+
version = "0.8.7"
88
source = "registry+https://github.com/rust-lang/crates.io-index"
9-
checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f"
9+
checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01"
1010
dependencies = [
1111
"cfg-if",
1212
"once_cell",
1313
"version_check",
14+
"zerocopy",
1415
]
1516

1617
[[package]]
@@ -293,6 +294,24 @@ version = "1.18.0"
293294
source = "registry+https://github.com/rust-lang/crates.io-index"
294295
checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
295296

297+
[[package]]
298+
name = "proc-macro2"
299+
version = "1.0.75"
300+
source = "registry+https://github.com/rust-lang/crates.io-index"
301+
checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708"
302+
dependencies = [
303+
"unicode-ident",
304+
]
305+
306+
[[package]]
307+
name = "quote"
308+
version = "1.0.35"
309+
source = "registry+https://github.com/rust-lang/crates.io-index"
310+
checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
311+
dependencies = [
312+
"proc-macro2",
313+
]
314+
296315
[[package]]
297316
name = "regalloc2"
298317
version = "0.9.3"
@@ -360,12 +379,29 @@ version = "1.2.0"
360379
source = "registry+https://github.com/rust-lang/crates.io-index"
361380
checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
362381

382+
[[package]]
383+
name = "syn"
384+
version = "2.0.47"
385+
source = "registry+https://github.com/rust-lang/crates.io-index"
386+
checksum = "1726efe18f42ae774cc644f330953a5e7b3c3003d3edcecf18850fe9d4dd9afb"
387+
dependencies = [
388+
"proc-macro2",
389+
"quote",
390+
"unicode-ident",
391+
]
392+
363393
[[package]]
364394
name = "target-lexicon"
365395
version = "0.12.12"
366396
source = "registry+https://github.com/rust-lang/crates.io-index"
367397
checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a"
368398

399+
[[package]]
400+
name = "unicode-ident"
401+
version = "1.0.12"
402+
source = "registry+https://github.com/rust-lang/crates.io-index"
403+
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
404+
369405
[[package]]
370406
name = "version_check"
371407
version = "0.9.4"
@@ -470,3 +506,23 @@ name = "windows_x86_64_msvc"
470506
version = "0.48.5"
471507
source = "registry+https://github.com/rust-lang/crates.io-index"
472508
checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
509+
510+
[[package]]
511+
name = "zerocopy"
512+
version = "0.7.32"
513+
source = "registry+https://github.com/rust-lang/crates.io-index"
514+
checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be"
515+
dependencies = [
516+
"zerocopy-derive",
517+
]
518+
519+
[[package]]
520+
name = "zerocopy-derive"
521+
version = "0.7.32"
522+
source = "registry+https://github.com/rust-lang/crates.io-index"
523+
checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
524+
dependencies = [
525+
"proc-macro2",
526+
"quote",
527+
"syn",
528+
]

compiler/rustc_data_structures/src/sync.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ mod parallel;
5656
pub use parallel::scope;
5757
pub use parallel::{join, par_for_each_in, par_map, parallel_guard, try_par_for_each_in};
5858

59-
pub use std::sync::atomic::Ordering;
60-
pub use std::sync::atomic::Ordering::SeqCst;
61-
6259
pub use vec::{AppendOnlyIndexVec, AppendOnlyVec};
6360

6461
mod vec;
@@ -67,8 +64,7 @@ mod freeze;
6764
pub use freeze::{FreezeLock, FreezeReadGuard, FreezeWriteGuard};
6865

6966
mod mode {
70-
use super::Ordering;
71-
use std::sync::atomic::AtomicU8;
67+
use std::sync::atomic::{AtomicU8, Ordering};
7268

7369
const UNINITIALIZED: u8 = 0;
7470
const DYN_NOT_THREAD_SAFE: u8 = 1;
@@ -113,6 +109,7 @@ cfg_match! {
113109
cfg(not(parallel_compiler)) => {
114110
use std::ops::Add;
115111
use std::cell::Cell;
112+
use std::sync::atomic::Ordering;
116113

117114
pub unsafe auto trait Send {}
118115
pub unsafe auto trait Sync {}

compiler/rustc_driver_impl/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use rustc_codegen_ssa::{traits::CodegenBackend, CodegenErrors, CodegenResults};
2525
use rustc_data_structures::profiling::{
2626
get_resident_set_size, print_time_passes_entry, TimePassesFormat,
2727
};
28-
use rustc_data_structures::sync::SeqCst;
2928
use rustc_errors::registry::{InvalidErrorCode, Registry};
3029
use rustc_errors::{markdown, ColorConfig};
3130
use rustc_errors::{DiagCtxt, ErrorGuaranteed, PResult};
@@ -476,7 +475,7 @@ fn run_compiler(
476475
eprintln!(
477476
"Fuel used by {}: {}",
478477
sess.opts.unstable_opts.print_fuel.as_ref().unwrap(),
479-
sess.print_fuel.load(SeqCst)
478+
sess.print_fuel.load(Ordering::SeqCst)
480479
);
481480
}
482481

compiler/rustc_errors/src/diagnostic_builder.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,7 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
266266
/// Converts the builder to a `Diagnostic` for later emission,
267267
/// unless dcx has disabled such buffering.
268268
pub fn into_diagnostic(mut self) -> Option<(Diagnostic, &'a DiagCtxt)> {
269-
let flags = self.dcx.inner.lock().flags;
270-
if flags.dont_buffer_diagnostics || flags.treat_err_as_bug.is_some() {
269+
if self.dcx.inner.lock().flags.treat_err_as_bug.is_some() {
271270
self.emit();
272271
return None;
273272
}

compiler/rustc_errors/src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -524,9 +524,6 @@ pub struct DiagCtxtFlags {
524524
/// If Some, the Nth error-level diagnostic is upgraded to bug-level.
525525
/// (rustc: see `-Z treat-err-as-bug`)
526526
pub treat_err_as_bug: Option<NonZeroUsize>,
527-
/// If true, immediately emit diagnostics that would otherwise be buffered.
528-
/// (rustc: see `-Z dont-buffer-diagnostics` and `-Z treat-err-as-bug`)
529-
pub dont_buffer_diagnostics: bool,
530527
/// Show macro backtraces.
531528
/// (rustc: see `-Z macro-backtrace`)
532529
pub macro_backtrace: bool,

compiler/rustc_interface/src/tests.rs

-1
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,6 @@ fn test_unstable_options_tracking_hash() {
659659
// tidy-alphabetical-start
660660
untracked!(assert_incr_state, Some(String::from("loaded")));
661661
untracked!(deduplicate_diagnostics, false);
662-
untracked!(dont_buffer_diagnostics, true);
663662
untracked!(dump_dep_graph, true);
664663
untracked!(dump_mir, Some(String::from("abc")));
665664
untracked!(dump_mir_dataflow, true);

compiler/rustc_middle/src/mir/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1316,6 +1316,7 @@ impl<'tcx> BasicBlockData<'tcx> {
13161316
}
13171317

13181318
/// Does the block have no statements and an unreachable terminator?
1319+
#[inline]
13191320
pub fn is_empty_unreachable(&self) -> bool {
13201321
self.statements.is_empty() && matches!(self.terminator().kind, TerminatorKind::Unreachable)
13211322
}

compiler/rustc_mir_transform/src/const_goto.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<'tcx> MirPass<'tcx> for ConstGoto {
5151
// if we applied optimizations, we potentially have some cfg to cleanup to
5252
// make it easier for further passes
5353
if should_simplify {
54-
simplify_cfg(tcx, body);
54+
simplify_cfg(body);
5555
simplify_locals(body, tcx);
5656
}
5757
}

compiler/rustc_mir_transform/src/deduplicate_blocks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl<'tcx> MirPass<'tcx> for DeduplicateBlocks {
2525
if has_opts_to_apply {
2626
let mut opt_applier = OptApplier { tcx, duplicates };
2727
opt_applier.visit_body(body);
28-
simplify_cfg(tcx, body);
28+
simplify_cfg(body);
2929
}
3030
}
3131
}

compiler/rustc_mir_transform/src/early_otherwise_branch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ impl<'tcx> MirPass<'tcx> for EarlyOtherwiseBranch {
212212
// Since this optimization adds new basic blocks and invalidates others,
213213
// clean up the cfg to make it nicer for other passes
214214
if should_cleanup {
215-
simplify_cfg(tcx, body);
215+
simplify_cfg(body);
216216
}
217217
}
218218
}

compiler/rustc_mir_transform/src/inline.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use rustc_target::abi::FieldIdx;
1515
use rustc_target::spec::abi::Abi;
1616

1717
use crate::cost_checker::CostChecker;
18-
use crate::simplify::{remove_dead_blocks, CfgSimplifier};
18+
use crate::simplify::simplify_cfg;
1919
use crate::util;
2020
use std::iter;
2121
use std::ops::{Range, RangeFrom};
@@ -56,8 +56,7 @@ impl<'tcx> MirPass<'tcx> for Inline {
5656
let _guard = span.enter();
5757
if inline(tcx, body) {
5858
debug!("running simplify cfg on {:?}", body.source);
59-
CfgSimplifier::new(body).simplify();
60-
remove_dead_blocks(body);
59+
simplify_cfg(body);
6160
deref_finder(tcx, body);
6261
}
6362
}

compiler/rustc_mir_transform/src/match_branches.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ impl<'tcx> MirPass<'tcx> for MatchBranchSimplification {
174174
}
175175

176176
if should_cleanup {
177-
simplify_cfg(tcx, body);
177+
simplify_cfg(body);
178178
}
179179
}
180180
}

compiler/rustc_mir_transform/src/remove_unneeded_drops.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl<'tcx> MirPass<'tcx> for RemoveUnneededDrops {
3838
// if we applied optimizations, we potentially have some cfg to cleanup to
3939
// make it easier for further passes
4040
if should_simplify {
41-
simplify_cfg(tcx, body);
41+
simplify_cfg(body);
4242
}
4343
}
4444
}

compiler/rustc_mir_transform/src/separate_const_switch.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ impl<'tcx> MirPass<'tcx> for SeparateConstSwitch {
5050
sess.mir_opt_level() >= 2 && sess.opts.unstable_opts.unsound_mir_opts
5151
}
5252

53-
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
53+
fn run_pass(&self, _: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
5454
// If execution did something, applying a simplification layer
5555
// helps later passes optimize the copy away.
5656
if separate_const_switch(body) > 0 {
57-
super::simplify::simplify_cfg(tcx, body);
57+
super::simplify::simplify_cfg(body);
5858
}
5959
}
6060
}

0 commit comments

Comments
 (0)