@@ -136,7 +136,7 @@ pub(super) fn check<'tcx>(
136136 fun_span : Option < Span > ,
137137 ) -> bool {
138138 // (path, fn_has_argument, methods, suffix)
139- const KNOW_TYPES : [ ( Symbol , bool , & [ Symbol ] , & str ) ; 4 ] = [
139+ const KNOW_TYPES : [ ( Symbol , bool , & [ Symbol ] , & str ) ; 5 ] = [
140140 ( sym:: BTreeEntry , false , & [ sym:: or_insert] , "with" ) ,
141141 ( sym:: HashMapEntry , false , & [ sym:: or_insert] , "with" ) ,
142142 (
@@ -145,16 +145,17 @@ pub(super) fn check<'tcx>(
145145 & [ sym:: map_or, sym:: ok_or, sym:: or, sym:: unwrap_or] ,
146146 "else" ,
147147 ) ,
148- ( sym:: Result , true , & [ sym:: or, sym:: unwrap_or] , "else" ) ,
148+ ( sym:: Option , false , & [ sym:: get_or_insert] , "with" ) ,
149+ ( sym:: Result , true , & [ sym:: map_or, sym:: or, sym:: unwrap_or] , "else" ) ,
149150 ] ;
150151
151152 if KNOW_TYPES . iter ( ) . any ( |k| k. 2 . contains ( & name) )
152153 && switch_to_lazy_eval ( cx, arg)
153154 && !contains_return ( arg)
154155 && let self_ty = cx. typeck_results ( ) . expr_ty ( self_expr)
155- && let Some ( & ( _, fn_has_arguments, poss , suffix) ) =
156- KNOW_TYPES . iter ( ) . find ( | & & i| is_type_diagnostic_item ( cx , self_ty , i . 0 ) )
157- && poss . contains ( & name)
156+ && let Some ( & ( _, fn_has_arguments, _ , suffix) ) = KNOW_TYPES
157+ . iter ( )
158+ . find ( | & & i| is_type_diagnostic_item ( cx , self_ty , i . 0 ) && i . 2 . contains ( & name) )
158159 {
159160 let ctxt = span. ctxt ( ) ;
160161 let mut app = Applicability :: HasPlaceholders ;
0 commit comments