Skip to content

Commit 116bf9c

Browse files
committed
rustup: address (new) clippy errors.
1 parent e08d0d6 commit 116bf9c

File tree

3 files changed

+10
-17
lines changed

3 files changed

+10
-17
lines changed

crates/rustc_codegen_spirv/src/link.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,8 @@ fn do_spirv_opt(
317317
);
318318

319319
match result {
320-
Ok(binary) => match binary {
321-
spirv_tools::binary::Binary::OwnedU32(words) => words,
322-
_ => binary.as_words().to_vec(),
323-
},
320+
Ok(spirv_tools::binary::Binary::OwnedU32(words)) => words,
321+
Ok(binary) => binary.as_words().to_vec(),
324322
Err(e) => {
325323
let mut err = sess.struct_warn(&e.to_string());
326324
err.note("spirv-opt failed, leaving as unoptimized");

crates/rustc_codegen_spirv/src/linker/simple_passes.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ pub fn check_fragment_insts(sess: &Session, module: &Module) -> Result<()> {
173173
.map(|i| func_id_to_idx[&i.operands[1].unwrap_id_ref()]);
174174
let mut any_err = None;
175175
for entry in entries {
176-
any_err = any_err.or(visit(
176+
let entry_had_err = visit(
177177
sess,
178178
module,
179179
&mut visited,
@@ -182,7 +182,8 @@ pub fn check_fragment_insts(sess: &Session, module: &Module) -> Result<()> {
182182
entry,
183183
&func_id_to_idx,
184184
)
185-
.err());
185+
.err();
186+
any_err = any_err.or(entry_had_err);
186187
}
187188
return match any_err {
188189
Some(err) => Err(err),
@@ -206,17 +207,10 @@ pub fn check_fragment_insts(sess: &Session, module: &Module) -> Result<()> {
206207
let mut any_err = None;
207208
for inst in module.functions[index].all_inst_iter() {
208209
if inst.class.opcode == Op::FunctionCall {
209-
let called_func = func_id_to_idx[&inst.operands[0].unwrap_id_ref()];
210-
any_err = any_err.or(visit(
211-
sess,
212-
module,
213-
visited,
214-
stack,
215-
names,
216-
called_func,
217-
func_id_to_idx,
218-
)
219-
.err());
210+
let callee = func_id_to_idx[&inst.operands[0].unwrap_id_ref()];
211+
let callee_had_err =
212+
visit(sess, module, visited, stack, names, callee, func_id_to_idx).err();
213+
any_err = any_err.or(callee_had_err);
220214
}
221215
if matches!(
222216
inst.class.opcode,

examples/shaders/reduce/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
feature(register_attr),
55
register_attr(spirv)
66
)]
7+
#![allow(clippy::too_many_arguments, clippy::missing_safety_doc)]
78
// HACK(eddyb) can't easily see warnings otherwise from `spirv-builder` builds.
89
#![deny(warnings)]
910
use spirv_std::glam::UVec3;

0 commit comments

Comments
 (0)