Skip to content

Commit 2ab744f

Browse files
committed
Auto merge of rust-lang#118655 - compiler-errors:rollup-vrngyzn, r=compiler-errors
Rollup of 9 pull requests Successful merges: - rust-lang#117793 (Update variable name to fix `unused_variables` warning) - rust-lang#118123 (Add support for making lib features internal) - rust-lang#118268 (Pretty print `Fn<(..., ...)>` trait refs with parentheses (almost) always) - rust-lang#118346 (Add `deeply_normalize_for_diagnostics`, use it in coherence) - rust-lang#118350 (Simplify Default for tuples) - rust-lang#118450 (Use OnceCell in cell module documentation) - rust-lang#118585 (Fix parser ICE when recovering `dyn`/`impl` after `for<...>`) - rust-lang#118587 (Cleanup error handlers some more) - rust-lang#118642 (bootstrap(builder.rs): Don't explicitly warn against `semicolon_in_expressions_from_macros`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents d92b735 + 0687c6e commit 2ab744f

File tree

6 files changed

+20
-14
lines changed

6 files changed

+20
-14
lines changed

alloc/tests/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#![feature(thin_box)]
4242
#![feature(strict_provenance)]
4343
#![feature(drain_keep_rest)]
44+
#![allow(internal_features)]
4445
#![deny(fuzzy_provenance_casts)]
4546
#![deny(unsafe_op_in_unsafe_fn)]
4647

core/src/cell.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,17 +143,17 @@
143143
//!
144144
//! ```
145145
//! # #![allow(dead_code)]
146-
//! use std::cell::RefCell;
146+
//! use std::cell::OnceCell;
147147
//!
148148
//! struct Graph {
149149
//! edges: Vec<(i32, i32)>,
150-
//! span_tree_cache: RefCell<Option<Vec<(i32, i32)>>>
150+
//! span_tree_cache: OnceCell<Vec<(i32, i32)>>
151151
//! }
152152
//!
153153
//! impl Graph {
154154
//! fn minimum_spanning_tree(&self) -> Vec<(i32, i32)> {
155-
//! self.span_tree_cache.borrow_mut()
156-
//! .get_or_insert_with(|| self.calc_span_tree())
155+
//! self.span_tree_cache
156+
//! .get_or_init(|| self.calc_span_tree())
157157
//! .clone()
158158
//! }
159159
//!

core/src/intrinsics.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,6 +1906,7 @@ extern "rust-intrinsic" {
19061906
///
19071907
/// ```
19081908
/// #![feature(core_intrinsics)]
1909+
/// # #![allow(internal_features)]
19091910
///
19101911
/// use std::intrinsics::ctlz;
19111912
///
@@ -1918,6 +1919,7 @@ extern "rust-intrinsic" {
19181919
///
19191920
/// ```
19201921
/// #![feature(core_intrinsics)]
1922+
/// # #![allow(internal_features)]
19211923
///
19221924
/// use std::intrinsics::ctlz;
19231925
///
@@ -1939,6 +1941,7 @@ extern "rust-intrinsic" {
19391941
///
19401942
/// ```
19411943
/// #![feature(core_intrinsics)]
1944+
/// # #![allow(internal_features)]
19421945
///
19431946
/// use std::intrinsics::ctlz_nonzero;
19441947
///
@@ -1965,6 +1968,7 @@ extern "rust-intrinsic" {
19651968
///
19661969
/// ```
19671970
/// #![feature(core_intrinsics)]
1971+
/// # #![allow(internal_features)]
19681972
///
19691973
/// use std::intrinsics::cttz;
19701974
///
@@ -1977,6 +1981,7 @@ extern "rust-intrinsic" {
19771981
///
19781982
/// ```
19791983
/// #![feature(core_intrinsics)]
1984+
/// # #![allow(internal_features)]
19801985
///
19811986
/// use std::intrinsics::cttz;
19821987
///
@@ -1998,6 +2003,7 @@ extern "rust-intrinsic" {
19982003
///
19992004
/// ```
20002005
/// #![feature(core_intrinsics)]
2006+
/// # #![allow(internal_features)]
20012007
///
20022008
/// use std::intrinsics::cttz_nonzero;
20032009
///
@@ -2463,6 +2469,7 @@ extern "rust-intrinsic" {
24632469
/// ```no_run
24642470
/// #![feature(const_eval_select)]
24652471
/// #![feature(core_intrinsics)]
2472+
/// # #![allow(internal_features)]
24662473
/// use std::hint::unreachable_unchecked;
24672474
/// use std::intrinsics::const_eval_select;
24682475
///

core/src/tuple.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,19 @@ macro_rules! tuple_impls {
5050
maybe_tuple_doc! {
5151
$($T)+ @
5252
#[unstable(feature = "structural_match", issue = "31434")]
53-
impl<$($T: ConstParamTy),+> ConstParamTy for ($($T,)+)
54-
{}
53+
impl<$($T: ConstParamTy),+> ConstParamTy for ($($T,)+) {}
5554
}
5655

5756
maybe_tuple_doc! {
5857
$($T)+ @
5958
#[unstable(feature = "structural_match", issue = "31434")]
60-
impl<$($T),+> StructuralPartialEq for ($($T,)+)
61-
{}
59+
impl<$($T),+> StructuralPartialEq for ($($T,)+) {}
6260
}
6361

6462
maybe_tuple_doc! {
6563
$($T)+ @
6664
#[unstable(feature = "structural_match", issue = "31434")]
67-
impl<$($T),+> StructuralEq for ($($T,)+)
68-
{}
65+
impl<$($T),+> StructuralEq for ($($T,)+) {}
6966
}
7067

7168
maybe_tuple_doc! {
@@ -118,7 +115,7 @@ macro_rules! tuple_impls {
118115
impl<$($T: Default),+> Default for ($($T,)+) {
119116
#[inline]
120117
fn default() -> ($($T,)+) {
121-
($({ let x: $T = Default::default(); x},)+)
118+
($($T::default(),)+)
122119
}
123120
}
124121
}
@@ -196,7 +193,7 @@ macro_rules! lexical_partial_cmp {
196193
($a:expr, $b:expr, $($rest_a:expr, $rest_b:expr),+) => {
197194
match ($a).partial_cmp(&$b) {
198195
Some(Equal) => lexical_partial_cmp!($($rest_a, $rest_b),+),
199-
ordering => ordering
196+
ordering => ordering
200197
}
201198
};
202199
($a:expr, $b:expr) => { ($a).partial_cmp(&$b) };
@@ -206,7 +203,7 @@ macro_rules! lexical_cmp {
206203
($a:expr, $b:expr, $($rest_a:expr, $rest_b:expr),+) => {
207204
match ($a).cmp(&$b) {
208205
Equal => lexical_cmp!($($rest_a, $rest_b),+),
209-
ordering => ordering
206+
ordering => ordering
210207
}
211208
};
212209
($a:expr, $b:expr) => { ($a).cmp(&$b) };

core/tests/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
#![feature(get_many_mut)]
118118
#![feature(offset_of)]
119119
#![feature(iter_map_windows)]
120+
#![allow(internal_features)]
120121
#![deny(unsafe_op_in_unsafe_fn)]
121122
#![deny(fuzzy_provenance_casts)]
122123

std/src/sys/unix/os.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ pub fn getcwd() -> io::Result<PathBuf> {
180180
}
181181

182182
#[cfg(target_os = "espidf")]
183-
pub fn chdir(p: &path::Path) -> io::Result<()> {
183+
pub fn chdir(_p: &path::Path) -> io::Result<()> {
184184
super::unsupported::unsupported()
185185
}
186186

0 commit comments

Comments
 (0)