Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit ff4a253

Browse files
committed
Auto merge of rust-lang#73369 - RalfJung:rollup-hl8g9zf, r=RalfJung
Rollup of 10 pull requests Successful merges: - rust-lang#72707 (Use min_specialization in the remaining rustc crates) - rust-lang#72740 (On recursive ADT, provide indirection structured suggestion) - rust-lang#72879 (Miri: avoid tracking current location three times) - rust-lang#72938 (Stabilize Option::zip) - rust-lang#73086 (Rename "cyclone" to "apple-a7" per changes in upstream LLVM) - rust-lang#73104 (Example about explicit mutex dropping) - rust-lang#73139 (Add methods to go from a nul-terminated Vec<u8> to a CString) - rust-lang#73296 (Remove vestigial CI job msvc-aux.) - rust-lang#73304 (Revert heterogeneous SocketAddr PartialEq impls) - rust-lang#73331 (extend network support for HermitCore) Failed merges: r? @ghost
2 parents d4ecf31 + 54bd077 commit ff4a253

File tree

92 files changed

+1061
-582
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1061
-582
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -428,11 +428,6 @@ jobs:
428428
NO_DEBUG_ASSERTIONS: 1
429429
NO_LLVM_ASSERTIONS: 1
430430
os: windows-latest-xl
431-
- name: x86_64-msvc-aux
432-
env:
433-
RUST_CHECK_TARGET: check-aux EXCLUDE_CARGO=1
434-
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc"
435-
os: windows-latest-xl
436431
- name: x86_64-msvc-cargo
437432
env:
438433
SCRIPT: python x.py test src/tools/cargotest src/tools/cargo

Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,9 +1434,9 @@ dependencies = [
14341434

14351435
[[package]]
14361436
name = "hermit-abi"
1437-
version = "0.1.13"
1437+
version = "0.1.14"
14381438
source = "registry+https://github.com/rust-lang/crates.io-index"
1439-
checksum = "91780f809e750b0a89f5544be56617ff6b1227ee485bcb06ebe10cdf89bd3b71"
1439+
checksum = "b9586eedd4ce6b3c498bc3b4dd92fc9f11166aa908a914071953768066c67909"
14401440
dependencies = [
14411441
"compiler_builtins",
14421442
"libc",

src/bootstrap/builder.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,6 @@ impl<'a> Builder<'a> {
373373
test::UiFullDeps,
374374
test::Rustdoc,
375375
test::Pretty,
376-
test::RunPassValgrindPretty,
377376
test::Crate,
378377
test::CrateLibrustc,
379378
test::CrateRustdoc,

src/bootstrap/mk/Makefile.in

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ Q := @
66
BOOTSTRAP_ARGS :=
77
endif
88

9-
ifdef EXCLUDE_CARGO
10-
AUX_ARGS :=
11-
else
12-
AUX_ARGS := src/tools/cargo src/tools/cargotest
13-
endif
14-
159
BOOTSTRAP := $(CFG_PYTHON) $(CFG_SRC_DIR)src/bootstrap/bootstrap.py
1610

1711
all:
@@ -48,8 +42,8 @@ check:
4842
$(Q)$(BOOTSTRAP) test $(BOOTSTRAP_ARGS)
4943
check-aux:
5044
$(Q)$(BOOTSTRAP) test \
51-
src/test/run-pass-valgrind/pretty \
52-
$(AUX_ARGS) \
45+
src/tools/cargo \
46+
src/tools/cargotest \
5347
$(BOOTSTRAP_ARGS)
5448
check-bootstrap:
5549
$(Q)$(CFG_PYTHON) $(CFG_SRC_DIR)src/bootstrap/bootstrap_test.py

src/bootstrap/test.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -930,13 +930,6 @@ host_test!(UiFullDeps { path: "src/test/ui-fulldeps", mode: "ui", suite: "ui-ful
930930
host_test!(Rustdoc { path: "src/test/rustdoc", mode: "rustdoc", suite: "rustdoc" });
931931

932932
host_test!(Pretty { path: "src/test/pretty", mode: "pretty", suite: "pretty" });
933-
test!(RunPassValgrindPretty {
934-
path: "src/test/run-pass-valgrind/pretty",
935-
mode: "pretty",
936-
suite: "run-pass-valgrind",
937-
default: false,
938-
host: true
939-
});
940933

941934
default_test!(RunMake { path: "src/test/run-make", mode: "run-make", suite: "run-make" });
942935

src/ci/azure-pipelines/auto.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,6 @@ jobs:
142142
# FIXME(#59637)
143143
NO_DEBUG_ASSERTIONS: 1
144144
NO_LLVM_ASSERTIONS: 1
145-
# MSVC aux tests
146-
x86_64-msvc-aux:
147-
RUST_CHECK_TARGET: check-aux EXCLUDE_CARGO=1
148-
INITIAL_RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc
149145
x86_64-msvc-cargo:
150146
SCRIPT: python x.py test src/tools/cargotest src/tools/cargo
151147
INITIAL_RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-lld

src/ci/github-actions/ci.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -492,12 +492,6 @@ jobs:
492492
NO_LLVM_ASSERTIONS: 1
493493
<<: *job-windows-xl
494494

495-
- name: x86_64-msvc-aux
496-
env:
497-
RUST_CHECK_TARGET: check-aux EXCLUDE_CARGO=1
498-
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc
499-
<<: *job-windows-xl
500-
501495
- name: x86_64-msvc-cargo
502496
env:
503497
SCRIPT: python x.py test src/tools/cargotest src/tools/cargo

src/libcore/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@
145145
#![feature(associated_type_bounds)]
146146
#![feature(const_type_id)]
147147
#![feature(const_caller_location)]
148-
#![feature(option_zip)]
149148
#![feature(no_niche)] // rust-lang/rust#68303
150149

151150
#[prelude_import]

src/libcore/option.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -926,17 +926,19 @@ impl<T> Option<T> {
926926
/// # Examples
927927
///
928928
/// ```
929-
/// #![feature(option_zip)]
930929
/// let x = Some(1);
931930
/// let y = Some("hi");
932931
/// let z = None::<u8>;
933932
///
934933
/// assert_eq!(x.zip(y), Some((1, "hi")));
935934
/// assert_eq!(x.zip(z), None);
936935
/// ```
937-
#[unstable(feature = "option_zip", issue = "70086")]
936+
#[stable(feature = "option_zip_option", since = "1.46.0")]
938937
pub fn zip<U>(self, other: Option<U>) -> Option<(T, U)> {
939-
self.zip_with(other, |a, b| (a, b))
938+
match (self, other) {
939+
(Some(a), Some(b)) => Some((a, b)),
940+
_ => None,
941+
}
940942
}
941943

942944
/// Zips `self` and another `Option` with function `f`.

src/librustc_arena/lib.rs

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ macro_rules! which_arena_for_type {
602602

603603
#[macro_export]
604604
macro_rules! declare_arena {
605-
([], [$($a:tt $name:ident: $ty:ty,)*], $tcx:lifetime) => {
605+
([], [$($a:tt $name:ident: $ty:ty, $gen_ty:ty;)*], $tcx:lifetime) => {
606606
#[derive(Default)]
607607
pub struct Arena<$tcx> {
608608
pub dropless: $crate::DroplessArena,
@@ -611,17 +611,17 @@ macro_rules! declare_arena {
611611
}
612612

613613
#[marker]
614-
pub trait ArenaAllocatable {}
614+
pub trait ArenaAllocatable<'tcx> {}
615615

616-
impl<T: Copy> ArenaAllocatable for T {}
616+
impl<'tcx, T: Copy> ArenaAllocatable<'tcx> for T {}
617617

618-
unsafe trait ArenaField<'tcx>: Sized {
618+
unsafe trait ArenaField<'tcx>: Sized + ArenaAllocatable<'tcx> {
619619
/// Returns a specific arena to allocate from.
620620
/// If `None` is returned, the `DropArena` will be used.
621621
fn arena<'a>(arena: &'a Arena<'tcx>) -> Option<&'a $crate::TypedArena<Self>>;
622622
}
623623

624-
unsafe impl<'tcx, T> ArenaField<'tcx> for T {
624+
unsafe impl<'tcx, T: ArenaAllocatable<'tcx>> ArenaField<'tcx> for T {
625625
#[inline]
626626
default fn arena<'a>(_: &'a Arena<'tcx>) -> Option<&'a $crate::TypedArena<Self>> {
627627
panic!()
@@ -630,18 +630,27 @@ macro_rules! declare_arena {
630630

631631
$(
632632
#[allow(unused_lifetimes)]
633-
impl<$tcx> ArenaAllocatable for $ty {}
634-
unsafe impl<$tcx> ArenaField<$tcx> for $ty {
633+
impl<$tcx> ArenaAllocatable<$tcx> for $ty {}
634+
unsafe impl<$tcx, '_x, '_y, '_z, '_w> ArenaField<$tcx> for $gen_ty where Self: ArenaAllocatable<$tcx> {
635635
#[inline]
636636
fn arena<'a>(_arena: &'a Arena<$tcx>) -> Option<&'a $crate::TypedArena<Self>> {
637-
$crate::which_arena_for_type!($a[&_arena.$name])
637+
// SAFETY: We only implement `ArenaAllocatable<$tcx>` for
638+
// `$ty`, so `$ty` and Self are the same type
639+
unsafe {
640+
::std::mem::transmute::<
641+
Option<&'a $crate::TypedArena<$ty>>,
642+
Option<&'a $crate::TypedArena<Self>>,
643+
>(
644+
$crate::which_arena_for_type!($a[&_arena.$name])
645+
)
646+
}
638647
}
639648
}
640649
)*
641650

642651
impl<'tcx> Arena<'tcx> {
643652
#[inline]
644-
pub fn alloc<T: ArenaAllocatable>(&self, value: T) -> &mut T {
653+
pub fn alloc<T: ArenaAllocatable<'tcx>>(&self, value: T) -> &mut T {
645654
if !::std::mem::needs_drop::<T>() {
646655
return self.dropless.alloc(value);
647656
}
@@ -659,7 +668,7 @@ macro_rules! declare_arena {
659668
self.dropless.alloc_slice(value)
660669
}
661670

662-
pub fn alloc_from_iter<'a, T: ArenaAllocatable>(
671+
pub fn alloc_from_iter<'a, T: ArenaAllocatable<'tcx>>(
663672
&'a self,
664673
iter: impl ::std::iter::IntoIterator<Item = T>,
665674
) -> &'a mut [T] {

0 commit comments

Comments
 (0)