Skip to content

Sync from rust 2025/02/14 #631

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

Closed
wants to merge 43 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
60ee6fb
Update tests.
m-ou-se Oct 31, 2024
0f89f3f
Use a C-safe return type for `__rust_[ui]128_*` overflowing intrinsics
tgross35 Dec 15, 2024
daeeffa
Rollup merge of #132397 - m-ou-se:warn-missing-abi, r=Nadrieril
jhpratt Jan 15, 2025
cdf26a1
Rollup merge of #134338 - tgross35:overflowing-c-safe-ret, r=bjorn3,a…
jhpratt Jan 15, 2025
4600047
When LLVM's location discriminator value limit is exceeded, emit loca…
khuey Jan 17, 2025
49e047f
Treat undef bytes as equal to any other byte
oli-obk Jan 8, 2025
301d247
remove support for the #[start] attribute
RalfJung Dec 14, 2024
c482251
Auto merge of #134299 - RalfJung:remove-start, r=compiler-errors
bors Jan 21, 2025
0692ca3
Make CodegenCx and Builder generic
ZuseZ4 Jan 24, 2025
d6d7c15
Merge commit '9f33f846ddc06afd7ffd839ee4f18babac3f3204'
GuillaumeGomez Jan 24, 2025
4fec62a
Rollup merge of #135581 - EnzymeAD:refactor-codgencx, r=oli-obk
matthiaskrgr Jan 24, 2025
24ce0a2
Stabilize `const_black_box`
tgross35 Jan 12, 2025
06f8ed1
Auto merge of #136024 - GuillaumeGomez:cg_gcc-subtree, r=GuillaumeGomez
bors Jan 27, 2025
600999a
ABI-required target features: warn when they are missing in base CPU …
RalfJung Jan 27, 2025
90a6f2b
Do not treat vtable supertraits as distinct when bound with different…
compiler-errors Jan 10, 2025
12feb0e
Use ExistentialTraitRef throughout codegen
compiler-errors Jan 10, 2025
a05dca8
Rollup merge of #135414 - tgross35:stabilize-const_black_box, r=dtolnay
jhpratt Jan 31, 2025
afe0843
Auto merge of #136331 - jhpratt:rollup-curo1f4, r=jhpratt
bors Jan 31, 2025
e0d8fb9
tree-wide: parallel: Fully removed all `Lrc`, replaced with `Arc`
safinaskar Feb 3, 2025
819ab9b
cg_gcc: Directly use rustc_abi instead of reexports
workingjubilee Nov 3, 2024
db4b00f
Auto merge of #136471 - safinaskar:parallel, r=SparrowLii
bors Feb 6, 2025
21b60aa
Remove Linkage::Private
bjorn3 Feb 7, 2025
a90648d
Remove Linkage::Appending
bjorn3 Feb 7, 2025
83f7576
compiler: remove reexports from rustc_target::callconv
workingjubilee Feb 5, 2025
180f350
Rustfmt
bjorn3 Feb 8, 2025
01f1025
Rollup merge of #136706 - workingjubilee:finish-up-rustc-abi-updates,…
workingjubilee Feb 9, 2025
5bf05c1
Auto merge of #136751 - bjorn3:update_rustfmt, r=Mark-Simulacrum
bors Feb 9, 2025
65da92e
cg_gcc: stop caring about compiling for unknown targets
workingjubilee Feb 10, 2025
d7f2227
compiler/rustc_codegen_gcc/src/back/lto.rs: delete "unsafe impl Sync/…
safinaskar Feb 11, 2025
feb78f9
Implement and use BikeshedGuaranteedNoDrop for union/unsafe field val…
compiler-errors Feb 6, 2025
853ae3d
Rollup merge of #136858 - safinaskar:parallel-cleanup-2025-02-11-07-5…
jhpratt Feb 13, 2025
fd526a2
Make `-O` mean `-C opt-level=3`
clubby789 Jan 13, 2025
b79dd82
Merge branch 'master' into sync_from_rust_2025_02_14
antoyo Feb 14, 2025
9928586
Update to nightly-2025-02-14
antoyo Feb 14, 2025
b6026d3
Fix patches
antoyo Feb 14, 2025
7f0b5e4
Fix libcore tests
antoyo Feb 14, 2025
98b00c2
Fix compilation
antoyo Feb 14, 2025
1bbe493
Format
antoyo Feb 14, 2025
40c1684
Update other patches
antoyo Feb 14, 2025
db36370
Fix clippy warnings
antoyo Feb 14, 2025
b425573
Fix tests
antoyo Feb 14, 2025
145c830
Remove test
antoyo Feb 14, 2025
f0a138e
Update GCC version
antoyo Feb 14, 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
28 changes: 1 addition & 27 deletions build_system/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,19 +426,6 @@ fn std_tests(env: &Env, args: &TestArg) -> Result<(), String> {
run_command_with_env(&command, None, Some(env))?;
maybe_run_command_in_vm(&[&cargo_target_dir.join("track-caller-attribute")], env, args)?;

// FIXME: create a function "display_if_not_quiet" or something along the line.
println!("[AOT] mod_bench");
let mut command = args.config_info.rustc_command_vec();
command.extend_from_slice(&[
&"example/mod_bench.rs",
&"--crate-type",
&"bin",
&"--target",
&args.config_info.target_triple,
]);
run_command_with_env(&command, None, Some(env))?;
// FIXME: the compiled binary is not run.

Ok(())
}

Expand Down Expand Up @@ -691,25 +678,12 @@ fn test_projects(env: &Env, args: &TestArg) -> Result<(), String> {
fn test_libcore(env: &Env, args: &TestArg) -> Result<(), String> {
// FIXME: create a function "display_if_not_quiet" or something along the line.
println!("[TEST] libcore");
let path = get_sysroot_dir().join("sysroot_src/library/core/tests");
let path = get_sysroot_dir().join("sysroot_src/library/coretests");
let _ = remove_dir_all(path.join("target"));
run_cargo_command(&[&"test"], Some(&path), env, args)?;
Ok(())
}

// echo "[BENCH COMPILE] mod_bench"
//
// COMPILE_MOD_BENCH_INLINE="$RUSTC example/mod_bench.rs --crate-type bin -Zmir-opt-level=3 -O --crate-name mod_bench_inline"
// COMPILE_MOD_BENCH_LLVM_0="rustc example/mod_bench.rs --crate-type bin -Copt-level=0 -o $cargo_target_dir/mod_bench_llvm_0 -Cpanic=abort"
// COMPILE_MOD_BENCH_LLVM_1="rustc example/mod_bench.rs --crate-type bin -Copt-level=1 -o $cargo_target_dir/mod_bench_llvm_1 -Cpanic=abort"
// COMPILE_MOD_BENCH_LLVM_2="rustc example/mod_bench.rs --crate-type bin -Copt-level=2 -o $cargo_target_dir/mod_bench_llvm_2 -Cpanic=abort"
// COMPILE_MOD_BENCH_LLVM_3="rustc example/mod_bench.rs --crate-type bin -Copt-level=3 -o $cargo_target_dir/mod_bench_llvm_3 -Cpanic=abort"
//
// Use 100 runs, because a single compilations doesn't take more than ~150ms, so it isn't very slow
// hyperfine --runs ${COMPILE_RUNS:-100} "$COMPILE_MOD_BENCH_INLINE" "$COMPILE_MOD_BENCH_LLVM_0" "$COMPILE_MOD_BENCH_LLVM_1" "$COMPILE_MOD_BENCH_LLVM_2" "$COMPILE_MOD_BENCH_LLVM_3"
// echo "[BENCH RUN] mod_bench"
// hyperfine --runs ${RUN_RUNS:-10} $cargo_target_dir/mod_bench{,_inline} $cargo_target_dir/mod_bench_llvm_*

fn extended_rand_tests(env: &Env, args: &TestArg) -> Result<(), String> {
if !args.is_using_gcc_master_branch() {
println!("Not using GCC master branch. Skipping `extended_rand_tests`.");
Expand Down
7 changes: 4 additions & 3 deletions example/alloc_example.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![feature(start, core_intrinsics, alloc_error_handler, lang_items)]
#![feature(core_intrinsics, alloc_error_handler, lang_items)]
#![no_std]
#![no_main]
#![allow(internal_features)]

extern crate alloc;
Expand Down Expand Up @@ -37,8 +38,8 @@ unsafe extern "C" fn _Unwind_Resume() {
core::intrinsics::unreachable();
}

#[start]
fn main(_argc: isize, _argv: *const *const u8) -> isize {
#[no_mangle]
extern "C" fn main(_argc: core::ffi::c_int, _argv: *const *const u8) -> core::ffi::c_int {
let world: Box<&str> = Box::new("Hello World!\0");
unsafe {
puts(*world as *const str as *const u8);
Expand Down
30 changes: 29 additions & 1 deletion example/mini_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ impl<T: ?Sized, A: Allocator> LegacyReceiver for Box<T, A> {}
#[lang = "copy"]
pub trait Copy {}

#[lang = "bikeshed_guaranteed_no_drop"]
pub trait BikeshedGuaranteedNoDrop {}

impl Copy for bool {}
impl Copy for u8 {}
impl Copy for u16 {}
Expand Down Expand Up @@ -139,6 +142,14 @@ impl Mul for usize {
}
}

impl Mul for i32 {
type Output = Self;

fn mul(self, rhs: Self) -> Self::Output {
self * rhs
}
}

#[lang = "add"]
pub trait Add<RHS = Self> {
type Output;
Expand All @@ -162,6 +173,14 @@ impl Add for i8 {
}
}

impl Add for i32 {
type Output = Self;

fn add(self, rhs: Self) -> Self {
self + rhs
}
}

impl Add for usize {
type Output = Self;

Expand Down Expand Up @@ -209,6 +228,14 @@ impl Sub for i8 {
}
}

impl Sub for i32 {
type Output = Self;

fn sub(self, rhs: Self) -> Self {
self - rhs
}
}

impl Sub for i16 {
type Output = Self;

Expand Down Expand Up @@ -664,6 +691,7 @@ pub mod libc {
pub fn memcpy(dst: *mut u8, src: *const u8, size: usize);
pub fn memmove(dst: *mut u8, src: *const u8, size: usize);
pub fn strncpy(dst: *mut u8, src: *const u8, size: usize);
pub fn exit(status: i32);
}
}

Expand All @@ -689,7 +717,7 @@ impl<T> Index<usize> for [T] {
}
}

extern {
extern "C" {
type VaListImpl;
}

Expand Down
6 changes: 3 additions & 3 deletions example/mini_core_hello_world.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Adapted from https://github.com/sunfishcode/mir2cranelift/blob/master/rust-examples/nocore-hello-world.rs

#![feature(
no_core, unboxed_closures, start, lang_items, never_type, linkage,
no_core, unboxed_closures, lang_items, never_type, linkage,
extern_types, thread_local
)]
#![no_core]
Expand Down Expand Up @@ -258,13 +258,13 @@ fn main() {

assert_eq!(((|()| 42u8) as fn(()) -> u8)(()), 42);

extern {
extern "C" {
#[linkage = "weak"]
static ABC: *const u8;
}

{
extern {
extern "C" {
#[linkage = "weak"]
static ABC: *const u8;
}
Expand Down
36 changes: 0 additions & 36 deletions example/mod_bench.rs

This file was deleted.

2 changes: 1 addition & 1 deletion example/std_example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::arch::x86_64::*;
use std::io::Write;
use std::ops::Coroutine;

extern {
extern "C" {
pub fn printf(format: *const i8, ...) -> i32;
}

Expand Down
2 changes: 1 addition & 1 deletion libgccjit.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d6f5a708104a98199ac0f01a3b6b279a0f7c66d3
48664a6cab29d48138ffa004b7978d52ef73e3ac
44 changes: 0 additions & 44 deletions patches/0022-core-Disable-not-compiling-tests.patch

This file was deleted.

20 changes: 10 additions & 10 deletions patches/0028-core-Disable-long-running-tests.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ Date: Fri, 3 Dec 2021 12:16:30 +0100
Subject: [PATCH] Disable long running tests

---
library/core/tests/slice.rs | 2 ++
library/coretests/tests/slice.rs | 2 ++
1 file changed, 2 insertions(+)

diff --git a/library/core/tests/slice.rs b/library/core/tests/slice.rs
index 8402833..84592e0 100644
--- a/library/core/tests/slice.rs
+++ b/library/core/tests/slice.rs
@@ -2462,6 +2462,7 @@ take_tests! {
diff --git a/library/coretests/tests/slice.rs b/library/coretests/tests/slice.rs
index caffb66..c60a50c 100644
--- a/library/coretests/tests/slice.rs
+++ b/library/coretests/tests/slice.rs
@@ -2488,6 +2488,7 @@ split_off_tests! {
#[cfg(not(miri))] // unused in Miri
const EMPTY_MAX: &'static [()] = &[(); usize::MAX];

+/*
// can't be a constant due to const mutability rules
#[cfg(not(miri))] // unused in Miri
macro_rules! empty_max_mut {
@@ -2485,6 +2486,7 @@ take_tests! {
(take_mut_oob_max_range_to_inclusive, (..=usize::MAX), None, empty_max_mut!()),
(take_mut_in_bounds_max_range_from, (usize::MAX..), Some(&mut [] as _), empty_max_mut!()),
@@ -2511,6 +2512,7 @@ split_off_tests! {
(split_off_mut_oob_max_range_to_inclusive, (..=usize::MAX), None, empty_max_mut!()),
(split_off_mut_in_bounds_max_range_from, (usize::MAX..), Some(&mut [] as _), empty_max_mut!()),
}
+*/

#[test]
fn test_slice_from_ptr_range() {
--
2.26.2.7.g19db9cfb68
2.48.1

Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@ Date: Thu, 28 Sep 2023 17:37:38 -0400
Subject: [PATCH] Disable libstd and libtest dylib

---
library/std/Cargo.toml | 2 +-
library/test/Cargo.toml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
library/std/Cargo.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/library/std/Cargo.toml b/library/std/Cargo.toml
index 5b21355..cb0c49b 100644
index add5a20..3d670d2 100644
--- a/library/std/Cargo.toml
+++ b/library/std/Cargo.toml
@@ -9,7 +9,7 @@ description = "The Rust Standard Library"
edition = "2021"
@@ -10,7 +10,7 @@ edition = "2021"
autobenches = false

[lib]
-crate-type = ["dylib", "rlib"]
+crate-type = ["rlib"]

[dependencies]
alloc = { path = "../alloc", public = true }
--
2.48.1

18 changes: 10 additions & 8 deletions patches/libgccjit12/0001-core-Disable-portable-simd-test.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,29 @@ Date: Sat, 18 Nov 2023 10:50:36 -0500
Subject: [PATCH] [core] Disable portable-simd test

---
library/core/tests/lib.rs | 2 --
library/coretests/tests/lib.rs | 2 --
1 file changed, 2 deletions(-)

diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs
index b71786c..cf484d5 100644
--- a/library/core/tests/lib.rs
+++ b/library/core/tests/lib.rs
@@ -87,7 +87,6 @@
diff --git a/library/coretests/tests/lib.rs b/library/coretests/tests/lib.rs
index ff4776f..5715ab4 100644
--- a/library/coretests/tests/lib.rs
+++ b/library/coretests/tests/lib.rs
@@ -65,7 +65,6 @@
#![feature(numfmt)]
#![feature(pattern)]
#![feature(pointer_is_aligned_to)]
-#![feature(portable_simd)]
#![feature(ptr_metadata)]
#![feature(slice_from_ptr_range)]
#![feature(slice_internals)]
@@ -155,7 +154,6 @@ mod pin;
@@ -169,7 +168,6 @@ mod pin;
mod pin_macro;
mod ptr;
mod result;
-mod simd;
mod slice;
mod str;
mod str_lossy;
-- 2.45.2
--
2.48.1

2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2025-01-12"
channel = "nightly-2025-02-14"
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]
Loading
Loading