rustup: address (new) clippy errors.

This commit is contained in:
Eduard-Mihai Burtescu 2022-04-11 20:04:40 +00:00 committed by Eduard-Mihai Burtescu
parent e08d0d6a48
commit 116bf9c4d4
3 changed files with 10 additions and 17 deletions

View File

@ -317,10 +317,8 @@ fn do_spirv_opt(
);
match result {
Ok(binary) => match binary {
spirv_tools::binary::Binary::OwnedU32(words) => words,
_ => binary.as_words().to_vec(),
},
Ok(spirv_tools::binary::Binary::OwnedU32(words)) => words,
Ok(binary) => binary.as_words().to_vec(),
Err(e) => {
let mut err = sess.struct_warn(&e.to_string());
err.note("spirv-opt failed, leaving as unoptimized");

View File

@ -173,7 +173,7 @@ pub fn check_fragment_insts(sess: &Session, module: &Module) -> Result<()> {
.map(|i| func_id_to_idx[&i.operands[1].unwrap_id_ref()]);
let mut any_err = None;
for entry in entries {
any_err = any_err.or(visit(
let entry_had_err = visit(
sess,
module,
&mut visited,
@ -182,7 +182,8 @@ pub fn check_fragment_insts(sess: &Session, module: &Module) -> Result<()> {
entry,
&func_id_to_idx,
)
.err());
.err();
any_err = any_err.or(entry_had_err);
}
return match any_err {
Some(err) => Err(err),
@ -206,17 +207,10 @@ pub fn check_fragment_insts(sess: &Session, module: &Module) -> Result<()> {
let mut any_err = None;
for inst in module.functions[index].all_inst_iter() {
if inst.class.opcode == Op::FunctionCall {
let called_func = func_id_to_idx[&inst.operands[0].unwrap_id_ref()];
any_err = any_err.or(visit(
sess,
module,
visited,
stack,
names,
called_func,
func_id_to_idx,
)
.err());
let callee = func_id_to_idx[&inst.operands[0].unwrap_id_ref()];
let callee_had_err =
visit(sess, module, visited, stack, names, callee, func_id_to_idx).err();
any_err = any_err.or(callee_had_err);
}
if matches!(
inst.class.opcode,

View File

@ -4,6 +4,7 @@
feature(register_attr),
register_attr(spirv)
)]
#![allow(clippy::too_many_arguments, clippy::missing_safety_doc)]
// HACK(eddyb) can't easily see warnings otherwise from `spirv-builder` builds.
#![deny(warnings)]
use spirv_std::glam::UVec3;