@@ -61,7 +61,7 @@ fn is_impl_not_trait_with_bool_out<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -
6161 )
6262 } )
6363 . map_or ( false , |assoc_item| {
64- let proj = cx. tcx . mk_projection ( assoc_item. def_id , cx. tcx . mk_substs_trait ( ty, [ ] ) ) ;
64+ let proj = Ty :: new_projection ( cx. tcx , assoc_item. def_id , cx. tcx . mk_substs_trait ( ty, [ ] ) ) ;
6565 let nty = cx. tcx . normalize_erasing_regions ( cx. param_env , proj) ;
6666
6767 nty. is_bool ( )
@@ -70,14 +70,18 @@ fn is_impl_not_trait_with_bool_out<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -
7070
7171impl < ' tcx > LateLintPass < ' tcx > for BoolAssertComparison {
7272 fn check_expr ( & mut self , cx : & LateContext < ' tcx > , expr : & ' tcx Expr < ' _ > ) {
73- let Some ( macro_call) = root_macro_call_first_node ( cx, expr) else { return } ;
73+ let Some ( macro_call) = root_macro_call_first_node ( cx, expr) else {
74+ return ;
75+ } ;
7476 let macro_name = cx. tcx . item_name ( macro_call. def_id ) ;
7577 let eq_macro = match macro_name. as_str ( ) {
7678 "assert_eq" | "debug_assert_eq" => true ,
7779 "assert_ne" | "debug_assert_ne" => false ,
7880 _ => return ,
7981 } ;
80- let Some ( ( a, b, _) ) = find_assert_eq_args ( cx, expr, macro_call. expn ) else { return } ;
82+ let Some ( ( a, b, _) ) = find_assert_eq_args ( cx, expr, macro_call. expn ) else {
83+ return ;
84+ } ;
8185
8286 let a_span = a. span . source_callsite ( ) ;
8387 let b_span = b. span . source_callsite ( ) ;
@@ -126,7 +130,9 @@ impl<'tcx> LateLintPass<'tcx> for BoolAssertComparison {
126130 let mut suggestions = vec ! [ ( name_span, non_eq_mac. to_string( ) ) , ( lit_span, String :: new( ) ) ] ;
127131
128132 if bool_value ^ eq_macro {
129- let Some ( sugg) = Sugg :: hir_opt ( cx, non_lit_expr) else { return } ;
133+ let Some ( sugg) = Sugg :: hir_opt ( cx, non_lit_expr) else {
134+ return ;
135+ } ;
130136 suggestions. push ( ( non_lit_expr. span , ( !sugg) . to_string ( ) ) ) ;
131137 }
132138
0 commit comments