Skip to content

Commit a79deca

Browse files
dvdplmFirestar99
authored andcommitted
update toolchain to 2025-11-02
1 parent bd47508 commit a79deca

File tree

8 files changed

+60
-46
lines changed

8 files changed

+60
-46
lines changed

crates/rustc_codegen_spirv/build.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ use std::{env, fs, mem};
1919
/// `cargo publish`. We need to figure out a way to do this properly, but let's hardcode it for now :/
2020
//const REQUIRED_RUST_TOOLCHAIN: &str = include_str!("../../rust-toolchain.toml");
2121
const REQUIRED_RUST_TOOLCHAIN: &str = r#"[toolchain]
22-
channel = "nightly-2025-08-04"
22+
channel = "nightly-2025-11-02"
2323
components = ["rust-src", "rustc-dev", "llvm-tools"]
24-
# commit_hash = f34ba774c78ea32b7c40598b8ad23e75cdac42a6"#;
24+
# commit_hash = bd3ac0330018c23b111bbee176f32c377be7b319"#;
2525

2626
fn rustc_output(arg: &str) -> Result<String, Box<dyn Error>> {
2727
let rustc = env::var("RUSTC").unwrap_or_else(|_| "rustc".into());
@@ -198,6 +198,13 @@ mod win {",
198198
for link_path in raw_dylib::",
199199
);
200200
}
201+
src = src.replace(
202+
"
203+
for (link_path, as_needed) in raw_dylib::",
204+
"
205+
#[cfg(any())]
206+
for (link_path, as_needed) in raw_dylib::",
207+
);
201208
if relative_path == Path::new("src/back/metadata.rs") {
202209
// HACK(eddyb) remove `object` dependency.
203210
src = src.replace(

crates/rustc_codegen_spirv/src/builder/builder_methods.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2792,6 +2792,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
27922792
_src_align: Align,
27932793
size: Self::Value,
27942794
flags: MemFlags,
2795+
_tt: Option<rustc_ast::expand::typetree::FncTree>,
27952796
) {
27962797
if flags != MemFlags::empty() {
27972798
self.err(format!(
@@ -2878,7 +2879,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
28782879
size: Self::Value,
28792880
flags: MemFlags,
28802881
) {
2881-
self.memcpy(dst, dst_align, src, src_align, size, flags);
2882+
self.memcpy(dst, dst_align, src, src_align, size, flags, None);
28822883
}
28832884

28842885
fn memset(
@@ -3124,6 +3125,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
31243125
dst: Self::Value,
31253126
src: Self::Value,
31263127
order: AtomicOrdering,
3128+
_ret_ptr: bool,
31273129
) -> Self::Value {
31283130
let ty = src.ty;
31293131

crates/rustc_codegen_spirv/src/builder/mod.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ impl<'a, 'tcx> DebugInfoBuilderMethods for Builder<'a, 'tcx> {
183183
_direct_offset: Size,
184184
// NB: each offset implies a deref (i.e. they're steps in a pointer chain).
185185
_indirect_offsets: &[Size],
186-
_fragment: Option<Range<Size>>,
186+
_fragment: &Option<Range<Size>>,
187187
) {
188188
todo!()
189189
}
@@ -203,6 +203,21 @@ impl<'a, 'tcx> DebugInfoBuilderMethods for Builder<'a, 'tcx> {
203203
fn set_var_name(&mut self, _value: Self::Value, _name: &str) {
204204
todo!()
205205
}
206+
207+
fn dbg_var_value(
208+
&mut self,
209+
_dbg_var: Self::DIVariable,
210+
_dbg_loc: Self::DILocation,
211+
_value: Self::Value,
212+
_direct_offset: Size,
213+
// NB: each offset implies a deref (i.e. they're steps in a pointer chain).
214+
_indirect_offsets: &[Size],
215+
// Byte range in the `dbg_var` covered by this fragment,
216+
// if this is a fragment of a composite `DIVariable`.
217+
_fragment: &Option<Range<Size>>,
218+
) {
219+
todo!()
220+
}
206221
}
207222

208223
impl<'a, 'tcx> ArgAbiBuilderMethods<'tcx> for Builder<'a, 'tcx> {

crates/rustc_codegen_spirv/src/codegen_cx/constant.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,7 @@ impl<'tcx> CodegenCx<'tcx> {
506506

507507
// HACK(eddyb) these should never happen when using
508508
// `read_scalar`, but better not outright crash.
509-
AllocError::ScalarSizeMismatch(_)
510-
| AllocError::OverwritePartialPointer(_) => {
509+
AllocError::ScalarSizeMismatch(_) => {
511510
Err(format!("unrecognized `AllocError::{err:?}`"))
512511
}
513512
},

crates/rustc_codegen_spirv/src/codegen_cx/declare.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ use itertools::Itertools;
1111
use rspirv::spirv::{FunctionControl, LinkageType, StorageClass, Word};
1212
use rustc_abi::Align;
1313
use rustc_codegen_ssa::traits::{PreDefineCodegenMethods, StaticCodegenMethods};
14-
use rustc_hir::attrs::InlineAttr;
14+
use rustc_hir::attrs::{InlineAttr, Linkage};
1515
use rustc_middle::bug;
1616
use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs};
17-
use rustc_middle::mir::mono::{Linkage, MonoItem, Visibility};
17+
use rustc_middle::mir::mono::{MonoItem, Visibility};
1818
use rustc_middle::ty::layout::{FnAbiOf, LayoutOf};
1919
use rustc_middle::ty::{self, Instance, TypeVisitableExt, TypingEnv};
2020
use rustc_span::Span;
@@ -178,7 +178,7 @@ impl<'tcx> CodegenCx<'tcx> {
178178

179179
// Check if this is a From trait implementation
180180
if let Some(impl_def_id) = self.tcx.impl_of_assoc(def_id)
181-
&& let Some(trait_ref) = self.tcx.impl_trait_ref(impl_def_id)
181+
&& let Some(trait_ref) = self.tcx.impl_opt_trait_ref(impl_def_id)
182182
{
183183
let trait_def_id = trait_ref.skip_binder().def_id;
184184

crates/rustc_codegen_spirv/src/lib.rs

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,9 @@ use maybe_pqp_cg_ssa::traits::{
151151
};
152152
use maybe_pqp_cg_ssa::{CodegenResults, CompiledModule, ModuleCodegen, ModuleKind, TargetConfig};
153153
use rspirv::binary::Assemble;
154-
use rustc_ast::expand::allocator::AllocatorKind;
155-
use rustc_ast::expand::autodiff_attrs::AutoDiffItem;
154+
use rustc_ast::expand::allocator::AllocatorMethod;
156155
use rustc_data_structures::fx::FxIndexMap;
157-
use rustc_errors::{DiagCtxtHandle, FatalError};
156+
use rustc_errors::DiagCtxtHandle;
158157
use rustc_metadata::EncodedMetadata;
159158
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
160159
use rustc_middle::mir::mono::{MonoItem, MonoItemData};
@@ -281,6 +280,10 @@ impl CodegenBackend for SpirvCodegenBackend {
281280
);
282281
drop(timer);
283282
}
283+
284+
fn name(&self) -> &'static str {
285+
"SpirvCodegenBackend"
286+
}
284287
}
285288

286289
struct SpirvModuleBuffer(Vec<u32>);
@@ -299,16 +302,13 @@ impl ThinBufferMethods for SpirvModuleBuffer {
299302
fn data(&self) -> &[u8] {
300303
self.as_bytes()
301304
}
302-
fn thin_link_data(&self) -> &[u8] {
303-
&[]
304-
}
305305
}
306306

307307
impl SpirvCodegenBackend {
308308
fn optimize_common(
309309
_cgcx: &CodegenContext<Self>,
310310
module: &mut ModuleCodegen<<Self as WriteBackendMethods>::Module>,
311-
) -> Result<(), FatalError> {
311+
) {
312312
// Apply DCE ("dead code elimination") to modules before ever serializing
313313
// them as `.spv` files (technically, `.rcgu.o` files inside `.rlib`s),
314314
// that will later get linked (potentially many times, esp. if this is
@@ -317,8 +317,6 @@ impl SpirvCodegenBackend {
317317
linker::dce::dce(&mut module.module_llvm);
318318

319319
// FIXME(eddyb) run as many optimization passes as possible, not just DCE.
320-
321-
Ok(())
322320
}
323321
}
324322

@@ -339,8 +337,7 @@ impl WriteBackendMethods for SpirvCodegenBackend {
339337
_exported_symbols_for_lto: &[String],
340338
_each_linked_rlib_for_lto: &[PathBuf],
341339
_modules: Vec<FatLtoInput<Self>>,
342-
_diff_fncs: Vec<AutoDiffItem>,
343-
) -> Result<ModuleCodegen<Self::Module>, FatalError> {
340+
) -> ModuleCodegen<Self::Module> {
344341
assert!(
345342
cgcx.lto == rustc_session::config::Lto::Fat,
346343
"`run_and_optimize_fat_lto` (for `WorkItemResult::NeedsFatLto`) should \
@@ -356,7 +353,7 @@ impl WriteBackendMethods for SpirvCodegenBackend {
356353
_each_linked_rlib_for_lto: &[PathBuf], // njn: ?
357354
modules: Vec<(String, Self::ThinBuffer)>,
358355
cached_modules: Vec<(SerializedModule<Self::ModuleBuffer>, WorkProduct)>,
359-
) -> Result<(Vec<ThinModule<Self>>, Vec<WorkProduct>), FatalError> {
356+
) -> (Vec<ThinModule<Self>>, Vec<WorkProduct>) {
360357
link::run_thin(cgcx, modules, cached_modules)
361358
}
362359

@@ -373,14 +370,14 @@ impl WriteBackendMethods for SpirvCodegenBackend {
373370
_dcx: DiagCtxtHandle<'_>,
374371
module: &mut ModuleCodegen<Self::Module>,
375372
_config: &ModuleConfig,
376-
) -> Result<(), FatalError> {
373+
) {
377374
Self::optimize_common(cgcx, module)
378375
}
379376

380377
fn optimize_thin(
381378
cgcx: &CodegenContext<Self>,
382379
thin_module: ThinModule<Self>,
383-
) -> Result<ModuleCodegen<Self::Module>, FatalError> {
380+
) -> ModuleCodegen<Self::Module> {
384381
// FIXME(eddyb) the inefficiency of Module -> [u8] -> Module roundtrips
385382
// comes from upstream and it applies to `rustc_codegen_llvm` as well,
386383
// eventually it should be properly addressed (for `ThinLocal` at least).
@@ -393,15 +390,15 @@ impl WriteBackendMethods for SpirvCodegenBackend {
393390
kind: ModuleKind::Regular,
394391
thin_lto_buffer: None,
395392
};
396-
Self::optimize_common(cgcx, &mut module)?;
397-
Ok(module)
393+
Self::optimize_common(cgcx, &mut module);
394+
module
398395
}
399396

400397
fn codegen(
401398
cgcx: &CodegenContext<Self>,
402399
module: ModuleCodegen<Self::Module>,
403400
_config: &ModuleConfig,
404-
) -> Result<CompiledModule, FatalError> {
401+
) -> CompiledModule {
405402
let kind = module.kind;
406403
let (name, module_buffer) = Self::serialize_module(module);
407404

@@ -412,7 +409,7 @@ impl WriteBackendMethods for SpirvCodegenBackend {
412409
);
413410
fs::write(&path, module_buffer.as_bytes()).unwrap();
414411

415-
Ok(CompiledModule {
412+
CompiledModule {
416413
name,
417414
kind,
418415
object: Some(path),
@@ -421,13 +418,10 @@ impl WriteBackendMethods for SpirvCodegenBackend {
421418
assembly: None,
422419
llvm_ir: None,
423420
links_from_incr_cache: vec![],
424-
})
421+
}
425422
}
426423

427-
fn prepare_thin(
428-
module: ModuleCodegen<Self::Module>,
429-
_want_summary: bool,
430-
) -> (String, Self::ThinBuffer) {
424+
fn prepare_thin(module: ModuleCodegen<Self::Module>) -> (String, Self::ThinBuffer) {
431425
Self::serialize_module(module)
432426
}
433427

@@ -440,13 +434,7 @@ impl WriteBackendMethods for SpirvCodegenBackend {
440434
}
441435

442436
impl ExtraBackendMethods for SpirvCodegenBackend {
443-
fn codegen_allocator(
444-
&self,
445-
_: TyCtxt<'_>,
446-
_: &str,
447-
_: AllocatorKind,
448-
_: AllocatorKind,
449-
) -> Self::Module {
437+
fn codegen_allocator(&self, _: TyCtxt<'_>, _: &str, _: &[AllocatorMethod]) -> Self::Module {
450438
todo!()
451439
}
452440

crates/rustc_codegen_spirv/src/link.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ use ar::{Archive, GnuBuilder, Header};
77
use rspirv::binary::Assemble;
88
use rspirv::dr::Module;
99
use rustc_ast::CRATE_NODE_ID;
10+
use rustc_attr_parsing::{ShouldEmit, eval_config_entry};
1011
use rustc_codegen_spirv_types::{CompileResult, ModuleResult};
1112
use rustc_codegen_ssa::back::lto::{SerializedModule, ThinModule, ThinShared};
1213
use rustc_codegen_ssa::back::write::CodegenContext;
1314
use rustc_codegen_ssa::{CodegenResults, NativeLib};
1415
use rustc_data_structures::fx::FxHashSet;
15-
use rustc_errors::{Diag, FatalError};
16+
use rustc_errors::Diag;
17+
use rustc_hir::attrs::NativeLibKind;
1618
use rustc_metadata::{EncodedMetadata, fs::METADATA_FILENAME};
1719
use rustc_middle::bug;
1820
use rustc_middle::dep_graph::WorkProduct;
@@ -22,7 +24,6 @@ use rustc_session::config::{
2224
CrateType, DebugInfo, Lto, OptLevel, OutFileName, OutputFilenames, OutputType,
2325
};
2426
use rustc_session::output::{check_file_is_writeable, invalid_output_for_target, out_filename};
25-
use rustc_session::utils::NativeLibKind;
2627
use rustc_span::Symbol;
2728
use std::collections::BTreeMap;
2829
use std::ffi::{CString, OsStr};
@@ -496,7 +497,9 @@ fn add_upstream_native_libraries(
496497
// (see `compiler/rustc_codegen_ssa/src/back/link.rs`)
497498
fn relevant_lib(sess: &Session, lib: &NativeLib) -> bool {
498499
match lib.cfg {
499-
Some(ref cfg) => rustc_attr_parsing::cfg_matches(cfg, sess, CRATE_NODE_ID, None),
500+
Some(ref cfg) => {
501+
eval_config_entry(sess, cfg, CRATE_NODE_ID, None, ShouldEmit::ErrorsAndLints).as_bool()
502+
}
500503
None => true,
501504
}
502505
}
@@ -634,7 +637,7 @@ pub(crate) fn run_thin(
634637
cgcx: &CodegenContext<SpirvCodegenBackend>,
635638
modules: Vec<(String, SpirvModuleBuffer)>,
636639
cached_modules: Vec<(SerializedModule<SpirvModuleBuffer>, WorkProduct)>,
637-
) -> Result<(Vec<ThinModule<SpirvCodegenBackend>>, Vec<WorkProduct>), FatalError> {
640+
) -> (Vec<ThinModule<SpirvCodegenBackend>>, Vec<WorkProduct>) {
638641
if cgcx.opts.cg.linker_plugin_lto.enabled() {
639642
unreachable!("We should never reach this case if the LTO step is deferred to the linker");
640643
}
@@ -674,5 +677,5 @@ pub(crate) fn run_thin(
674677
});
675678
}
676679

677-
Ok((opt_jobs, vec![]))
680+
(opt_jobs, vec![])
678681
}

rust-toolchain.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[toolchain]
2-
channel = "nightly-2025-08-04"
2+
channel = "nightly-2025-11-02"
33
components = ["rust-src", "rustc-dev", "llvm-tools"]
4-
# commit_hash = f34ba774c78ea32b7c40598b8ad23e75cdac42a6
4+
# commit_hash = bd3ac0330018c23b111bbee176f32c377be7b319
55

66
# Whenever changing the nightly channel, update the commit hash above, and
77
# change `REQUIRED_RUST_TOOLCHAIN` in `crates/rustc_codegen_spirv/build.rs` too.

0 commit comments

Comments
 (0)