@@ -233,21 +233,22 @@ impl<'a> SemanticBuilder<'a> {
233
233
// TODO: It would be even more efficient to calculate counts in parser to avoid
234
234
// this extra AST traversal.
235
235
let stats = Stats :: count ( program) ;
236
- self . nodes . reserve ( stats. nodes ) ;
237
- self . scope . reserve ( stats. scopes ) ;
238
- self . symbols . reserve ( stats. symbols , stats. references ) ;
236
+ self . nodes . reserve ( stats. nodes as usize ) ;
237
+ self . scope . reserve ( stats. scopes as usize ) ;
238
+ self . symbols . reserve ( stats. symbols as usize , stats. references as usize ) ;
239
239
240
240
// Visit AST to generate scopes tree etc
241
241
self . visit_program ( program) ;
242
242
243
243
// Check that estimated counts accurately
244
244
#[ cfg( debug_assertions) ]
245
245
{
246
+ #[ allow( clippy:: cast_possible_truncation) ]
246
247
let actual_stats = Stats {
247
- nodes : self . nodes . len ( ) ,
248
- scopes : self . scope . len ( ) ,
249
- symbols : self . symbols . len ( ) ,
250
- references : self . symbols . references . len ( ) ,
248
+ nodes : self . nodes . len ( ) as u32 ,
249
+ scopes : self . scope . len ( ) as u32 ,
250
+ symbols : self . symbols . len ( ) as u32 ,
251
+ references : self . symbols . references . len ( ) as u32 ,
251
252
} ;
252
253
Stats :: assert_accurate ( & actual_stats, & stats) ;
253
254
}
0 commit comments