clippy fix
This commit is contained in:
parent
95b64a324a
commit
da0d1dd6d8
|
@ -1,5 +1,3 @@
|
||||||
use crate::frontend::types::TypeStruct;
|
|
||||||
use crate::frontend::Callable;
|
|
||||||
use crate::rtlil;
|
use crate::rtlil;
|
||||||
use crate::rtlil::SigSpec;
|
use crate::rtlil::SigSpec;
|
||||||
|
|
||||||
|
|
|
@ -347,7 +347,7 @@ impl Context {
|
||||||
|
|
||||||
let mut new_type = callee_def.ret_type;
|
let mut new_type = callee_def.ret_type;
|
||||||
|
|
||||||
if genargs.len() != 0 {
|
if !genargs.is_empty() {
|
||||||
// need to infer generic arguments
|
// need to infer generic arguments
|
||||||
for inf_res in inferred_args {
|
for inf_res in inferred_args {
|
||||||
match inf_res {
|
match inf_res {
|
||||||
|
@ -370,7 +370,7 @@ impl Context {
|
||||||
let mut new_expr = expr.clone();
|
let mut new_expr = expr.clone();
|
||||||
new_expr.typ = new_type;
|
new_expr.typ = new_type;
|
||||||
new_expr.kind = typed_ir::ExprKind::Call(typed_ir::Call {
|
new_expr.kind = typed_ir::ExprKind::Call(typed_ir::Call {
|
||||||
called: call.called.clone(),
|
called: call.called,
|
||||||
args: args_typed,
|
args: args_typed,
|
||||||
genargs,
|
genargs,
|
||||||
});
|
});
|
||||||
|
@ -412,7 +412,7 @@ impl Context {
|
||||||
let args = callsig
|
let args = callsig
|
||||||
.args
|
.args
|
||||||
.iter()
|
.iter()
|
||||||
.map(|(name, typ)| {
|
.map(|(_name, typ)| {
|
||||||
let mut out = String::new();
|
let mut out = String::new();
|
||||||
self.types.pretty_type(&mut out, *typ)?;
|
self.types.pretty_type(&mut out, *typ)?;
|
||||||
Ok(out)
|
Ok(out)
|
||||||
|
@ -421,7 +421,7 @@ impl Context {
|
||||||
let genargs = callsig
|
let genargs = callsig
|
||||||
.genargs
|
.genargs
|
||||||
.iter()
|
.iter()
|
||||||
.map(|(name, typ)| {
|
.map(|(_name, typ)| {
|
||||||
let mut type_str = String::new();
|
let mut type_str = String::new();
|
||||||
self.types.pretty_type(&mut type_str, *typ)?;
|
self.types.pretty_type(&mut type_str, *typ)?;
|
||||||
Ok(type_str)
|
Ok(type_str)
|
||||||
|
|
|
@ -246,11 +246,7 @@ impl TypingContext {
|
||||||
match kind {
|
match kind {
|
||||||
TypeKind::ElabType(_) => todo!(),
|
TypeKind::ElabType(_) => todo!(),
|
||||||
TypeKind::Logic(data) => {
|
TypeKind::Logic(data) => {
|
||||||
if let ElabValue::Concrete(_) = data.value {
|
matches!(data.value, ElabValue::Concrete(_))
|
||||||
true
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
TypeKind::UInt(_) => todo!(),
|
TypeKind::UInt(_) => todo!(),
|
||||||
TypeKind::Callable(_) => todo!(),
|
TypeKind::Callable(_) => todo!(),
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
use super::declaration::{declaration, NetDecl};
|
|
||||||
use super::tokens::{token, Token, TokenKind as tk, TokenSpan};
|
use super::tokens::{token, Token, TokenKind as tk, TokenSpan};
|
||||||
use super::IResult;
|
use super::IResult;
|
||||||
use nom::multi::separated_list0;
|
use nom::multi::separated_list0;
|
||||||
|
@ -31,7 +30,7 @@ fn state_variant(input: TokenSpan) -> IResult<TokenSpan, StateVariant> {
|
||||||
)),
|
)),
|
||||||
)),
|
)),
|
||||||
|(name, param)| StateVariant {
|
|(name, param)| StateVariant {
|
||||||
name: name.clone(),
|
name,
|
||||||
params: param,
|
params: param,
|
||||||
},
|
},
|
||||||
)(input)
|
)(input)
|
||||||
|
|
|
@ -2,15 +2,14 @@ use nom::{
|
||||||
branch::alt,
|
branch::alt,
|
||||||
combinator::map,
|
combinator::map,
|
||||||
error::context,
|
error::context,
|
||||||
multi::{many1, separated_list1},
|
multi::separated_list1,
|
||||||
sequence::{delimited, separated_pair, tuple},
|
sequence::{delimited, separated_pair, tuple},
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::parser::{
|
use crate::parser::{
|
||||||
assign_statement, expression,
|
|
||||||
expression::{expression, Expression},
|
expression::{expression, Expression},
|
||||||
tokens::{token, TokenKind as tk, TokenSpan},
|
tokens::{token, TokenKind as tk, TokenSpan},
|
||||||
Assign, IResult, Span,
|
IResult,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|
|
@ -6,7 +6,7 @@ use nom::{
|
||||||
branch::alt,
|
branch::alt,
|
||||||
combinator::{map, opt},
|
combinator::{map, opt},
|
||||||
multi::separated_list0,
|
multi::separated_list0,
|
||||||
sequence::{delimited, preceded, separated_pair, tuple},
|
sequence::{delimited, tuple},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|
Loading…
Reference in New Issue