@@ -2235,7 +2235,10 @@ fn lint_expect_fun_call(
2235
2235
span_replace_word,
2236
2236
& format ! ( "use of `{}` followed by a function call" , name) ,
2237
2237
"try this" ,
2238
- format ! ( "unwrap_or_else({} {{ panic!({}) }})" , closure_args, arg_root_snippet) ,
2238
+ format ! (
2239
+ "unwrap_or_else({} {{ panic!(\" {{}}\" , {}) }})" ,
2240
+ closure_args, arg_root_snippet
2241
+ ) ,
2239
2242
applicability,
2240
2243
) ;
2241
2244
}
@@ -2672,7 +2675,7 @@ fn lint_get_unwrap<'tcx>(cx: &LateContext<'tcx>, expr: &hir::Expr<'_>, get_args:
2672
2675
if_chain ! {
2673
2676
if needs_ref;
2674
2677
if let Some ( parent) = get_parent_expr( cx, expr) ;
2675
- if let hir:: ExprKind :: Unary ( hir:: UnOp :: UnDeref , _) = parent. kind;
2678
+ if let hir:: ExprKind :: Unary ( hir:: UnOp :: Deref , _) = parent. kind;
2676
2679
then {
2677
2680
needs_ref = false ;
2678
2681
span = parent. span;
@@ -3116,7 +3119,7 @@ fn lint_filter_map<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>, is_f
3116
3119
// in `filter(|x| ..)`, replace `*x` with `x`
3117
3120
let a_path = if_chain! {
3118
3121
if !is_filter_param_ref;
3119
- if let ExprKind :: Unary ( UnOp :: UnDeref , expr_path) = a. kind;
3122
+ if let ExprKind :: Unary ( UnOp :: Deref , expr_path) = a. kind;
3120
3123
then { expr_path } else { a }
3121
3124
} ;
3122
3125
// let the filter closure arg and the map closure arg be equal
@@ -3758,8 +3761,8 @@ fn lint_option_as_ref_deref<'tcx>(
3758
3761
} ,
3759
3762
hir:: ExprKind :: AddrOf ( hir:: BorrowKind :: Ref , m, ref inner) if same_mutability ( m) => {
3760
3763
if_chain ! {
3761
- if let hir:: ExprKind :: Unary ( hir:: UnOp :: UnDeref , ref inner1) = inner. kind;
3762
- if let hir:: ExprKind :: Unary ( hir:: UnOp :: UnDeref , ref inner2) = inner1. kind;
3764
+ if let hir:: ExprKind :: Unary ( hir:: UnOp :: Deref , ref inner1) = inner. kind;
3765
+ if let hir:: ExprKind :: Unary ( hir:: UnOp :: Deref , ref inner2) = inner1. kind;
3763
3766
then {
3764
3767
path_to_local_id( inner2, closure_body. params[ 0 ] . pat. hir_id)
3765
3768
} else {
@@ -4113,7 +4116,7 @@ fn lint_filetype_is_file(cx: &LateContext<'_>, expr: &hir::Expr<'_>, args: &[hir
4113
4116
if_chain ! {
4114
4117
if let Some ( parent) = get_parent_expr( cx, expr) ;
4115
4118
if let hir:: ExprKind :: Unary ( op, _) = parent. kind;
4116
- if op == hir:: UnOp :: UnNot ;
4119
+ if op == hir:: UnOp :: Not ;
4117
4120
then {
4118
4121
lint_unary = "!" ;
4119
4122
verb = "denies" ;
0 commit comments