Apply suggested change

Co-authored-by: Philipp Krones <hello@philkrones.com>
This commit is contained in:
Dániel Buga 2020-07-26 21:08:07 +02:00
parent 94cf90e5a5
commit 9c41822d34

View File

@ -2717,8 +2717,8 @@ fn lint_lazy_eval<'tcx>(
allow_variant_calls: bool,
simplify_using: &str,
) {
let is_option = is_type_diagnostic_item(cx, cx.tables().expr_ty(&args[0]), sym!(option_type));
let is_result = is_type_diagnostic_item(cx, cx.tables().expr_ty(&args[0]), sym!(result_type));
let is_option = is_type_diagnostic_item(cx, cx.typeck_results().expr_ty(&args[0]), sym!(option_type));
let is_result = is_type_diagnostic_item(cx, cx.typeck_results().expr_ty(&args[0]), sym!(result_type));
if !is_option && !is_result {
return;