@@ -884,17 +884,17 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
884
884
fn is_async_drop_impl (
885
885
tcx : TyCtxt < ' tcx > ,
886
886
local_decls : & IndexVec < Local , LocalDecl < ' tcx > > ,
887
- param_env : ty:: ParamEnv < ' tcx > ,
887
+ typing_env : ty:: TypingEnv < ' tcx > ,
888
888
local : Local ,
889
889
) -> bool {
890
890
let ty = local_decls[ local] . ty ;
891
- if ty. is_async_drop ( tcx, param_env ) || ty. is_coroutine ( ) {
891
+ if ty. is_async_drop ( tcx, typing_env ) || ty. is_coroutine ( ) {
892
892
return true ;
893
893
}
894
- ty. needs_async_drop ( tcx, param_env )
894
+ ty. needs_async_drop ( tcx, typing_env )
895
895
}
896
896
fn is_async_drop ( & self , local : Local ) -> bool {
897
- Self :: is_async_drop_impl ( self . tcx , & self . local_decls , self . param_env , local)
897
+ Self :: is_async_drop_impl ( self . tcx , & self . local_decls , self . typing_env ( ) , local)
898
898
}
899
899
900
900
fn leave_top_scope ( & mut self , block : BasicBlock ) -> BasicBlock {
@@ -909,6 +909,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
909
909
&& scope. drops . iter ( ) . any ( |v| v. kind == DropKind :: Value && self . is_async_drop ( v. local ) ) ;
910
910
let dropline_to = if has_async_drops { Some ( self . diverge_dropline ( ) ) } else { None } ;
911
911
let scope = self . scopes . scopes . last ( ) . expect ( "leave_top_scope called with no scopes" ) ;
912
+ let typing_env = self . typing_env ( ) ;
912
913
build_scope_drops (
913
914
& mut self . cfg ,
914
915
& mut self . scopes . unwind_drops ,
@@ -919,7 +920,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
919
920
dropline_to,
920
921
is_coroutine && needs_cleanup,
921
922
self . arg_count ,
922
- |v : Local | Self :: is_async_drop_impl ( self . tcx , & self . local_decls , self . param_env , v) ,
923
+ |v : Local | Self :: is_async_drop_impl ( self . tcx , & self . local_decls , typing_env , v) ,
923
924
)
924
925
. into_block ( )
925
926
}
@@ -1703,7 +1704,7 @@ impl<'a, 'tcx: 'a> Builder<'a, 'tcx> {
1703
1704
let mut dropline_indices = IndexVec :: from_elem_n ( dropline_target, 1 ) ;
1704
1705
for ( drop_idx, drop_data) in drops. drops . iter_enumerated ( ) . skip ( 1 ) {
1705
1706
match drop_data. data . kind {
1706
- DropKind :: Storage => {
1707
+ DropKind :: Storage | DropKind :: ForLint => {
1707
1708
let coroutine_drop = self
1708
1709
. scopes
1709
1710
. coroutine_drops
0 commit comments