Skip to content

Commit

Permalink
Address CI failures (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
msiglreith committed Nov 21, 2023
1 parent 2283f57 commit a3b41ed
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions autogen/src/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ pub fn gen_operand_parse_methods(grammar: &[structs::OperandKind]) -> TokenStrea
// Logic operands that expand to concrete operand pairs,
// that is, those operand kinds with 'Pair' name prefix.
// We only have two cases. So hard code it.
let pair_kinds = vec![("IdRef", "LiteralInteger"), ("IdRef", "IdRef")];
let pair_kinds = [("IdRef", "LiteralInteger"), ("IdRef", "IdRef")];
let pair_cases = pair_kinds.iter().map(|&(k0, k1)| {
let kind = as_ident(&format!("Pair{}{}", k0, k1));
let kind0 = get_dr_operand_kind(k0);
Expand All @@ -253,7 +253,7 @@ pub fn gen_operand_parse_methods(grammar: &[structs::OperandKind]) -> TokenStrea
});

// These kinds are manually handled.
let manual_kinds = vec![
let manual_kinds = [
"IdResultType",
"IdResult",
"LiteralContextDependentNumber",
Expand Down
2 changes: 1 addition & 1 deletion autogen/src/dr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ pub fn gen_dr_operand_kinds(grammar: &[structs::OperandKind]) -> TokenStream {

enum_kinds
.chain(id_kinds)
.chain(num_kinds.into_iter())
.chain(num_kinds)
.chain(str_kinds)
.collect::<Vec<_>>()
};
Expand Down
6 changes: 4 additions & 2 deletions rspirv/dr/constructs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,11 @@ mod tests {
assert_eq!(
format!(
"{}",
dr::Operand::FunctionControl(spirv::FunctionControl::INLINE)
dr::Operand::FunctionControl(
spirv::FunctionControl::INLINE | spirv::FunctionControl::CONST
)
),
"INLINE",
"FunctionControl(INLINE | CONST)",
);
assert_eq!(format!("{}", dr::Operand::IdRef(3)), "%3");
assert_eq!(format!("{}", dr::Operand::LiteralBit32(3)), "3");
Expand Down
6 changes: 5 additions & 1 deletion rspirv/lift/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,11 @@ impl LiftContext {
let start_label = fun.blocks[0].label.as_ref().unwrap().result_id.unwrap();
let start_block = context.blocks.lookup_token(start_label);
let blocks = mem::replace(&mut context.blocks, LiftStorage::new()).unwrap();
let fun_ret = fun.def.as_ref().and_then(|d| d.result_type).expect("functions must have a result type");
let fun_ret = fun
.def
.as_ref()
.and_then(|d| d.result_type)
.expect("functions must have a result type");

functions.push(module::Function {
control: def.function_control,
Expand Down
5 changes: 1 addition & 4 deletions rspirv/sr/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ pub struct Token<T> {

impl<T> Clone for Token<T> {
fn clone(&self) -> Self {
Token {
index: self.index,
marker: self.marker,
}
*self
}
}
impl<T> Copy for Token<T> {}
Expand Down

0 comments on commit a3b41ed

Please sign in to comment.