@@ -884,17 +884,17 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
884884 fn is_async_drop_impl (
885885 tcx : TyCtxt < ' tcx > ,
886886 local_decls : & IndexVec < Local , LocalDecl < ' tcx > > ,
887- param_env : ty:: ParamEnv < ' tcx > ,
887+ typing_env : ty:: TypingEnv < ' tcx > ,
888888 local : Local ,
889889 ) -> bool {
890890 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 ( ) {
892892 return true ;
893893 }
894- ty. needs_async_drop ( tcx, param_env )
894+ ty. needs_async_drop ( tcx, typing_env )
895895 }
896896 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)
898898 }
899899
900900 fn leave_top_scope ( & mut self , block : BasicBlock ) -> BasicBlock {
@@ -909,6 +909,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
909909 && scope. drops . iter ( ) . any ( |v| v. kind == DropKind :: Value && self . is_async_drop ( v. local ) ) ;
910910 let dropline_to = if has_async_drops { Some ( self . diverge_dropline ( ) ) } else { None } ;
911911 let scope = self . scopes . scopes . last ( ) . expect ( "leave_top_scope called with no scopes" ) ;
912+ let typing_env = self . typing_env ( ) ;
912913 build_scope_drops (
913914 & mut self . cfg ,
914915 & mut self . scopes . unwind_drops ,
@@ -919,7 +920,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
919920 dropline_to,
920921 is_coroutine && needs_cleanup,
921922 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) ,
923924 )
924925 . into_block ( )
925926 }
@@ -1703,7 +1704,7 @@ impl<'a, 'tcx: 'a> Builder<'a, 'tcx> {
17031704 let mut dropline_indices = IndexVec :: from_elem_n ( dropline_target, 1 ) ;
17041705 for ( drop_idx, drop_data) in drops. drops . iter_enumerated ( ) . skip ( 1 ) {
17051706 match drop_data. data . kind {
1706- DropKind :: Storage => {
1707+ DropKind :: Storage | DropKind :: ForLint => {
17071708 let coroutine_drop = self
17081709 . scopes
17091710 . coroutine_drops
0 commit comments