Skip to content

Commit 1a5281a

Browse files
committed
update to nightly-2026-07-03, rustc 1.98.0
1 parent e920442 commit 1a5281a

12 files changed

Lines changed: 93 additions & 67 deletions

File tree

crates/rustc_codegen_spirv/build.rs

Lines changed: 3 additions & 3 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-2026-06-25"
22+
channel = "nightly-2026-07-03"
2323
components = ["rust-src", "rustc-dev", "llvm-tools"]
24-
# commit_hash = f28ac764c36004fa6a6e098d15b4016a838c13c6"#;
24+
# commit_hash = c397dae808f70caebab1fc4e11b3edf7e59f58c7"#;
2525

2626
fn rustc_output(arg: &str) -> Result<String, Box<dyn Error>> {
2727
let rustc = env::var("RUSTC").unwrap_or_else(|_| "rustc".into());
@@ -272,7 +272,7 @@ pub(super) fn elf_e_flags(architecture: Architecture, sess: &Session) -> u32 {",
272272
bx, llarg, arg.layout,
273273
));",
274274
);
275-
src = src.replace("fx.fill_function_debug_context();", "");
275+
src = src.replace("fx.fill_function_debug_context(&mut start_bx);", "");
276276
}
277277
if relative_path == Path::new("src/mir/block.rs") {
278278
src = src.replace(

crates/rustc_codegen_spirv/src/abi.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,10 @@ impl<'tcx> ConvSpirvType<'tcx> for TyAndLayout<'tcx> {
402402
// Note: We can't use auto_struct_layout here because the spirv types here might be undefined due to
403403
// recursive pointer types.
404404
let a_offset = Size::ZERO;
405-
let b_offset = a.primitive().size(cx).align_to(b.primitive().align(cx).abi);
405+
let b_offset = a
406+
.primitive()
407+
.size(cx)
408+
.align_to(b.primitive().default_align(cx).abi);
406409
let a = trans_scalar(cx, span, *self, a, a_offset);
407410
let b = trans_scalar(cx, span, *self, b, b_offset);
408411
let size = if self.is_unsized() {
@@ -471,7 +474,10 @@ pub fn scalar_pair_element_backend_type<'tcx>(
471474
};
472475
let offset = match index {
473476
0 => Size::ZERO,
474-
1 => a.primitive().size(cx).align_to(b.primitive().align(cx).abi),
477+
1 => a
478+
.primitive()
479+
.size(cx)
480+
.align_to(b.primitive().default_align(cx).abi),
475481
_ => unreachable!(),
476482
};
477483
trans_scalar(cx, span, ty, [a, b][index], offset)

crates/rustc_codegen_spirv/src/builder/builder_methods.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,7 +1854,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
18541854
self.bitcast(loaded_val, ty)
18551855
}
18561856

1857-
fn volatile_load(&mut self, ty: Self::Type, ptr: Self::Value) -> Self::Value {
1857+
fn volatile_load(&mut self, ty: Self::Type, ptr: Self::Value, _align: Align) -> Self::Value {
18581858
// TODO: Implement this
18591859
let result = self.load(ty, ptr, Align::from_bytes(0).unwrap());
18601860
self.zombie(result.def(self), "volatile load is not supported yet");
@@ -1909,7 +1909,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
19091909
let b_offset = a
19101910
.primitive()
19111911
.size(self)
1912-
.align_to(b.primitive().align(self).abi);
1912+
.align_to(b.primitive().default_align(self).abi);
19131913

19141914
let mut load = |i, scalar: Scalar, align| {
19151915
let llptr = if i == 0 {
@@ -3485,4 +3485,8 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
34853485
fn alloca_with_ty(&mut self, _layout: TyAndLayout<'tcx>) -> Self::Value {
34863486
bug!("scalable alloca is not supported in SPIR-V backend")
34873487
}
3488+
3489+
fn vscale(&mut self, _ty: Self::Type) -> Self::Value {
3490+
self.fatal("scalable vectors not supported");
3491+
}
34883492
}

crates/rustc_codegen_spirv/src/builder/intrinsics.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use crate::custom_insts::CustomInst;
99
use crate::spirv_type::SpirvType;
1010
use rspirv::dr::Operand;
1111
use rspirv::spirv::GlslStd450Op as GLOp;
12+
use rustc_abi::Align;
1213
use rustc_codegen_ssa::RetagInfo;
1314
use rustc_codegen_ssa::mir::IntrinsicResult;
1415
use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue};
@@ -107,7 +108,8 @@ impl<'a, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'tcx> {
107108
sym::volatile_load | sym::unaligned_volatile_load => {
108109
let ptr = args[0].immediate();
109110
let layout = self.layout_of(fn_args.type_at(0));
110-
let load = self.volatile_load(layout.spirv_type(self.span(), self), ptr);
111+
let load =
112+
self.volatile_load(layout.spirv_type(self.span(), self), ptr, Align::ONE);
111113
if !result.layout.is_zst() {
112114
self.store(load, result.val.llval, result.val.align);
113115
}

crates/rustc_codegen_spirv/src/builder/mod.rs

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub mod libm_intrinsics;
77
mod spirv_asm;
88

99
pub use ext_inst::ExtInst;
10-
use rustc_span::DUMMY_SP;
10+
use rustc_span::{BytePos, DUMMY_SP, SourceFile, Symbol};
1111
pub use spirv_asm::InstructionTable;
1212

1313
// HACK(eddyb) avoids rewriting all of the imports (see `lib.rs` and `build.rs`).
@@ -208,6 +208,54 @@ impl<'a, 'tcx> DebugInfoBuilderMethods<'_> for Builder<'a, 'tcx> {
208208
_fragment: &Option<Range<Size>>,
209209
) {
210210
}
211+
212+
fn dbg_scope_fn(
213+
&mut self,
214+
_instance: Instance<'_>,
215+
_fn_abi: &FnAbi<'_, Ty<'_>>,
216+
_maybe_definition_llfn: Option<Self::Function>,
217+
) -> Self::DIScope {
218+
}
219+
220+
fn dbg_create_lexical_block(
221+
&mut self,
222+
_pos: BytePos,
223+
_parent_scope: Self::DIScope,
224+
) -> Self::DIScope {
225+
}
226+
227+
fn dbg_location_clone_with_discriminator(
228+
&mut self,
229+
_loc: Self::DILocation,
230+
_discriminator: u32,
231+
) -> Option<Self::DILocation> {
232+
None
233+
}
234+
235+
fn dbg_loc(
236+
&mut self,
237+
_scope: Self::DIScope,
238+
_inlined_at: Option<Self::DILocation>,
239+
_span: Span,
240+
) -> Self::DILocation {
241+
}
242+
243+
fn extend_scope_to_file(
244+
&mut self,
245+
_scope_metadata: Self::DIScope,
246+
_file: &SourceFile,
247+
) -> Self::DIScope {
248+
}
249+
250+
fn create_dbg_var(
251+
&mut self,
252+
_variable_name: Symbol,
253+
_variable_type: Ty<'_>,
254+
_scope_metadata: Self::DIScope,
255+
_variable_kind: rustc_codegen_ssa::mir::debuginfo::VariableKind,
256+
_span: Span,
257+
) -> Self::DIVariable {
258+
}
211259
}
212260

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

crates/rustc_codegen_spirv/src/codegen_cx/constant.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ use crate::spirv_type::SpirvType;
88
use itertools::Itertools as _;
99
use rspirv::spirv::Word;
1010
use rustc_abi::{self as abi, AddressSpace, Float, HasDataLayout, Integer, Primitive, Size};
11-
use rustc_codegen_ssa::traits::{ConstCodegenMethods, MiscCodegenMethods, StaticCodegenMethods};
11+
use rustc_codegen_ssa::traits::{
12+
ConstCodegenMethods, MiscCodegenMethods, PacMetadata, StaticCodegenMethods,
13+
};
1214
use rustc_middle::mir::interpret::{AllocError, ConstAllocation, GlobalAlloc, Scalar, alloc_range};
1315
use rustc_middle::ty::layout::LayoutOf;
1416
use rustc_span::{DUMMY_SP, Span};
@@ -226,6 +228,16 @@ impl ConstCodegenMethods for CodegenCx<'_> {
226228
self.builder.lookup_const_scalar(v)
227229
}
228230

231+
fn scalar_to_backend_with_pac(
232+
&self,
233+
cv: Scalar,
234+
layout: rustc_abi::Scalar,
235+
ty: Self::Type,
236+
_pac: Option<PacMetadata>,
237+
) -> Self::Value {
238+
self.scalar_to_backend(cv, layout, ty)
239+
}
240+
229241
fn scalar_to_backend(
230242
&self,
231243
scalar: Scalar,
@@ -268,7 +280,7 @@ impl ConstCodegenMethods for CodegenCx<'_> {
268280
(value, AddressSpace::ZERO)
269281
}
270282
GlobalAlloc::Function { instance } => (
271-
self.get_fn_addr(instance),
283+
self.get_fn_addr(instance, None),
272284
self.data_layout().instruction_address_space,
273285
),
274286
GlobalAlloc::VTable(vty, dyn_ty) => {

crates/rustc_codegen_spirv/src/codegen_cx/entry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl<'tcx> CodegenCx<'tcx> {
191191
self.get_fn(entry_instance).ty,
192192
None,
193193
Some(entry_fn_abi),
194-
self.get_fn_addr(entry_instance),
194+
self.get_fn_addr(entry_instance, None),
195195
&call_args,
196196
None,
197197
None,

crates/rustc_codegen_spirv/src/codegen_cx/mod.rs

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ use rspirv::dr::{Module, Operand};
2020
use rspirv::spirv::{Decoration, LinkageType, Word};
2121
use rustc_abi::{AddressSpace, HasDataLayout, TargetDataLayout};
2222
use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece};
23-
use rustc_codegen_ssa::mir::debuginfo::VariableKind;
2423
use rustc_codegen_ssa::traits::{
2524
AsmCodegenMethods, BackendTypes, DebugInfoCodegenMethods, GlobalAsmOperandRef,
26-
MiscCodegenMethods,
25+
MiscCodegenMethods, PacMetadata,
2726
};
2827
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
2928
use rustc_hir::def_id::DefId;
@@ -32,8 +31,7 @@ use rustc_middle::ty::layout::{HasTyCtxt, HasTypingEnv};
3231
use rustc_middle::ty::{self, Instance, Ty, TyCtxt, TypingEnv};
3332
use rustc_session::Session;
3433
use rustc_span::symbol::Symbol;
35-
use rustc_span::{BytePos, DUMMY_SP, SourceFile, Span};
36-
use rustc_target::callconv::FnAbi;
34+
use rustc_span::{DUMMY_SP, Span};
3735
use rustc_target::spec::{HasTargetSpec, Target, TargetTuple};
3836
use std::cell::RefCell;
3937
use std::collections::BTreeSet;
@@ -889,7 +887,7 @@ impl<'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'tcx> {
889887
// NOTE(eddyb) see the comment on `SpirvValueKind::FnAddr`, this should
890888
// be fixed upstream, so we never see any "function pointer" values being
891889
// created just to perform direct calls.
892-
fn get_fn_addr(&self, instance: Instance<'tcx>) -> Self::Value {
890+
fn get_fn_addr(&self, instance: Instance<'tcx>, _pac: Option<PacMetadata>) -> Self::Value {
893891
let function = self.get_fn(instance);
894892
let span = self.tcx.def_span(instance.def_id());
895893

@@ -944,50 +942,6 @@ impl<'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'tcx> {
944942
) {
945943
// Ignore.
946944
}
947-
948-
fn dbg_create_lexical_block(
949-
&self,
950-
_pos: BytePos,
951-
_parent_scope: Self::DIScope,
952-
) -> Self::DIScope {
953-
}
954-
955-
fn dbg_location_clone_with_discriminator(
956-
&self,
957-
_loc: Self::DILocation,
958-
_discriminator: u32,
959-
) -> Option<Self::DILocation> {
960-
None
961-
}
962-
963-
fn dbg_scope_fn(
964-
&self,
965-
_: Instance<'tcx>,
966-
_: &FnAbi<'tcx, Ty<'tcx>>,
967-
_: Option<Self::Function>,
968-
) -> Self::DIScope {
969-
}
970-
971-
fn dbg_loc(&self, _: Self::DIScope, _: Option<Self::DILocation>, _: Span) -> Self::DILocation {}
972-
973-
fn extend_scope_to_file(
974-
&self,
975-
_scope_metadata: Self::DIScope,
976-
_file: &SourceFile,
977-
) -> Self::DIScope {
978-
}
979-
980-
fn debuginfo_finalize(&self) {}
981-
982-
fn create_dbg_var(
983-
&self,
984-
_variable_name: Symbol,
985-
_variable_type: Ty<'tcx>,
986-
_scope_metadata: Self::DIScope,
987-
_variable_kind: VariableKind,
988-
_span: Span,
989-
) -> Self::DIVariable {
990-
}
991945
}
992946

993947
impl<'tcx> AsmCodegenMethods<'tcx> for CodegenCx<'tcx> {

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-2026-06-25"
2+
channel = "nightly-2026-07-03"
33
components = ["rust-src", "rustc-dev", "llvm-tools"]
4-
# commit_hash = f28ac764c36004fa6a6e098d15b4016a838c13c6
4+
# commit_hash = c397dae808f70caebab1fc4e11b3edf7e59f58c7
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.

tests/compiletests/ui/dis/ptr_write.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
%7 = OpLabel
55
OpLine %8 7 35
66
%9 = OpLoad %10 %4
7-
OpLine %11 1933 40
7+
OpLine %11 1941 40
88
OpStore %6 %9
99
OpNoLine
1010
OpReturn

0 commit comments

Comments
 (0)