Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
d80db5b
tests/codegen-llvm: Make rust-abi-arch-specific-adjustment portable
Gelbpunkt Sep 8, 2025
16c7206
Note some previous attempts to change the Default impl for `[T; 0]`
Zalathar Sep 14, 2025
7791178
fix 404 link
luca3s Sep 14, 2025
ce859d7
Switch `std::vec::PeekMut::pop` from self to this parameter.
cammeresi Sep 14, 2025
572b423
On FreeBSD, use readdir instead of readdir_r
asomers Sep 14, 2025
927c4c0
Fix typo in error message
Jules-Bertholet Sep 14, 2025
b92ad97
bootstrap.py: disable incremental build for bootstrap in CI
lolbinarycat Sep 14, 2025
5ebdec5
rustc_codegen_llvm: Adjust RISC-V inline assembly's clobber list
a4lg Sep 15, 2025
8265748
opt-dist: don't set `RUST_LOG=collector=debug`
ognevny Sep 15, 2025
bcdb3ee
Rollup merge of #146344 - Gelbpunkt:loongarch-codegen-llvm-test, r=Ma…
matthiaskrgr Sep 15, 2025
f34e30a
Rollup merge of #146530 - a4lg:riscv-inline-asm-default-clobber-float…
matthiaskrgr Sep 15, 2025
4950bf5
Rollup merge of #146533 - Zalathar:array-default, r=compiler-errors
matthiaskrgr Sep 15, 2025
1f363a1
Rollup merge of #146539 - luca3s:push-xuwtvwrsspnp, r=jieyouxu
matthiaskrgr Sep 15, 2025
98ab2b0
Rollup merge of #146546 - cammeresi:pop, r=Mark-Simulacrum
matthiaskrgr Sep 15, 2025
fbd63a9
Rollup merge of #146549 - asomers:freebsd-readdir, r=Mark-Simulacrum
matthiaskrgr Sep 15, 2025
070456b
Rollup merge of #146559 - Jules-Bertholet:fix-typo, r=nnethercote
matthiaskrgr Sep 15, 2025
cb9f476
Rollup merge of #146563 - lolbinarycat:bootstrap-ci-no-incremental, r…
matthiaskrgr Sep 15, 2025
8f2b602
Rollup merge of #146576 - ognevny:opt-dist-collector-logs, r=Kobzol
matthiaskrgr Sep 15, 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: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ Shohei Wada <[email protected]>
Shotaro Yamada <[email protected]>
Shotaro Yamada <[email protected]> <[email protected]>
Shyam Sundar B <[email protected]>
Sidney Cammeresi <[email protected]> <[email protected]>
Simon Barber-Dueck <[email protected]> Simon BD <simon@server>
Simon Sapin <[email protected]> <[email protected]>
Simonas Kazlauskas <[email protected]> Simonas Kazlauskas <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_codegen_llvm/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
}
InlineAsmArch::RiscV32 | InlineAsmArch::RiscV64 => {
constraints.extend_from_slice(&[
"~{fflags}".to_string(),
"~{vtype}".to_string(),
"~{vl}".to_string(),
"~{vxsat}".to_string(),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ middle_failed_writing_file =
# Note: We only mention patterns here since the error can only occur with references, and those
# are forbidden in const generics.
middle_invalid_const_in_valtree = constant {$global_const_id} cannot be used as pattern
.note = constants that reference mutable or external memory cannot be used as pattern
.note = constants that reference mutable or external memory cannot be used as patterns

middle_layout_cycle =
a cycle occurred during layout computation
Expand Down
4 changes: 2 additions & 2 deletions library/alloc/src/vec/peek_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ impl<'a, T> PeekMut<'a, T> {

/// Removes the peeked value from the vector and returns it.
#[unstable(feature = "vec_peek_mut", issue = "122742")]
pub fn pop(self) -> T {
pub fn pop(this: Self) -> T {
// SAFETY: PeekMut is only constructed if the vec is non-empty
unsafe { self.vec.pop().unwrap_unchecked() }
unsafe { this.vec.pop().unwrap_unchecked() }
}
}

Expand Down
4 changes: 2 additions & 2 deletions library/alloctests/tests/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::ops::Bound::*;
use std::panic::{AssertUnwindSafe, catch_unwind};
use std::rc::Rc;
use std::sync::atomic::{AtomicU32, Ordering};
use std::vec::{Drain, IntoIter};
use std::vec::{Drain, IntoIter, PeekMut};

use crate::testing::macros::struct_with_counted_drop;

Expand Down Expand Up @@ -2647,7 +2647,7 @@ fn test_peek_mut() {
assert_eq!(*p, 2);
*p = 0;
assert_eq!(*p, 0);
p.pop();
PeekMut::pop(p);
assert_eq!(vec.len(), 1);
} else {
unreachable!()
Expand Down
5 changes: 5 additions & 0 deletions library/core/src/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,11 @@ impl<T: Copy> SpecArrayClone for T {
// The Default impls cannot be done with const generics because `[T; 0]` doesn't
// require Default to be implemented, and having different impl blocks for
// different numbers isn't supported yet.
//
// Trying to improve the `[T; 0]` situation has proven to be difficult.
// Please see these issues for more context on past attempts and crater runs:
// - https://github.com/rust-lang/rust/issues/61415
// - https://github.com/rust-lang/rust/pull/145457

macro_rules! array_impl_default {
{$n:expr, $t:ident $($ts:ident)*} => {
Expand Down
120 changes: 63 additions & 57 deletions library/std/src/sys/fs/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,31 @@ use libc::fstatat as fstatat64;
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "hurd"))]
use libc::fstatat64;
#[cfg(any(
target_os = "aix",
target_os = "android",
target_os = "solaris",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "redox",
target_os = "illumos",
target_os = "aix",
target_os = "nto",
target_os = "redox",
target_os = "solaris",
target_os = "vita",
all(target_os = "linux", target_env = "musl"),
))]
use libc::readdir as readdir64;
#[cfg(not(any(
target_os = "aix",
target_os = "android",
target_os = "linux",
target_os = "solaris",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "hurd",
target_os = "illumos",
target_os = "l4re",
target_os = "fuchsia",
target_os = "redox",
target_os = "aix",
target_os = "linux",
target_os = "nto",
target_os = "redox",
target_os = "solaris",
target_os = "vita",
target_os = "hurd",
)))]
use libc::readdir_r as readdir64_r;
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "hurd"))]
Expand Down Expand Up @@ -271,16 +273,17 @@ unsafe impl Send for Dir {}
unsafe impl Sync for Dir {}

#[cfg(any(
target_os = "aix",
target_os = "android",
target_os = "linux",
target_os = "solaris",
target_os = "illumos",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "redox",
target_os = "aix",
target_os = "hurd",
target_os = "illumos",
target_os = "linux",
target_os = "nto",
target_os = "redox",
target_os = "solaris",
target_os = "vita",
target_os = "hurd",
))]
pub struct DirEntry {
dir: Arc<InnerReadDir>,
Expand All @@ -295,16 +298,17 @@ pub struct DirEntry {
// we're not using the immediate `d_name` on these targets. Keeping this as an
// `entry` field in `DirEntry` helps reduce the `cfg` boilerplate elsewhere.
#[cfg(any(
target_os = "aix",
target_os = "android",
target_os = "linux",
target_os = "solaris",
target_os = "illumos",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "redox",
target_os = "aix",
target_os = "hurd",
target_os = "illumos",
target_os = "linux",
target_os = "nto",
target_os = "redox",
target_os = "solaris",
target_os = "vita",
target_os = "hurd",
))]
struct dirent64_min {
d_ino: u64,
Expand All @@ -319,16 +323,17 @@ struct dirent64_min {
}

#[cfg(not(any(
target_os = "aix",
target_os = "android",
target_os = "linux",
target_os = "solaris",
target_os = "illumos",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "redox",
target_os = "aix",
target_os = "hurd",
target_os = "illumos",
target_os = "linux",
target_os = "nto",
target_os = "redox",
target_os = "solaris",
target_os = "vita",
target_os = "hurd",
)))]
pub struct DirEntry {
dir: Arc<InnerReadDir>,
Expand Down Expand Up @@ -698,16 +703,17 @@ impl Iterator for ReadDir {
type Item = io::Result<DirEntry>;

#[cfg(any(
target_os = "aix",
target_os = "android",
target_os = "linux",
target_os = "solaris",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "redox",
target_os = "hurd",
target_os = "illumos",
target_os = "aix",
target_os = "linux",
target_os = "nto",
target_os = "redox",
target_os = "solaris",
target_os = "vita",
target_os = "hurd",
))]
fn next(&mut self) -> Option<io::Result<DirEntry>> {
use crate::sys::os::{errno, set_errno};
Expand Down Expand Up @@ -768,6 +774,9 @@ impl Iterator for ReadDir {
// only access those bytes.
#[cfg(not(target_os = "vita"))]
let entry = dirent64_min {
#[cfg(target_os = "freebsd")]
d_ino: (*entry_ptr).d_fileno,
#[cfg(not(target_os = "freebsd"))]
d_ino: (*entry_ptr).d_ino as u64,
#[cfg(not(any(
target_os = "solaris",
Expand All @@ -791,16 +800,17 @@ impl Iterator for ReadDir {
}

#[cfg(not(any(
target_os = "aix",
target_os = "android",
target_os = "linux",
target_os = "solaris",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "redox",
target_os = "hurd",
target_os = "illumos",
target_os = "aix",
target_os = "linux",
target_os = "nto",
target_os = "redox",
target_os = "solaris",
target_os = "vita",
target_os = "hurd",
)))]
fn next(&mut self) -> Option<io::Result<DirEntry>> {
if self.end_of_stream {
Expand Down Expand Up @@ -970,36 +980,32 @@ impl DirEntry {
}

#[cfg(any(
target_os = "linux",
target_os = "aix",
target_os = "android",
target_os = "cygwin",
target_os = "emscripten",
target_os = "android",
target_os = "solaris",
target_os = "illumos",
target_os = "haiku",
target_os = "l4re",
target_os = "fuchsia",
target_os = "redox",
target_os = "vxworks",
target_os = "espidf",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "haiku",
target_os = "horizon",
target_os = "vita",
target_os = "aix",
target_os = "nto",
target_os = "hurd",
target_os = "illumos",
target_os = "l4re",
target_os = "linux",
target_os = "nto",
target_os = "redox",
target_os = "rtems",
target_os = "solaris",
target_os = "vita",
target_os = "vxworks",
target_vendor = "apple",
))]
pub fn ino(&self) -> u64 {
self.entry.d_ino as u64
}

#[cfg(any(
target_os = "freebsd",
target_os = "openbsd",
target_os = "netbsd",
target_os = "dragonfly"
))]
#[cfg(any(target_os = "openbsd", target_os = "netbsd", target_os = "dragonfly"))]
pub fn ino(&self) -> u64 {
self.entry.d_fileno as u64
}
Expand All @@ -1014,7 +1020,6 @@ impl DirEntry {
#[cfg(any(
target_os = "netbsd",
target_os = "openbsd",
target_os = "freebsd",
target_os = "dragonfly",
target_vendor = "apple",
))]
Expand All @@ -1030,7 +1035,6 @@ impl DirEntry {
#[cfg(not(any(
target_os = "netbsd",
target_os = "openbsd",
target_os = "freebsd",
target_os = "dragonfly",
target_vendor = "apple",
)))]
Expand All @@ -1040,6 +1044,7 @@ impl DirEntry {

#[cfg(not(any(
target_os = "android",
target_os = "freebsd",
target_os = "linux",
target_os = "solaris",
target_os = "illumos",
Expand All @@ -1055,6 +1060,7 @@ impl DirEntry {
}
#[cfg(any(
target_os = "android",
target_os = "freebsd",
target_os = "linux",
target_os = "solaris",
target_os = "illumos",
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,9 @@ def build_bootstrap_cmd(self, env):
# See also: <https://github.com/rust-lang/rust/issues/70208>.
if "CARGO_BUILD_TARGET" in env:
del env["CARGO_BUILD_TARGET"]
# if in CI, don't use incremental build when building bootstrap.
if "GITHUB_ACTIONS" in env:
env["CARGO_INCREMENTAL"] = "0"
env["CARGO_TARGET_DIR"] = build_dir
env["RUSTC"] = self.rustc()
env["LD_LIBRARY_PATH"] = (
Expand Down
2 changes: 1 addition & 1 deletion src/doc/rustc/src/target-tier-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -701,4 +701,4 @@ RFC process, with approval by the compiler and infra teams. Any such proposal
will be communicated widely to the Rust community, both when initially proposed
and before being dropped from a stable release.

[MCP]: https://forge.rust-lang.org/compiler/mcp.html
[MCP]: https://forge.rust-lang.org/compiler/proposals-and-stabilization.html#how-do-i-submit-an-mcp
1 change: 0 additions & 1 deletion src/tools/opt-dist/src/training.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ fn init_compiler_benchmarks(
"--exact-match",
crates.join(",").as_str(),
])
.env("RUST_LOG", "collector=debug")
.env("RUSTC", env.rustc_stage_0().as_str())
.env("RUSTC_BOOTSTRAP", "1")
.workdir(&env.rustc_perf_dir());
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen-llvm/asm/riscv-clobbers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extern crate minicore;
use minicore::*;

// CHECK-LABEL: @flags_clobber
// CHECK: call void asm sideeffect "", "~{vtype},~{vl},~{vxsat},~{vxrm}"()
// CHECK: call void asm sideeffect "", "~{fflags},~{vtype},~{vl},~{vxsat},~{vxrm}"()
#[no_mangle]
pub unsafe fn flags_clobber() {
asm!("", options(nostack, nomem));
Expand Down
8 changes: 6 additions & 2 deletions tests/codegen-llvm/rust-abi-arch-specific-adjustment.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
//@ add-core-stubs
//@ compile-flags: -Copt-level=3 -C no-prepopulate-passes
//@ revisions: riscv64 loongarch64

//@[riscv64] only-riscv64
//@[riscv64] compile-flags: --target riscv64gc-unknown-linux-gnu
//@[riscv64] needs-llvm-components: riscv

//@[loongarch64] only-loongarch64
//@[loongarch64] compile-flags: --target loongarch64-unknown-linux-gnu
//@[loongarch64] needs-llvm-components: loongarch

#![crate_type = "lib"]
#![feature(no_core)]
#![no_core]

extern crate minicore;
use minicore::*;

#[no_mangle]
// riscv64: define noundef i8 @arg_attr_u8(i8 noundef zeroext %x)
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/consts/const_refs_to_static_fail.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ error: constant BAD_PATTERN cannot be used as pattern
LL | BAD_PATTERN => {},
| ^^^^^^^^^^^
|
= note: constants that reference mutable or external memory cannot be used as pattern
= note: constants that reference mutable or external memory cannot be used as patterns

error: aborting due to 3 previous errors

Expand Down
Loading
Loading