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: manual_slice_size_calculation.rs
    path of file: ./repos/rust-clippy/clippy_lints/src
    
    the code of the file until where you have to start completion: use clippy_utils::diagnostics::span_lint_and_sugg;
use clippy_utils::source::snippet_with_context;
use clippy_utils::{expr_or_init, in_constant, std_or_core};
use rustc_errors::Applicability;
use rustc_hir::{BinOpKind, Expr, ExprKind};
use rustc_lint::{LateContext, LateLintPass};
use rustc_middle::ty;
use rustc_session::declare_lint_pass;
use rustc_span::symbol::sym;

declare_clippy_lint! {
    /// ### What it does
    /// When `a` is `&[T]`, detect `a.len() * size_of::<T>()` and suggest `size_of_val(a)`
    /// instead.
    ///
    /// ### Why is this better?
    /// * Shorter to write
    /// * Removes the need for the human and the compiler to worry about overflow in the
   
    
    fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
        // Does not apply inside const because size_of_val is not cost in stable.
        if !in_constant(cx, expr.hir_id)
            && let ExprKind::Binary(ref op, left, right) = expr.kind
            && BinOpKind::Mul == op.node
            && !expr.span.from_expansion()
            && let Some(receiver) = simplify(cx, left, right)
        {
            let ctxt = expr.span.ctxt();
            let mut app = Applicability::MachineApplicable;
            let val_name = snippet_with_context(cx, receiver.span, ctxt, "slice", &mut app).0;
            let Some(sugg) = std_or_core(cx) else { return };

            span_lint_and_sugg(
                cx,
                MANUAL_SLICE_SIZE_CALCULATION,
                expr.span,
                "manual slice size calculation",
                "try",
                format!("{sugg}::mem::size_of_val({val_name})"),
                app,
            );
        }
    }