Skip to content

Rollup of 12 pull requests #145003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Aug 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ec40ee4
Add documentation for unstable_feature_bound
tiif Jul 30, 2025
712c28e
Remove space
tiif Jul 30, 2025
1eb9b13
Change visibility of Args new function
chotchki Aug 2, 2025
b4f404b
Fix wrong font being used for tooltips `i` icons
GuillaumeGomez Aug 4, 2025
2260749
Add GUI regression test for tooltips `i` icons
GuillaumeGomez Aug 4, 2025
81081f4
compiletest: add hint for when a ui test produces no errors
lolbinarycat Aug 4, 2025
b3317dd
Correct the use of `must_use` on btree::IterMut
JonathanBrouwer Aug 4, 2025
7196d8c
Rehome tests/ui/issues/ tests [3/?]
Oneirical Jul 13, 2025
81edf2b
Drop `rust-version` from `rustc_thread_pool`
cuviper Aug 4, 2025
df61951
autolabel PRs that change etc tests as `F-explicit_tail_calls`
WaffleLapkin Aug 5, 2025
3e764d0
Add regression tests for seemingly fixed issues
ShoyuVanilla Aug 4, 2025
eee6f80
Renamed `isolate_most_least_significant_one` functions
okaneco Aug 5, 2025
2cd5b49
Fix some doc links for intrinsics
ehuss Aug 6, 2025
f96fbb2
run-make: Allow blessing snapshot files that don't exist yet
Zalathar Aug 5, 2025
e89ae47
Rollup merge of #144552 - Oneirical:uncountable-integer-3, r=jieyouxu
Kobzol Aug 6, 2025
21e488c
Rollup merge of #144676 - tiif:dev_guide_unstable_bound, r=BoxyUwU
Kobzol Aug 6, 2025
bde39e5
Rollup merge of #144836 - chotchki:patch-1, r=tgross35
Kobzol Aug 6, 2025
0700713
Rollup merge of #144910 - ShoyuVanilla:add-regression-tests, r=fee1-dead
Kobzol Aug 6, 2025
4b6971e
Rollup merge of #144913 - GuillaumeGomez:fix-wrong-i-icon, r=fmease
Kobzol Aug 6, 2025
5ac0856
Rollup merge of #144924 - lolbinarycat:compiletest-pass-directives-hi…
Kobzol Aug 6, 2025
6afd162
Rollup merge of #144926 - JonathanBrouwer:fix-mustuse, r=cuviper
Kobzol Aug 6, 2025
d54fb83
Rollup merge of #144928 - cuviper:rustc_thread_pool-msrv, r=lqd
Kobzol Aug 6, 2025
07e8634
Rollup merge of #144945 - WaffleLapkin:autolabeletc, r=WaffleLapkin
Kobzol Aug 6, 2025
a88e29b
Rollup merge of #144954 - Zalathar:run-make-bless, r=jieyouxu
Kobzol Aug 6, 2025
84dc97c
Rollup merge of #144971 - okaneco:rename_isolate_ones, r=joshtriplett
Kobzol Aug 6, 2025
66f0f27
Rollup merge of #144978 - ehuss:intrinsic-doc-links, r=scottmcm
Kobzol Aug 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion compiler/rustc_thread_pool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ authors = [
]
description = "Core APIs for Rayon - fork for rustc"
license = "MIT OR Apache-2.0"
rust-version = "1.63"
edition = "2021"
readme = "README.md"
keywords = ["parallel", "thread", "concurrency", "join", "performance"]
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/collections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ impl<'a, K: 'a, V: 'a> Default for Iter<'a, K, V> {
/// documentation for more.
///
/// [`iter_mut`]: BTreeMap::iter_mut
#[must_use = "iterators are lazy and do nothing unless consumed"]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct IterMut<'a, K: 'a, V: 'a> {
range: LazyLeafRange<marker::ValMut<'a>, K, V>,
Expand All @@ -391,7 +392,6 @@ pub struct IterMut<'a, K: 'a, V: 'a> {
_marker: PhantomData<&'a mut (K, V)>,
}

#[must_use = "iterators are lazy and do nothing unless consumed"]
#[stable(feature = "collection_debug", since = "1.17.0")]
impl<K: fmt::Debug, V: fmt::Debug> fmt::Debug for IterMut<'_, K, V> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down
8 changes: 4 additions & 4 deletions library/core/src/intrinsics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2667,7 +2667,7 @@ pub unsafe fn vtable_align(ptr: *const ()) -> usize;
/// More specifically, this is the offset in bytes between successive
/// items of the same type, including alignment padding.
///
/// The stabilized version of this intrinsic is [`size_of`].
/// The stabilized version of this intrinsic is [`core::mem::size_of`].
#[rustc_nounwind]
#[unstable(feature = "core_intrinsics", issue = "none")]
#[rustc_intrinsic_const_stable_indirect]
Expand All @@ -2681,7 +2681,7 @@ pub const fn size_of<T>() -> usize;
/// Therefore, implementations must not require the user to uphold
/// any safety invariants.
///
/// The stabilized version of this intrinsic is [`align_of`].
/// The stabilized version of this intrinsic is [`core::mem::align_of`].
#[rustc_nounwind]
#[unstable(feature = "core_intrinsics", issue = "none")]
#[rustc_intrinsic_const_stable_indirect]
Expand All @@ -2704,7 +2704,7 @@ pub const fn variant_count<T>() -> usize;

/// The size of the referenced value in bytes.
///
/// The stabilized version of this intrinsic is [`size_of_val`].
/// The stabilized version of this intrinsic is [`core::mem::size_of_val`].
///
/// # Safety
///
Expand All @@ -2717,7 +2717,7 @@ pub const unsafe fn size_of_val<T: ?Sized>(ptr: *const T) -> usize;

/// The required alignment of the referenced value.
///
/// The stabilized version of this intrinsic is [`align_of_val`].
/// The stabilized version of this intrinsic is [`core::mem::align_of_val`].
///
/// # Safety
///
Expand Down
12 changes: 6 additions & 6 deletions library/core/src/num/int_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,14 @@ macro_rules! int_impl {
///
#[doc = concat!("let n: ", stringify!($SelfT), " = 0b_01100100;")]
///
/// assert_eq!(n.isolate_most_significant_one(), 0b_01000000);
#[doc = concat!("assert_eq!(0_", stringify!($SelfT), ".isolate_most_significant_one(), 0);")]
/// assert_eq!(n.isolate_highest_one(), 0b_01000000);
#[doc = concat!("assert_eq!(0_", stringify!($SelfT), ".isolate_highest_one(), 0);")]
/// ```
#[unstable(feature = "isolate_most_least_significant_one", issue = "136909")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline(always)]
pub const fn isolate_most_significant_one(self) -> Self {
pub const fn isolate_highest_one(self) -> Self {
self & (((1 as $SelfT) << (<$SelfT>::BITS - 1)).wrapping_shr(self.leading_zeros()))
}

Expand All @@ -198,14 +198,14 @@ macro_rules! int_impl {
///
#[doc = concat!("let n: ", stringify!($SelfT), " = 0b_01100100;")]
///
/// assert_eq!(n.isolate_least_significant_one(), 0b_00000100);
#[doc = concat!("assert_eq!(0_", stringify!($SelfT), ".isolate_least_significant_one(), 0);")]
/// assert_eq!(n.isolate_lowest_one(), 0b_00000100);
#[doc = concat!("assert_eq!(0_", stringify!($SelfT), ".isolate_lowest_one(), 0);")]
/// ```
#[unstable(feature = "isolate_most_least_significant_one", issue = "136909")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline(always)]
pub const fn isolate_least_significant_one(self) -> Self {
pub const fn isolate_lowest_one(self) -> Self {
self & self.wrapping_neg()
}

Expand Down
8 changes: 4 additions & 4 deletions library/core/src/num/nonzero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,15 +629,15 @@ macro_rules! nonzero_integer {
#[doc = concat!("let a = NonZero::<", stringify!($Int), ">::new(0b_01100100)?;")]
#[doc = concat!("let b = NonZero::<", stringify!($Int), ">::new(0b_01000000)?;")]
///
/// assert_eq!(a.isolate_most_significant_one(), b);
/// assert_eq!(a.isolate_highest_one(), b);
/// # Some(())
/// # }
/// ```
#[unstable(feature = "isolate_most_least_significant_one", issue = "136909")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline(always)]
pub const fn isolate_most_significant_one(self) -> Self {
pub const fn isolate_highest_one(self) -> Self {
let n = self.get() & (((1 as $Int) << (<$Int>::BITS - 1)).wrapping_shr(self.leading_zeros()));

// SAFETY:
Expand All @@ -659,15 +659,15 @@ macro_rules! nonzero_integer {
#[doc = concat!("let a = NonZero::<", stringify!($Int), ">::new(0b_01100100)?;")]
#[doc = concat!("let b = NonZero::<", stringify!($Int), ">::new(0b_00000100)?;")]
///
/// assert_eq!(a.isolate_least_significant_one(), b);
/// assert_eq!(a.isolate_lowest_one(), b);
/// # Some(())
/// # }
/// ```
#[unstable(feature = "isolate_most_least_significant_one", issue = "136909")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline(always)]
pub const fn isolate_least_significant_one(self) -> Self {
pub const fn isolate_lowest_one(self) -> Self {
let n = self.get();
let n = n & n.wrapping_neg();

Expand Down
12 changes: 6 additions & 6 deletions library/core/src/num/uint_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,14 @@ macro_rules! uint_impl {
///
#[doc = concat!("let n: ", stringify!($SelfT), " = 0b_01100100;")]
///
/// assert_eq!(n.isolate_most_significant_one(), 0b_01000000);
#[doc = concat!("assert_eq!(0_", stringify!($SelfT), ".isolate_most_significant_one(), 0);")]
/// assert_eq!(n.isolate_highest_one(), 0b_01000000);
#[doc = concat!("assert_eq!(0_", stringify!($SelfT), ".isolate_highest_one(), 0);")]
/// ```
#[unstable(feature = "isolate_most_least_significant_one", issue = "136909")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline(always)]
pub const fn isolate_most_significant_one(self) -> Self {
pub const fn isolate_highest_one(self) -> Self {
self & (((1 as $SelfT) << (<$SelfT>::BITS - 1)).wrapping_shr(self.leading_zeros()))
}

Expand All @@ -250,14 +250,14 @@ macro_rules! uint_impl {
///
#[doc = concat!("let n: ", stringify!($SelfT), " = 0b_01100100;")]
///
/// assert_eq!(n.isolate_least_significant_one(), 0b_00000100);
#[doc = concat!("assert_eq!(0_", stringify!($SelfT), ".isolate_least_significant_one(), 0);")]
/// assert_eq!(n.isolate_lowest_one(), 0b_00000100);
#[doc = concat!("assert_eq!(0_", stringify!($SelfT), ".isolate_lowest_one(), 0);")]
/// ```
#[unstable(feature = "isolate_most_least_significant_one", issue = "136909")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline(always)]
pub const fn isolate_least_significant_one(self) -> Self {
pub const fn isolate_lowest_one(self) -> Self {
self & self.wrapping_neg()
}

Expand Down
20 changes: 10 additions & 10 deletions library/coretests/tests/nonzero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ fn nonzero_trailing_zeros() {
}

#[test]
fn test_nonzero_isolate_most_significant_one() {
fn test_nonzero_isolate_highest_one() {
// Signed most significant one
macro_rules! nonzero_int_impl {
($($T:ty),+) => {
Expand All @@ -335,8 +335,8 @@ fn test_nonzero_isolate_most_significant_one() {
let mut i = 0;
while i < <$T>::BITS {
assert_eq!(
NonZero::<$T>::new(BITS >> i).unwrap().isolate_most_significant_one(),
NonZero::<$T>::new(MOST_SIG_ONE >> i).unwrap().isolate_most_significant_one()
NonZero::<$T>::new(BITS >> i).unwrap().isolate_highest_one(),
NonZero::<$T>::new(MOST_SIG_ONE >> i).unwrap().isolate_highest_one()
);
i += 1;
}
Expand All @@ -356,8 +356,8 @@ fn test_nonzero_isolate_most_significant_one() {
let mut i = 0;
while i < <$T>::BITS {
assert_eq!(
NonZero::<$T>::new(BITS >> i).unwrap().isolate_most_significant_one(),
NonZero::<$T>::new(MOST_SIG_ONE >> i).unwrap().isolate_most_significant_one(),
NonZero::<$T>::new(BITS >> i).unwrap().isolate_highest_one(),
NonZero::<$T>::new(MOST_SIG_ONE >> i).unwrap().isolate_highest_one(),
);
i += 1;
}
Expand All @@ -371,7 +371,7 @@ fn test_nonzero_isolate_most_significant_one() {
}

#[test]
fn test_nonzero_isolate_least_significant_one() {
fn test_nonzero_isolate_lowest_one() {
// Signed least significant one
macro_rules! nonzero_int_impl {
($($T:ty),+) => {
Expand All @@ -385,8 +385,8 @@ fn test_nonzero_isolate_least_significant_one() {
let mut i = 0;
while i < <$T>::BITS {
assert_eq!(
NonZero::<$T>::new(BITS << i).unwrap().isolate_least_significant_one(),
NonZero::<$T>::new(LEAST_SIG_ONE << i).unwrap().isolate_least_significant_one()
NonZero::<$T>::new(BITS << i).unwrap().isolate_lowest_one(),
NonZero::<$T>::new(LEAST_SIG_ONE << i).unwrap().isolate_lowest_one()
);
i += 1;
}
Expand All @@ -406,8 +406,8 @@ fn test_nonzero_isolate_least_significant_one() {
let mut i = 0;
while i < <$T>::BITS {
assert_eq!(
NonZero::<$T>::new(BITS << i).unwrap().isolate_least_significant_one(),
NonZero::<$T>::new(LEAST_SIG_ONE << i).unwrap().isolate_least_significant_one(),
NonZero::<$T>::new(BITS << i).unwrap().isolate_lowest_one(),
NonZero::<$T>::new(LEAST_SIG_ONE << i).unwrap().isolate_lowest_one(),
);
i += 1;
}
Expand Down
12 changes: 6 additions & 6 deletions library/coretests/tests/num/int_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ macro_rules! int_module {
}

#[test]
fn test_isolate_most_significant_one() {
fn test_isolate_highest_one() {
const BITS: $T = -1;
const MOST_SIG_ONE: $T = 1 << (<$T>::BITS - 1);

Expand All @@ -203,15 +203,15 @@ macro_rules! int_module {
let mut i = 0;
while i < <$T>::BITS {
assert_eq!(
(BITS >> i).isolate_most_significant_one(),
(MOST_SIG_ONE >> i).isolate_most_significant_one()
(BITS >> i).isolate_highest_one(),
(MOST_SIG_ONE >> i).isolate_highest_one()
);
i += 1;
}
}

#[test]
fn test_isolate_least_significant_one() {
fn test_isolate_lowest_one() {
const BITS: $T = -1;
const LEAST_SIG_ONE: $T = 1;

Expand All @@ -220,8 +220,8 @@ macro_rules! int_module {
let mut i = 0;
while i < <$T>::BITS {
assert_eq!(
(BITS << i).isolate_least_significant_one(),
(LEAST_SIG_ONE << i).isolate_least_significant_one()
(BITS << i).isolate_lowest_one(),
(LEAST_SIG_ONE << i).isolate_lowest_one()
);
i += 1;
}
Expand Down
12 changes: 6 additions & 6 deletions library/coretests/tests/num/uint_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ macro_rules! uint_module {
}

#[test]
fn test_isolate_most_significant_one() {
fn test_isolate_highest_one() {
const BITS: $T = <$T>::MAX;
const MOST_SIG_ONE: $T = 1 << (<$T>::BITS - 1);

Expand All @@ -160,15 +160,15 @@ macro_rules! uint_module {
let mut i = 0;
while i < <$T>::BITS {
assert_eq!(
(BITS >> i).isolate_most_significant_one(),
(MOST_SIG_ONE >> i).isolate_most_significant_one(),
(BITS >> i).isolate_highest_one(),
(MOST_SIG_ONE >> i).isolate_highest_one(),
);
i += 1;
}
}

#[test]
fn test_isolate_least_significant_one() {
fn test_isolate_lowest_one() {
const BITS: $T = <$T>::MAX;
const LEAST_SIG_ONE: $T = 1;

Expand All @@ -177,8 +177,8 @@ macro_rules! uint_module {
let mut i = 0;
while i < <$T>::BITS {
assert_eq!(
(BITS << i).isolate_least_significant_one(),
(LEAST_SIG_ONE << i).isolate_least_significant_one(),
(BITS << i).isolate_lowest_one(),
(LEAST_SIG_ONE << i).isolate_lowest_one(),
);
i += 1;
}
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/args/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ impl !Sync for Args {}

impl Args {
#[inline]
pub(super) fn new(args: Vec<OsString>) -> Self {
pub fn new(args: Vec<OsString>) -> Self {
Args { iter: args.into_iter() }
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/doc/rustc-dev-guide/src/stability.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,7 @@ the `deprecated_in_future` lint is triggered which is default `allow`, but most
of the standard library raises it to a warning with
`#![warn(deprecated_in_future)]`.

## unstable_feature_bound
The `#[unstable_feature_bound(foo)]` attribute can be used together with `#[unstable]` attribute to mark an `impl` of stable type and stable trait as unstable. In std/core, an item annotated with `#[unstable_feature_bound(foo)]` can only be used by another item that is also annotated with `#[unstable_feature_bound(foo)]`. Outside of std/core, using an item with `#[unstable_feature_bound(foo)]` requires the feature to be enabled with `#![feature(foo)]` attribute on the crate. Currently, only `impl`s and free functions can be annotated with `#[unstable_feature_bound]`.

[blog]: https://www.ralfj.de/blog/2018/07/19/const.html
4 changes: 4 additions & 0 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1838,6 +1838,10 @@ instead, we check that it's not a "finger" cursor.
border-right: 3px solid var(--target-border-color);
}

a.tooltip {
font-family: var(--font-family);
}

.code-header a.tooltip {
color: inherit;
margin-right: 15px;
Expand Down
2 changes: 1 addition & 1 deletion src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ impl<'test> TestCx<'test> {
if proc_res.status.success() {
let err = &format!("{} test did not emit an error", self.config.mode);
let extra_note = (self.config.mode == crate::common::TestMode::Ui)
.then_some("note: by default, ui tests are expected not to compile");
.then_some("note: by default, ui tests are expected not to compile.\nhint: use check-pass, build-pass, or run-pass directive to change this behavior.");
self.fatal_proc_rec_general(err, extra_note, proc_res, || ());
}

Expand Down
11 changes: 10 additions & 1 deletion src/tools/run-make-support/src/diff/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub struct Diff {
actual: Option<String>,
actual_name: Option<String>,
normalizers: Vec<(String, String)>,
bless_dir: Option<String>,
drop_bomb: DropBomb,
}

Expand All @@ -37,13 +38,21 @@ impl Diff {
actual: None,
actual_name: None,
normalizers: Vec::new(),
bless_dir: std::env::var("RUSTC_BLESS_TEST").ok(),
drop_bomb: DropBomb::arm("diff"),
}
}

/// Specify the expected output for the diff from a file.
pub fn expected_file<P: AsRef<Path>>(&mut self, path: P) -> &mut Self {
let path = path.as_ref();
// In `--bless` mode, create the snapshot file if it doesn't already exist.
// The empty file will be overwritten with the actual text.
if self.bless_dir.is_some()
&& let Ok(false) = std::fs::exists(path)
{
fs::write(path, "");
}
let content = fs::read_to_string(path);
let name = path.to_string_lossy().to_string();

Expand Down Expand Up @@ -148,7 +157,7 @@ impl Diff {
let Some(ref expected_file) = self.expected_file else {
return false;
};
let Ok(bless_dir) = std::env::var("RUSTC_BLESS_TEST") else {
let Some(ref bless_dir) = self.bless_dir else {
return false;
};

Expand Down
4 changes: 2 additions & 2 deletions tests/rustdoc-gui/notable-trait.goml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ define-function: (
[x, i_x],
block {
// Checking they have the same y position.
compare-elements-position: (
compare-elements-position-near: (
"//*[@id='method.create_an_iterator_from_read']//a[normalize-space()='NotableStructWithLongName']",
"//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']",
["y"],
{"y": 1},
)
// Checking they don't have the same x position.
compare-elements-position-false: (
Expand Down
Loading
Loading