fix warnings caused by missing spans (#1340)
This commit is contained in:
parent
96250e4d45
commit
89cc999a57
4 changed files with 17 additions and 7 deletions
1
changelogs/unreleased/1340-dark64
Normal file
1
changelogs/unreleased/1340-dark64
Normal file
|
@ -0,0 +1 @@
|
|||
Add missing source information
|
|
@ -101,6 +101,7 @@ impl<'ast> VariableWriteRemover {
|
|||
.span(span),
|
||||
ConditionalKind::IfElse,
|
||||
)
|
||||
.span(span)
|
||||
.into(),
|
||||
Type::Struct(..) => StructExpression::conditional(
|
||||
BooleanExpression::uint_eq(
|
||||
|
@ -114,7 +115,6 @@ impl<'ast> VariableWriteRemover {
|
|||
UExpression::from(i).span(span),
|
||||
)
|
||||
.span(span)
|
||||
.span(span)
|
||||
.into(),
|
||||
tail.clone(),
|
||||
new_expression.clone(),
|
||||
|
@ -134,6 +134,7 @@ impl<'ast> VariableWriteRemover {
|
|||
.span(span),
|
||||
ConditionalKind::IfElse,
|
||||
)
|
||||
.span(span)
|
||||
.into(),
|
||||
Type::Tuple(..) => TupleExpression::conditional(
|
||||
BooleanExpression::uint_eq(
|
||||
|
@ -166,6 +167,7 @@ impl<'ast> VariableWriteRemover {
|
|||
.span(span),
|
||||
ConditionalKind::IfElse,
|
||||
)
|
||||
.span(span)
|
||||
.into(),
|
||||
Type::FieldElement => FieldElementExpression::conditional(
|
||||
BooleanExpression::uint_eq(
|
||||
|
@ -198,6 +200,7 @@ impl<'ast> VariableWriteRemover {
|
|||
.span(span),
|
||||
ConditionalKind::IfElse,
|
||||
)
|
||||
.span(span)
|
||||
.into(),
|
||||
Type::Boolean => BooleanExpression::conditional(
|
||||
BooleanExpression::uint_eq(
|
||||
|
@ -230,6 +233,7 @@ impl<'ast> VariableWriteRemover {
|
|||
.span(span),
|
||||
ConditionalKind::IfElse,
|
||||
)
|
||||
.span(span)
|
||||
.into(),
|
||||
Type::Uint(..) => UExpression::conditional(
|
||||
BooleanExpression::uint_eq(
|
||||
|
@ -262,10 +266,12 @@ impl<'ast> VariableWriteRemover {
|
|||
.span(span),
|
||||
ConditionalKind::IfElse,
|
||||
)
|
||||
.span(span)
|
||||
.into(),
|
||||
})
|
||||
.collect::<Vec<_>>(),
|
||||
)
|
||||
.span(span)
|
||||
.annotate(ArrayType::new(inner_ty.clone(), size))
|
||||
.into()
|
||||
}
|
||||
|
@ -394,6 +400,7 @@ impl<'ast> VariableWriteRemover {
|
|||
})
|
||||
.collect(),
|
||||
)
|
||||
.span(span)
|
||||
.annotate(members)
|
||||
.into(),
|
||||
_ => unreachable!(),
|
||||
|
@ -512,6 +519,7 @@ impl<'ast> VariableWriteRemover {
|
|||
})
|
||||
.collect(),
|
||||
)
|
||||
.span(span)
|
||||
.annotate(tuple_ty)
|
||||
.into(),
|
||||
_ => unreachable!(),
|
||||
|
|
|
@ -907,7 +907,8 @@ impl<'ast, T: Field> ResultFolder<'ast, T> for ZirPropagator<'ast, T> {
|
|||
))
|
||||
} else {
|
||||
Ok(ConditionalOrExpression::Conditional(
|
||||
ConditionalExpression::new(condition, consequence, alternative),
|
||||
ConditionalExpression::new(condition, consequence, alternative)
|
||||
.span(e.span),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1161,7 +1161,8 @@ impl<'ast, T: Field> Checker<'ast, T> {
|
|||
let decl_v = DeclarationVariable::new(
|
||||
self.id_in_this_scope(arg.id.value.id),
|
||||
decl_ty.clone(),
|
||||
);
|
||||
)
|
||||
.with_span(arg.id.span().in_module(module_id));
|
||||
|
||||
let is_mutable = arg.id.value.is_mutable;
|
||||
|
||||
|
@ -2162,10 +2163,9 @@ impl<'ast, T: Field> Checker<'ast, T> {
|
|||
span: Some(assignee.span().in_module(module_id)),
|
||||
message: format!("Assignment to an immutable variable `{}`", variable_name),
|
||||
}),
|
||||
_ => Ok(TypedAssignee::Identifier(Variable::new(
|
||||
info.id,
|
||||
info.ty.clone(),
|
||||
))),
|
||||
_ => Ok(TypedAssignee::Identifier(
|
||||
Variable::new(info.id, info.ty.clone()).with_span(span),
|
||||
)),
|
||||
},
|
||||
None => Err(ErrorInner {
|
||||
span: Some(assignee.span().in_module(module_id)),
|
||||
|
|
Loading…
Reference in a new issue