1 use rustc_hir::{self as hir, def_id::DefId, QPath};
2 use rustc_lint::LateContext;
3 use rustc_span::symbol::sym;
5 use crate::utils::{is_ty_param_diagnostic_item, span_lint};
7 pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_>, def_id: DefId) -> bool {
8 if cx.tcx.is_diagnostic_item(sym::option_type, def_id) {
9 if is_ty_param_diagnostic_item(cx, qpath, sym::option_type).is_some() {
14 "consider using `Option<T>` instead of `Option<Option<T>>` or a custom \
15 enum if you need to distinguish all 3 cases",