@@ -278,15 +278,15 @@ impl<'tcx> Body<'tcx> {
278
278
279
279
/// Returns an iterator over all function arguments.
280
280
#[ inline]
281
- pub fn args_iter ( & self ) -> impl Iterator < Item = Local > {
281
+ pub fn args_iter ( & self ) -> impl Iterator < Item = Local > + ExactSizeIterator {
282
282
let arg_count = self . arg_count ;
283
- ( 1 ..= arg_count) . map ( Local :: new)
283
+ ( 1 ..arg_count + 1 ) . map ( Local :: new)
284
284
}
285
285
286
286
/// Returns an iterator over all user-defined variables and compiler-generated temporaries (all
287
287
/// locals that are neither arguments nor the return place).
288
288
#[ inline]
289
- pub fn vars_and_temps_iter ( & self ) -> impl Iterator < Item = Local > {
289
+ pub fn vars_and_temps_iter ( & self ) -> impl Iterator < Item = Local > + ExactSizeIterator {
290
290
let arg_count = self . arg_count ;
291
291
let local_count = self . local_decls . len ( ) ;
292
292
( arg_count + 1 ..local_count) . map ( Local :: new)
@@ -2380,11 +2380,15 @@ impl<'tcx> UserTypeProjections {
2380
2380
UserTypeProjections { contents : projs. collect ( ) }
2381
2381
}
2382
2382
2383
- pub fn projections_and_spans ( & self ) -> impl Iterator < Item = & ( UserTypeProjection , Span ) > {
2383
+ pub fn projections_and_spans ( & self )
2384
+ -> impl Iterator < Item = & ( UserTypeProjection , Span ) > + ExactSizeIterator
2385
+ {
2384
2386
self . contents . iter ( )
2385
2387
}
2386
2388
2387
- pub fn projections ( & self ) -> impl Iterator < Item = & UserTypeProjection > {
2389
+ pub fn projections ( & self )
2390
+ -> impl Iterator < Item = & UserTypeProjection > + ExactSizeIterator
2391
+ {
2388
2392
self . contents . iter ( ) . map ( |& ( ref user_type, _span) | user_type)
2389
2393
}
2390
2394
0 commit comments