]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/try_err.rs
Rollup merge of #87528 - :stack_overflow_obsd, r=joshtriplett
[rust.git] / src / tools / clippy / clippy_lints / src / try_err.rs
index 1196271d5dd139b6aee2b530a32164ef1c0426e4..e9ec120a7f958d78eb8e96441c57277515cfe2c3 100644 (file)
@@ -143,7 +143,7 @@ fn find_return_type<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx ExprKind<'_>) -> O
 fn result_error_type<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option<Ty<'tcx>> {
     if_chain! {
         if let ty::Adt(_, subst) = ty.kind();
-        if is_type_diagnostic_item(cx, ty, sym::result_type);
+        if is_type_diagnostic_item(cx, ty, sym::Result);
         then {
             Some(subst.type_at(1))
         } else {
@@ -160,7 +160,7 @@ fn poll_result_error_type<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option<
         let ready_ty = subst.type_at(0);
 
         if let ty::Adt(ready_def, ready_subst) = ready_ty.kind();
-        if cx.tcx.is_diagnostic_item(sym::result_type, ready_def.did);
+        if cx.tcx.is_diagnostic_item(sym::Result, ready_def.did);
         then {
             Some(ready_subst.type_at(1))
         } else {
@@ -177,11 +177,11 @@ fn poll_option_result_error_type<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) ->
         let ready_ty = subst.type_at(0);
 
         if let ty::Adt(ready_def, ready_subst) = ready_ty.kind();
-        if cx.tcx.is_diagnostic_item(sym::option_type, ready_def.did);
+        if cx.tcx.is_diagnostic_item(sym::Option, ready_def.did);
         let some_ty = ready_subst.type_at(0);
 
         if let ty::Adt(some_def, some_subst) = some_ty.kind();
-        if cx.tcx.is_diagnostic_item(sym::result_type, some_def.did);
+        if cx.tcx.is_diagnostic_item(sym::Result, some_def.did);
         then {
             Some(some_subst.type_at(1))
         } else {