Skip to content

Sync from rust 2024/06/18 #532

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 82 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
3ca0c59
Forbid implementing `Freeze` even if the trait is stabilized
oli-obk Feb 23, 2024
929e12d
Stabilize associated type bounds
compiler-errors Mar 5, 2024
d0dc943
Introduce perma-unstable `wasm-c-abi` flag
daxpedda Feb 27, 2024
dd9407d
use Instance::expect_resolve() instead of unwraping Instance::resolve()
RalfJung Mar 10, 2024
915646f
Rename `IntoDiagnostic` as `Diagnostic`.
nnethercote Mar 6, 2024
0031b21
Auto merge of #122132 - nnethercote:diag-renaming3, r=nnethercote
bors Mar 11, 2024
a6202e2
Rollup merge of #121840 - oli-obk:freeze, r=dtolnay
jhpratt Mar 11, 2024
be24d39
Use published gccjit dependency instead of git repository
GuillaumeGomez Mar 11, 2024
e3a9b1d
Check whether a static is mutable instead of passing it down
oli-obk Oct 6, 2023
8fdfbf5
Make some functions private that are only ever used in the same module
oli-obk Feb 26, 2024
6d573e9
Ensure nested allocations in statics do not get deduplicated
oli-obk Feb 26, 2024
e7795ed
Some comment nits
oli-obk Mar 11, 2024
a64942a
Mark codegen_gcc fields used only on feature master as such
krtab Jan 4, 2024
9476fe7
avoid naming LLVM basic blocks when fewer_names is true
erikdesjardins Mar 15, 2024
ff2b405
revert changes and just delete the fixme
erikdesjardins Mar 16, 2024
678e624
Auto merge of #122055 - compiler-errors:stabilize-atb, r=oli-obk
bors Mar 19, 2024
c8cb091
Codegen const panic messages as function calls
Mark-Simulacrum Mar 18, 2024
83eaede
Make RawPtr take Ty and Mutbl separately
compiler-errors Mar 21, 2024
a951158
Auto merge of #119552 - krtab:dead_code_priv_mod_pub_field, r=cjgillo…
bors Mar 23, 2024
95c7fde
Unbox and unwrap the contents of `StatementKind::Coverage`
Zalathar Mar 23, 2024
abbe1ba
CFI: Use Instance at callsites
maurer Mar 15, 2024
1a05106
Add+Use `mir::BinOp::Cmp`
scottmcm Mar 6, 2023
1ee4ae9
Rollup merge of #122937 - Zalathar:unbox, r=oli-obk
matthiaskrgr Mar 24, 2024
211b585
Auto merge of #122671 - Mark-Simulacrum:const-panic-msg, r=Nilstrieb
bors Mar 29, 2024
cc98f86
stabilize ptr.is_aligned, move ptr.is_aligned_to to a new feature gate
Gankra Mar 3, 2024
27ba1ba
Auto merge of #118310 - scottmcm:three-way-compare, r=davidtwco
bors Apr 2, 2024
f7a6ac1
Rollup merge of #122334 - GuillaumeGomez:vendor-cg_gcc, r=Mark-Simula…
GuillaumeGomez Apr 5, 2024
040afd3
Save/restore more items in cache with incremental compilation
pacak Apr 6, 2024
b9b05d5
Make `PlaceRef` hold a `PlaceValue` for the non-layout fields (like `…
scottmcm Apr 11, 2024
cccf379
Put `PlaceValue` into `OperandValue::Ref`, rather than 3 tuple fields
scottmcm Apr 11, 2024
4ea3389
use [N x i8] for alloca types
erikdesjardins Feb 24, 2024
50a1471
restore location in gcc alloca codegen
erikdesjardins Apr 12, 2024
6f36e82
static_mut_refs: use raw pointers to remove the remaining FIXME
RalfJung Apr 15, 2024
0f17e5a
Auto merge of #117919 - daxpedda:wasm-c-abi, r=wesleywiser
bors Apr 19, 2024
dd50f45
Fixup `rustc_codegen_gcc` test signature
WaffleLapkin Apr 20, 2024
224285d
Rollup merge of #123967 - RalfJung:static_mut_refs, r=Nilstrieb
jieyouxu Apr 20, 2024
2d082ae
Stabilize the size of incr comp object file names
saethlin Apr 3, 2024
79d217f
Rollup merge of #124003 - WaffleLapkin:dellvmization, r=scottmcm,Ralf…
matthiaskrgr Apr 23, 2024
752af44
Auto merge of #122053 - erikdesjardins:alloca, r=nikic
bors Apr 24, 2024
df0639b
Error on using `yield` without also using `#[coroutine]` on the closure
oli-obk Apr 11, 2024
2b875f0
Step bootstrap cfgs
Mark-Simulacrum Apr 29, 2024
3ea32a7
Inline & delete `Ty::new_unit`, since it's just a field access
WaffleLapkin May 2, 2024
7ed351a
Rollup merge of #124624 - WaffleLapkin:old_unit, r=fmease
matthiaskrgr May 2, 2024
efa15eb
Auto merge of #123441 - saethlin:fixed-len-file-names, r=oli-obk
bors May 3, 2024
f26221a
Refactor float `Primitive`s to a separate `Float` type
beetrees May 6, 2024
6b7db50
Simplify `use crate::rustc_foo::bar` occurrences.
nnethercote May 8, 2024
7ad7346
codegen: memmove/memset cannot be non-temporal
RalfJung May 9, 2024
ce11a86
Rollup merge of #124797 - beetrees:primitive-float, r=davidtwco
matthiaskrgr May 10, 2024
06f1ba4
Auto merge of #124972 - matthiaskrgr:rollup-3fablim, r=matthiaskrgr
bors May 10, 2024
21f58e4
Rename Unsafe to Safety
spastorino May 17, 2024
cae9e7e
Stop using `to_hir_binop` in codegen
scottmcm May 22, 2024
29fc479
rustc_codegen_llvm: add support for writing summary bitcode
durin42 Jan 19, 2024
4a79b06
rustc_codegen_gcc: fix changed method signature
durin42 May 23, 2024
a1d2933
Rollup merge of #125345 - durin42:thin-link-bitcode, r=bjorn3
GuillaumeGomez May 23, 2024
b2d3981
Uplift TypeRelation and Relate
compiler-errors May 31, 2024
d565d3d
ScalarInt: size mismatches are a bug, do not delay the panic
RalfJung Jun 8, 2024
47dbb5f
Merge branch 'master' into sync_from_rust_2024_06_18
antoyo Jun 18, 2024
82df918
Fix libcore patch
GuillaumeGomez Mar 26, 2024
9e688c0
Fix non-master build
GuillaumeGomez Mar 26, 2024
f777797
Format code
GuillaumeGomez May 15, 2024
ea5945f
Update libgccjit version
GuillaumeGomez Mar 27, 2024
1665f69
Fix casts
GuillaumeGomez Apr 3, 2024
5cc56e1
Fix usage of `get_size` for gcc 12
GuillaumeGomez Apr 3, 2024
f44e15a
Remove usage of `-Zno-parallel-llvm`
GuillaumeGomez Mar 27, 2024
269caff
Fix clippy lint
GuillaumeGomez Mar 27, 2024
91cc60d
Fix stdarch crate add patch
GuillaumeGomez Apr 2, 2024
7737cf9
If the type of a global is not the same, we remove the global and rep…
GuillaumeGomez Apr 19, 2024
7dd901b
Update gcc version to 272d0ccced960394fe6ff2b40b01610208cb4940
GuillaumeGomez Apr 25, 2024
ec1efbf
Add shl and shr missing casts
GuillaumeGomez May 21, 2024
ddd3131
Add missing cast for function_ptr arguments
GuillaumeGomez May 21, 2024
920dfa4
Fix warnings
GuillaumeGomez May 21, 2024
b9282c5
Add explanations for ptr func call argument cast
GuillaumeGomez May 22, 2024
d14f440
Remove the hack in zext
antoyo Jun 12, 2024
765274b
Fix provenance intrinsics
antoyo Jun 18, 2024
c341614
Fix tests
antoyo Jun 18, 2024
c6b872b
WIP: Implement dummy ThinLTO
antoyo Jun 26, 2024
ec46c89
Fix type of intrinsics
antoyo Jun 28, 2024
2b070a6
Fix clippy warnings
antoyo Jun 28, 2024
7562d2c
Fix build failure in cfg-if
GuillaumeGomez Jun 28, 2024
3484ed0
Comment libgccjit 12 CI
antoyo Jun 30, 2024
5b0034c
Replace the type of global variables instead of replacing them
antoyo Jul 2, 2024
a003e7a
Fix intrinsic/generic-arithmetic-pass.rs test
antoyo Jul 2, 2024
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
40 changes: 21 additions & 19 deletions .github/workflows/gcc12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,24 @@ jobs:
- name: Build
run: |
./y.sh prepare --only-libcore --libgccjit12-patches
./y.sh build --sysroot --no-default-features --sysroot-panic-abort
cargo test --no-default-features
./y.sh clean all

- name: Prepare dependencies
run: |
git config --global user.email "[email protected]"
git config --global user.name "User"
./y.sh prepare --libgccjit12-patches

- name: Add more failing tests for GCC 12
run: cat tests/failing-ui-tests12.txt >> tests/failing-ui-tests.txt

- name: Add more failing tests because the sysroot is not compiled with LTO
run: cat tests/failing-non-lto-tests.txt >> tests/failing-ui-tests.txt

- name: Run tests
run: |
./y.sh test --release --clean --build-sysroot ${{ matrix.commands }} --no-default-features
./y.sh build --no-default-features
# Uncomment when we no longer need to remove global variables.
#./y.sh build --sysroot --no-default-features --sysroot-panic-abort
#cargo test --no-default-features
#./y.sh clean all

#- name: Prepare dependencies
#run: |
#git config --global user.email "[email protected]"
#git config --global user.name "User"
#./y.sh prepare --libgccjit12-patches

#- name: Add more failing tests for GCC 12
#run: cat tests/failing-ui-tests12.txt >> tests/failing-ui-tests.txt

#- name: Add more failing tests because the sysroot is not compiled with LTO
#run: cat tests/failing-non-lto-tests.txt >> tests/failing-ui-tests.txt

#- name: Run tests
#run: |
#./y.sh test --release --clean --build-sysroot ${{ matrix.commands }} --no-default-features
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ master = ["gccjit/master"]
default = ["master"]

[dependencies]
gccjit = { git = "https://github.com/antoyo/gccjit.rs" }
#gccjit = "2.0"
gccjit = { git = "https://github.com/rust-lang/gccjit.rs" }

# Local copy.
#gccjit = { path = "../gccjit.rs" }
Expand Down
5 changes: 3 additions & 2 deletions build_system/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,10 @@ impl ConfigInfo {

// Since we don't support ThinLTO, disable LTO completely when not trying to do LTO.
// TODO(antoyo): remove when we can handle ThinLTO.
if !env.contains_key(&"FAT_LTO".to_string()) {
// TODO: remove:
/*if !env.contains_key(&"FAT_LTO".to_string()) {
rustflags.push("-Clto=off".to_string());
}
}*/
// FIXME(antoyo): remove once the atomic shim is gone
if os_name == "Darwin" {
rustflags.extend_from_slice(&[
Expand Down
8 changes: 6 additions & 2 deletions build_system/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -645,12 +645,16 @@ fn test_projects(env: &Env, args: &TestArg) -> Result<(), String> {
//"https://github.com/rust-lang/cargo", // TODO: very slow, only run on master?
];

let mut env = env.clone();
let rustflags =
format!("{} --cap-lints allow", env.get("RUSTFLAGS").cloned().unwrap_or_default());
env.insert("RUSTFLAGS".to_string(), rustflags);
let run_tests = |projects_path, iter: &mut dyn Iterator<Item = &&str>| -> Result<(), String> {
for project in iter {
let clone_result = git_clone_root_dir(project, projects_path, true)?;
let repo_path = Path::new(&clone_result.repo_dir);
run_cargo_command(&[&"build", &"--release"], Some(repo_path), env, args)?;
run_cargo_command(&[&"test"], Some(repo_path), env, args)?;
run_cargo_command(&[&"build", &"--release"], Some(repo_path), &env, args)?;
run_cargo_command(&[&"test"], Some(repo_path), &env, args)?;
}

Ok(())
Expand Down
3 changes: 2 additions & 1 deletion example/example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ fn array_as_slice(arr: &[u8; 3]) -> &[u8] {
arr
}

unsafe fn use_ctlz_nonzero(a: u16) -> u16 {
// FIXME: fix the intrinsic implementation to work with the new ->u32 signature
unsafe fn use_ctlz_nonzero(a: u16) -> u32 {
intrinsics::ctlz_nonzero(a)
}

Expand Down
33 changes: 31 additions & 2 deletions example/mini_core.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![feature(
no_core, lang_items, intrinsics, unboxed_closures, type_ascription, extern_types,
decl_macro, rustc_attrs, transparent_unions, auto_traits,
decl_macro, rustc_attrs, transparent_unions, auto_traits, freeze_impls,
thread_local
)]
#![no_core]
Expand Down Expand Up @@ -418,6 +418,35 @@ pub fn panic(_msg: &'static str) -> ! {
}
}

macro_rules! panic_const {
($($lang:ident = $message:expr,)+) => {
pub mod panic_const {
use super::*;

$(
#[track_caller]
#[lang = stringify!($lang)]
pub fn $lang() -> ! {
panic($message);
}
)+
}
}
}

panic_const! {
panic_const_add_overflow = "attempt to add with overflow",
panic_const_sub_overflow = "attempt to subtract with overflow",
panic_const_mul_overflow = "attempt to multiply with overflow",
panic_const_div_overflow = "attempt to divide with overflow",
panic_const_rem_overflow = "attempt to calculate the remainder with overflow",
panic_const_neg_overflow = "attempt to negate with overflow",
panic_const_shr_overflow = "attempt to shift right with overflow",
panic_const_shl_overflow = "attempt to shift left with overflow",
panic_const_div_by_zero = "attempt to divide by zero",
panic_const_rem_by_zero = "attempt to calculate the remainder with a divisor of zero",
}

#[lang = "panic_cannot_unwind"]
fn panic_cannot_unwind() -> ! {
unsafe {
Expand Down Expand Up @@ -563,7 +592,7 @@ pub mod intrinsics {
pub fn min_align_of_val<T: ?Sized>(val: *const T) -> usize;
pub fn copy<T>(src: *const T, dst: *mut T, count: usize);
pub fn transmute<T, U>(e: T) -> U;
pub fn ctlz_nonzero<T>(x: T) -> T;
pub fn ctlz_nonzero<T>(x: T) -> u32;
#[rustc_safe_intrinsic]
pub fn needs_drop<T: ?Sized>() -> bool;
#[rustc_safe_intrinsic]
Expand Down
6 changes: 2 additions & 4 deletions example/mini_core_hello_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#![feature(
no_core, unboxed_closures, start, lang_items, never_type, linkage,
extern_types, thread_local
extern_types, thread_local, raw_ref_op
)]
#![no_core]
#![allow(dead_code, internal_features, non_camel_case_types)]
Expand Down Expand Up @@ -99,9 +99,7 @@ fn start<T: Termination + 'static>(

static mut NUM: u8 = 6 * 7;

// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint
#[allow(static_mut_refs)]
static NUM_REF: &'static u8 = unsafe { &NUM };
static NUM_REF: &'static u8 = unsafe { &* &raw const NUM };

macro_rules! assert {
($e:expr) => {
Expand Down
4 changes: 2 additions & 2 deletions example/std_example.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![allow(internal_features)]
#![feature(core_intrinsics, coroutines, coroutine_trait, is_sorted)]
#![feature(core_intrinsics, coroutines, coroutine_trait, is_sorted, stmt_expr_attributes)]

#[cfg(feature="master")]
#[cfg(target_arch="x86_64")]
Expand Down Expand Up @@ -103,7 +103,7 @@ fn main() {
test_simd();
}

Box::pin(move |mut _task_context| {
Box::pin(#[coroutine] move |mut _task_context| {
yield ();
}).as_mut().resume(0);

Expand Down
2 changes: 1 addition & 1 deletion libgccjit.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b6f163f52
341be3b7d7ac6976cfed8ed59da3573c040d0776
2 changes: 1 addition & 1 deletion patches/0001-Add-stdarch-Cargo.toml-for-testing.patch
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ index 0000000..4c63700
+members = [
+ "crates/core_arch",
+ "crates/std_detect",
+ "crates/stdarch-gen",
+ "crates/stdarch-gen-arm",
+ #"examples/"
+]
+exclude = [
Expand Down
2 changes: 1 addition & 1 deletion patches/0022-core-Disable-not-compiling-tests.patch
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ index 42a26ae..5ac1042 100644
+#![cfg(test)]
#![feature(alloc_layout_extra)]
#![feature(array_chunks)]
#![feature(array_windows)]
#![feature(array_ptr_get)]
14 changes: 7 additions & 7 deletions patches/libgccjit12/0001-core-Disable-portable-simd-test.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From a5663265f797a43c502915c356fe7899c16cee92 Mon Sep 17 00:00:00 2001
From 124a11ce086952a5794d5cfbaa45175809497b81 Mon Sep 17 00:00:00 2001
From: None <[email protected]>
Date: Sat, 18 Nov 2023 10:50:36 -0500
Subject: [PATCH] [core] Disable portable-simd test
Expand All @@ -8,18 +8,18 @@ Subject: [PATCH] [core] Disable portable-simd test
1 file changed, 2 deletions(-)

diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs
index d0a119c..76fdece 100644
index b71786c..cf484d5 100644
--- a/library/core/tests/lib.rs
+++ b/library/core/tests/lib.rs
@@ -89,7 +89,6 @@
@@ -95,7 +95,6 @@
#![feature(never_type)]
#![feature(unwrap_infallible)]
#![feature(pointer_is_aligned)]
#![feature(pointer_is_aligned_to)]
-#![feature(portable_simd)]
#![feature(ptr_metadata)]
#![feature(lazy_cell)]
#![feature(unsized_tuple_coercion)]
@@ -155,7 +154,6 @@ mod pin;
#![feature(const_option)]
@@ -157,7 +156,6 @@ mod pin;
mod pin_macro;
mod ptr;
mod result;
Expand All @@ -28,5 +28,5 @@ index d0a119c..76fdece 100644
mod str;
mod str_lossy;
--
2.42.1
2.45.2

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-2024-03-10"
channel = "nightly-2024-06-18"
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]
2 changes: 1 addition & 1 deletion src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
let builtin_unreachable = self.context.get_builtin_function("__builtin_unreachable");
let builtin_unreachable: RValue<'gcc> =
unsafe { std::mem::transmute(builtin_unreachable) };
self.call(self.type_void(), None, None, builtin_unreachable, &[], None);
self.call(self.type_void(), None, None, builtin_unreachable, &[], None, None);
}

// Write results to outputs.
Expand Down
Loading
Loading