Skip to content

Commit 332ea52

Browse files
committed
rustc_codegen_spirv: switch to Rust 2024 edition.
1 parent 5318ef3 commit 332ea52

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
@@ -690,10 +690,10 @@ impl CodegenArgs {
690690
*current_id = *remap.entry(*current_id).or_insert_with(|| len as u32 + 1);
691691
};
692692
module.all_inst_iter_mut().for_each(|inst| {
693-
if let Some(ref mut result_id) = &mut inst.result_id {
693+
if let Some(result_id) = &mut inst.result_id {
694694
insert(result_id);
695695
}
696-
if let Some(ref mut result_type) = &mut inst.result_type {
696+
if let Some(result_type) = &mut inst.result_type {
697697
insert(result_type);
698698
}
699699
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
@@ -500,7 +500,7 @@ impl Drop for DumpModuleOnPanic<'_, '_, '_> {
500500
}
501501

502502
/// This is the entrypoint for a hot plugged `rustc_codegen_spirv`
503-
#[no_mangle]
503+
#[unsafe(no_mangle)]
504504
pub fn __rustc_codegen_backend() -> Box<dyn CodegenBackend> {
505505
// Tweak rustc's default ICE panic hook, to direct people to `rust-gpu`.
506506
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
@@ -28,11 +28,11 @@ fn capability_for_float_width(width: u32) -> Option<rspirv::spirv::Capability> {
2828

2929
pub fn shift_ids(module: &mut Module, add: u32) {
3030
module.all_inst_iter_mut().for_each(|inst| {
31-
if let Some(ref mut result_id) = &mut inst.result_id {
31+
if let Some(result_id) = &mut inst.result_id {
3232
*result_id += add;
3333
}
3434

35-
if let Some(ref mut result_type) = &mut inst.result_type {
35+
if let Some(result_type) = &mut inst.result_type {
3636
*result_type += add;
3737
}
3838

@@ -130,11 +130,11 @@ pub fn compact_ids(module: &mut Module) -> u32 {
130130
};
131131

132132
module.all_inst_iter_mut().for_each(|inst| {
133-
if let Some(ref mut result_id) = &mut inst.result_id {
133+
if let Some(result_id) = &mut inst.result_id {
134134
*result_id = insert(*result_id);
135135
}
136136

137-
if let Some(ref mut result_type) = &mut inst.result_type {
137+
if let Some(result_type) = &mut inst.result_type {
138138
*result_type = insert(*result_type);
139139
}
140140

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)