Skip to content

Commit f8776cb

Browse files
committed
clippy: box some Stmts to make error enums smaller
1 parent 69baae1 commit f8776cb

File tree

7 files changed

+14
-8
lines changed

7 files changed

+14
-8
lines changed

src/intrinsic/annotations.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub enum AnnotationError {
3333
NotOnWhile {
3434
span: Span,
3535
annotation_name: Ident,
36-
annotated: Stmt,
36+
annotated: Box<Stmt>,
3737
},
3838
WrongArgument {
3939
span: Span,

src/mc/mod.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,18 @@ pub enum JaniConversionError {
4646
UnsupportedPre(Expr),
4747
UnsupportedAssume(Expr),
4848
UnsupportedAssert(Expr),
49-
UnsupportedHavoc { stmt: Stmt, can_eliminate: bool },
49+
UnsupportedHavoc {
50+
stmt: Box<Stmt>,
51+
can_eliminate: bool,
52+
},
5053
UnsupportedInftyPost(Expr),
5154
NondetSelection(Span),
5255
MismatchedDirection(Span),
5356
UnsupportedCall(Span, Ident),
54-
UnsupportedCalculus { proc: Ident, calculus: Ident },
57+
UnsupportedCalculus {
58+
proc: Ident,
59+
calculus: Ident,
60+
},
5561
}
5662

5763
impl JaniConversionError {

src/mc/opsem.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ fn translate_stmt(
143143
Ok(start)
144144
}
145145
StmtKind::Havoc(dir, _) => Err(JaniConversionError::UnsupportedHavoc {
146-
stmt: stmt.clone(),
146+
stmt: Box::new(stmt.clone()),
147147
can_eliminate: automaton.spec_part.direction == *dir,
148148
}),
149149
StmtKind::Compare(_, _) | StmtKind::Negate(_) | StmtKind::Validate(_) => {

src/proof_rules/mciver_ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl Encoding for ASTAnnotation {
144144
return Err(AnnotationError::NotOnWhile {
145145
span: annotation_span,
146146
annotation_name: self.name(),
147-
annotated: inner_stmt.clone(),
147+
annotated: Box::new(inner_stmt.clone()),
148148
});
149149
};
150150

src/proof_rules/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ impl<'tcx, 'sunit> VisitorMut for EncodingVisitor<'tcx, 'sunit> {
288288
AnnotationError::NotOnWhile {
289289
span: *annotation_span,
290290
annotation_name: *ident,
291-
annotated: inner_stmt.as_ref().clone(),
291+
annotated: Box::new(inner_stmt.as_ref().clone()),
292292
},
293293
));
294294
}

src/proof_rules/ost.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl Encoding for OSTAnnotation {
137137
return Err(AnnotationError::NotOnWhile {
138138
span: annotation_span,
139139
annotation_name: self.name(),
140-
annotated: inner_stmt.clone(),
140+
annotated: Box::new(inner_stmt.clone()),
141141
});
142142
};
143143

src/proof_rules/past.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl Encoding for PASTAnnotation {
135135
return Err(AnnotationError::NotOnWhile {
136136
span: annotation_span,
137137
annotation_name: self.name(),
138-
annotated: inner_stmt.clone(),
138+
annotated: Box::new(inner_stmt.clone()),
139139
});
140140
};
141141

0 commit comments

Comments
 (0)