Skip to content

Commit 7d3e036

Browse files
committed
Auto merge of #96720 - JohnTitor:rollup-9jaaekr, r=JohnTitor
Rollup of 7 pull requests Successful merges: - #96603 (Enable full revision in const generics ui tests) - #96616 (Relax memory ordering used in `min_stack`) - #96619 (Relax memory ordering used in SameMutexCheck) - #96628 (Stabilize `bool::then_some`) - #96658 (Move callback to the () => {} syntax.) - #96677 (Add more tests for label-break-value) - #96697 (Enable tracing for all queries) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents bdcb6a9 + ade1232 commit 7d3e036

File tree

47 files changed

+625
-214
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

+625
-214
lines changed

Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -4245,6 +4245,7 @@ dependencies = [
42454245
"rustc_serialize",
42464246
"rustc_session",
42474247
"rustc_span",
4248+
"tracing",
42484249
]
42494250

42504251
[[package]]

compiler/rustc_ast_pretty/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(bool_to_option)]
21
#![feature(crate_visibility_modifier)]
32
#![feature(box_patterns)]
43
#![recursion_limit = "256"]

compiler/rustc_borrowck/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! This query borrow-checks the MIR to (further) ensure it is not broken.
22
33
#![allow(rustc::potential_query_instability)]
4-
#![feature(bool_to_option)]
54
#![feature(box_patterns)]
65
#![feature(crate_visibility_modifier)]
76
#![feature(let_chains)]

compiler/rustc_builtin_macros/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
55
#![feature(array_windows)]
66
#![feature(box_patterns)]
7-
#![feature(bool_to_option)]
87
#![feature(crate_visibility_modifier)]
98
#![feature(decl_macro)]
109
#![feature(is_sorted)]

compiler/rustc_codegen_llvm/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//! This API is completely unstable and subject to change.
66
77
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
8-
#![feature(bool_to_option)]
98
#![feature(crate_visibility_modifier)]
109
#![feature(let_chains)]
1110
#![feature(let_else)]

compiler/rustc_codegen_ssa/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
2-
#![feature(bool_to_option)]
32
#![feature(box_patterns)]
43
#![feature(try_blocks)]
54
#![feature(let_else)]

compiler/rustc_const_eval/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Rust MIR: a lowered representation of Rust.
55
*/
66

77
#![feature(assert_matches)]
8-
#![feature(bool_to_option)]
98
#![feature(box_patterns)]
109
#![feature(control_flow_enum)]
1110
#![feature(crate_visibility_modifier)]

compiler/rustc_data_structures/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#![feature(array_windows)]
1111
#![feature(associated_type_bounds)]
1212
#![feature(auto_traits)]
13-
#![feature(bool_to_option)]
1413
#![feature(control_flow_enum)]
1514
#![feature(core_intrinsics)]
1615
#![feature(extend_one)]

compiler/rustc_infer/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
1515
#![allow(rustc::potential_query_instability)]
1616
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
17-
#![feature(bool_to_option)]
1817
#![feature(box_patterns)]
1918
#![feature(control_flow_enum)]
2019
#![cfg_attr(bootstrap, feature(derive_default_enum))]

compiler/rustc_interface/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(bool_to_option)]
21
#![feature(box_patterns)]
32
#![feature(let_else)]
43
#![feature(internal_output_capture)]

compiler/rustc_lint/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#![allow(rustc::potential_query_instability)]
2929
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
3030
#![feature(array_windows)]
31-
#![feature(bool_to_option)]
3231
#![feature(box_patterns)]
3332
#![feature(control_flow_enum)]
3433
#![feature(crate_visibility_modifier)]

compiler/rustc_middle/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#![feature(array_windows)]
2828
#![feature(assert_matches)]
2929
#![feature(backtrace)]
30-
#![feature(bool_to_option)]
3130
#![feature(box_patterns)]
3231
#![feature(core_intrinsics)]
3332
#![cfg_attr(bootstrap, feature(derive_default_enum))]

compiler/rustc_mir_build/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
//!
33
//! This crate also contains the match exhaustiveness and usefulness checking.
44
#![allow(rustc::potential_query_instability)]
5-
#![feature(bool_to_option)]
65
#![feature(box_patterns)]
76
#![feature(control_flow_enum)]
87
#![feature(crate_visibility_modifier)]

compiler/rustc_mir_dataflow/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(associated_type_defaults)]
2-
#![feature(bool_to_option)]
32
#![feature(box_patterns)]
43
#![feature(box_syntax)]
54
#![feature(exact_size_is_empty)]

compiler/rustc_monomorphize/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(array_windows)]
2-
#![feature(bool_to_option)]
32
#![feature(crate_visibility_modifier)]
43
#![feature(control_flow_enum)]
54
#![feature(let_else)]

compiler/rustc_query_impl/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ rustc_query_system = { path = "../rustc_query_system" }
2020
rustc_serialize = { path = "../rustc_serialize" }
2121
rustc_session = { path = "../rustc_session" }
2222
rustc_span = { path = "../rustc_span" }
23+
tracing = "0.1"
2324

2425
[features]
2526
rustc_use_parallel_compiler = ["rustc-rayon-core", "rustc_query_system/rustc_use_parallel_compiler"]

compiler/rustc_query_impl/src/plumbing.rs

+3
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,8 @@ macro_rules! define_queries {
435435

436436
fn force_from_dep_node(tcx: TyCtxt<'_>, dep_node: DepNode) -> bool {
437437
if let Some(key) = recover(tcx, dep_node) {
438+
#[cfg(debug_assertions)]
439+
let _guard = tracing::span!(tracing::Level::TRACE, stringify!($name), ?key).entered();
438440
let tcx = QueryCtxt::from_tcx(tcx);
439441
force_query::<queries::$name<'_>, _>(tcx, key, dep_node);
440442
true
@@ -532,6 +534,7 @@ macro_rules! define_queries_struct {
532534

533535
$($(#[$attr])*
534536
#[inline(always)]
537+
#[tracing::instrument(level = "trace", skip(self, tcx))]
535538
fn $name(
536539
&'tcx self,
537540
tcx: TyCtxt<$tcx>,

compiler/rustc_query_system/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(assert_matches)]
2-
#![feature(bool_to_option)]
32
#![feature(core_intrinsics)]
43
#![feature(hash_raw_entry)]
54
#![feature(let_else)]

compiler/rustc_query_system/src/query/plumbing.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,7 @@ where
675675
}
676676
}
677677

678+
#[derive(Debug)]
678679
pub enum QueryMode {
679680
Get,
680681
Ensure,
@@ -697,7 +698,6 @@ where
697698
None
698699
};
699700

700-
debug!("ty::query::get_query<{}>(key={:?}, span={:?})", Q::NAME, key, span);
701701
let (result, dep_node_index) = try_execute_query(
702702
tcx,
703703
Q::query_state(tcx),

compiler/rustc_resolve/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
1010
#![feature(box_patterns)]
1111
#![feature(drain_filter)]
12-
#![feature(bool_to_option)]
1312
#![feature(crate_visibility_modifier)]
1413
#![feature(if_let_guard)]
1514
#![feature(let_chains)]

compiler/rustc_span/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
1616
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
1717
#![feature(array_windows)]
18-
#![feature(bool_to_option)]
1918
#![feature(crate_visibility_modifier)]
2019
#![feature(let_else)]
2120
#![feature(if_let_guard)]

compiler/rustc_target/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
1010
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
1111
#![feature(associated_type_bounds)]
12-
#![feature(bool_to_option)]
1312
#![feature(exhaustive_patterns)]
1413
#![feature(let_else)]
1514
#![feature(min_specialization)]

compiler/rustc_trait_selection/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
1313
#![allow(rustc::potential_query_instability)]
1414
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
15-
#![feature(bool_to_option)]
1615
#![feature(box_patterns)]
1716
#![feature(control_flow_enum)]
1817
#![feature(crate_visibility_modifier)]

compiler/rustc_typeck/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ This API is completely unstable and subject to change.
5757

5858
#![allow(rustc::potential_query_instability)]
5959
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
60-
#![feature(bool_to_option)]
6160
#![feature(box_patterns)]
6261
#![feature(control_flow_enum)]
6362
#![feature(crate_visibility_modifier)]

library/core/src/bool.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ impl bool {
99
/// # Examples
1010
///
1111
/// ```
12-
/// #![feature(bool_to_option)]
13-
///
1412
/// assert_eq!(false.then_some(0), None);
1513
/// assert_eq!(true.then_some(0), Some(0));
1614
/// ```
17-
#[unstable(feature = "bool_to_option", issue = "80967")]
15+
#[stable(feature = "bool_to_option", since = "1.62.0")]
1816
#[rustc_const_unstable(feature = "const_bool_to_option", issue = "91917")]
1917
#[inline]
2018
pub const fn then_some<T>(self, t: T) -> Option<T>

library/core/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#![feature(array_methods)]
44
#![feature(array_windows)]
55
#![feature(bench_black_box)]
6-
#![feature(bool_to_option)]
76
#![feature(box_syntax)]
87
#![feature(cell_update)]
98
#![feature(const_assume)]

library/std/src/sys_common/condvar/check.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,14 @@ impl SameMutexCheck {
2424
}
2525
pub fn verify(&self, mutex: &MovableMutex) {
2626
let addr = mutex.raw() as *const imp::Mutex as *const () as *mut _;
27-
match self.addr.compare_exchange(ptr::null_mut(), addr, Ordering::SeqCst, Ordering::SeqCst)
28-
{
27+
// Relaxed is okay here because we never read through `self.addr`, and only use it to
28+
// compare addresses.
29+
match self.addr.compare_exchange(
30+
ptr::null_mut(),
31+
addr,
32+
Ordering::Relaxed,
33+
Ordering::Relaxed,
34+
) {
2935
Ok(_) => {} // Stored the address
3036
Err(n) if n == addr => {} // Lost a race to store the same address
3137
_ => panic!("attempted to use a condition variable with two mutexes"),

library/std/src/sys_common/thread.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::sys::thread as imp;
44

55
pub fn min_stack() -> usize {
66
static MIN: atomic::AtomicUsize = atomic::AtomicUsize::new(0);
7-
match MIN.load(Ordering::SeqCst) {
7+
match MIN.load(Ordering::Relaxed) {
88
0 => {}
99
n => return n - 1,
1010
}
@@ -13,6 +13,6 @@ pub fn min_stack() -> usize {
1313

1414
// 0 is our sentinel value, so ensure that we'll never see 0 after
1515
// initialization has run
16-
MIN.store(amt + 1, Ordering::SeqCst);
16+
MIN.store(amt + 1, Ordering::Relaxed);
1717
amt
1818
}

0 commit comments

Comments
 (0)