Skip to content

Commit 9d82de1

Browse files
committed
Auto merge of #146610 - matthiaskrgr:rollup-xkt5kjz, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #146344 (tests/codegen-llvm: Make rust-abi-arch-specific-adjustment portable) - #146530 (rustc_codegen_llvm: Adjust RISC-V inline assembly's clobber list) - #146533 (Note some previous attempts to change the Default impl for `[T; 0]`) - #146539 (fix 404 MCP link) - #146546 (Switch `std::vec::PeekMut::pop` from self to this parameter.) - #146549 (On FreeBSD, use readdir instead of readdir_r) - #146559 (Fix typo in error message) - #146563 (bootstrap.py: disable incremental build for bootstrap in CI) - #146576 (opt-dist: don't set `RUST_LOG=collector=debug`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents a454fcc + 8f2b602 commit 9d82de1

File tree

16 files changed

+93
-74
lines changed

16 files changed

+93
-74
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,7 @@ Shohei Wada <[email protected]>
609609
Shotaro Yamada <[email protected]>
610610
611611
Shyam Sundar B <[email protected]>
612+
612613
Simon Barber-Dueck <[email protected]> Simon BD <simon@server>
613614
614615
Simonas Kazlauskas <[email protected]> Simonas Kazlauskas <[email protected]>

compiler/rustc_codegen_llvm/src/asm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
240240
}
241241
InlineAsmArch::RiscV32 | InlineAsmArch::RiscV64 => {
242242
constraints.extend_from_slice(&[
243+
"~{fflags}".to_string(),
243244
"~{vtype}".to_string(),
244245
"~{vl}".to_string(),
245246
"~{vxsat}".to_string(),

compiler/rustc_middle/messages.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ middle_failed_writing_file =
8484
# Note: We only mention patterns here since the error can only occur with references, and those
8585
# are forbidden in const generics.
8686
middle_invalid_const_in_valtree = constant {$global_const_id} cannot be used as pattern
87-
.note = constants that reference mutable or external memory cannot be used as pattern
87+
.note = constants that reference mutable or external memory cannot be used as patterns
8888
8989
middle_layout_cycle =
9090
a cycle occurred during layout computation

library/alloc/src/vec/peek_mut.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ impl<'a, T> PeekMut<'a, T> {
2929

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

library/alloctests/tests/vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::ops::Bound::*;
1515
use std::panic::{AssertUnwindSafe, catch_unwind};
1616
use std::rc::Rc;
1717
use std::sync::atomic::{AtomicU32, Ordering};
18-
use std::vec::{Drain, IntoIter};
18+
use std::vec::{Drain, IntoIter, PeekMut};
1919

2020
use crate::testing::macros::struct_with_counted_drop;
2121

@@ -2647,7 +2647,7 @@ fn test_peek_mut() {
26472647
assert_eq!(*p, 2);
26482648
*p = 0;
26492649
assert_eq!(*p, 0);
2650-
p.pop();
2650+
PeekMut::pop(p);
26512651
assert_eq!(vec.len(), 1);
26522652
} else {
26532653
unreachable!()

library/core/src/array/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,11 @@ impl<T: Copy> SpecArrayClone for T {
472472
// The Default impls cannot be done with const generics because `[T; 0]` doesn't
473473
// require Default to be implemented, and having different impl blocks for
474474
// different numbers isn't supported yet.
475+
//
476+
// Trying to improve the `[T; 0]` situation has proven to be difficult.
477+
// Please see these issues for more context on past attempts and crater runs:
478+
// - https://github.com/rust-lang/rust/issues/61415
479+
// - https://github.com/rust-lang/rust/pull/145457
475480

476481
macro_rules! array_impl_default {
477482
{$n:expr, $t:ident $($ts:ident)*} => {

library/std/src/sys/fs/unix.rs

Lines changed: 63 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,31 @@ use libc::fstatat as fstatat64;
2121
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "hurd"))]
2222
use libc::fstatat64;
2323
#[cfg(any(
24+
target_os = "aix",
2425
target_os = "android",
25-
target_os = "solaris",
26+
target_os = "freebsd",
2627
target_os = "fuchsia",
27-
target_os = "redox",
2828
target_os = "illumos",
29-
target_os = "aix",
3029
target_os = "nto",
30+
target_os = "redox",
31+
target_os = "solaris",
3132
target_os = "vita",
3233
all(target_os = "linux", target_env = "musl"),
3334
))]
3435
use libc::readdir as readdir64;
3536
#[cfg(not(any(
37+
target_os = "aix",
3638
target_os = "android",
37-
target_os = "linux",
38-
target_os = "solaris",
39+
target_os = "freebsd",
40+
target_os = "fuchsia",
41+
target_os = "hurd",
3942
target_os = "illumos",
4043
target_os = "l4re",
41-
target_os = "fuchsia",
42-
target_os = "redox",
43-
target_os = "aix",
44+
target_os = "linux",
4445
target_os = "nto",
46+
target_os = "redox",
47+
target_os = "solaris",
4548
target_os = "vita",
46-
target_os = "hurd",
4749
)))]
4850
use libc::readdir_r as readdir64_r;
4951
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "hurd"))]
@@ -271,16 +273,17 @@ unsafe impl Send for Dir {}
271273
unsafe impl Sync for Dir {}
272274

273275
#[cfg(any(
276+
target_os = "aix",
274277
target_os = "android",
275-
target_os = "linux",
276-
target_os = "solaris",
277-
target_os = "illumos",
278+
target_os = "freebsd",
278279
target_os = "fuchsia",
279-
target_os = "redox",
280-
target_os = "aix",
280+
target_os = "hurd",
281+
target_os = "illumos",
282+
target_os = "linux",
281283
target_os = "nto",
284+
target_os = "redox",
285+
target_os = "solaris",
282286
target_os = "vita",
283-
target_os = "hurd",
284287
))]
285288
pub struct DirEntry {
286289
dir: Arc<InnerReadDir>,
@@ -295,16 +298,17 @@ pub struct DirEntry {
295298
// we're not using the immediate `d_name` on these targets. Keeping this as an
296299
// `entry` field in `DirEntry` helps reduce the `cfg` boilerplate elsewhere.
297300
#[cfg(any(
301+
target_os = "aix",
298302
target_os = "android",
299-
target_os = "linux",
300-
target_os = "solaris",
301-
target_os = "illumos",
303+
target_os = "freebsd",
302304
target_os = "fuchsia",
303-
target_os = "redox",
304-
target_os = "aix",
305+
target_os = "hurd",
306+
target_os = "illumos",
307+
target_os = "linux",
305308
target_os = "nto",
309+
target_os = "redox",
310+
target_os = "solaris",
306311
target_os = "vita",
307-
target_os = "hurd",
308312
))]
309313
struct dirent64_min {
310314
d_ino: u64,
@@ -319,16 +323,17 @@ struct dirent64_min {
319323
}
320324

321325
#[cfg(not(any(
326+
target_os = "aix",
322327
target_os = "android",
323-
target_os = "linux",
324-
target_os = "solaris",
325-
target_os = "illumos",
328+
target_os = "freebsd",
326329
target_os = "fuchsia",
327-
target_os = "redox",
328-
target_os = "aix",
330+
target_os = "hurd",
331+
target_os = "illumos",
332+
target_os = "linux",
329333
target_os = "nto",
334+
target_os = "redox",
335+
target_os = "solaris",
330336
target_os = "vita",
331-
target_os = "hurd",
332337
)))]
333338
pub struct DirEntry {
334339
dir: Arc<InnerReadDir>,
@@ -698,16 +703,17 @@ impl Iterator for ReadDir {
698703
type Item = io::Result<DirEntry>;
699704

700705
#[cfg(any(
706+
target_os = "aix",
701707
target_os = "android",
702-
target_os = "linux",
703-
target_os = "solaris",
708+
target_os = "freebsd",
704709
target_os = "fuchsia",
705-
target_os = "redox",
710+
target_os = "hurd",
706711
target_os = "illumos",
707-
target_os = "aix",
712+
target_os = "linux",
708713
target_os = "nto",
714+
target_os = "redox",
715+
target_os = "solaris",
709716
target_os = "vita",
710-
target_os = "hurd",
711717
))]
712718
fn next(&mut self) -> Option<io::Result<DirEntry>> {
713719
use crate::sys::os::{errno, set_errno};
@@ -768,6 +774,9 @@ impl Iterator for ReadDir {
768774
// only access those bytes.
769775
#[cfg(not(target_os = "vita"))]
770776
let entry = dirent64_min {
777+
#[cfg(target_os = "freebsd")]
778+
d_ino: (*entry_ptr).d_fileno,
779+
#[cfg(not(target_os = "freebsd"))]
771780
d_ino: (*entry_ptr).d_ino as u64,
772781
#[cfg(not(any(
773782
target_os = "solaris",
@@ -791,16 +800,17 @@ impl Iterator for ReadDir {
791800
}
792801

793802
#[cfg(not(any(
803+
target_os = "aix",
794804
target_os = "android",
795-
target_os = "linux",
796-
target_os = "solaris",
805+
target_os = "freebsd",
797806
target_os = "fuchsia",
798-
target_os = "redox",
807+
target_os = "hurd",
799808
target_os = "illumos",
800-
target_os = "aix",
809+
target_os = "linux",
801810
target_os = "nto",
811+
target_os = "redox",
812+
target_os = "solaris",
802813
target_os = "vita",
803-
target_os = "hurd",
804814
)))]
805815
fn next(&mut self) -> Option<io::Result<DirEntry>> {
806816
if self.end_of_stream {
@@ -970,36 +980,32 @@ impl DirEntry {
970980
}
971981

972982
#[cfg(any(
973-
target_os = "linux",
983+
target_os = "aix",
984+
target_os = "android",
974985
target_os = "cygwin",
975986
target_os = "emscripten",
976-
target_os = "android",
977-
target_os = "solaris",
978-
target_os = "illumos",
979-
target_os = "haiku",
980-
target_os = "l4re",
981-
target_os = "fuchsia",
982-
target_os = "redox",
983-
target_os = "vxworks",
984987
target_os = "espidf",
988+
target_os = "freebsd",
989+
target_os = "fuchsia",
990+
target_os = "haiku",
985991
target_os = "horizon",
986-
target_os = "vita",
987-
target_os = "aix",
988-
target_os = "nto",
989992
target_os = "hurd",
993+
target_os = "illumos",
994+
target_os = "l4re",
995+
target_os = "linux",
996+
target_os = "nto",
997+
target_os = "redox",
990998
target_os = "rtems",
999+
target_os = "solaris",
1000+
target_os = "vita",
1001+
target_os = "vxworks",
9911002
target_vendor = "apple",
9921003
))]
9931004
pub fn ino(&self) -> u64 {
9941005
self.entry.d_ino as u64
9951006
}
9961007

997-
#[cfg(any(
998-
target_os = "freebsd",
999-
target_os = "openbsd",
1000-
target_os = "netbsd",
1001-
target_os = "dragonfly"
1002-
))]
1008+
#[cfg(any(target_os = "openbsd", target_os = "netbsd", target_os = "dragonfly"))]
10031009
pub fn ino(&self) -> u64 {
10041010
self.entry.d_fileno as u64
10051011
}
@@ -1014,7 +1020,6 @@ impl DirEntry {
10141020
#[cfg(any(
10151021
target_os = "netbsd",
10161022
target_os = "openbsd",
1017-
target_os = "freebsd",
10181023
target_os = "dragonfly",
10191024
target_vendor = "apple",
10201025
))]
@@ -1030,7 +1035,6 @@ impl DirEntry {
10301035
#[cfg(not(any(
10311036
target_os = "netbsd",
10321037
target_os = "openbsd",
1033-
target_os = "freebsd",
10341038
target_os = "dragonfly",
10351039
target_vendor = "apple",
10361040
)))]
@@ -1040,6 +1044,7 @@ impl DirEntry {
10401044

10411045
#[cfg(not(any(
10421046
target_os = "android",
1047+
target_os = "freebsd",
10431048
target_os = "linux",
10441049
target_os = "solaris",
10451050
target_os = "illumos",
@@ -1055,6 +1060,7 @@ impl DirEntry {
10551060
}
10561061
#[cfg(any(
10571062
target_os = "android",
1063+
target_os = "freebsd",
10581064
target_os = "linux",
10591065
target_os = "solaris",
10601066
target_os = "illumos",

src/bootstrap/bootstrap.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,9 @@ def build_bootstrap_cmd(self, env):
10391039
# See also: <https://github.com/rust-lang/rust/issues/70208>.
10401040
if "CARGO_BUILD_TARGET" in env:
10411041
del env["CARGO_BUILD_TARGET"]
1042+
# if in CI, don't use incremental build when building bootstrap.
1043+
if "GITHUB_ACTIONS" in env:
1044+
env["CARGO_INCREMENTAL"] = "0"
10421045
env["CARGO_TARGET_DIR"] = build_dir
10431046
env["RUSTC"] = self.rustc()
10441047
env["LD_LIBRARY_PATH"] = (

src/doc/rustc/src/target-tier-policy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,4 +701,4 @@ RFC process, with approval by the compiler and infra teams. Any such proposal
701701
will be communicated widely to the Rust community, both when initially proposed
702702
and before being dropped from a stable release.
703703

704-
[MCP]: https://forge.rust-lang.org/compiler/mcp.html
704+
[MCP]: https://forge.rust-lang.org/compiler/proposals-and-stabilization.html#how-do-i-submit-an-mcp

src/tools/opt-dist/src/training.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ fn init_compiler_benchmarks(
3939
"--exact-match",
4040
crates.join(",").as_str(),
4141
])
42-
.env("RUST_LOG", "collector=debug")
4342
.env("RUSTC", env.rustc_stage_0().as_str())
4443
.env("RUSTC_BOOTSTRAP", "1")
4544
.workdir(&env.rustc_perf_dir());

0 commit comments

Comments
 (0)