Skip to content

Commit f9c818d

Browse files
committed
rustc_codegen_spirv: switch to Rust 2024 edition.
1 parent 7a0f1a2 commit f9c818d

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

crates/rustc_codegen_spirv/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description = "SPIR-V code generator backend for rustc"
44
documentation = "https://rust-gpu.github.io/rust-gpu/api/rustc_codegen_spirv/index.html"
55
version.workspace = true
66
authors.workspace = true
7-
edition.workspace = true
7+
edition = "2024"
88
license.workspace = true
99
repository.workspace = true
1010

crates/rustc_codegen_spirv/src/codegen_cx/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,10 +685,10 @@ impl CodegenArgs {
685685
*current_id = *remap.entry(*current_id).or_insert_with(|| len as u32 + 1);
686686
};
687687
module.all_inst_iter_mut().for_each(|inst| {
688-
if let Some(ref mut result_id) = &mut inst.result_id {
688+
if let Some(result_id) = &mut inst.result_id {
689689
insert(result_id);
690690
}
691-
if let Some(ref mut result_type) = &mut inst.result_type {
691+
if let Some(result_type) = &mut inst.result_type {
692692
insert(result_type);
693693
}
694694
inst.operands.iter_mut().for_each(|op| {

crates/rustc_codegen_spirv/src/custom_insts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ macro_rules! def_custom_insts {
117117
pub fn with_operands<T: Clone>(self, operands: &[T]) -> CustomInst<T> {
118118
match self {
119119
$(Self::$name => match operands {
120-
[$($($field,)+ $(ref $variadic_field @ ..)?)?] => CustomInst::$name $({
120+
[$($($field,)+ $($variadic_field @ ..)?)?] => CustomInst::$name $({
121121
$($field: $field.clone(),)+
122122
$($variadic_field: $variadic_field.iter().cloned().collect())?
123123
})?,

crates/rustc_codegen_spirv/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ impl Drop for DumpModuleOnPanic<'_, '_, '_> {
549549
}
550550

551551
/// This is the entrypoint for a hot plugged `rustc_codegen_spirv`
552-
#[no_mangle]
552+
#[unsafe(no_mangle)]
553553
pub fn __rustc_codegen_backend() -> Box<dyn CodegenBackend> {
554554
// Tweak rustc's default ICE panic hook, to direct people to `rust-gpu`.
555555
rustc_driver::install_ice_hook("https://github.com/rust-gpu/rust-gpu/issues/new", |dcx| {

crates/rustc_codegen_spirv/src/linker/import_export_link.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ fn check_tys_equal(
202202

203203
fn replace_all_uses_with(module: &mut Module, rules: &FxHashMap<u32, u32>) {
204204
module.all_inst_iter_mut().for_each(|inst| {
205-
if let Some(ref mut result_type) = &mut inst.result_type {
205+
if let Some(result_type) = &mut inst.result_type {
206206
if let Some(&rewrite) = rules.get(result_type) {
207207
*result_type = rewrite;
208208
}

crates/rustc_codegen_spirv/src/linker/simple_passes.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ use std::mem::take;
88

99
pub fn shift_ids(module: &mut Module, add: u32) {
1010
module.all_inst_iter_mut().for_each(|inst| {
11-
if let Some(ref mut result_id) = &mut inst.result_id {
11+
if let Some(result_id) = &mut inst.result_id {
1212
*result_id += add;
1313
}
1414

15-
if let Some(ref mut result_type) = &mut inst.result_type {
15+
if let Some(result_type) = &mut inst.result_type {
1616
*result_type += add;
1717
}
1818

@@ -110,11 +110,11 @@ pub fn compact_ids(module: &mut Module) -> u32 {
110110
};
111111

112112
module.all_inst_iter_mut().for_each(|inst| {
113-
if let Some(ref mut result_id) = &mut inst.result_id {
113+
if let Some(result_id) = &mut inst.result_id {
114114
*result_id = insert(*result_id);
115115
}
116116

117-
if let Some(ref mut result_type) = &mut inst.result_type {
117+
if let Some(result_type) = &mut inst.result_type {
118118
*result_type = insert(*result_type);
119119
}
120120

crates/rustc_codegen_spirv/src/linker/spirt_passes/diagnostics.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,15 +389,15 @@ impl DiagnosticReporter<'_> {
389389
.split_last()
390390
.filter(
391391
|(
392-
&UseOrigin::Global {
392+
UseOrigin::Global {
393393
attrs: use_attrs, ..
394394
}
395-
| &UseOrigin::IntraFunc {
395+
| UseOrigin::IntraFunc {
396396
func_attrs: use_attrs,
397397
..
398398
},
399399
_,
400-
)| { use_attrs == attrs },
400+
)| *use_attrs == attrs,
401401
)
402402
.map_or((None, &self.use_stack[..]), |(current, stack)| {
403403
(Some(current), stack)

0 commit comments

Comments
 (0)