Skip to content

Rollup of 8 pull requests #139724

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 17 commits into from
Apr 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
60 changes: 5 additions & 55 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -931,15 +931,6 @@ dependencies = [
"winapi",
]

[[package]]
name = "deranged"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e"
dependencies = [
"powerfmt",
]

[[package]]
name = "derive-where"
version = "1.2.7"
Expand Down Expand Up @@ -2425,12 +2416,6 @@ dependencies = [
"num-traits",
]

[[package]]
name = "num-conv"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"

[[package]]
name = "num-integer"
version = "0.1.46"
Expand Down Expand Up @@ -2808,12 +2793,6 @@ dependencies = [
"portable-atomic",
]

[[package]]
name = "powerfmt"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"

[[package]]
name = "ppv-lite86"
version = "0.2.21"
Expand Down Expand Up @@ -3616,6 +3595,7 @@ name = "rustc_driver_impl"
version = "0.0.0"
dependencies = [
"ctrlc",
"jiff",
"libc",
"rustc_abi",
"rustc_ast",
Expand Down Expand Up @@ -3662,7 +3642,6 @@ dependencies = [
"rustc_ty_utils",
"serde_json",
"shlex",
"time",
"tracing",
"windows 0.59.0",
]
Expand Down Expand Up @@ -5356,37 +5335,6 @@ dependencies = [
"libc",
]

[[package]]
name = "time"
version = "0.3.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40"
dependencies = [
"deranged",
"itoa",
"num-conv",
"powerfmt",
"serde",
"time-core",
"time-macros",
]

[[package]]
name = "time-core"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c"

[[package]]
name = "time-macros"
version = "0.2.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49"
dependencies = [
"num-conv",
"time-core",
]

[[package]]
name = "tinystr"
version = "0.7.6"
Expand Down Expand Up @@ -6111,11 +6059,13 @@ dependencies = [

[[package]]
name = "windows-bindgen"
version = "0.59.0"
version = "0.61.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b7fb600834d7e868f6e5bb748a86101427330fafbf9485c331b9d5f562d54a5"
checksum = "ac1c59c20569610dd9ed784d5f003fb493ec57b4cf39d974eb03a84bb7156c90"
dependencies = [
"rayon",
"serde",
"serde_json",
]

[[package]]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_driver_impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = "0.0.0"
edition = "2024"

[dependencies]
jiff = { version = "0.2.5", default-features = false, features = ["std"] }
# tidy-alphabetical-start
rustc_abi = { path = "../rustc_abi" }
rustc_ast = { path = "../rustc_ast" }
Expand Down Expand Up @@ -50,7 +51,6 @@ rustc_trait_selection = { path = "../rustc_trait_selection" }
rustc_ty_utils = { path = "../rustc_ty_utils" }
serde_json = "1.0.59"
shlex = "1.0"
time = { version = "0.3.36", default-features = false, features = ["alloc", "formatting", "macros"] }
tracing = { version = "0.1.35" }
# tidy-alphabetical-end

Expand Down
13 changes: 3 additions & 10 deletions compiler/rustc_driver_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use std::path::{Path, PathBuf};
use std::process::{self, Command, Stdio};
use std::sync::OnceLock;
use std::sync::atomic::{AtomicBool, Ordering};
use std::time::{Instant, SystemTime};
use std::time::Instant;
use std::{env, str};

use rustc_ast as ast;
Expand Down Expand Up @@ -66,8 +66,6 @@ use rustc_span::FileName;
use rustc_span::def_id::LOCAL_CRATE;
use rustc_target::json::ToJson;
use rustc_target::spec::{Target, TargetTuple};
use time::OffsetDateTime;
use time::macros::format_description;
use tracing::trace;

#[allow(unused_macros)]
Expand Down Expand Up @@ -1301,13 +1299,8 @@ fn ice_path_with_config(config: Option<&UnstableOptions>) -> &'static Option<Pat
.or_else(|| std::env::current_dir().ok())
.unwrap_or_default(),
};
let now: OffsetDateTime = SystemTime::now().into();
let file_now = now
.format(
// Don't use a standard datetime format because Windows doesn't support `:` in paths
&format_description!("[year]-[month]-[day]T[hour]_[minute]_[second]"),
)
.unwrap_or_default();
// Don't use a standard datetime format because Windows doesn't support `:` in paths
let file_now = jiff::Zoned::now().strftime("%Y-%m-%dT%H_%M_%S");
let pid = std::process::id();
path.push(format!("rustc-ice-{file_now}-{pid}.txt"));
Some(path)
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_passes/src/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
ItemKind::Trait(_, _, _, generics, _, items)
if generics.params.len() != 0
|| items.iter().any(|item| matches!(item.kind, AssocItemKind::Type)) => {}
ItemKind::TyAlias(_, _, generics) if generics.params.len() != 0 => {}
_ => {
self.dcx().emit_err(errors::DocSearchUnboxInvalid { span: meta.span() });
}
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
//! parameters (corresponding to `format_spec` in [the syntax](#syntax)). These
//! parameters affect the string representation of what's being formatted.
//!
//! The colon `:` in format syntax divides indentifier of the input data and
//! The colon `:` in format syntax divides identifier of the input data and
//! the formatting options, the colon itself does not change anything, only
//! introduces the options.
//!
Expand Down
1 change: 1 addition & 0 deletions library/core/src/intrinsics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2737,6 +2737,7 @@ pub const fn carrying_mul_add<T: ~const fallback::CarryingMulAdd<Unsigned = U>,
/// `x % y != 0` or `y == 0` or `x == T::MIN && y == -1`
///
/// This intrinsic does not have a stable counterpart.
#[rustc_intrinsic_const_stable_indirect]
#[rustc_nounwind]
#[rustc_intrinsic]
pub const unsafe fn exact_div<T: Copy>(x: T, y: T) -> T;
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/uint_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3343,7 +3343,7 @@ macro_rules! uint_impl {
}
}

/// Returns `true` if and only if `self == 2^k` for some `k`.
/// Returns `true` if and only if `self == 2^k` for some unsigned integer `k`.
///
/// # Examples
///
Expand Down
6 changes: 0 additions & 6 deletions library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,6 @@ impl<T> [T] {
/// // let chunks: &[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed
/// ```
#[unstable(feature = "slice_as_chunks", issue = "74985")]
#[rustc_const_unstable(feature = "slice_as_chunks", issue = "74985")]
#[inline]
#[must_use]
pub const unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]] {
Expand Down Expand Up @@ -1333,7 +1332,6 @@ impl<T> [T] {
/// assert_eq!(chunks, &[['R', 'u'], ['s', 't']]);
/// ```
#[unstable(feature = "slice_as_chunks", issue = "74985")]
#[rustc_const_unstable(feature = "slice_as_chunks", issue = "74985")]
#[inline]
#[track_caller]
#[must_use]
Expand Down Expand Up @@ -1368,7 +1366,6 @@ impl<T> [T] {
/// assert_eq!(chunks, &[['o', 'r'], ['e', 'm']]);
/// ```
#[unstable(feature = "slice_as_chunks", issue = "74985")]
#[rustc_const_unstable(feature = "slice_as_chunks", issue = "74985")]
#[inline]
#[track_caller]
#[must_use]
Expand Down Expand Up @@ -1448,7 +1445,6 @@ impl<T> [T] {
/// // let chunks: &[[_; 0]] = slice.as_chunks_unchecked_mut() // Zero-length chunks are never allowed
/// ```
#[unstable(feature = "slice_as_chunks", issue = "74985")]
#[rustc_const_unstable(feature = "slice_as_chunks", issue = "74985")]
#[inline]
#[must_use]
pub const unsafe fn as_chunks_unchecked_mut<const N: usize>(&mut self) -> &mut [[T; N]] {
Expand Down Expand Up @@ -1489,7 +1485,6 @@ impl<T> [T] {
/// assert_eq!(v, &[1, 1, 2, 2, 9]);
/// ```
#[unstable(feature = "slice_as_chunks", issue = "74985")]
#[rustc_const_unstable(feature = "slice_as_chunks", issue = "74985")]
#[inline]
#[track_caller]
#[must_use]
Expand Down Expand Up @@ -1530,7 +1525,6 @@ impl<T> [T] {
/// assert_eq!(v, &[9, 1, 1, 2, 2]);
/// ```
#[unstable(feature = "slice_as_chunks", issue = "74985")]
#[rustc_const_unstable(feature = "slice_as_chunks", issue = "74985")]
#[inline]
#[track_caller]
#[must_use]
Expand Down
7 changes: 0 additions & 7 deletions library/std/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ fn main() {
.expect("CARGO_CFG_TARGET_POINTER_WIDTH was not set")
.parse()
.unwrap();
let target_features: Vec<_> = env::var("CARGO_CFG_TARGET_FEATURE")
.unwrap_or_default()
.split(",")
.map(ToOwned::to_owned)
.collect();
let is_miri = env::var_os("CARGO_CFG_MIRI").is_some();

println!("cargo:rustc-check-cfg=cfg(netbsd10)");
Expand Down Expand Up @@ -108,8 +103,6 @@ fn main() {
("s390x", _) => false,
// Unsupported <https://github.com/llvm/llvm-project/issues/94434>
("arm64ec", _) => false,
// LLVM crash <https://github.com/llvm/llvm-project/issues/129394>
("aarch64", _) if !target_features.iter().any(|f| f == "neon") => false,
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
("x86_64", "windows") if target_env == "gnu" && target_abi != "llvm" => false,
// Infinite recursion <https://github.com/llvm/llvm-project/issues/97981>
Expand Down
1 change: 1 addition & 0 deletions library/std/src/io/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ use crate::{error, fmt, result, sys};
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(bootstrap), doc(search_unbox))]
pub type Result<T> = result::Result<T, Error>;

/// The error type for I/O operations of the [`Read`], [`Write`], [`Seek`], and
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/fs/windows/remove_dir_all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ fn open_link_no_reparse(
ObjectName: &mut path_str,
RootDirectory: parent.as_raw_handle(),
Attributes: ATTRIBUTES.load(Ordering::Relaxed),
..c::OBJECT_ATTRIBUTES::default()
..c::OBJECT_ATTRIBUTES::with_length()
};
let share = c::FILE_SHARE_DELETE | c::FILE_SHARE_READ | c::FILE_SHARE_WRITE;
let options = c::FILE_OPEN_REPARSE_POINT | options;
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/sys/pal/windows/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ impl UNICODE_STRING {
}
}

impl Default for OBJECT_ATTRIBUTES {
fn default() -> Self {
impl OBJECT_ATTRIBUTES {
pub fn with_length() -> Self {
Self {
Length: size_of::<Self>() as _,
RootDirectory: ptr::null_mut(),
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/sys/pal/windows/c/bindings.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
--out windows_sys.rs
--flat
--sys
--no-core
--no-deps
--link windows_targets
--filter
!INVALID_HANDLE_VALUE
ABOVE_NORMAL_PRIORITY_CLASS
Expand All @@ -19,7 +20,6 @@ ALL_PROCESSOR_GROUPS
ARM64_NT_NEON128
BELOW_NORMAL_PRIORITY_CLASS
bind
BOOL
BY_HANDLE_FILE_INFORMATION
CALLBACK_CHUNK_FINISHED
CALLBACK_STREAM_SWITCH
Expand Down
Loading
Loading