Skip to content

Commit 2e8386e

Browse files
authored
Merge pull request rust-lang#387 from rust-lang/sync_from_rust_2023_11_17
Sync from rust 2023/11/17
2 parents c6bc7ec + a3b6444 commit 2e8386e

14 files changed

+64
-34
lines changed

.github/workflows/ci.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,10 @@ jobs:
9999
- name: Build
100100
run: |
101101
./y.sh prepare --only-libcore
102-
./y.sh build
103-
cargo test
102+
# TODO: remove --features master when it is back to the default.
103+
./y.sh build --features master
104+
# TODO: remove --features master when it is back to the default.
105+
cargo test --features master
104106
./clean_all.sh
105107
106108
- name: Prepare dependencies
@@ -121,7 +123,8 @@ jobs:
121123

122124
- name: Run tests
123125
run: |
124-
./test.sh --release --clean --build-sysroot ${{ matrix.commands }}
126+
# TODO: remove --features master when it is back to the default.
127+
./test.sh --features master --release --clean --build-sysroot ${{ matrix.commands }}
125128
126129
duplicates:
127130
runs-on: ubuntu-latest

.github/workflows/failures.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@ jobs:
2121
libgccjit_version:
2222
- gcc: "libgccjit.so"
2323
artifacts_branch: "master"
24+
# TODO: switch back to --no-default-features in the case of libgccjit 12 when the default is to enable
25+
# master again.
26+
extra: "--features master"
2427
- gcc: "libgccjit_without_int128.so"
2528
artifacts_branch: "master-without-128bit-integers"
29+
extra: "--features master"
2630
- gcc: "libgccjit12.so"
2731
artifacts_branch: "gcc12"
28-
extra: "--no-default-features"
2932
# FIXME(antoyo): we need to set GCC_EXEC_PREFIX so that the linker can find the linker plugin.
3033
# Not sure why it's not found otherwise.
3134
env_extra: "TEST_FLAGS='-Cpanic=abort -Zpanic-abort-tests' GCC_EXEC_PREFIX=/usr/lib/gcc/"

.github/workflows/m68k.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@ jobs:
114114
- name: Build
115115
run: |
116116
./y.sh prepare --only-libcore --cross
117-
./y.sh build --target-triple m68k-unknown-linux-gnu
118-
CG_GCC_TEST_TARGET=m68k-unknown-linux-gnu cargo test
117+
# TODO: remove --features master when it is back to the default.
118+
./y.sh build --target-triple m68k-unknown-linux-gnu --features master
119+
# TODO: remove --features master when it is back to the default.
120+
CG_GCC_TEST_TARGET=m68k-unknown-linux-gnu cargo test --features master
119121
./clean_all.sh
120122
121123
- name: Prepare dependencies
@@ -136,4 +138,5 @@ jobs:
136138

137139
- name: Run tests
138140
run: |
139-
./test.sh --release --clean --build-sysroot ${{ matrix.commands }}
141+
# TODO: remove --features master when it is back to the default.
142+
./test.sh --release --features master --clean --build-sysroot ${{ matrix.commands }}

.github/workflows/release.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ jobs:
7878
- name: Build
7979
run: |
8080
./y.sh prepare --only-libcore
81-
EMBED_LTO_BITCODE=1 ./y.sh build --release --release-sysroot
82-
cargo test
81+
# TODO: remove --features master when it is back to the default.
82+
EMBED_LTO_BITCODE=1 ./y.sh build --release --release-sysroot --features master
83+
# TODO: remove --features master when it is back to the default.
84+
cargo test --features master
8385
./clean_all.sh
8486
8587
- name: Prepare dependencies
@@ -102,4 +104,5 @@ jobs:
102104

103105
- name: Run tests
104106
run: |
105-
EMBED_LTO_BITCODE=1 ./test.sh --release --clean --release-sysroot --build-sysroot ${{ matrix.commands }}
107+
# TODO: remove --features master when it is back to the default.
108+
EMBED_LTO_BITCODE=1 ./test.sh --release --clean --release-sysroot --build-sysroot ${{ matrix.commands }} --features master

.github/workflows/stdarch.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,10 @@ jobs:
9292
- name: Build
9393
run: |
9494
./y.sh prepare --only-libcore
95-
./y.sh build --release --release-sysroot
96-
cargo test
95+
# TODO: remove `--features master` when it is back to the default.
96+
./y.sh build --release --release-sysroot --features master
97+
# TODO: remove --features master when it is back to the default.
98+
cargo test --features master
9799
98100
- name: Clean
99101
if: ${{ !matrix.cargo_runner }}
@@ -111,12 +113,14 @@ jobs:
111113
uses: actions-rs/[email protected]
112114
with:
113115
command: build
114-
args: --release
116+
# TODO: remove `--features master` when it is back to the default.
117+
args: --release --features master
115118

116119
- name: Run tests
117120
if: ${{ !matrix.cargo_runner }}
118121
run: |
119-
./test.sh --release --clean --release-sysroot --build-sysroot --mini-tests --std-tests --test-libcore
122+
# TODO: remove `--features master` when it is back to the default.
123+
./test.sh --release --clean --release-sysroot --build-sysroot --mini-tests --std-tests --test-libcore --features master
120124
121125
- name: Run stdarch tests
122126
if: ${{ !matrix.cargo_runner }}

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ path = "tests/lang_tests_release.rs"
1818
harness = false
1919

2020
[features]
21-
default = ["master"]
2221
master = ["gccjit/master"]
2322

2423
[dependencies]

config.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ else
2525
exit 1
2626
fi
2727

28-
HOST_TRIPLE=$(rustc -vV | grep host | cut -d: -f2 | tr -d " ")
28+
HOST_TRIPLE=$($RUSTC -vV | grep host | cut -d: -f2 | tr -d " ")
2929
# TODO: remove $OVERWRITE_TARGET_TRIPLE when config.sh is removed.
3030
TARGET_TRIPLE="${OVERWRITE_TARGET_TRIPLE:-$HOST_TRIPLE}"
3131

@@ -54,6 +54,10 @@ if [[ -z "$BUILTIN_BACKEND" ]]; then
5454
export RUSTFLAGS="$CG_RUSTFLAGS $linker -Csymbol-mangling-version=v0 -Cdebuginfo=2 $disable_lto_flags -Zcodegen-backend=$(pwd)/target/${CHANNEL:-debug}/librustc_codegen_gcc.$dylib_ext --sysroot $(pwd)/build_sysroot/sysroot $TEST_FLAGS"
5555
else
5656
export RUSTFLAGS="$CG_RUSTFLAGS $linker -Csymbol-mangling-version=v0 -Cdebuginfo=2 $disable_lto_flags -Zcodegen-backend=gcc $TEST_FLAGS -Cpanic=abort"
57+
58+
if [[ ! -z "$RUSTC_SYSROOT" ]]; then
59+
export RUSTFLAGS="$RUSTFLAGS --sysroot $RUSTC_SYSROOT"
60+
fi
5761
fi
5862

5963
# FIXME(antoyo): remove once the atomic shim is gone

example/alloc_example.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extern "C" {
1818
}
1919

2020
#[panic_handler]
21-
fn panic_handler(_: &core::panic::PanicInfo) -> ! {
21+
fn panic_handler(_: &core::panic::PanicInfo<'_>) -> ! {
2222
core::intrinsics::abort();
2323
}
2424

example/alloc_system.rs

+14-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#![no_std]
55
#![feature(allocator_api, rustc_private)]
6-
#![cfg_attr(any(unix, target_os = "redox"), feature(libc))]
76

87
// The minimum alignment guaranteed by the architecture. This value is used to
98
// add fast paths for low alignment values.
@@ -48,7 +47,18 @@ mod realloc_fallback {
4847
}
4948
#[cfg(any(unix, target_os = "redox"))]
5049
mod platform {
51-
extern crate libc;
50+
mod libc {
51+
use core::ffi::{c_void, c_int};
52+
53+
#[link(name = "c")]
54+
extern "C" {
55+
pub fn malloc(size: usize) -> *mut c_void;
56+
pub fn realloc(ptr: *mut c_void, size: usize) -> *mut c_void;
57+
pub fn calloc(nmemb: usize, size: usize) -> *mut c_void;
58+
pub fn free(ptr: *mut u8);
59+
pub fn posix_memalign(memptr: *mut *mut c_void, alignment: usize, size: usize) -> c_int;
60+
}
61+
}
5262
use core::ptr;
5363
use MIN_ALIGN;
5464
use System;
@@ -82,12 +92,12 @@ mod platform {
8292
}
8393
#[inline]
8494
unsafe fn dealloc(&self, ptr: *mut u8, _layout: Layout) {
85-
libc::free(ptr as *mut libc::c_void)
95+
libc::free(ptr as *mut _)
8696
}
8797
#[inline]
8898
unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 {
8999
if layout.align() <= MIN_ALIGN && layout.align() <= new_size {
90-
libc::realloc(ptr as *mut libc::c_void, new_size) as *mut u8
100+
libc::realloc(ptr as *mut _, new_size) as *mut u8
91101
} else {
92102
self.realloc_fallback(ptr, layout, new_size)
93103
}

example/mod_bench.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
extern {}
77

88
#[panic_handler]
9-
fn panic_handler(_: &core::panic::PanicInfo) -> ! {
9+
fn panic_handler(_: &core::panic::PanicInfo<'_>) -> ! {
1010
core::intrinsics::abort();
1111
}
1212

failing-ui-tests12.txt

+1
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ tests/ui/sse2.rs
3939
tests/ui/codegen/issue-79865-llvm-miscompile.rs
4040
tests/ui/intrinsics/intrinsics-integer.rs
4141
tests/ui/std-backtrace.rs
42+
tests/ui/mir/alignment/packed.rs
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
From 7bcd24ec6d4a96121874cb1ae5a23ea274aeff34 Mon Sep 17 00:00:00 2001
1+
From a5663265f797a43c502915c356fe7899c16cee92 Mon Sep 17 00:00:00 2001
22
From: None <[email protected]>
3-
Date: Thu, 19 Oct 2023 13:12:51 -0400
3+
Date: Sat, 18 Nov 2023 10:50:36 -0500
44
Subject: [PATCH] [core] Disable portable-simd test
55

66
---
77
library/core/tests/lib.rs | 2 --
88
1 file changed, 2 deletions(-)
99

1010
diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs
11-
index 5814ed4..194ad4c 100644
11+
index d0a119c..76fdece 100644
1212
--- a/library/core/tests/lib.rs
1313
+++ b/library/core/tests/lib.rs
14-
@@ -90,7 +90,6 @@
14+
@@ -89,7 +89,6 @@
15+
#![feature(never_type)]
1516
#![feature(unwrap_infallible)]
16-
#![feature(pointer_byte_offsets)]
1717
#![feature(pointer_is_aligned)]
1818
-#![feature(portable_simd)]
1919
#![feature(ptr_metadata)]
2020
#![feature(lazy_cell)]
2121
#![feature(unsized_tuple_coercion)]
22-
@@ -157,7 +156,6 @@ mod pin;
22+
@@ -155,7 +154,6 @@ mod pin;
2323
mod pin_macro;
2424
mod ptr;
2525
mod result;
@@ -28,5 +28,5 @@ index 5814ed4..194ad4c 100644
2828
mod str;
2929
mod str_lossy;
3030
--
31-
2.42.0
31+
2.42.1
3232

rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2023-10-21"
2+
channel = "nightly-2023-11-17"
33
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]

src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
* TODO(antoyo): remove the patches.
1313
*/
1414

15-
#![cfg_attr(not(bootstrap), allow(internal_features))]
16-
#![cfg_attr(not(bootstrap), doc(rust_logo))]
17-
#![cfg_attr(not(bootstrap), feature(rustdoc_internals))]
15+
#![allow(internal_features)]
16+
#![doc(rust_logo)]
17+
#![feature(rustdoc_internals)]
1818
#![feature(
1919
rustc_private,
2020
decl_macro,
@@ -402,7 +402,7 @@ pub fn target_features(sess: &Session, allow_unstable: bool, target_info: &Locke
402402
.iter()
403403
.filter_map(
404404
|&(feature, gate)| {
405-
if sess.is_nightly_build() || allow_unstable || gate.is_none() { Some(feature) } else { None }
405+
if sess.is_nightly_build() || allow_unstable || gate.is_stable() { Some(feature) } else { None }
406406
},
407407
)
408408
.filter(|_feature| {

0 commit comments

Comments
 (0)