File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -720,15 +720,18 @@ fn compute_layout<'tcx>(
720
720
_ => bug ! ( ) ,
721
721
} ;
722
722
723
+ let param_env = tcx. param_env ( source. def_id ( ) ) ;
724
+
723
725
for ( local, decl) in body. local_decls . iter_enumerated ( ) {
724
726
// Ignore locals which are internal or not live
725
727
if !live_locals. contains ( local) || decl. internal {
726
728
continue ;
727
729
}
730
+ let decl_ty = tcx. normalize_erasing_regions ( param_env, decl. ty ) ;
728
731
729
732
// Sanity check that typeck knows about the type of locals which are
730
733
// live across a suspension point
731
- if !allowed. contains ( & decl . ty ) && !allowed_upvars. contains ( & decl . ty ) {
734
+ if !allowed. contains ( & decl_ty ) && !allowed_upvars. contains ( & decl_ty ) {
732
735
span_bug ! (
733
736
body. span,
734
737
"Broken MIR: generator contains type {} in MIR, \
Original file line number Diff line number Diff line change
1
+ // check-pass
2
+ // edition:2018
3
+ // compile-flags: --crate-type=lib
4
+
5
+ pub async fn test ( ) {
6
+ const C : usize = 4 ;
7
+ foo ( & mut [ 0u8 ; C ] ) . await ;
8
+ }
9
+
10
+ async fn foo ( _: & mut [ u8 ] ) { }
You can’t perform that action at this time.
0 commit comments