mirror of
https://github.com/EmbarkStudios/rust-gpu.git
synced 2024-11-22 06:45:13 +00:00
rustup: address (new) clippy errors.
This commit is contained in:
parent
e08d0d6a48
commit
116bf9c4d4
@ -317,10 +317,8 @@ fn do_spirv_opt(
|
|||||||
);
|
);
|
||||||
|
|
||||||
match result {
|
match result {
|
||||||
Ok(binary) => match binary {
|
Ok(spirv_tools::binary::Binary::OwnedU32(words)) => words,
|
||||||
spirv_tools::binary::Binary::OwnedU32(words) => words,
|
Ok(binary) => binary.as_words().to_vec(),
|
||||||
_ => binary.as_words().to_vec(),
|
|
||||||
},
|
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
let mut err = sess.struct_warn(&e.to_string());
|
let mut err = sess.struct_warn(&e.to_string());
|
||||||
err.note("spirv-opt failed, leaving as unoptimized");
|
err.note("spirv-opt failed, leaving as unoptimized");
|
||||||
|
@ -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()]);
|
.map(|i| func_id_to_idx[&i.operands[1].unwrap_id_ref()]);
|
||||||
let mut any_err = None;
|
let mut any_err = None;
|
||||||
for entry in entries {
|
for entry in entries {
|
||||||
any_err = any_err.or(visit(
|
let entry_had_err = visit(
|
||||||
sess,
|
sess,
|
||||||
module,
|
module,
|
||||||
&mut visited,
|
&mut visited,
|
||||||
@ -182,7 +182,8 @@ pub fn check_fragment_insts(sess: &Session, module: &Module) -> Result<()> {
|
|||||||
entry,
|
entry,
|
||||||
&func_id_to_idx,
|
&func_id_to_idx,
|
||||||
)
|
)
|
||||||
.err());
|
.err();
|
||||||
|
any_err = any_err.or(entry_had_err);
|
||||||
}
|
}
|
||||||
return match any_err {
|
return match any_err {
|
||||||
Some(err) => Err(err),
|
Some(err) => Err(err),
|
||||||
@ -206,17 +207,10 @@ pub fn check_fragment_insts(sess: &Session, module: &Module) -> Result<()> {
|
|||||||
let mut any_err = None;
|
let mut any_err = None;
|
||||||
for inst in module.functions[index].all_inst_iter() {
|
for inst in module.functions[index].all_inst_iter() {
|
||||||
if inst.class.opcode == Op::FunctionCall {
|
if inst.class.opcode == Op::FunctionCall {
|
||||||
let called_func = func_id_to_idx[&inst.operands[0].unwrap_id_ref()];
|
let callee = func_id_to_idx[&inst.operands[0].unwrap_id_ref()];
|
||||||
any_err = any_err.or(visit(
|
let callee_had_err =
|
||||||
sess,
|
visit(sess, module, visited, stack, names, callee, func_id_to_idx).err();
|
||||||
module,
|
any_err = any_err.or(callee_had_err);
|
||||||
visited,
|
|
||||||
stack,
|
|
||||||
names,
|
|
||||||
called_func,
|
|
||||||
func_id_to_idx,
|
|
||||||
)
|
|
||||||
.err());
|
|
||||||
}
|
}
|
||||||
if matches!(
|
if matches!(
|
||||||
inst.class.opcode,
|
inst.class.opcode,
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
feature(register_attr),
|
feature(register_attr),
|
||||||
register_attr(spirv)
|
register_attr(spirv)
|
||||||
)]
|
)]
|
||||||
|
#![allow(clippy::too_many_arguments, clippy::missing_safety_doc)]
|
||||||
// HACK(eddyb) can't easily see warnings otherwise from `spirv-builder` builds.
|
// HACK(eddyb) can't easily see warnings otherwise from `spirv-builder` builds.
|
||||||
#![deny(warnings)]
|
#![deny(warnings)]
|
||||||
use spirv_std::glam::UVec3;
|
use spirv_std::glam::UVec3;
|
||||||
|
Loading…
Reference in New Issue
Block a user