Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions autogen/src/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ fn gen_operand_param_parse_methods(grammar: &[structs::OperandKind]) -> Vec<(&st
// For each operand kind in the BitEnum category, its
// enumerants are bit masks. If a certain bit having associated
// parameters is set, we also need to decode the corresponding
// parameters. E.g., for MemoryAccess Aigned, an additional
// parameters. E.g., for MemoryAccess Aligned, an additional
// LiteralInteger, which stands for the known alignment, should
// be decoded.

Expand Down Expand Up @@ -191,10 +191,7 @@ fn gen_operand_param_parse_methods(grammar: &[structs::OperandKind]) -> Vec<(&st
spirv::#kind::#symbol => vec![#(#params),*]
}
});
// TODO: filter duplicated symbols mapping to the same discriminator to avoid
// unreachable patterns.
quote! {
#[allow(unreachable_patterns)]
fn #function_name(&mut self, #lo_kind: spirv::#kind) -> Result<Vec<dr::Operand>> {
Ok(match #lo_kind {
#(#cases),*,
Expand Down
3 changes: 0 additions & 3 deletions autogen/src/sr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,6 @@ pub fn gen_sr_code_from_instruction_grammar(
.map(ops::Terminator::Branch)
}
}
// TODO: filter duplicated symbols mapping to the same discriminator to avoid
// unreachable patterns.
#[allow(unreachable_patterns)]
pub fn lift_op(
&mut self, raw: &dr::Instruction
) -> Result<ops::Op, InstructionError> {
Expand Down
2 changes: 0 additions & 2 deletions rspirv/binary/autogen_parse_operand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ impl Parser<'_, '_> {
}
Ok(params)
}
#[allow(unreachable_patterns)]
fn parse_execution_mode_arguments(
&mut self,
execution_mode: spirv::ExecutionMode,
Expand Down Expand Up @@ -459,7 +458,6 @@ impl Parser<'_, '_> {
_ => vec![],
})
}
#[allow(unreachable_patterns)]
fn parse_decoration_arguments(
&mut self,
decoration: spirv::Decoration,
Expand Down
1 change: 1 addition & 0 deletions rspirv/grammar/reflect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ pub fn is_type(opcode: spirv::Op) -> bool {
| spirv::Op::TypeAccelerationStructureKHR
| spirv::Op::TypeRayQueryKHR
| spirv::Op::TypeForwardPointer
| spirv::Op::TypeCooperativeMatrixKHR
)
}

Expand Down
6 changes: 3 additions & 3 deletions rspirv/grammar/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl CoreInstructionTable {
pub fn get(opcode: spirv::Op) -> &'static Instruction<'static> {
INSTRUCTION_TABLE
.iter()
.find(|inst| (inst.opcode == opcode))
.find(|inst| inst.opcode == opcode)
.expect("internal error")
}

Expand Down Expand Up @@ -145,7 +145,7 @@ impl GlslStd450InstructionTable {
pub fn get(opcode: spirv::GLOp) -> &'static ExtendedInstruction<'static> {
GLSL_STD_450_INSTRUCTION_TABLE
.iter()
.find(|inst| (inst.opcode == opcode as spirv::Word))
.find(|inst| inst.opcode == opcode as spirv::Word)
.expect("internal error")
}

Expand Down Expand Up @@ -176,7 +176,7 @@ impl OpenCLStd100InstructionTable {
pub fn get(opcode: spirv::CLOp) -> &'static ExtendedInstruction<'static> {
OPENCL_STD_100_INSTRUCTION_TABLE
.iter()
.find(|inst| (inst.opcode == opcode as spirv::Word))
.find(|inst| inst.opcode == opcode as spirv::Word)
.expect("internal error")
}

Expand Down
1 change: 0 additions & 1 deletion rspirv/lift/autogen_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ impl LiftContext {
_ => self.lift_branch(raw).map(ops::Terminator::Branch),
}
}
#[allow(unreachable_patterns)]
pub fn lift_op(&mut self, raw: &dr::Instruction) -> Result<ops::Op, InstructionError> {
let mut operands = raw.operands.iter();
match raw.class.opcode as u32 {
Expand Down
2 changes: 1 addition & 1 deletion rspirv/lift/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl From<OperandError> for InstructionError {
}
}

/// Error that may occur during the convesion from the data representation
/// Error that may occur during the conversion from the data representation
/// of a module into a structured representation.
#[derive(Clone, Debug)]
pub enum ConversionError {
Expand Down
2 changes: 1 addition & 1 deletion rspirv/lift/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl<T, L: Borrow<Token<T>>> LiftStorage<T, L> {
&mut self,
id: spirv::Word,
value: T,
) -> (Token<T>, VacantEntry<spirv::Word, L>) {
) -> (Token<T>, VacantEntry<'_, spirv::Word, L>) {
let token = self.values.append(value);
match self.lookup.entry(id) {
Entry::Occupied(_) => panic!("Id {:?} is already used", id),
Expand Down
Loading