Skip to content

Rollup of 12 pull requests #143867

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 34 commits into from
Jul 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
0748462
std: move NuttX to use arc4random for random number generation
no1wudi Jul 11, 2025
7ad30cc
Some const_trait_impl test cleanups
oli-obk Jul 11, 2025
120c9fc
Disambiguate between rustc vs std having debug assertions
jieyouxu Jul 11, 2025
33e6962
Fix std debug assertions gate in `fmt-write-boat`
jieyouxu Jul 11, 2025
1a28fb8
Update sysinfo version to `0.36.0`
GuillaumeGomez Jul 11, 2025
2f05fa6
Fix ICE for parsed attributes with longer path not handled by CheckAt…
JonathanBrouwer Jul 11, 2025
cdbe44d
Use short command method directly from fingerprint
Shourya742 Jul 11, 2025
0c81bf8
fix PartialEq const feature name and const_cmp tracking issue
RalfJung Jul 11, 2025
b94083e
fix const_ops tracking issue
RalfJung Jul 11, 2025
d004abb
remove format short command and push format short command method insi…
Shourya742 Jul 11, 2025
507fd38
htmldocck: better error messages for negative raw directives
lolbinarycat Jul 11, 2025
0528cc9
Access `wasi_sdk_path` instead of reading environment variable in boo…
Kobzol Jul 11, 2025
b0e4c35
./x test miri: fix cleaning the miri_ui directory
RalfJung Jul 12, 2025
33668c1
Remove outdated debugger version warning
jieyouxu Jul 5, 2025
832b627
Move `string_enum` to `util` module
jieyouxu Jul 12, 2025
b4dfd51
Do not allow defaults for `Mode` and `Config`
jieyouxu Jul 12, 2025
4aad9ab
Rename `Mode` to `TestMode`
jieyouxu Jul 12, 2025
b9ae117
Do not glob-reexport `TestMode` variants
jieyouxu Jul 12, 2025
6f8a7f0
Make rustdoc-gui-test dummy compiletest config purpose explicit
jieyouxu Jul 12, 2025
8011058
Make it clearer which key-values belong to which autolabel
jieyouxu Jul 12, 2025
869c0e7
Hoist the more "special" autolabels to the start of the section
jieyouxu Jul 12, 2025
977e7d4
Label clippy changes with `T-clippy` team label
jieyouxu Jul 12, 2025
5d56459
Rollup merge of #143776 - no1wudi:fix, r=tgross35
fmease Jul 13, 2025
59859b8
Rollup merge of #143778 - oli-obk:const-cleanup, r=fee1-dead
fmease Jul 13, 2025
3cd37df
Rollup merge of #143782 - jieyouxu:debug-assertions, r=ChrisDenton
fmease Jul 13, 2025
8719acd
Rollup merge of #143791 - GuillaumeGomez:update-sysinfo, r=jieyouxu
fmease Jul 13, 2025
b0e559a
Rollup merge of #143796 - JonathanBrouwer:fix-builtin-attribute-prefi…
fmease Jul 13, 2025
d607b94
Rollup merge of #143798 - Shourya742:2025-07-11-remove-format-short-c…
fmease Jul 13, 2025
95b5a08
Rollup merge of #143803 - RalfJung:const-trait-tracking, r=compiler-e…
fmease Jul 13, 2025
f8bbc91
Rollup merge of #143814 - lolbinarycat:htmldocck-negative-err, r=fmease
fmease Jul 13, 2025
886ad3a
Rollup merge of #143817 - Kobzol:wasi-sdk-path, r=jieyouxu
fmease Jul 13, 2025
2cbd0bc
Rollup merge of #143822 - RalfJung:miri-ui-clean, r=jieyouxu
fmease Jul 13, 2025
bb330bb
Rollup merge of #143823 - jieyouxu:compiletest-maintenance-5, r=Kobzol
fmease Jul 13, 2025
155eadf
Rollup merge of #143841 - jieyouxu:clippy-autolabel, r=fmease
fmease Jul 13, 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
5 changes: 3 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4349,6 +4349,7 @@ dependencies = [
"rustc_ast_lowering",
"rustc_ast_pretty",
"rustc_attr_data_structures",
"rustc_attr_parsing",
"rustc_data_structures",
"rustc_errors",
"rustc_expand",
Expand Down Expand Up @@ -5230,9 +5231,9 @@ dependencies = [

[[package]]
name = "sysinfo"
version = "0.35.2"
version = "0.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c3ffa3e4ff2b324a57f7aeb3c349656c7b127c3c189520251a648102a92496e"
checksum = "aab138f5c1bb35231de19049060a87977ad23e04f2303e953bc5c2947ac7dec4"
dependencies = [
"libc",
"objc2-core-foundation",
Expand Down
5 changes: 5 additions & 0 deletions compiler/rustc_attr_parsing/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,11 @@ impl<'sess, S: Stage> AttributeParser<'sess, S> {
attributes
}

/// Returns whether there is a parser for an attribute with this name
pub fn is_parsed_attribute(path: &[Symbol]) -> bool {
Late::parsers().0.contains_key(path)
}

fn lower_attr_args(&self, args: &ast::AttrArgs, lower_span: impl Fn(Span) -> Span) -> AttrArgs {
match args {
ast::AttrArgs::Empty => AttrArgs::Empty,
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_passes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ rustc_ast = { path = "../rustc_ast" }
rustc_ast_lowering = { path = "../rustc_ast_lowering" }
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
rustc_attr_data_structures = { path = "../rustc_attr_data_structures" }
rustc_attr_parsing = { path = "../rustc_attr_parsing" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
rustc_expand = { path = "../rustc_expand" }
Expand Down
11 changes: 10 additions & 1 deletion compiler/rustc_passes/src/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@

use std::cell::Cell;
use std::collections::hash_map::Entry;
use std::slice;

use rustc_abi::{Align, ExternAbi, Size};
use rustc_ast::{AttrStyle, LitKind, MetaItemInner, MetaItemKind, ast};
use rustc_attr_data_structures::{AttributeKind, InlineAttr, ReprAttr, find_attr};
use rustc_attr_parsing::{AttributeParser, Late};
use rustc_data_structures::fx::FxHashMap;
use rustc_errors::{Applicability, DiagCtxtHandle, IntoDiagArg, MultiSpan, StashKey};
use rustc_feature::{AttributeDuplicates, AttributeType, BUILTIN_ATTRIBUTE_MAP, BuiltinAttribute};
Expand Down Expand Up @@ -384,11 +386,18 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
| sym::custom_mir,
..
] => {}
[name, ..] => {
[name, rest@..] => {
match BUILTIN_ATTRIBUTE_MAP.get(name) {
// checked below
Some(BuiltinAttribute { type_: AttributeType::CrateLevel, .. }) => {}
Some(_) => {
if rest.len() > 0 && AttributeParser::<Late>::is_parsed_attribute(slice::from_ref(name)) {
// Check if we tried to use a builtin attribute as an attribute namespace, like `#[must_use::skip]`.
// This check is here to solve https://github.com/rust-lang/rust/issues/137590
// An error is already produced for this case elsewhere
continue
}

// FIXME: differentiate between unstable and internal attributes just
// like we do with features instead of just accepting `rustc_`
// attributes by name. That should allow trimming the above list, too.
Expand Down
12 changes: 6 additions & 6 deletions library/core/src/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ use crate::ops::ControlFlow;
)]
#[rustc_diagnostic_item = "PartialEq"]
#[const_trait]
#[rustc_const_unstable(feature = "const_trait_impl", issue = "67792")]
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
pub trait PartialEq<Rhs: PointeeSized = Self>: PointeeSized {
/// Tests for `self` and `other` values to be equal, and is used by `==`.
#[must_use]
Expand Down Expand Up @@ -1809,7 +1809,7 @@ mod impls {
macro_rules! partial_eq_impl {
($($t:ty)*) => ($(
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")]
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
impl const PartialEq for $t {
#[inline]
fn eq(&self, other: &Self) -> bool { *self == *other }
Expand Down Expand Up @@ -2017,7 +2017,7 @@ mod impls {
// & pointers

#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")]
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
impl<A: PointeeSized, B: PointeeSized> const PartialEq<&B> for &A
where
A: ~const PartialEq<B>,
Expand Down Expand Up @@ -2089,7 +2089,7 @@ mod impls {
// &mut pointers

#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")]
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
impl<A: PointeeSized, B: PointeeSized> const PartialEq<&mut B> for &mut A
where
A: ~const PartialEq<B>,
Expand Down Expand Up @@ -2159,7 +2159,7 @@ mod impls {
impl<A: PointeeSized> Eq for &mut A where A: Eq {}

#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")]
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
impl<A: PointeeSized, B: PointeeSized> const PartialEq<&mut B> for &A
where
A: ~const PartialEq<B>,
Expand All @@ -2175,7 +2175,7 @@ mod impls {
}

#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")]
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
impl<A: PointeeSized, B: PointeeSized> const PartialEq<&B> for &mut A
where
A: ~const PartialEq<B>,
Expand Down
24 changes: 12 additions & 12 deletions library/core/src/ops/arith.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
/// ```
#[lang = "add"]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
#[rustc_on_unimplemented(
on(all(Self = "{integer}", Rhs = "{float}"), message = "cannot add a float to an integer",),
on(all(Self = "{float}", Rhs = "{integer}"), message = "cannot add an integer to a float",),
Expand Down Expand Up @@ -96,7 +96,7 @@ pub trait Add<Rhs = Self> {
macro_rules! add_impl {
($($t:ty)*) => ($(
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const Add for $t {
type Output = $t;

Expand Down Expand Up @@ -179,7 +179,7 @@ add_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f16 f32 f64 f128
/// ```
#[lang = "sub"]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
#[rustc_on_unimplemented(
message = "cannot subtract `{Rhs}` from `{Self}`",
label = "no implementation for `{Self} - {Rhs}`",
Expand Down Expand Up @@ -208,7 +208,7 @@ pub trait Sub<Rhs = Self> {
macro_rules! sub_impl {
($($t:ty)*) => ($(
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const Sub for $t {
type Output = $t;

Expand Down Expand Up @@ -313,7 +313,7 @@ sub_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f16 f32 f64 f128
/// ```
#[lang = "mul"]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
#[diagnostic::on_unimplemented(
message = "cannot multiply `{Self}` by `{Rhs}`",
label = "no implementation for `{Self} * {Rhs}`"
Expand Down Expand Up @@ -341,7 +341,7 @@ pub trait Mul<Rhs = Self> {
macro_rules! mul_impl {
($($t:ty)*) => ($(
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const Mul for $t {
type Output = $t;

Expand Down Expand Up @@ -450,7 +450,7 @@ mul_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f16 f32 f64 f128
/// ```
#[lang = "div"]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
#[diagnostic::on_unimplemented(
message = "cannot divide `{Self}` by `{Rhs}`",
label = "no implementation for `{Self} / {Rhs}`"
Expand Down Expand Up @@ -484,7 +484,7 @@ macro_rules! div_impl_integer {
///
#[doc = $panic]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const Div for $t {
type Output = $t;

Expand All @@ -505,7 +505,7 @@ div_impl_integer! {
macro_rules! div_impl_float {
($($t:ty)*) => ($(
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const Div for $t {
type Output = $t;

Expand Down Expand Up @@ -556,7 +556,7 @@ div_impl_float! { f16 f32 f64 f128 }
/// ```
#[lang = "rem"]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
#[diagnostic::on_unimplemented(
message = "cannot calculate the remainder of `{Self}` divided by `{Rhs}`",
label = "no implementation for `{Self} % {Rhs}`"
Expand Down Expand Up @@ -590,7 +590,7 @@ macro_rules! rem_impl_integer {
///
#[doc = $panic]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const Rem for $t {
type Output = $t;

Expand Down Expand Up @@ -626,7 +626,7 @@ macro_rules! rem_impl_float {
/// assert_eq!(x % y, remainder);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const Rem for $t {
type Output = $t;

Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/random/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ cfg_if::cfg_if! {
target_os = "rtems",
target_os = "solaris",
target_os = "vita",
target_os = "nuttx",
))] {
mod arc4random;
pub use arc4random::fill_bytes;
Expand All @@ -44,7 +45,6 @@ cfg_if::cfg_if! {
target_os = "hurd",
target_os = "l4re",
target_os = "nto",
target_os = "nuttx",
))] {
mod unix_legacy;
pub use unix_legacy::fill_bytes;
Expand Down
8 changes: 4 additions & 4 deletions src/bootstrap/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"

[[package]]
name = "libc"
version = "0.2.172"
version = "0.2.174"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"

[[package]]
name = "libredox"
Expand Down Expand Up @@ -730,9 +730,9 @@ dependencies = [

[[package]]
name = "sysinfo"
version = "0.35.0"
version = "0.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b897c8ea620e181c7955369a31be5f48d9a9121cb59fd33ecef9ff2a34323422"
checksum = "aab138f5c1bb35231de19049060a87977ad23e04f2303e953bc5c2947ac7dec4"
dependencies = [
"libc",
"memchr",
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ walkdir = "2.4"
xz2 = "0.1"

# Dependencies needed by the build-metrics feature
sysinfo = { version = "0.35.0", default-features = false, optional = true, features = ["system"] }
sysinfo = { version = "0.36.0", default-features = false, optional = true, features = ["system"] }

# Dependencies needed by the `tracing` feature
tracing = { version = "0.1", optional = true, features = ["attributes"] }
Expand Down
9 changes: 7 additions & 2 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,13 @@ impl Step for Miri {
// Miri has its own "target dir" for ui test dependencies. Make sure it gets cleared when
// the sysroot gets rebuilt, to avoid "found possibly newer version of crate `std`" errors.
if !builder.config.dry_run() {
let ui_test_dep_dir =
builder.stage_out(miri.build_compiler, Mode::ToolStd).join("miri_ui");
// This has to match `CARGO_TARGET_TMPDIR` in Miri's `ui.rs`.
// This means we need `host` here as that's the target `ui.rs` is built for.
let ui_test_dep_dir = builder
.stage_out(miri.build_compiler, Mode::ToolStd)
.join(host)
.join("tmp")
.join("miri_ui");
// The mtime of `miri_sysroot` changes when the sysroot gets rebuilt (also see
// <https://github.com/RalfJung/rustc-build-sysroot/commit/10ebcf60b80fe2c3dc765af0ff19fdc0da4b7466>).
// We can hence use that directly as a signal to clear the ui test dir.
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ impl Build {
if let Some(path) = configured {
return Some(path.join("lib").join(target.to_string()));
}
let mut env_root = PathBuf::from(std::env::var_os("WASI_SDK_PATH")?);
let mut env_root = self.wasi_sdk_path.clone()?;
env_root.push("share");
env_root.push("wasi-sysroot");
env_root.push("lib");
Expand Down
29 changes: 4 additions & 25 deletions src/bootstrap/src/utils/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ pub struct CommandFingerprint {
cwd: Option<PathBuf>,
}

impl FormatShortCmd for CommandFingerprint {
fn format_short_cmd(&self) -> String {
impl CommandFingerprint {
/// Helper method to format both Command and BootstrapCommand as a short execution line,
/// without all the other details (e.g. environment variables).
pub fn format_short_cmd(&self) -> String {
let program = Path::new(&self.program);
let mut line = vec![program.file_name().unwrap().to_str().unwrap().to_owned()];
line.extend(self.args.iter().map(|arg| arg.to_string_lossy().into_owned()));
Expand Down Expand Up @@ -545,29 +547,6 @@ impl Default for CommandOutput {
}
}

/// Helper trait to format both Command and BootstrapCommand as a short execution line,
/// without all the other details (e.g. environment variables).
pub trait FormatShortCmd {
fn format_short_cmd(&self) -> String;
}

#[cfg(feature = "tracing")]
impl FormatShortCmd for BootstrapCommand {
fn format_short_cmd(&self) -> String {
self.command.format_short_cmd()
}
}

#[cfg(feature = "tracing")]
impl FormatShortCmd for Command {
fn format_short_cmd(&self) -> String {
let program = Path::new(self.get_program());
let mut line = vec![program.file_name().unwrap().to_str().unwrap()];
line.extend(self.get_args().map(|arg| arg.to_str().unwrap()));
line.join(" ")
}
}

#[derive(Clone, Default)]
pub struct ExecutionContext {
dry_run: DryRun,
Expand Down
4 changes: 1 addition & 3 deletions src/bootstrap/src/utils/tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,11 @@ macro_rules! error {
macro_rules! trace_cmd {
($cmd:expr) => {
{
use $crate::utils::exec::FormatShortCmd;

::tracing::span!(
target: "COMMAND",
::tracing::Level::TRACE,
"executing command",
cmd = $cmd.format_short_cmd(),
cmd = $cmd.fingerprint().format_short_cmd(),
full_cmd = ?$cmd
).entered()
}
Expand Down
4 changes: 4 additions & 0 deletions src/etc/htmldocck.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,10 +564,14 @@ def check_command(c, cache):
# hasraw/matchesraw <path> <pat> = string test
elif len(c.args) == 2 and "raw" in c.cmd:
cerr = "`PATTERN` did not match"
if c.negated:
cerr = "`PATTERN` unexpectedly matched"
ret = check_string(cache.get_file(c.args[0]), c.args[1], regexp)
# has/matches <path> <pat> <match> = XML tree test
elif len(c.args) == 3 and "raw" not in c.cmd:
cerr = "`XPATH PATTERN` did not match"
if c.negated:
cerr = "`XPATH PATTERN` unexpectedly matched"
ret = get_nb_matching_elements(cache, c, regexp, True) != 0
else:
raise InvalidCheck("Invalid number of {} arguments".format(c.cmd))
Expand Down
Loading
Loading