Skip to content

Commit 30bd492

Browse files
authored
Merge pull request #844 from rust-lang/sync_from_rust_2026_01_28
Sync from rust 2026/01/28
2 parents 48a52d9 + 809af1f commit 30bd492

File tree

22 files changed

+225
-94
lines changed

22 files changed

+225
-94
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ jobs:
113113
git config --global user.name "User"
114114
./y.sh prepare
115115
116+
- name: Add more failing tests for GCC without 128-bit integers support
117+
if: ${{ matrix.libgccjit_version.gcc == 'gcc-15-without-int128.deb' }}
118+
run: cat tests/failing-ui-tests-without-128bit-integers.txt >> tests/failing-ui-tests.txt
119+
116120
- name: Run tests
117121
run: |
118122
./y.sh test --release --clean --build-sysroot ${{ matrix.commands }}

Cargo.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@ dependencies = [
5656

5757
[[package]]
5858
name = "gccjit"
59-
version = "3.2.0"
59+
version = "3.3.0"
6060
source = "registry+https://github.com/rust-lang/crates.io-index"
61-
checksum = "ef03c8ae23826a0755b980999a553a262c61f2f585245e647192d95bf09eee79"
61+
checksum = "26b73d18b642ce16378af78f89664841d7eeafa113682ff5d14573424eb0232a"
6262
dependencies = [
6363
"gccjit_sys",
6464
]
6565

6666
[[package]]
6767
name = "gccjit_sys"
68-
version = "1.2.0"
68+
version = "1.3.0"
6969
source = "registry+https://github.com/rust-lang/crates.io-index"
70-
checksum = "0ff511da413e4a5da6f09607748395ba37525e01ba7d322cbec3efc43095dd60"
70+
checksum = "ee689456c013616942d5aef9a84d613cefcc3b335340d036f3650fc1a7459e15"
7171
dependencies = [
7272
"libc",
7373
]

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ default = ["master"]
2424
[dependencies]
2525
object = { version = "0.37.0", default-features = false, features = ["std", "read"] }
2626
tempfile = "3.20"
27-
gccjit = { version = "3.2.0", features = ["dlopen"] }
27+
gccjit = { version = "3.3.0", features = ["dlopen"] }
2828
#gccjit = { git = "https://github.com/rust-lang/gccjit.rs", branch = "error-dlopen", features = ["dlopen"] }
2929

3030
# Local copy.

build_system/src/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,10 +679,10 @@ fn test_projects(env: &Env, args: &TestArg) -> Result<(), String> {
679679
create_dir(projects_path)?;
680680

681681
let nb_parts = args.nb_parts.unwrap_or(0);
682-
if nb_parts > 0 {
682+
if let Some(count) = projects.len().checked_div(nb_parts) {
683683
// We increment the number of tests by one because if this is an odd number, we would skip
684684
// one test.
685-
let count = projects.len() / nb_parts + 1;
685+
let count = count + 1;
686686
let current_part = args.current_part.unwrap();
687687
let start = current_part * count;
688688
// We remove the projects we don't want to test.

example/alloc_system.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// SPDX-License-Identifier: MIT OR Apache-2.0
2-
// SPDX-FileCopyrightText: The Rust Project Developers (see https://thanks.rust-lang.org)
3-
41
#![no_std]
52
#![feature(allocator_api, rustc_private)]
63

example/mini_core.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -748,25 +748,25 @@ extern "C" {
748748
pub struct VaList<'a>(&'a mut VaListImpl);
749749

750750
#[rustc_builtin_macro]
751-
#[rustc_macro_transparency = "semitransparent"]
751+
#[rustc_macro_transparency = "semiopaque"]
752752
pub macro stringify($($t:tt)*) {
753753
/* compiler built-in */
754754
}
755755

756756
#[rustc_builtin_macro]
757-
#[rustc_macro_transparency = "semitransparent"]
757+
#[rustc_macro_transparency = "semiopaque"]
758758
pub macro file() {
759759
/* compiler built-in */
760760
}
761761

762762
#[rustc_builtin_macro]
763-
#[rustc_macro_transparency = "semitransparent"]
763+
#[rustc_macro_transparency = "semiopaque"]
764764
pub macro line() {
765765
/* compiler built-in */
766766
}
767767

768768
#[rustc_builtin_macro]
769-
#[rustc_macro_transparency = "semitransparent"]
769+
#[rustc_macro_transparency = "semiopaque"]
770770
pub macro cfg() {
771771
/* compiler built-in */
772772
}

libgccjit.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
586d798e864fb33b1b4e842c5493a653841a7c02
1+
896045775f7c40fafe48c6e398f6c53bf6af889e

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2025-12-20"
2+
channel = "nightly-2026-01-30"
33
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]

src/abi.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ impl<'gcc, 'tcx> FnAbiGccExt<'gcc, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
243243
pub fn conv_to_fn_attribute<'gcc>(conv: CanonAbi, arch: &Arch) -> Option<FnAttribute<'gcc>> {
244244
let attribute = match conv {
245245
CanonAbi::C | CanonAbi::Rust => return None,
246+
// gcc/gccjit does not have anything for this.
247+
CanonAbi::RustPreserveNone => return None,
246248
CanonAbi::RustCold => FnAttribute::Cold,
247249
// Functions with this calling convention can only be called from assembly, but it is
248250
// possible to declare an `extern "custom"` block, so the backend still needs a calling

src/back/lto.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ use std::sync::atomic::Ordering;
2626
use gccjit::{Context, OutputKind};
2727
use object::read::archive::ArchiveFile;
2828
use rustc_codegen_ssa::back::lto::{SerializedModule, ThinModule, ThinShared};
29-
use rustc_codegen_ssa::back::write::{CodegenContext, FatLtoInput};
29+
use rustc_codegen_ssa::back::write::{CodegenContext, FatLtoInput, SharedEmitter};
3030
use rustc_codegen_ssa::traits::*;
3131
use rustc_codegen_ssa::{ModuleCodegen, ModuleKind, looks_like_rust_object_file};
3232
use rustc_data_structures::memmap::Mmap;
33-
use rustc_errors::DiagCtxtHandle;
33+
use rustc_errors::{DiagCtxt, DiagCtxtHandle};
3434
use rustc_log::tracing::info;
3535
use rustc_middle::bug;
3636
use rustc_middle::dep_graph::WorkProduct;
@@ -112,10 +112,11 @@ fn save_as_file(obj: &[u8], path: &Path) -> Result<(), LtoBitcodeFromRlib> {
112112
/// for further optimization.
113113
pub(crate) fn run_fat(
114114
cgcx: &CodegenContext<GccCodegenBackend>,
115+
shared_emitter: &SharedEmitter,
115116
each_linked_rlib_for_lto: &[PathBuf],
116117
modules: Vec<FatLtoInput<GccCodegenBackend>>,
117118
) -> ModuleCodegen<GccContext> {
118-
let dcx = cgcx.create_dcx();
119+
let dcx = DiagCtxt::new(Box::new(shared_emitter.clone()));
119120
let dcx = dcx.handle();
120121
let lto_data = prepare_lto(cgcx, each_linked_rlib_for_lto, dcx);
121122
/*let symbols_below_threshold =
@@ -283,14 +284,13 @@ impl ModuleBufferMethods for ModuleBuffer {
283284
/// can simply be copied over from the incr. comp. cache.
284285
pub(crate) fn run_thin(
285286
cgcx: &CodegenContext<GccCodegenBackend>,
287+
dcx: DiagCtxtHandle<'_>,
286288
each_linked_rlib_for_lto: &[PathBuf],
287289
modules: Vec<(String, ThinBuffer)>,
288290
cached_modules: Vec<(SerializedModule<ModuleBuffer>, WorkProduct)>,
289291
) -> (Vec<ThinModule<GccCodegenBackend>>, Vec<WorkProduct>) {
290-
let dcx = cgcx.create_dcx();
291-
let dcx = dcx.handle();
292292
let lto_data = prepare_lto(cgcx, each_linked_rlib_for_lto, dcx);
293-
if cgcx.opts.cg.linker_plugin_lto.enabled() {
293+
if cgcx.use_linker_plugin_lto {
294294
unreachable!(
295295
"We should never reach this case if the LTO step \
296296
is deferred to the linker"
@@ -522,8 +522,6 @@ pub fn optimize_thin_module(
522522
thin_module: ThinModule<GccCodegenBackend>,
523523
_cgcx: &CodegenContext<GccCodegenBackend>,
524524
) -> ModuleCodegen<GccContext> {
525-
//let dcx = cgcx.create_dcx();
526-
527525
//let module_name = &thin_module.shared.module_names[thin_module.idx];
528526
/*let tm_factory_config = TargetMachineFactoryConfig::new(cgcx, module_name.to_str().unwrap());
529527
let tm = (cgcx.tm_factory)(tm_factory_config).map_err(|e| write::llvm_err(&dcx, e))?;*/

0 commit comments

Comments
 (0)