You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: unnecessary_cast.rs
    path of file: ./repos/rust-clippy/clippy_lints/src/casts
    
    the code of the file until where you have to start completion: use clippy_utils::diagnostics::span_lint_and_sugg;
use clippy_utils::numeric_literal::NumericLiteral;
use clippy_utils::source::snippet_opt;
use cl
    
fn is_cast_from_ty_alias<'tcx>(cx: &LateContext<'tcx>, expr: impl Visitable<'tcx>, cast_from: Ty<'tcx>) -> bool {
    for_each_expr(expr, |expr| {
        // Calls are a `Path`, and usage of locals are a `Path`. So, this checks
        // - call() as i32
        // - local as i32
        if let ExprKind::Path(qpath) = expr.kind {
            let res = cx.qpath_res(&qpath, expr.hir_id);
            // Function call
            if let Res::Def(DefKind::Fn, def_id) = res {
                let Some(snippet) = snippet_opt(cx, cx.tcx.def_span(def_id)) else {
                    return ControlFlow::Continue(());
                };
                // This is the worst part of this entire function. This is the only way I know of to
                // check whether a function returns a type alias. Sure, you can get the return type
                // from a function in the current crate as an hir ty, but how do you get it for
                // external functions?? Simple: It's impossible. So, we check whether a part of the
                // function's declaration snippet is exactly equal to the `Ty`. That way, we can
                // see whether it's a type alias.
                //
                // FIXME: This won't work if the type is given an alias through `use`, should we
                // consider this a type alias as well?
                if !snippet
                    .split("->")
                    .skip(1)
                    .map(|s| snippet_eq_ty(s, cast_from) || s.split("where").any(|ty| snippet_eq_ty(ty, cast_from)))
                    .any(|a| a)
                {
                    return ControlFlow::Break(());
                }
            // Local usage
            } else if let Res::Local(hir_id) = res
                && let Node::Local(l) = cx.tcx.parent_hir_node(hir_id)
            {
                if let Some(e) = l.init
                    && is_cast_from_ty_alias(cx, e, cast_from)
                {
                    return ControlFlow::Break::<()>(());
                }

                if let Some(ty) = l.ty
                    && let TyKind::Path(qpath) = ty.kind
                    && is_ty_alias(&qpath)
                {
                    return ControlFlow::Break::<()>(());
                }
            }
        }

        ControlFlow::Continue(())
    })
    .is_some()
}