about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md5
-rw-r--r--clippy_lints/src/copies.rs20
-rw-r--r--clippy_lints/src/format.rs7
-rw-r--r--clippy_lints/src/lib.register_all.rs1
-rw-r--r--clippy_lints/src/lib.register_correctness.rs1
-rw-r--r--clippy_lints/src/lib.register_lints.rs1
-rw-r--r--clippy_lints/src/lib.rs3
-rw-r--r--clippy_lints/src/manual_unwrap_or.rs2
-rw-r--r--clippy_lints/src/mem_discriminant.rs82
-rw-r--r--clippy_lints/src/needless_continue.rs13
-rw-r--r--clippy_lints/src/utils/internal_lints.rs3
-rw-r--r--clippy_utils/src/higher.rs1
-rw-r--r--clippy_utils/src/lib.rs1
-rw-r--r--clippy_utils/src/paths.rs1
-rw-r--r--clippy_utils/src/sugg.rs6
-rw-r--r--tests/ui-internal/unnecessary_symbol_str.fixed4
-rw-r--r--tests/ui-internal/unnecessary_symbol_str.rs4
-rw-r--r--tests/ui-internal/unnecessary_symbol_str.stderr8
-rw-r--r--tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.stderr6
-rw-r--r--tests/ui/asm_syntax.stderr10
-rw-r--r--tests/ui/assertions_on_constants.stderr18
-rw-r--r--tests/ui/bool_assert_comparison.stderr44
-rw-r--r--tests/ui/cast_lossless_float.fixed22
-rw-r--r--tests/ui/cast_lossless_float.rs22
-rw-r--r--tests/ui/cast_lossless_float.stderr66
-rw-r--r--tests/ui/cast_lossless_integer.fixed38
-rw-r--r--tests/ui/cast_lossless_integer.rs38
-rw-r--r--tests/ui/cast_lossless_integer.stderr114
-rw-r--r--tests/ui/checked_unwrap/simple_conditionals.stderr2
-rw-r--r--tests/ui/collapsible_match2.stderr2
-rw-r--r--tests/ui/crashes/ice-6255.stderr2
-rw-r--r--tests/ui/crashes/ice-6256.stderr2
-rw-r--r--tests/ui/declare_interior_mutable_const/others.stderr2
-rw-r--r--tests/ui/declare_interior_mutable_const/traits.stderr2
-rw-r--r--tests/ui/default_numeric_fallback_f64.stderr2
-rw-r--r--tests/ui/default_numeric_fallback_i32.stderr2
-rw-r--r--tests/ui/doc_unsafe.stderr2
-rw-r--r--tests/ui/eq_op_macros.stderr8
-rw-r--r--tests/ui/fallible_impl_from.stderr8
-rw-r--r--tests/ui/format.stderr26
-rw-r--r--tests/ui/implicit_hasher.stderr6
-rw-r--r--tests/ui/item_after_statement.stderr2
-rw-r--r--tests/ui/manual_unwrap_or.fixed4
-rw-r--r--tests/ui/manual_unwrap_or.rs4
-rw-r--r--tests/ui/mem_discriminant.fixed45
-rw-r--r--tests/ui/mem_discriminant.rs45
-rw-r--r--tests/ui/mem_discriminant.stderr94
-rw-r--r--tests/ui/mem_discriminant_unfixable.rs16
-rw-r--r--tests/ui/mem_discriminant_unfixable.stderr20
-rw-r--r--tests/ui/mem_replace_macro.stderr2
-rw-r--r--tests/ui/missing_panics_doc.stderr4
-rw-r--r--tests/ui/panic_in_result_fn.stderr12
-rw-r--r--tests/ui/panic_in_result_fn_assertions.stderr6
-rw-r--r--tests/ui/panicking_macros.stderr32
-rw-r--r--tests/ui/pattern_type_mismatch/syntax.stderr2
-rw-r--r--tests/ui/rename.fixed1
-rw-r--r--tests/ui/rename.rs1
-rw-r--r--tests/ui/rename.stderr14
-rw-r--r--tests/ui/toplevel_ref_arg.stderr2
-rw-r--r--tests/ui/toplevel_ref_arg_non_rustfix.stderr2
-rw-r--r--tests/ui/try_err.stderr4
-rw-r--r--tests/ui/undocumented_unsafe_blocks.stderr2
-rw-r--r--tests/ui/unit_cmp.stderr8
-rw-r--r--tests/ui/useless_conversion.fixed2
-rw-r--r--tests/ui/useless_conversion.rs2
65 files changed, 312 insertions, 621 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dacf552d606..3b4c687209e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1873,10 +1873,10 @@ Released 2019-01-17
 
 [2e26fdc2...b2601be](https://github.com/rust-lang/rust-clippy/compare/2e26fdc2...b2601be)
 
-* New lints: [`slow_vector_initialization`], [`mem_discriminant_non_enum`],
+* New lints: [`slow_vector_initialization`], `mem_discriminant_non_enum`,
   [`redundant_clone`], [`wildcard_dependencies`],
   [`into_iter_on_ref`], `into_iter_on_array`, [`deprecated_cfg_attr`],
-  [`mem_discriminant_non_enum`], [`cargo_common_metadata`]
+  [`cargo_common_metadata`]
 * Add support for `u128` and `i128` to integer related lints
 * Add float support to `mistyped_literal_suffixes`
 * Fix false positives in `use_self`
@@ -2842,7 +2842,6 @@ Released 2018-09-13
 [`match_wild_err_arm`]: https://rust-lang.github.io/rust-clippy/master/index.html#match_wild_err_arm
 [`match_wildcard_for_single_variants`]: https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants
 [`maybe_infinite_iter`]: https://rust-lang.github.io/rust-clippy/master/index.html#maybe_infinite_iter
-[`mem_discriminant_non_enum`]: https://rust-lang.github.io/rust-clippy/master/index.html#mem_discriminant_non_enum
 [`mem_forget`]: https://rust-lang.github.io/rust-clippy/master/index.html#mem_forget
 [`mem_replace_option_with_none`]: https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_none
 [`mem_replace_with_default`]: https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default
diff --git a/clippy_lints/src/copies.rs b/clippy_lints/src/copies.rs
index 6ded2f233ef..8abf10c0d1c 100644
--- a/clippy_lints/src/copies.rs
+++ b/clippy_lints/src/copies.rs
@@ -9,7 +9,7 @@ use rustc_data_structures::fx::FxHashSet;
 use rustc_errors::{Applicability, DiagnosticBuilder};
 use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
 use rustc_hir::{Block, Expr, ExprKind, HirId};
-use rustc_lint::{LateContext, LateLintPass};
+use rustc_lint::{LateContext, LateLintPass, LintContext};
 use rustc_middle::hir::map::Map;
 use rustc_session::{declare_lint_pass, declare_tool_lint};
 use rustc_span::{source_map::Span, symbol::Symbol, BytePos};
@@ -432,10 +432,11 @@ fn emit_branches_sharing_code_lint(
     let mut add_expr_note = false;
 
     // Construct suggestions
+    let sm = cx.sess().source_map();
     if start_stmts > 0 {
         let block = blocks[0];
         let span_start = first_line_of_span(cx, if_expr.span).shrink_to_lo();
-        let span_end = block.stmts[start_stmts - 1].span.source_callsite();
+        let span_end = sm.stmt_span(block.stmts[start_stmts - 1].span, block.span);
 
         let cond_span = first_line_of_span(cx, if_expr.span).until(block.span);
         let cond_snippet = reindent_multiline(snippet(cx, cond_span, "_"), false, None);
@@ -454,15 +455,14 @@ fn emit_branches_sharing_code_lint(
         let span_end = block.span.shrink_to_hi();
 
         let moved_start = if end_stmts == 0 && block.expr.is_some() {
-            block.expr.unwrap().span
+            block.expr.unwrap().span.source_callsite()
         } else {
-            block.stmts[block.stmts.len() - end_stmts].span
-        }
-        .source_callsite();
-        let moved_end = block
-            .expr
-            .map_or_else(|| block.stmts[block.stmts.len() - 1].span, |expr| expr.span)
-            .source_callsite();
+            sm.stmt_span(block.stmts[block.stmts.len() - end_stmts].span, block.span)
+        };
+        let moved_end = block.expr.map_or_else(
+            || sm.stmt_span(block.stmts[block.stmts.len() - 1].span, block.span),
+            |expr| expr.span.source_callsite(),
+        );
 
         let moved_span = moved_start.to(moved_end);
         let moved_snipped = reindent_multiline(snippet(cx, moved_span, "_"), true, None);
diff --git a/clippy_lints/src/format.rs b/clippy_lints/src/format.rs
index 472db6f5731..c22f9d0e170 100644
--- a/clippy_lints/src/format.rs
+++ b/clippy_lints/src/format.rs
@@ -89,12 +89,7 @@ impl<'tcx> LateLintPass<'tcx> for UselessFormat {
     }
 }
 
-fn span_useless_format(cx: &LateContext<'_>, span: Span, mut sugg: String, mut applicability: Applicability) {
-    // The callsite span contains the statement semicolon for some reason.
-    if snippet_with_applicability(cx, span, "..", &mut applicability).ends_with(';') {
-        sugg.push(';');
-    }
-
+fn span_useless_format(cx: &LateContext<'_>, span: Span, sugg: String, applicability: Applicability) {
     span_lint_and_sugg(
         cx,
         USELESS_FORMAT,
diff --git a/clippy_lints/src/lib.register_all.rs b/clippy_lints/src/lib.register_all.rs
index 4c2dfbd1d84..c949ee23ecc 100644
--- a/clippy_lints/src/lib.register_all.rs
+++ b/clippy_lints/src/lib.register_all.rs
@@ -130,7 +130,6 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
     LintId::of(matches::REDUNDANT_PATTERN_MATCHING),
     LintId::of(matches::SINGLE_MATCH),
     LintId::of(matches::WILDCARD_IN_OR_PATTERNS),
-    LintId::of(mem_discriminant::MEM_DISCRIMINANT_NON_ENUM),
     LintId::of(mem_replace::MEM_REPLACE_OPTION_WITH_NONE),
     LintId::of(mem_replace::MEM_REPLACE_WITH_DEFAULT),
     LintId::of(mem_replace::MEM_REPLACE_WITH_UNINIT),
diff --git a/clippy_lints/src/lib.register_correctness.rs b/clippy_lints/src/lib.register_correctness.rs
index 94a385dad84..ff56a6081fb 100644
--- a/clippy_lints/src/lib.register_correctness.rs
+++ b/clippy_lints/src/lib.register_correctness.rs
@@ -37,7 +37,6 @@ store.register_group(true, "clippy::correctness", Some("clippy_correctness"), ve
     LintId::of(loops::NEVER_LOOP),
     LintId::of(loops::WHILE_IMMUTABLE_CONDITION),
     LintId::of(match_str_case_mismatch::MATCH_STR_CASE_MISMATCH),
-    LintId::of(mem_discriminant::MEM_DISCRIMINANT_NON_ENUM),
     LintId::of(mem_replace::MEM_REPLACE_WITH_UNINIT),
     LintId::of(methods::CLONE_DOUBLE_REF),
     LintId::of(methods::ITERATOR_STEP_BY_ZERO),
diff --git a/clippy_lints/src/lib.register_lints.rs b/clippy_lints/src/lib.register_lints.rs
index b1aa2aa930e..e8dd3708c8e 100644
--- a/clippy_lints/src/lib.register_lints.rs
+++ b/clippy_lints/src/lib.register_lints.rs
@@ -245,7 +245,6 @@ store.register_lints(&[
     matches::SINGLE_MATCH_ELSE,
     matches::WILDCARD_ENUM_MATCH_ARM,
     matches::WILDCARD_IN_OR_PATTERNS,
-    mem_discriminant::MEM_DISCRIMINANT_NON_ENUM,
     mem_forget::MEM_FORGET,
     mem_replace::MEM_REPLACE_OPTION_WITH_NONE,
     mem_replace::MEM_REPLACE_WITH_DEFAULT,
diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs
index 58e4c061892..ed7e8277023 100644
--- a/clippy_lints/src/lib.rs
+++ b/clippy_lints/src/lib.rs
@@ -268,7 +268,6 @@ mod match_on_vec_items;
 mod match_result_ok;
 mod match_str_case_mismatch;
 mod matches;
-mod mem_discriminant;
 mod mem_forget;
 mod mem_replace;
 mod methods;
@@ -606,7 +605,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
     let doc_valid_idents = conf.doc_valid_idents.iter().cloned().collect::<FxHashSet<_>>();
     store.register_late_pass(move || Box::new(doc::DocMarkdown::new(doc_valid_idents.clone())));
     store.register_late_pass(|| Box::new(neg_multiply::NegMultiply));
-    store.register_late_pass(|| Box::new(mem_discriminant::MemDiscriminant));
     store.register_late_pass(|| Box::new(mem_forget::MemForget));
     store.register_late_pass(|| Box::new(arithmetic::Arithmetic::default()));
     store.register_late_pass(|| Box::new(assign_ops::AssignOps));
@@ -861,6 +859,7 @@ pub fn register_renamed(ls: &mut rustc_lint::LintStore) {
     ls.register_renamed("clippy::panic_params", "non_fmt_panics");
     ls.register_renamed("clippy::unknown_clippy_lints", "unknown_lints");
     ls.register_renamed("clippy::invalid_atomic_ordering", "invalid_atomic_ordering");
+    ls.register_renamed("clippy::mem_discriminant_non_enum", "enum_intrinsics_non_enums");
 }
 
 // only exists to let the dogfood integration test works.
diff --git a/clippy_lints/src/manual_unwrap_or.rs b/clippy_lints/src/manual_unwrap_or.rs
index 2ae9cb4f9c1..42478e3416e 100644
--- a/clippy_lints/src/manual_unwrap_or.rs
+++ b/clippy_lints/src/manual_unwrap_or.rs
@@ -98,7 +98,7 @@ fn lint_manual_unwrap_or<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
                 reindent_multiline(or_body_snippet.into(), true, Some(indent));
 
             let suggestion = if scrutinee.span.from_expansion() {
-                    // we don't want parenthesis around macro, e.g. `(some_macro!()).unwrap_or(0)`
+                    // we don't want parentheses around macro, e.g. `(some_macro!()).unwrap_or(0)`
                     sugg::Sugg::hir_with_macro_callsite(cx, scrutinee, "..")
                 }
                 else {
diff --git a/clippy_lints/src/mem_discriminant.rs b/clippy_lints/src/mem_discriminant.rs
deleted file mode 100644
index 59176c4b846..00000000000
--- a/clippy_lints/src/mem_discriminant.rs
+++ /dev/null
@@ -1,82 +0,0 @@
-use clippy_utils::diagnostics::span_lint_and_then;
-use clippy_utils::source::snippet;
-use clippy_utils::ty::walk_ptrs_ty_depth;
-use clippy_utils::{match_def_path, paths};
-use if_chain::if_chain;
-use rustc_errors::Applicability;
-use rustc_hir::{BorrowKind, Expr, ExprKind};
-use rustc_lint::{LateContext, LateLintPass};
-use rustc_session::{declare_lint_pass, declare_tool_lint};
-
-declare_clippy_lint! {
-    /// ### What it does
-    /// Checks for calls of `mem::discriminant()` on a non-enum type.
-    ///
-    /// ### Why is this bad?
-    /// The value of `mem::discriminant()` on non-enum types
-    /// is unspecified.
-    ///
-    /// ### Example
-    /// ```rust
-    /// use std::mem;
-    ///
-    /// mem::discriminant(&"hello");
-    /// mem::discriminant(&&Some(2));
-    /// ```
-    pub MEM_DISCRIMINANT_NON_ENUM,
-    correctness,
-    "calling `mem::descriminant` on non-enum type"
-}
-
-declare_lint_pass!(MemDiscriminant => [MEM_DISCRIMINANT_NON_ENUM]);
-
-impl<'tcx> LateLintPass<'tcx> for MemDiscriminant {
-    fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
-        if_chain! {
-            if let ExprKind::Call(func, func_args) = expr.kind;
-            // is `mem::discriminant`
-            if let ExprKind::Path(ref func_qpath) = func.kind;
-            if let Some(def_id) = cx.qpath_res(func_qpath, func.hir_id).opt_def_id();
-            if match_def_path(cx, def_id, &paths::MEM_DISCRIMINANT);
-            // type is non-enum
-            let ty_param = cx.typeck_results().node_substs(func.hir_id).type_at(0);
-            if !ty_param.is_enum();
-
-            then {
-                span_lint_and_then(
-                    cx,
-                    MEM_DISCRIMINANT_NON_ENUM,
-                    expr.span,
-                    &format!("calling `mem::discriminant` on non-enum type `{}`", ty_param),
-                    |diag| {
-                        // if this is a reference to an enum, suggest dereferencing
-                        let (base_ty, ptr_depth) = walk_ptrs_ty_depth(ty_param);
-                        if ptr_depth >= 1 && base_ty.is_enum() {
-                            let param = &func_args[0];
-
-                            // cancel out '&'s first
-                            let mut derefs_needed = ptr_depth;
-                            let mut cur_expr = param;
-                            while derefs_needed > 0  {
-                                if let ExprKind::AddrOf(BorrowKind::Ref, _, inner_expr) = cur_expr.kind {
-                                    derefs_needed -= 1;
-                                    cur_expr = inner_expr;
-                                } else {
-                                    break;
-                                }
-                            }
-
-                            let derefs = "*".repeat(derefs_needed);
-                            diag.span_suggestion(
-                                param.span,
-                                "try dereferencing",
-                                format!("{}{}", derefs, snippet(cx, cur_expr.span, "<param>")),
-                                Applicability::MachineApplicable,
-                            );
-                        }
-                    },
-                )
-            }
-        }
-    }
-}
diff --git a/clippy_lints/src/needless_continue.rs b/clippy_lints/src/needless_continue.rs
index 5a50cc48d61..7aa93ed7839 100644
--- a/clippy_lints/src/needless_continue.rs
+++ b/clippy_lints/src/needless_continue.rs
@@ -36,9 +36,8 @@
 use clippy_utils::diagnostics::span_lint_and_help;
 use clippy_utils::source::{indent_of, snippet, snippet_block};
 use rustc_ast::ast;
-use rustc_lint::{EarlyContext, EarlyLintPass};
+use rustc_lint::{EarlyContext, EarlyLintPass, LintContext};
 use rustc_session::{declare_lint_pass, declare_tool_lint};
-use rustc_span::source_map::{original_sp, DUMMY_SP};
 use rustc_span::Span;
 
 declare_clippy_lint! {
@@ -270,7 +269,7 @@ struct LintData<'a> {
     /// The 0-based index of the `if` statement in the containing loop block.
     stmt_idx: usize,
     /// The statements of the loop block.
-    block_stmts: &'a [ast::Stmt],
+    loop_block: &'a ast::Block,
 }
 
 const MSG_REDUNDANT_CONTINUE_EXPRESSION: &str = "this `continue` expression is redundant";
@@ -343,10 +342,10 @@ fn suggestion_snippet_for_continue_inside_else<'a>(cx: &EarlyContext<'_>, data:
     let indent = span_of_first_expr_in_block(data.if_block)
         .and_then(|span| indent_of(cx, span))
         .unwrap_or(0);
-    let to_annex = data.block_stmts[data.stmt_idx + 1..]
+    let to_annex = data.loop_block.stmts[data.stmt_idx + 1..]
         .iter()
-        .map(|stmt| original_sp(stmt.span, DUMMY_SP))
-        .map(|span| {
+        .map(|stmt| {
+            let span = cx.sess().source_map().stmt_span(stmt.span, data.loop_block.span);
             let snip = snippet_block(cx, span, "..", None).into_owned();
             snip.lines()
                 .map(|line| format!("{}{}", " ".repeat(indent), line))
@@ -393,7 +392,7 @@ fn check_and_warn<'a>(cx: &EarlyContext<'_>, expr: &'a ast::Expr) {
                     if_cond: cond,
                     if_block: then_block,
                     else_expr,
-                    block_stmts: &loop_block.stmts,
+                    loop_block,
                 };
                 if needless_continue_in_else(else_expr, label) {
                     emit_warning(
diff --git a/clippy_lints/src/utils/internal_lints.rs b/clippy_lints/src/utils/internal_lints.rs
index 9f9edbf258a..824ec53ab9c 100644
--- a/clippy_lints/src/utils/internal_lints.rs
+++ b/clippy_lints/src/utils/internal_lints.rs
@@ -770,8 +770,7 @@ impl<'tcx> LateLintPass<'tcx> for MatchTypeOnDiagItem {
             let segments: Vec<&str> = segments.iter().map(|sym| &**sym).collect();
             if let Some(ty_did) = path_to_res(cx, &segments[..]).opt_def_id();
             // Check if the matched type is a diagnostic item
-            let diag_items = cx.tcx.diagnostic_items(ty_did.krate);
-            if let Some(item_name) = diag_items.iter().find_map(|(k, v)| if *v == ty_did { Some(k) } else { None });
+            if let Some(item_name) = cx.tcx.get_diagnostic_name(ty_did);
             then {
                 // TODO: check paths constants from external crates.
                 let cx_snippet = snippet(cx, context.span, "_");
diff --git a/clippy_utils/src/higher.rs b/clippy_utils/src/higher.rs
index fb4d53e2845..60c4cb361aa 100644
--- a/clippy_utils/src/higher.rs
+++ b/clippy_utils/src/higher.rs
@@ -722,7 +722,6 @@ impl PanicExpn<'tcx> {
             if let Some(init) = block.expr;
             if let ExprKind::Call(_, [format_args]) = init.kind;
             let expn_data = expr.span.ctxt().outer_expn_data();
-            if let ExprKind::AddrOf(_, _, format_args) = format_args.kind;
             if let Some(format_args) = FormatArgsExpn::parse(format_args);
             then {
                 Some(PanicExpn {
diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs
index c540e1ebc9c..9bc380ca6ca 100644
--- a/clippy_utils/src/lib.rs
+++ b/clippy_utils/src/lib.rs
@@ -1641,7 +1641,6 @@ pub fn match_panic_def_id(cx: &LateContext<'_>, did: DefId) -> bool {
         did,
         &[
             &paths::BEGIN_PANIC,
-            &paths::BEGIN_PANIC_FMT,
             &paths::PANIC_ANY,
             &paths::PANICKING_PANIC,
             &paths::PANICKING_PANIC_FMT,
diff --git a/clippy_utils/src/paths.rs b/clippy_utils/src/paths.rs
index 7c61288f661..501b08a47f1 100644
--- a/clippy_utils/src/paths.rs
+++ b/clippy_utils/src/paths.rs
@@ -26,7 +26,6 @@ pub const ASSERT_NE_MACRO: [&str; 3] = ["core", "macros", "assert_ne"];
 pub const ASMUT_TRAIT: [&str; 3] = ["core", "convert", "AsMut"];
 pub const ASREF_TRAIT: [&str; 3] = ["core", "convert", "AsRef"];
 pub(super) const BEGIN_PANIC: [&str; 3] = ["std", "panicking", "begin_panic"];
-pub(super) const BEGIN_PANIC_FMT: [&str; 3] = ["std", "panicking", "begin_panic_fmt"];
 /// Preferably use the diagnostic item `sym::Borrow` where possible
 pub const BORROW_TRAIT: [&str; 3] = ["core", "borrow", "Borrow"];
 pub const BTREEMAP_CONTAINS_KEY: [&str; 6] = ["alloc", "collections", "btree", "map", "BTreeMap", "contains_key"];
diff --git a/clippy_utils/src/sugg.rs b/clippy_utils/src/sugg.rs
index 5b0efb1fd71..01fb944cc36 100644
--- a/clippy_utils/src/sugg.rs
+++ b/clippy_utils/src/sugg.rs
@@ -16,10 +16,10 @@ use std::convert::TryInto;
 use std::fmt::Display;
 use std::ops::{Add, Neg, Not, Sub};
 
-/// A helper type to build suggestion correctly handling parenthesis.
+/// A helper type to build suggestion correctly handling parentheses.
 #[derive(Clone, PartialEq)]
 pub enum Sugg<'a> {
-    /// An expression that never needs parenthesis such as `1337` or `[0; 42]`.
+    /// An expression that never needs parentheses such as `1337` or `[0; 42]`.
     NonParen(Cow<'a, str>),
     /// An expression that does not fit in other variants.
     MaybeParen(Cow<'a, str>),
@@ -283,7 +283,7 @@ impl<'a> Sugg<'a> {
         }
     }
 
-    /// Adds parenthesis to any expression that might need them. Suitable to the
+    /// Adds parentheses to any expression that might need them. Suitable to the
     /// `self` argument of a method call
     /// (e.g., to build `bar.foo()` or `(1 + 2).foo()`).
     pub fn maybe_par(self) -> Self {
diff --git a/tests/ui-internal/unnecessary_symbol_str.fixed b/tests/ui-internal/unnecessary_symbol_str.fixed
index 2ec0efe4c10..95b8c6dfe89 100644
--- a/tests/ui-internal/unnecessary_symbol_str.fixed
+++ b/tests/ui-internal/unnecessary_symbol_str.fixed
@@ -11,6 +11,6 @@ fn main() {
     Symbol::intern("foo") == rustc_span::sym::clippy;
     Symbol::intern("foo") == rustc_span::symbol::kw::SelfLower;
     Symbol::intern("foo") != rustc_span::symbol::kw::SelfUpper;
-    Ident::invalid().name == rustc_span::sym::clippy;
-    rustc_span::sym::clippy == Ident::invalid().name;
+    Ident::empty().name == rustc_span::sym::clippy;
+    rustc_span::sym::clippy == Ident::empty().name;
 }
diff --git a/tests/ui-internal/unnecessary_symbol_str.rs b/tests/ui-internal/unnecessary_symbol_str.rs
index 87e1b3a2ee7..ad6937cf60a 100644
--- a/tests/ui-internal/unnecessary_symbol_str.rs
+++ b/tests/ui-internal/unnecessary_symbol_str.rs
@@ -11,6 +11,6 @@ fn main() {
     Symbol::intern("foo").as_str() == "clippy";
     Symbol::intern("foo").to_string() == "self";
     Symbol::intern("foo").to_ident_string() != "Self";
-    &*Ident::invalid().as_str() == "clippy";
-    "clippy" == Ident::invalid().to_string();
+    &*Ident::empty().as_str() == "clippy";
+    "clippy" == Ident::empty().to_string();
 }
diff --git a/tests/ui-internal/unnecessary_symbol_str.stderr b/tests/ui-internal/unnecessary_symbol_str.stderr
index b1284b7c8ff..12e05eaa7a0 100644
--- a/tests/ui-internal/unnecessary_symbol_str.stderr
+++ b/tests/ui-internal/unnecessary_symbol_str.stderr
@@ -26,14 +26,14 @@ LL |     Symbol::intern("foo").to_ident_string() != "Self";
 error: unnecessary `Symbol` to string conversion
   --> $DIR/unnecessary_symbol_str.rs:14:5
    |
-LL |     &*Ident::invalid().as_str() == "clippy";
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Ident::invalid().name == rustc_span::sym::clippy`
+LL |     &*Ident::empty().as_str() == "clippy";
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Ident::empty().name == rustc_span::sym::clippy`
 
 error: unnecessary `Symbol` to string conversion
   --> $DIR/unnecessary_symbol_str.rs:15:5
    |
-LL |     "clippy" == Ident::invalid().to_string();
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `rustc_span::sym::clippy == Ident::invalid().name`
+LL |     "clippy" == Ident::empty().to_string();
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `rustc_span::sym::clippy == Ident::empty().name`
 
 error: aborting due to 5 previous errors
 
diff --git a/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.stderr b/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.stderr
index 87e962b9228..039b23b1bdb 100644
--- a/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.stderr
+++ b/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.stderr
@@ -82,13 +82,13 @@ error: use of irregular braces for `eprint!` macro
   --> $DIR/conf_nonstandard_macro_braces.rs:57:5
    |
 LL |     eprint!("test if user config overrides defaults");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-help: consider writing `eprint!["test if user config overrides defaults"];`
+help: consider writing `eprint!["test if user config overrides defaults"]`
   --> $DIR/conf_nonstandard_macro_braces.rs:57:5
    |
 LL |     eprint!("test if user config overrides defaults");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 7 previous errors
 
diff --git a/tests/ui/asm_syntax.stderr b/tests/ui/asm_syntax.stderr
index e3abbe08658..409f4db76bc 100644
--- a/tests/ui/asm_syntax.stderr
+++ b/tests/ui/asm_syntax.stderr
@@ -2,7 +2,7 @@ error: Intel x86 assembly syntax used
   --> $DIR/asm_syntax.rs:9:9
    |
 LL |         asm!("");
-   |         ^^^^^^^^^
+   |         ^^^^^^^^
    |
    = note: `-D clippy::inline-asm-x86-intel-syntax` implied by `-D warnings`
    = help: use AT&T x86 assembly syntax
@@ -11,7 +11,7 @@ error: Intel x86 assembly syntax used
   --> $DIR/asm_syntax.rs:10:9
    |
 LL |         asm!("", options());
-   |         ^^^^^^^^^^^^^^^^^^^^
+   |         ^^^^^^^^^^^^^^^^^^^
    |
    = help: use AT&T x86 assembly syntax
 
@@ -19,7 +19,7 @@ error: Intel x86 assembly syntax used
   --> $DIR/asm_syntax.rs:11:9
    |
 LL |         asm!("", options(nostack));
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: use AT&T x86 assembly syntax
 
@@ -27,7 +27,7 @@ error: AT&T x86 assembly syntax used
   --> $DIR/asm_syntax.rs:23:9
    |
 LL |         asm!("", options(att_syntax));
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `-D clippy::inline-asm-x86-att-syntax` implied by `-D warnings`
    = help: use Intel x86 assembly syntax
@@ -36,7 +36,7 @@ error: AT&T x86 assembly syntax used
   --> $DIR/asm_syntax.rs:24:9
    |
 LL |         asm!("", options(nostack, att_syntax));
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: use Intel x86 assembly syntax
 
diff --git a/tests/ui/assertions_on_constants.stderr b/tests/ui/assertions_on_constants.stderr
index 1eb87d89fad..4ca1e6f6e88 100644
--- a/tests/ui/assertions_on_constants.stderr
+++ b/tests/ui/assertions_on_constants.stderr
@@ -2,7 +2,7 @@ error: `assert!(true)` will be optimized out by the compiler
   --> $DIR/assertions_on_constants.rs:11:5
    |
 LL |     assert!(true);
-   |     ^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^
    |
    = note: `-D clippy::assertions-on-constants` implied by `-D warnings`
    = help: remove it
@@ -12,7 +12,7 @@ error: `assert!(false)` should probably be replaced
   --> $DIR/assertions_on_constants.rs:12:5
    |
 LL |     assert!(false);
-   |     ^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^
    |
    = help: use `panic!()` or `unreachable!()`
    = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -21,7 +21,7 @@ error: `assert!(true)` will be optimized out by the compiler
   --> $DIR/assertions_on_constants.rs:13:5
    |
 LL |     assert!(true, "true message");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: remove it
    = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -30,7 +30,7 @@ error: `assert!(false, "false message")` should probably be replaced
   --> $DIR/assertions_on_constants.rs:14:5
    |
 LL |     assert!(false, "false message");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `panic!("false message")` or `unreachable!("false message")`
    = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -39,7 +39,7 @@ error: `assert!(false, msg.to_uppercase())` should probably be replaced
   --> $DIR/assertions_on_constants.rs:17:5
    |
 LL |     assert!(false, msg.to_uppercase());
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `panic!(msg.to_uppercase())` or `unreachable!(msg.to_uppercase())`
    = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -48,7 +48,7 @@ error: `assert!(true)` will be optimized out by the compiler
   --> $DIR/assertions_on_constants.rs:20:5
    |
 LL |     assert!(B);
-   |     ^^^^^^^^^^^
+   |     ^^^^^^^^^^
    |
    = help: remove it
    = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -57,7 +57,7 @@ error: `assert!(false)` should probably be replaced
   --> $DIR/assertions_on_constants.rs:23:5
    |
 LL |     assert!(C);
-   |     ^^^^^^^^^^^
+   |     ^^^^^^^^^^
    |
    = help: use `panic!()` or `unreachable!()`
    = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -66,7 +66,7 @@ error: `assert!(false, "C message")` should probably be replaced
   --> $DIR/assertions_on_constants.rs:24:5
    |
 LL |     assert!(C, "C message");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `panic!("C message")` or `unreachable!("C message")`
    = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -75,7 +75,7 @@ error: `debug_assert!(true)` will be optimized out by the compiler
   --> $DIR/assertions_on_constants.rs:26:5
    |
 LL |     debug_assert!(true);
-   |     ^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^
    |
    = help: remove it
    = note: this error originates in the macro `$crate::assert` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/tests/ui/bool_assert_comparison.stderr b/tests/ui/bool_assert_comparison.stderr
index da9b56aa779..377d51be4cd 100644
--- a/tests/ui/bool_assert_comparison.stderr
+++ b/tests/ui/bool_assert_comparison.stderr
@@ -2,7 +2,7 @@ error: used `assert_eq!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:69:5
    |
 LL |     assert_eq!("a".is_empty(), false);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
    |
    = note: `-D clippy::bool-assert-comparison` implied by `-D warnings`
 
@@ -10,127 +10,127 @@ error: used `assert_eq!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:70:5
    |
 LL |     assert_eq!("".is_empty(), true);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
 
 error: used `assert_eq!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:71:5
    |
 LL |     assert_eq!(true, "".is_empty());
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
 
 error: used `assert_eq!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:76:5
    |
 LL |     assert_eq!(b, true);
-   |     ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
 
 error: used `assert_ne!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:79:5
    |
 LL |     assert_ne!("a".is_empty(), false);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
 
 error: used `assert_ne!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:80:5
    |
 LL |     assert_ne!("".is_empty(), true);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
 
 error: used `assert_ne!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:81:5
    |
 LL |     assert_ne!(true, "".is_empty());
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
 
 error: used `assert_ne!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:86:5
    |
 LL |     assert_ne!(b, true);
-   |     ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
 
 error: used `debug_assert_eq!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:89:5
    |
 LL |     debug_assert_eq!("a".is_empty(), false);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
 
 error: used `debug_assert_eq!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:90:5
    |
 LL |     debug_assert_eq!("".is_empty(), true);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
 
 error: used `debug_assert_eq!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:91:5
    |
 LL |     debug_assert_eq!(true, "".is_empty());
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
 
 error: used `debug_assert_eq!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:96:5
    |
 LL |     debug_assert_eq!(b, true);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
 
 error: used `debug_assert_ne!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:99:5
    |
 LL |     debug_assert_ne!("a".is_empty(), false);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
 
 error: used `debug_assert_ne!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:100:5
    |
 LL |     debug_assert_ne!("".is_empty(), true);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
 
 error: used `debug_assert_ne!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:101:5
    |
 LL |     debug_assert_ne!(true, "".is_empty());
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
 
 error: used `debug_assert_ne!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:106:5
    |
 LL |     debug_assert_ne!(b, true);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
 
 error: used `assert_eq!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:111:5
    |
 LL |     assert_eq!("a".is_empty(), false, "tadam {}", 1);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
 
 error: used `assert_eq!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:112:5
    |
 LL |     assert_eq!("a".is_empty(), false, "tadam {}", true);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
 
 error: used `assert_eq!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:113:5
    |
 LL |     assert_eq!(false, "a".is_empty(), "tadam {}", true);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
 
 error: used `debug_assert_eq!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:118:5
    |
 LL |     debug_assert_eq!("a".is_empty(), false, "tadam {}", 1);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
 
 error: used `debug_assert_eq!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:119:5
    |
 LL |     debug_assert_eq!("a".is_empty(), false, "tadam {}", true);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
 
 error: used `debug_assert_eq!` with a literal bool
   --> $DIR/bool_assert_comparison.rs:120:5
    |
 LL |     debug_assert_eq!(false, "a".is_empty(), "tadam {}", true);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `debug_assert!(..)`
 
 error: aborting due to 22 previous errors
 
diff --git a/tests/ui/cast_lossless_float.fixed b/tests/ui/cast_lossless_float.fixed
index 709d58b596c..32a9c1c4ae1 100644
--- a/tests/ui/cast_lossless_float.fixed
+++ b/tests/ui/cast_lossless_float.fixed
@@ -6,24 +6,24 @@
 fn main() {
     // Test clippy::cast_lossless with casts to floating-point types
     let x0 = 1i8;
-    f32::from(x0);
-    f64::from(x0);
+    let _ = f32::from(x0);
+    let _ = f64::from(x0);
     let x1 = 1u8;
-    f32::from(x1);
-    f64::from(x1);
+    let _ = f32::from(x1);
+    let _ = f64::from(x1);
     let x2 = 1i16;
-    f32::from(x2);
-    f64::from(x2);
+    let _ = f32::from(x2);
+    let _ = f64::from(x2);
     let x3 = 1u16;
-    f32::from(x3);
-    f64::from(x3);
+    let _ = f32::from(x3);
+    let _ = f64::from(x3);
     let x4 = 1i32;
-    f64::from(x4);
+    let _ = f64::from(x4);
     let x5 = 1u32;
-    f64::from(x5);
+    let _ = f64::from(x5);
 
     // Test with casts from floating-point types
-    f64::from(1.0f32);
+    let _ = f64::from(1.0f32);
 }
 
 // The lint would suggest using `f64::from(input)` here but the `XX::from` function is not const,
diff --git a/tests/ui/cast_lossless_float.rs b/tests/ui/cast_lossless_float.rs
index eb0aab88642..6f5ddcfe09c 100644
--- a/tests/ui/cast_lossless_float.rs
+++ b/tests/ui/cast_lossless_float.rs
@@ -6,24 +6,24 @@
 fn main() {
     // Test clippy::cast_lossless with casts to floating-point types
     let x0 = 1i8;
-    x0 as f32;
-    x0 as f64;
+    let _ = x0 as f32;
+    let _ = x0 as f64;
     let x1 = 1u8;
-    x1 as f32;
-    x1 as f64;
+    let _ = x1 as f32;
+    let _ = x1 as f64;
     let x2 = 1i16;
-    x2 as f32;
-    x2 as f64;
+    let _ = x2 as f32;
+    let _ = x2 as f64;
     let x3 = 1u16;
-    x3 as f32;
-    x3 as f64;
+    let _ = x3 as f32;
+    let _ = x3 as f64;
     let x4 = 1i32;
-    x4 as f64;
+    let _ = x4 as f64;
     let x5 = 1u32;
-    x5 as f64;
+    let _ = x5 as f64;
 
     // Test with casts from floating-point types
-    1.0f32 as f64;
+    let _ = 1.0f32 as f64;
 }
 
 // The lint would suggest using `f64::from(input)` here but the `XX::from` function is not const,
diff --git a/tests/ui/cast_lossless_float.stderr b/tests/ui/cast_lossless_float.stderr
index 0ed09f3083c..8326d40be71 100644
--- a/tests/ui/cast_lossless_float.stderr
+++ b/tests/ui/cast_lossless_float.stderr
@@ -1,70 +1,70 @@
 error: casting `i8` to `f32` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_float.rs:9:5
+  --> $DIR/cast_lossless_float.rs:9:13
    |
-LL |     x0 as f32;
-   |     ^^^^^^^^^ help: try: `f32::from(x0)`
+LL |     let _ = x0 as f32;
+   |             ^^^^^^^^^ help: try: `f32::from(x0)`
    |
    = note: `-D clippy::cast-lossless` implied by `-D warnings`
 
 error: casting `i8` to `f64` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_float.rs:10:5
+  --> $DIR/cast_lossless_float.rs:10:13
    |
-LL |     x0 as f64;
-   |     ^^^^^^^^^ help: try: `f64::from(x0)`
+LL |     let _ = x0 as f64;
+   |             ^^^^^^^^^ help: try: `f64::from(x0)`
 
 error: casting `u8` to `f32` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_float.rs:12:5
+  --> $DIR/cast_lossless_float.rs:12:13
    |
-LL |     x1 as f32;
-   |     ^^^^^^^^^ help: try: `f32::from(x1)`
+LL |     let _ = x1 as f32;
+   |             ^^^^^^^^^ help: try: `f32::from(x1)`
 
 error: casting `u8` to `f64` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_float.rs:13:5
+  --> $DIR/cast_lossless_float.rs:13:13
    |
-LL |     x1 as f64;
-   |     ^^^^^^^^^ help: try: `f64::from(x1)`
+LL |     let _ = x1 as f64;
+   |             ^^^^^^^^^ help: try: `f64::from(x1)`
 
 error: casting `i16` to `f32` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_float.rs:15:5
+  --> $DIR/cast_lossless_float.rs:15:13
    |
-LL |     x2 as f32;
-   |     ^^^^^^^^^ help: try: `f32::from(x2)`
+LL |     let _ = x2 as f32;
+   |             ^^^^^^^^^ help: try: `f32::from(x2)`
 
 error: casting `i16` to `f64` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_float.rs:16:5
+  --> $DIR/cast_lossless_float.rs:16:13
    |
-LL |     x2 as f64;
-   |     ^^^^^^^^^ help: try: `f64::from(x2)`
+LL |     let _ = x2 as f64;
+   |             ^^^^^^^^^ help: try: `f64::from(x2)`
 
 error: casting `u16` to `f32` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_float.rs:18:5
+  --> $DIR/cast_lossless_float.rs:18:13
    |
-LL |     x3 as f32;
-   |     ^^^^^^^^^ help: try: `f32::from(x3)`
+LL |     let _ = x3 as f32;
+   |             ^^^^^^^^^ help: try: `f32::from(x3)`
 
 error: casting `u16` to `f64` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_float.rs:19:5
+  --> $DIR/cast_lossless_float.rs:19:13
    |
-LL |     x3 as f64;
-   |     ^^^^^^^^^ help: try: `f64::from(x3)`
+LL |     let _ = x3 as f64;
+   |             ^^^^^^^^^ help: try: `f64::from(x3)`
 
 error: casting `i32` to `f64` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_float.rs:21:5
+  --> $DIR/cast_lossless_float.rs:21:13
    |
-LL |     x4 as f64;
-   |     ^^^^^^^^^ help: try: `f64::from(x4)`
+LL |     let _ = x4 as f64;
+   |             ^^^^^^^^^ help: try: `f64::from(x4)`
 
 error: casting `u32` to `f64` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_float.rs:23:5
+  --> $DIR/cast_lossless_float.rs:23:13
    |
-LL |     x5 as f64;
-   |     ^^^^^^^^^ help: try: `f64::from(x5)`
+LL |     let _ = x5 as f64;
+   |             ^^^^^^^^^ help: try: `f64::from(x5)`
 
 error: casting `f32` to `f64` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_float.rs:26:5
+  --> $DIR/cast_lossless_float.rs:26:13
    |
-LL |     1.0f32 as f64;
-   |     ^^^^^^^^^^^^^ help: try: `f64::from(1.0f32)`
+LL |     let _ = 1.0f32 as f64;
+   |             ^^^^^^^^^^^^^ help: try: `f64::from(1.0f32)`
 
 error: aborting due to 11 previous errors
 
diff --git a/tests/ui/cast_lossless_integer.fixed b/tests/ui/cast_lossless_integer.fixed
index 03e49adb117..72a708b4073 100644
--- a/tests/ui/cast_lossless_integer.fixed
+++ b/tests/ui/cast_lossless_integer.fixed
@@ -5,27 +5,27 @@
 
 fn main() {
     // Test clippy::cast_lossless with casts to integer types
-    i16::from(1i8);
-    i32::from(1i8);
-    i64::from(1i8);
-    i16::from(1u8);
-    i32::from(1u8);
-    i64::from(1u8);
-    u16::from(1u8);
-    u32::from(1u8);
-    u64::from(1u8);
-    i32::from(1i16);
-    i64::from(1i16);
-    i32::from(1u16);
-    i64::from(1u16);
-    u32::from(1u16);
-    u64::from(1u16);
-    i64::from(1i32);
-    i64::from(1u32);
-    u64::from(1u32);
+    let _ = i16::from(1i8);
+    let _ = i32::from(1i8);
+    let _ = i64::from(1i8);
+    let _ = i16::from(1u8);
+    let _ = i32::from(1u8);
+    let _ = i64::from(1u8);
+    let _ = u16::from(1u8);
+    let _ = u32::from(1u8);
+    let _ = u64::from(1u8);
+    let _ = i32::from(1i16);
+    let _ = i64::from(1i16);
+    let _ = i32::from(1u16);
+    let _ = i64::from(1u16);
+    let _ = u32::from(1u16);
+    let _ = u64::from(1u16);
+    let _ = i64::from(1i32);
+    let _ = i64::from(1u32);
+    let _ = u64::from(1u32);
 
     // Test with an expression wrapped in parens
-    u16::from(1u8 + 1u8);
+    let _ = u16::from(1u8 + 1u8);
 }
 
 // The lint would suggest using `f64::from(input)` here but the `XX::from` function is not const,
diff --git a/tests/ui/cast_lossless_integer.rs b/tests/ui/cast_lossless_integer.rs
index 6a984d24596..34bb47181e6 100644
--- a/tests/ui/cast_lossless_integer.rs
+++ b/tests/ui/cast_lossless_integer.rs
@@ -5,27 +5,27 @@
 
 fn main() {
     // Test clippy::cast_lossless with casts to integer types
-    1i8 as i16;
-    1i8 as i32;
-    1i8 as i64;
-    1u8 as i16;
-    1u8 as i32;
-    1u8 as i64;
-    1u8 as u16;
-    1u8 as u32;
-    1u8 as u64;
-    1i16 as i32;
-    1i16 as i64;
-    1u16 as i32;
-    1u16 as i64;
-    1u16 as u32;
-    1u16 as u64;
-    1i32 as i64;
-    1u32 as i64;
-    1u32 as u64;
+    let _ = 1i8 as i16;
+    let _ = 1i8 as i32;
+    let _ = 1i8 as i64;
+    let _ = 1u8 as i16;
+    let _ = 1u8 as i32;
+    let _ = 1u8 as i64;
+    let _ = 1u8 as u16;
+    let _ = 1u8 as u32;
+    let _ = 1u8 as u64;
+    let _ = 1i16 as i32;
+    let _ = 1i16 as i64;
+    let _ = 1u16 as i32;
+    let _ = 1u16 as i64;
+    let _ = 1u16 as u32;
+    let _ = 1u16 as u64;
+    let _ = 1i32 as i64;
+    let _ = 1u32 as i64;
+    let _ = 1u32 as u64;
 
     // Test with an expression wrapped in parens
-    (1u8 + 1u8) as u16;
+    let _ = (1u8 + 1u8) as u16;
 }
 
 // The lint would suggest using `f64::from(input)` here but the `XX::from` function is not const,
diff --git a/tests/ui/cast_lossless_integer.stderr b/tests/ui/cast_lossless_integer.stderr
index 8e2890f9c28..721b94876cb 100644
--- a/tests/ui/cast_lossless_integer.stderr
+++ b/tests/ui/cast_lossless_integer.stderr
@@ -1,118 +1,118 @@
 error: casting `i8` to `i16` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_integer.rs:8:5
+  --> $DIR/cast_lossless_integer.rs:8:13
    |
-LL |     1i8 as i16;
-   |     ^^^^^^^^^^ help: try: `i16::from(1i8)`
+LL |     let _ = 1i8 as i16;
+   |             ^^^^^^^^^^ help: try: `i16::from(1i8)`
    |
    = note: `-D clippy::cast-lossless` implied by `-D warnings`
 
 error: casting `i8` to `i32` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_integer.rs:9:5
+  --> $DIR/cast_lossless_integer.rs:9:13
    |
-LL |     1i8 as i32;
-   |     ^^^^^^^^^^ help: try: `i32::from(1i8)`
+LL |     let _ = 1i8 as i32;
+   |             ^^^^^^^^^^ help: try: `i32::from(1i8)`
 
 error: casting `i8` to `i64` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_integer.rs:10:5
+  --> $DIR/cast_lossless_integer.rs:10:13
    |
-LL |     1i8 as i64;
-   |     ^^^^^^^^^^ help: try: `i64::from(1i8)`
+LL |     let _ = 1i8 as i64;
+   |             ^^^^^^^^^^ help: try: `i64::from(1i8)`
 
 error: casting `u8` to `i16` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_integer.rs:11:5
+  --> $DIR/cast_lossless_integer.rs:11:13
    |
-LL |     1u8 as i16;
-   |     ^^^^^^^^^^ help: try: `i16::from(1u8)`
+LL |     let _ = 1u8 as i16;
+   |             ^^^^^^^^^^ help: try: `i16::from(1u8)`
 
 error: casting `u8` to `i32` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_integer.rs:12:5
+  --> $DIR/cast_lossless_integer.rs:12:13
    |
-LL |     1u8 as i32;
-   |     ^^^^^^^^^^ help: try: `i32::from(1u8)`
+LL |     let _ = 1u8 as i32;
+   |             ^^^^^^^^^^ help: try: `i32::from(1u8)`
 
 error: casting `u8` to `i64` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_integer.rs:13:5
+  --> $DIR/cast_lossless_integer.rs:13:13
    |
-LL |     1u8 as i64;
-   |     ^^^^^^^^^^ help: try: `i64::from(1u8)`
+LL |     let _ = 1u8 as i64;
+   |             ^^^^^^^^^^ help: try: `i64::from(1u8)`
 
 error: casting `u8` to `u16` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_integer.rs:14:5
+  --> $DIR/cast_lossless_integer.rs:14:13
    |
-LL |     1u8 as u16;
-   |     ^^^^^^^^^^ help: try: `u16::from(1u8)`
+LL |     let _ = 1u8 as u16;
+   |             ^^^^^^^^^^ help: try: `u16::from(1u8)`
 
 error: casting `u8` to `u32` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_integer.rs:15:5
+  --> $DIR/cast_lossless_integer.rs:15:13
    |
-LL |     1u8 as u32;
-   |     ^^^^^^^^^^ help: try: `u32::from(1u8)`
+LL |     let _ = 1u8 as u32;
+   |             ^^^^^^^^^^ help: try: `u32::from(1u8)`
 
 error: casting `u8` to `u64` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_integer.rs:16:5
+  --> $DIR/cast_lossless_integer.rs:16:13
    |
-LL |     1u8 as u64;
-   |     ^^^^^^^^^^ help: try: `u64::from(1u8)`
+LL |     let _ = 1u8 as u64;
+   |             ^^^^^^^^^^ help: try: `u64::from(1u8)`
 
 error: casting `i16` to `i32` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_integer.rs:17:5
+  --> $DIR/cast_lossless_integer.rs:17:13
    |
-LL |     1i16 as i32;
-   |     ^^^^^^^^^^^ help: try: `i32::from(1i16)`
+LL |     let _ = 1i16 as i32;
+   |             ^^^^^^^^^^^ help: try: `i32::from(1i16)`
 
 error: casting `i16` to `i64` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_integer.rs:18:5
+  --> $DIR/cast_lossless_integer.rs:18:13
    |
-LL |     1i16 as i64;
-   |     ^^^^^^^^^^^ help: try: `i64::from(1i16)`
+LL |     let _ = 1i16 as i64;
+   |             ^^^^^^^^^^^ help: try: `i64::from(1i16)`
 
 error: casting `u16` to `i32` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_integer.rs:19:5
+  --> $DIR/cast_lossless_integer.rs:19:13
    |
-LL |     1u16 as i32;
-   |     ^^^^^^^^^^^ help: try: `i32::from(1u16)`
+LL |     let _ = 1u16 as i32;
+   |             ^^^^^^^^^^^ help: try: `i32::from(1u16)`
 
 error: casting `u16` to `i64` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_integer.rs:20:5
+  --> $DIR/cast_lossless_integer.rs:20:13
    |
-LL |     1u16 as i64;
-   |     ^^^^^^^^^^^ help: try: `i64::from(1u16)`
+LL |     let _ = 1u16 as i64;
+   |             ^^^^^^^^^^^ help: try: `i64::from(1u16)`
 
 error: casting `u16` to `u32` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_integer.rs:21:5
+  --> $DIR/cast_lossless_integer.rs:21:13
    |
-LL |     1u16 as u32;
-   |     ^^^^^^^^^^^ help: try: `u32::from(1u16)`
+LL |     let _ = 1u16 as u32;
+   |             ^^^^^^^^^^^ help: try: `u32::from(1u16)`
 
 error: casting `u16` to `u64` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_integer.rs:22:5
+  --> $DIR/cast_lossless_integer.rs:22:13
    |
-LL |     1u16 as u64;
-   |     ^^^^^^^^^^^ help: try: `u64::from(1u16)`
+LL |     let _ = 1u16 as u64;
+   |             ^^^^^^^^^^^ help: try: `u64::from(1u16)`
 
 error: casting `i32` to `i64` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_integer.rs:23:5
+  --> $DIR/cast_lossless_integer.rs:23:13
    |
-LL |     1i32 as i64;
-   |     ^^^^^^^^^^^ help: try: `i64::from(1i32)`
+LL |     let _ = 1i32 as i64;
+   |             ^^^^^^^^^^^ help: try: `i64::from(1i32)`
 
 error: casting `u32` to `i64` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_integer.rs:24:5
+  --> $DIR/cast_lossless_integer.rs:24:13
    |
-LL |     1u32 as i64;
-   |     ^^^^^^^^^^^ help: try: `i64::from(1u32)`
+LL |     let _ = 1u32 as i64;
+   |             ^^^^^^^^^^^ help: try: `i64::from(1u32)`
 
 error: casting `u32` to `u64` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_integer.rs:25:5
+  --> $DIR/cast_lossless_integer.rs:25:13
    |
-LL |     1u32 as u64;
-   |     ^^^^^^^^^^^ help: try: `u64::from(1u32)`
+LL |     let _ = 1u32 as u64;
+   |             ^^^^^^^^^^^ help: try: `u64::from(1u32)`
 
 error: casting `u8` to `u16` may become silently lossy if you later change the type
-  --> $DIR/cast_lossless_integer.rs:28:5
+  --> $DIR/cast_lossless_integer.rs:28:13
    |
-LL |     (1u8 + 1u8) as u16;
-   |     ^^^^^^^^^^^^^^^^^^ help: try: `u16::from(1u8 + 1u8)`
+LL |     let _ = (1u8 + 1u8) as u16;
+   |             ^^^^^^^^^^^^^^^^^^ help: try: `u16::from(1u8 + 1u8)`
 
 error: aborting due to 19 previous errors
 
diff --git a/tests/ui/checked_unwrap/simple_conditionals.stderr b/tests/ui/checked_unwrap/simple_conditionals.stderr
index 82f26954380..34131592802 100644
--- a/tests/ui/checked_unwrap/simple_conditionals.stderr
+++ b/tests/ui/checked_unwrap/simple_conditionals.stderr
@@ -71,7 +71,7 @@ LL |             $a.unwrap(); // unnecessary
    |             ^^^^^^^^^^^
 ...
 LL |     m!(x);
-   |     ------ in this macro invocation
+   |     ----- in this macro invocation
    |
    = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
 
diff --git a/tests/ui/collapsible_match2.stderr b/tests/ui/collapsible_match2.stderr
index 55e70dce208..46b645aea13 100644
--- a/tests/ui/collapsible_match2.stderr
+++ b/tests/ui/collapsible_match2.stderr
@@ -46,7 +46,7 @@ LL | |                     },
    | |_____________________^
 ...
 LL |           mac!(res_opt => Ok(val), val => Some(n), foo(n));
-   |           ------------------------------------------------- in this macro invocation
+   |           ------------------------------------------------ in this macro invocation
    |
 help: the outer pattern can be modified to include the inner pattern
   --> $DIR/collapsible_match2.rs:46:28
diff --git a/tests/ui/crashes/ice-6255.stderr b/tests/ui/crashes/ice-6255.stderr
index 5dbf9d440dd..db0cb25e34a 100644
--- a/tests/ui/crashes/ice-6255.stderr
+++ b/tests/ui/crashes/ice-6255.stderr
@@ -5,7 +5,7 @@ LL |         extern crate std as core;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 ...
 LL | define_other_core!();
-   | --------------------- in this macro invocation
+   | -------------------- in this macro invocation
    |
    = note: this error originates in the macro `define_other_core` (in Nightly builds, run with -Z macro-backtrace for more info)
 
diff --git a/tests/ui/crashes/ice-6256.stderr b/tests/ui/crashes/ice-6256.stderr
index d35d459168f..ae4e6cad332 100644
--- a/tests/ui/crashes/ice-6256.stderr
+++ b/tests/ui/crashes/ice-6256.stderr
@@ -6,7 +6,7 @@ LL |     let f = |x: &dyn TT| x.func(); //[default]~ ERROR: mismatched types
    |
    = note: expected reference `&(dyn TT + 'static)`
               found reference `&dyn TT`
-note: the anonymous lifetime #1 defined on the body at 13:13...
+note: the anonymous lifetime #1 defined here...
   --> $DIR/ice-6256.rs:13:13
    |
 LL |     let f = |x: &dyn TT| x.func(); //[default]~ ERROR: mismatched types
diff --git a/tests/ui/declare_interior_mutable_const/others.stderr b/tests/ui/declare_interior_mutable_const/others.stderr
index 7c9d705fa98..fd0689dfc4c 100644
--- a/tests/ui/declare_interior_mutable_const/others.stderr
+++ b/tests/ui/declare_interior_mutable_const/others.stderr
@@ -31,7 +31,7 @@ LL |         const $name: $ty = $e;
    |         ^^^^^^^^^^^^^^^^^^^^^^
 ...
 LL | declare_const!(_ONCE: Once = Once::new()); //~ ERROR interior mutable
-   | ------------------------------------------ in this macro invocation
+   | ----------------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `declare_const` (in Nightly builds, run with -Z macro-backtrace for more info)
 
diff --git a/tests/ui/declare_interior_mutable_const/traits.stderr b/tests/ui/declare_interior_mutable_const/traits.stderr
index bed385b5273..7debe059ff4 100644
--- a/tests/ui/declare_interior_mutable_const/traits.stderr
+++ b/tests/ui/declare_interior_mutable_const/traits.stderr
@@ -13,7 +13,7 @@ LL |         const $name: $ty = $e;
    |         ^^^^^^^^^^^^^^^^^^^^^^
 ...
 LL |     declare_const!(ANOTHER_ATOMIC: AtomicUsize = Self::ATOMIC); //~ ERROR interior mutable
-   |     ----------------------------------------------------------- in this macro invocation
+   |     ---------------------------------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `declare_const` (in Nightly builds, run with -Z macro-backtrace for more info)
 
diff --git a/tests/ui/default_numeric_fallback_f64.stderr b/tests/ui/default_numeric_fallback_f64.stderr
index 961c7cb57c5..f8a2407b693 100644
--- a/tests/ui/default_numeric_fallback_f64.stderr
+++ b/tests/ui/default_numeric_fallback_f64.stderr
@@ -139,7 +139,7 @@ LL |             let x = 22.;
    |                     ^^^ help: consider adding suffix: `22.0_f64`
 ...
 LL |         internal_macro!();
-   |         ------------------ in this macro invocation
+   |         ----------------- in this macro invocation
    |
    = note: this error originates in the macro `internal_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
 
diff --git a/tests/ui/default_numeric_fallback_i32.stderr b/tests/ui/default_numeric_fallback_i32.stderr
index 5edf48b2020..6f9e124704b 100644
--- a/tests/ui/default_numeric_fallback_i32.stderr
+++ b/tests/ui/default_numeric_fallback_i32.stderr
@@ -151,7 +151,7 @@ LL |             let x = 22;
    |                     ^^ help: consider adding suffix: `22_i32`
 ...
 LL |         internal_macro!();
-   |         ------------------ in this macro invocation
+   |         ----------------- in this macro invocation
    |
    = note: this error originates in the macro `internal_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
 
diff --git a/tests/ui/doc_unsafe.stderr b/tests/ui/doc_unsafe.stderr
index 34ca37a6efd..d68b8a0c67b 100644
--- a/tests/ui/doc_unsafe.stderr
+++ b/tests/ui/doc_unsafe.stderr
@@ -47,7 +47,7 @@ LL | |         }
    | |_________^
 ...
 LL |   very_unsafe!();
-   |   --------------- in this macro invocation
+   |   -------------- in this macro invocation
    |
    = note: this error originates in the macro `very_unsafe` (in Nightly builds, run with -Z macro-backtrace for more info)
 
diff --git a/tests/ui/eq_op_macros.stderr b/tests/ui/eq_op_macros.stderr
index a28961e7568..885415b42c7 100644
--- a/tests/ui/eq_op_macros.stderr
+++ b/tests/ui/eq_op_macros.stderr
@@ -5,7 +5,7 @@ LL |         assert_eq!(a, a);
    |                    ^^^^
 ...
 LL |     assert_in_macro_def!();
-   |     ----------------------- in this macro invocation
+   |     ---------------------- in this macro invocation
    |
    = note: `-D clippy::eq-op` implied by `-D warnings`
    = note: this error originates in the macro `assert_in_macro_def` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -17,7 +17,7 @@ LL |         assert_ne!(a, a);
    |                    ^^^^
 ...
 LL |     assert_in_macro_def!();
-   |     ----------------------- in this macro invocation
+   |     ---------------------- in this macro invocation
    |
    = note: this error originates in the macro `assert_in_macro_def` (in Nightly builds, run with -Z macro-backtrace for more info)
 
@@ -52,7 +52,7 @@ LL |         debug_assert_eq!(a, a);
    |                          ^^^^
 ...
 LL |     assert_in_macro_def!();
-   |     ----------------------- in this macro invocation
+   |     ---------------------- in this macro invocation
    |
    = note: this error originates in the macro `assert_in_macro_def` (in Nightly builds, run with -Z macro-backtrace for more info)
 
@@ -63,7 +63,7 @@ LL |         debug_assert_ne!(a, a);
    |                          ^^^^
 ...
 LL |     assert_in_macro_def!();
-   |     ----------------------- in this macro invocation
+   |     ---------------------- in this macro invocation
    |
    = note: this error originates in the macro `assert_in_macro_def` (in Nightly builds, run with -Z macro-backtrace for more info)
 
diff --git a/tests/ui/fallible_impl_from.stderr b/tests/ui/fallible_impl_from.stderr
index 8b8054586e6..f5d0b98c108 100644
--- a/tests/ui/fallible_impl_from.stderr
+++ b/tests/ui/fallible_impl_from.stderr
@@ -37,7 +37,7 @@ note: potential failure(s)
   --> $DIR/fallible_impl_from.rs:30:13
    |
 LL |             panic!();
-   |             ^^^^^^^^^
+   |             ^^^^^^^^
    = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: consider implementing `TryFrom` instead
@@ -60,11 +60,11 @@ LL |         let s = s.unwrap();
    |                 ^^^^^^^^^^
 LL |         if !s.is_empty() {
 LL |             panic!("42");
-   |             ^^^^^^^^^^^^^
+   |             ^^^^^^^^^^^^
 LL |         } else if s.parse::<u32>().unwrap() != 42 {
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^
 LL |             panic!("{:?}", s);
-   |             ^^^^^^^^^^^^^^^^^^
+   |             ^^^^^^^^^^^^^^^^^
    = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: consider implementing `TryFrom` instead
@@ -86,7 +86,7 @@ note: potential failure(s)
 LL |         if s.parse::<u32>().ok().unwrap() != 42 {
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 LL |             panic!("{:?}", s);
-   |             ^^^^^^^^^^^^^^^^^^
+   |             ^^^^^^^^^^^^^^^^^
    = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to 4 previous errors
diff --git a/tests/ui/format.stderr b/tests/ui/format.stderr
index 496a083497d..701399b32d6 100644
--- a/tests/ui/format.stderr
+++ b/tests/ui/format.stderr
@@ -2,7 +2,7 @@ error: useless use of `format!`
   --> $DIR/format.rs:13:5
    |
 LL |     format!("foo");
-   |     ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string();`
+   |     ^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()`
    |
    = note: `-D clippy::useless-format` implied by `-D warnings`
 
@@ -10,13 +10,13 @@ error: useless use of `format!`
   --> $DIR/format.rs:14:5
    |
 LL |     format!("{{}}");
-   |     ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"{}".to_string();`
+   |     ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"{}".to_string()`
 
 error: useless use of `format!`
   --> $DIR/format.rs:15:5
    |
 LL |     format!("{{}} abc {{}}");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"{} abc {}".to_string();`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"{} abc {}".to_string()`
 
 error: useless use of `format!`
   --> $DIR/format.rs:16:5
@@ -25,61 +25,61 @@ LL | /     format!(
 LL | |         r##"foo {{}}
 LL | | " bar"##
 LL | |     );
-   | |______^
+   | |_____^
    |
 help: consider using `.to_string()`
    |
 LL ~     r##"foo {}
-LL + " bar"##.to_string();
+LL ~ " bar"##.to_string();
    |
 
 error: useless use of `format!`
   --> $DIR/format.rs:21:5
    |
 LL |     format!("{}", "foo");
-   |     ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string();`
+   |     ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()`
 
 error: useless use of `format!`
   --> $DIR/format.rs:25:5
    |
 LL |     format!("{:+}", "foo"); // Warn when the format makes no difference.
-   |     ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string();`
+   |     ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()`
 
 error: useless use of `format!`
   --> $DIR/format.rs:26:5
    |
 LL |     format!("{:<}", "foo"); // Warn when the format makes no difference.
-   |     ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string();`
+   |     ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()`
 
 error: useless use of `format!`
   --> $DIR/format.rs:31:5
    |
 LL |     format!("{}", arg);
-   |     ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.to_string();`
+   |     ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.to_string()`
 
 error: useless use of `format!`
   --> $DIR/format.rs:35:5
    |
 LL |     format!("{:+}", arg); // Warn when the format makes no difference.
-   |     ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.to_string();`
+   |     ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.to_string()`
 
 error: useless use of `format!`
   --> $DIR/format.rs:36:5
    |
 LL |     format!("{:<}", arg); // Warn when the format makes no difference.
-   |     ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.to_string();`
+   |     ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.to_string()`
 
 error: useless use of `format!`
   --> $DIR/format.rs:63:5
    |
 LL |     format!("{}", 42.to_string());
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `42.to_string();`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `42.to_string()`
 
 error: useless use of `format!`
   --> $DIR/format.rs:65:5
    |
 LL |     format!("{}", x.display().to_string());
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.display().to_string();`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.display().to_string()`
 
 error: useless use of `format!`
   --> $DIR/format.rs:69:18
diff --git a/tests/ui/implicit_hasher.stderr b/tests/ui/implicit_hasher.stderr
index dad5ab71f15..3f5f56b923f 100644
--- a/tests/ui/implicit_hasher.stderr
+++ b/tests/ui/implicit_hasher.stderr
@@ -107,7 +107,7 @@ LL |         impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> {
    |                                           ^^^^^^^^^^^^^
 ...
 LL | gen!(impl);
-   | ----------- in this macro invocation
+   | ---------- in this macro invocation
    |
    = note: this error originates in the macro `gen` (in Nightly builds, run with -Z macro-backtrace for more info)
 help: consider adding a type parameter
@@ -126,7 +126,7 @@ LL |         pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>)
    |                                 ^^^^^^^^^^^^^^^^^
 ...
 LL | gen!(fn bar);
-   | ------------- in this macro invocation
+   | ------------ in this macro invocation
    |
    = note: this error originates in the macro `gen` (in Nightly builds, run with -Z macro-backtrace for more info)
 help: consider adding a type parameter
@@ -141,7 +141,7 @@ LL |         pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>)
    |                                                               ^^^^^^^^^^^^
 ...
 LL | gen!(fn bar);
-   | ------------- in this macro invocation
+   | ------------ in this macro invocation
    |
    = note: this error originates in the macro `gen` (in Nightly builds, run with -Z macro-backtrace for more info)
 help: consider adding a type parameter
diff --git a/tests/ui/item_after_statement.stderr b/tests/ui/item_after_statement.stderr
index bcb163d4bc1..ab4a6374c73 100644
--- a/tests/ui/item_after_statement.stderr
+++ b/tests/ui/item_after_statement.stderr
@@ -25,7 +25,7 @@ LL | |             }
    | |_____________^
 ...
 LL |       b!();
-   |       ----- in this macro invocation
+   |       ---- in this macro invocation
    |
    = note: this error originates in the macro `b` (in Nightly builds, run with -Z macro-backtrace for more info)
 
diff --git a/tests/ui/manual_unwrap_or.fixed b/tests/ui/manual_unwrap_or.fixed
index 3717f962745..05d6c56f2ac 100644
--- a/tests/ui/manual_unwrap_or.fixed
+++ b/tests/ui/manual_unwrap_or.fixed
@@ -74,10 +74,10 @@ fn result_unwrap_or() {
     let a = Ok::<i32, &str>(1);
     a.unwrap_or(42);
 
-    // int case, suggestion must surround Result expr with parenthesis
+    // int case, suggestion must surround Result expr with parentheses
     (Ok(1) as Result<i32, &str>).unwrap_or(42);
 
-    // method call case, suggestion must not surround Result expr `s.method()` with parenthesis
+    // method call case, suggestion must not surround Result expr `s.method()` with parentheses
     struct S {}
     impl S {
         fn method(self) -> Option<i32> {
diff --git a/tests/ui/manual_unwrap_or.rs b/tests/ui/manual_unwrap_or.rs
index 989adde1f5b..09f62c69b71 100644
--- a/tests/ui/manual_unwrap_or.rs
+++ b/tests/ui/manual_unwrap_or.rs
@@ -95,13 +95,13 @@ fn result_unwrap_or() {
         Err(_) => 42,
     };
 
-    // int case, suggestion must surround Result expr with parenthesis
+    // int case, suggestion must surround Result expr with parentheses
     match Ok(1) as Result<i32, &str> {
         Ok(i) => i,
         Err(_) => 42,
     };
 
-    // method call case, suggestion must not surround Result expr `s.method()` with parenthesis
+    // method call case, suggestion must not surround Result expr `s.method()` with parentheses
     struct S {}
     impl S {
         fn method(self) -> Option<i32> {
diff --git a/tests/ui/mem_discriminant.fixed b/tests/ui/mem_discriminant.fixed
deleted file mode 100644
index 69a8f286d05..00000000000
--- a/tests/ui/mem_discriminant.fixed
+++ /dev/null
@@ -1,45 +0,0 @@
-// run-rustfix
-
-#![deny(clippy::mem_discriminant_non_enum)]
-
-use std::mem;
-
-enum Foo {
-    One(usize),
-    Two(u8),
-}
-
-fn main() {
-    // bad
-    mem::discriminant(&Some(2));
-    mem::discriminant(&None::<u8>);
-    mem::discriminant(&Foo::One(5));
-    mem::discriminant(&Foo::Two(5));
-
-    let ro = &Some(3);
-    let rro = &ro;
-    mem::discriminant(ro);
-    mem::discriminant(*rro);
-    mem::discriminant(*rro);
-
-    macro_rules! mem_discriminant_but_in_a_macro {
-        ($param:expr) => {
-            mem::discriminant($param)
-        };
-    }
-
-    mem_discriminant_but_in_a_macro!(*rro);
-
-    let rrrrro = &&&rro;
-    mem::discriminant(****rrrrro);
-    mem::discriminant(****rrrrro);
-
-    // ok
-    mem::discriminant(&Some(2));
-    mem::discriminant(&None::<u8>);
-    mem::discriminant(&Foo::One(5));
-    mem::discriminant(&Foo::Two(5));
-    mem::discriminant(ro);
-    mem::discriminant(*rro);
-    mem::discriminant(****rrrrro);
-}
diff --git a/tests/ui/mem_discriminant.rs b/tests/ui/mem_discriminant.rs
deleted file mode 100644
index 55db50fcdc7..00000000000
--- a/tests/ui/mem_discriminant.rs
+++ /dev/null
@@ -1,45 +0,0 @@
-// run-rustfix
-
-#![deny(clippy::mem_discriminant_non_enum)]
-
-use std::mem;
-
-enum Foo {
-    One(usize),
-    Two(u8),
-}
-
-fn main() {
-    // bad
-    mem::discriminant(&&Some(2));
-    mem::discriminant(&&None::<u8>);
-    mem::discriminant(&&Foo::One(5));
-    mem::discriminant(&&Foo::Two(5));
-
-    let ro = &Some(3);
-    let rro = &ro;
-    mem::discriminant(&ro);
-    mem::discriminant(rro);
-    mem::discriminant(&rro);
-
-    macro_rules! mem_discriminant_but_in_a_macro {
-        ($param:expr) => {
-            mem::discriminant($param)
-        };
-    }
-
-    mem_discriminant_but_in_a_macro!(&rro);
-
-    let rrrrro = &&&rro;
-    mem::discriminant(&rrrrro);
-    mem::discriminant(*rrrrro);
-
-    // ok
-    mem::discriminant(&Some(2));
-    mem::discriminant(&None::<u8>);
-    mem::discriminant(&Foo::One(5));
-    mem::discriminant(&Foo::Two(5));
-    mem::discriminant(ro);
-    mem::discriminant(*rro);
-    mem::discriminant(****rrrrro);
-}
diff --git a/tests/ui/mem_discriminant.stderr b/tests/ui/mem_discriminant.stderr
deleted file mode 100644
index 36a225b7594..00000000000
--- a/tests/ui/mem_discriminant.stderr
+++ /dev/null
@@ -1,94 +0,0 @@
-error: calling `mem::discriminant` on non-enum type `&std::option::Option<i32>`
-  --> $DIR/mem_discriminant.rs:14:5
-   |
-LL |     mem::discriminant(&&Some(2));
-   |     ^^^^^^^^^^^^^^^^^^---------^
-   |                       |
-   |                       help: try dereferencing: `&Some(2)`
-   |
-note: the lint level is defined here
-  --> $DIR/mem_discriminant.rs:3:9
-   |
-LL | #![deny(clippy::mem_discriminant_non_enum)]
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: calling `mem::discriminant` on non-enum type `&std::option::Option<u8>`
-  --> $DIR/mem_discriminant.rs:15:5
-   |
-LL |     mem::discriminant(&&None::<u8>);
-   |     ^^^^^^^^^^^^^^^^^^------------^
-   |                       |
-   |                       help: try dereferencing: `&None::<u8>`
-
-error: calling `mem::discriminant` on non-enum type `&Foo`
-  --> $DIR/mem_discriminant.rs:16:5
-   |
-LL |     mem::discriminant(&&Foo::One(5));
-   |     ^^^^^^^^^^^^^^^^^^-------------^
-   |                       |
-   |                       help: try dereferencing: `&Foo::One(5)`
-
-error: calling `mem::discriminant` on non-enum type `&Foo`
-  --> $DIR/mem_discriminant.rs:17:5
-   |
-LL |     mem::discriminant(&&Foo::Two(5));
-   |     ^^^^^^^^^^^^^^^^^^-------------^
-   |                       |
-   |                       help: try dereferencing: `&Foo::Two(5)`
-
-error: calling `mem::discriminant` on non-enum type `&std::option::Option<i32>`
-  --> $DIR/mem_discriminant.rs:21:5
-   |
-LL |     mem::discriminant(&ro);
-   |     ^^^^^^^^^^^^^^^^^^---^
-   |                       |
-   |                       help: try dereferencing: `ro`
-
-error: calling `mem::discriminant` on non-enum type `&std::option::Option<i32>`
-  --> $DIR/mem_discriminant.rs:22:5
-   |
-LL |     mem::discriminant(rro);
-   |     ^^^^^^^^^^^^^^^^^^---^
-   |                       |
-   |                       help: try dereferencing: `*rro`
-
-error: calling `mem::discriminant` on non-enum type `&&std::option::Option<i32>`
-  --> $DIR/mem_discriminant.rs:23:5
-   |
-LL |     mem::discriminant(&rro);
-   |     ^^^^^^^^^^^^^^^^^^----^
-   |                       |
-   |                       help: try dereferencing: `*rro`
-
-error: calling `mem::discriminant` on non-enum type `&&std::option::Option<i32>`
-  --> $DIR/mem_discriminant.rs:27:13
-   |
-LL |             mem::discriminant($param)
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^
-...
-LL |     mem_discriminant_but_in_a_macro!(&rro);
-   |     ---------------------------------------
-   |     |                                |
-   |     |                                help: try dereferencing: `*rro`
-   |     in this macro invocation
-   |
-   = note: this error originates in the macro `mem_discriminant_but_in_a_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: calling `mem::discriminant` on non-enum type `&&&&&std::option::Option<i32>`
-  --> $DIR/mem_discriminant.rs:34:5
-   |
-LL |     mem::discriminant(&rrrrro);
-   |     ^^^^^^^^^^^^^^^^^^-------^
-   |                       |
-   |                       help: try dereferencing: `****rrrrro`
-
-error: calling `mem::discriminant` on non-enum type `&&&std::option::Option<i32>`
-  --> $DIR/mem_discriminant.rs:35:5
-   |
-LL |     mem::discriminant(*rrrrro);
-   |     ^^^^^^^^^^^^^^^^^^-------^
-   |                       |
-   |                       help: try dereferencing: `****rrrrro`
-
-error: aborting due to 10 previous errors
-
diff --git a/tests/ui/mem_discriminant_unfixable.rs b/tests/ui/mem_discriminant_unfixable.rs
deleted file mode 100644
index e245d3257d5..00000000000
--- a/tests/ui/mem_discriminant_unfixable.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-#![deny(clippy::mem_discriminant_non_enum)]
-
-use std::mem;
-
-enum Foo {
-    One(usize),
-    Two(u8),
-}
-
-struct A(Foo);
-
-fn main() {
-    // bad
-    mem::discriminant(&"hello");
-    mem::discriminant(&A(Foo::One(0)));
-}
diff --git a/tests/ui/mem_discriminant_unfixable.stderr b/tests/ui/mem_discriminant_unfixable.stderr
deleted file mode 100644
index e2de3776f2c..00000000000
--- a/tests/ui/mem_discriminant_unfixable.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: calling `mem::discriminant` on non-enum type `&str`
-  --> $DIR/mem_discriminant_unfixable.rs:14:5
-   |
-LL |     mem::discriminant(&"hello");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: the lint level is defined here
-  --> $DIR/mem_discriminant_unfixable.rs:1:9
-   |
-LL | #![deny(clippy::mem_discriminant_non_enum)]
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: calling `mem::discriminant` on non-enum type `A`
-  --> $DIR/mem_discriminant_unfixable.rs:15:5
-   |
-LL |     mem::discriminant(&A(Foo::One(0)));
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
-
diff --git a/tests/ui/mem_replace_macro.stderr b/tests/ui/mem_replace_macro.stderr
index b4963acc455..dd69ab8b5ef 100644
--- a/tests/ui/mem_replace_macro.stderr
+++ b/tests/ui/mem_replace_macro.stderr
@@ -5,7 +5,7 @@ LL |         std::mem::replace($s, Default::default())
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ...
 LL |     take!(s);
-   |     --------- in this macro invocation
+   |     -------- in this macro invocation
    |
    = note: `-D clippy::mem-replace-with-default` implied by `-D warnings`
    = note: this error originates in the macro `take` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/tests/ui/missing_panics_doc.stderr b/tests/ui/missing_panics_doc.stderr
index 8d882cc6e0d..b863063b626 100644
--- a/tests/ui/missing_panics_doc.stderr
+++ b/tests/ui/missing_panics_doc.stderr
@@ -91,7 +91,7 @@ note: first possible panic found here
   --> $DIR/missing_panics_doc.rs:39:5
    |
 LL |     assert_eq!(x, 0);
-   |     ^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^
    = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: docs for function which may panic missing `# Panics` section
@@ -107,7 +107,7 @@ note: first possible panic found here
   --> $DIR/missing_panics_doc.rs:45:5
    |
 LL |     assert_ne!(x, 0);
-   |     ^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^
    = note: this error originates in the macro `assert_ne` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to 7 previous errors
diff --git a/tests/ui/panic_in_result_fn.stderr b/tests/ui/panic_in_result_fn.stderr
index 8d6e40c30a1..f56c2d03c66 100644
--- a/tests/ui/panic_in_result_fn.stderr
+++ b/tests/ui/panic_in_result_fn.stderr
@@ -13,7 +13,7 @@ note: return Err() instead of panicking
   --> $DIR/panic_in_result_fn.rs:9:9
    |
 LL |         panic!("error");
-   |         ^^^^^^^^^^^^^^^^
+   |         ^^^^^^^^^^^^^^^
    = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
@@ -30,7 +30,7 @@ note: return Err() instead of panicking
   --> $DIR/panic_in_result_fn.rs:14:9
    |
 LL |         unimplemented!();
-   |         ^^^^^^^^^^^^^^^^^
+   |         ^^^^^^^^^^^^^^^^
    = note: this error originates in the macro `unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
@@ -47,7 +47,7 @@ note: return Err() instead of panicking
   --> $DIR/panic_in_result_fn.rs:19:9
    |
 LL |         unreachable!();
-   |         ^^^^^^^^^^^^^^^
+   |         ^^^^^^^^^^^^^^
    = note: this error originates in the macro `unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
@@ -64,7 +64,7 @@ note: return Err() instead of panicking
   --> $DIR/panic_in_result_fn.rs:24:9
    |
 LL |         todo!("Finish this");
-   |         ^^^^^^^^^^^^^^^^^^^^^
+   |         ^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
@@ -81,7 +81,7 @@ note: return Err() instead of panicking
   --> $DIR/panic_in_result_fn.rs:55:5
    |
 LL |     panic!("error");
-   |     ^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^
    = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
@@ -98,7 +98,7 @@ note: return Err() instead of panicking
   --> $DIR/panic_in_result_fn.rs:69:5
    |
 LL |     todo!("finish main method");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to 6 previous errors
diff --git a/tests/ui/panic_in_result_fn_assertions.stderr b/tests/ui/panic_in_result_fn_assertions.stderr
index 4c39b37d879..7501d6d85ed 100644
--- a/tests/ui/panic_in_result_fn_assertions.stderr
+++ b/tests/ui/panic_in_result_fn_assertions.stderr
@@ -14,7 +14,7 @@ note: return Err() instead of panicking
   --> $DIR/panic_in_result_fn_assertions.rs:9:9
    |
 LL |         assert!(x == 5, "wrong argument");
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
@@ -32,7 +32,7 @@ note: return Err() instead of panicking
   --> $DIR/panic_in_result_fn_assertions.rs:15:9
    |
 LL |         assert_eq!(x, 5);
-   |         ^^^^^^^^^^^^^^^^^
+   |         ^^^^^^^^^^^^^^^^
    = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
@@ -50,7 +50,7 @@ note: return Err() instead of panicking
   --> $DIR/panic_in_result_fn_assertions.rs:21:9
    |
 LL |         assert_ne!(x, 1);
-   |         ^^^^^^^^^^^^^^^^^
+   |         ^^^^^^^^^^^^^^^^
    = note: this error originates in the macro `assert_ne` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to 3 previous errors
diff --git a/tests/ui/panicking_macros.stderr b/tests/ui/panicking_macros.stderr
index 2e83c305a67..2b607ff5888 100644
--- a/tests/ui/panicking_macros.stderr
+++ b/tests/ui/panicking_macros.stderr
@@ -2,7 +2,7 @@ error: `panic` should not be present in production code
   --> $DIR/panicking_macros.rs:8:5
    |
 LL |     panic!();
-   |     ^^^^^^^^^
+   |     ^^^^^^^^
    |
    = note: `-D clippy::panic` implied by `-D warnings`
 
@@ -10,19 +10,19 @@ error: `panic` should not be present in production code
   --> $DIR/panicking_macros.rs:9:5
    |
 LL |     panic!("message");
-   |     ^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^
 
 error: `panic` should not be present in production code
   --> $DIR/panicking_macros.rs:10:5
    |
 LL |     panic!("{} {}", "panic with", "multiple arguments");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: `todo` should not be present in production code
   --> $DIR/panicking_macros.rs:16:5
    |
 LL |     todo!();
-   |     ^^^^^^^^
+   |     ^^^^^^^
    |
    = note: `-D clippy::todo` implied by `-D warnings`
    = note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -31,7 +31,7 @@ error: `todo` should not be present in production code
   --> $DIR/panicking_macros.rs:17:5
    |
 LL |     todo!("message");
-   |     ^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info)
 
@@ -39,7 +39,7 @@ error: `todo` should not be present in production code
   --> $DIR/panicking_macros.rs:18:5
    |
 LL |     todo!("{} {}", "panic with", "multiple arguments");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info)
 
@@ -47,7 +47,7 @@ error: `unimplemented` should not be present in production code
   --> $DIR/panicking_macros.rs:24:5
    |
 LL |     unimplemented!();
-   |     ^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^
    |
    = note: `-D clippy::unimplemented` implied by `-D warnings`
    = note: this error originates in the macro `unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -56,7 +56,7 @@ error: `unimplemented` should not be present in production code
   --> $DIR/panicking_macros.rs:25:5
    |
 LL |     unimplemented!("message");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the macro `unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
 
@@ -64,7 +64,7 @@ error: `unimplemented` should not be present in production code
   --> $DIR/panicking_macros.rs:26:5
    |
 LL |     unimplemented!("{} {}", "panic with", "multiple arguments");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the macro `unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
 
@@ -72,7 +72,7 @@ error: usage of the `unreachable!` macro
   --> $DIR/panicking_macros.rs:32:5
    |
 LL |     unreachable!();
-   |     ^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^
    |
    = note: `-D clippy::unreachable` implied by `-D warnings`
    = note: this error originates in the macro `unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -81,7 +81,7 @@ error: usage of the `unreachable!` macro
   --> $DIR/panicking_macros.rs:33:5
    |
 LL |     unreachable!("message");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the macro `$crate::unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
 
@@ -89,7 +89,7 @@ error: usage of the `unreachable!` macro
   --> $DIR/panicking_macros.rs:34:5
    |
 LL |     unreachable!("{} {}", "panic with", "multiple arguments");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the macro `unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
 
@@ -97,13 +97,13 @@ error: `panic` should not be present in production code
   --> $DIR/panicking_macros.rs:40:5
    |
 LL |     panic!();
-   |     ^^^^^^^^^
+   |     ^^^^^^^^
 
 error: `todo` should not be present in production code
   --> $DIR/panicking_macros.rs:41:5
    |
 LL |     todo!();
-   |     ^^^^^^^^
+   |     ^^^^^^^
    |
    = note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info)
 
@@ -111,7 +111,7 @@ error: `unimplemented` should not be present in production code
   --> $DIR/panicking_macros.rs:42:5
    |
 LL |     unimplemented!();
-   |     ^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the macro `unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
 
@@ -119,7 +119,7 @@ error: usage of the `unreachable!` macro
   --> $DIR/panicking_macros.rs:43:5
    |
 LL |     unreachable!();
-   |     ^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^
    |
    = note: this error originates in the macro `unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
 
diff --git a/tests/ui/pattern_type_mismatch/syntax.stderr b/tests/ui/pattern_type_mismatch/syntax.stderr
index f309b273982..12b3d3a8bd0 100644
--- a/tests/ui/pattern_type_mismatch/syntax.stderr
+++ b/tests/ui/pattern_type_mismatch/syntax.stderr
@@ -70,7 +70,7 @@ LL |                 Some(_) => (),
    |                 ^^^^^^^
 ...
 LL |     matching_macro!(value);
-   |     ----------------------- in this macro invocation
+   |     ---------------------- in this macro invocation
    |
    = help: use `*` to dereference the match expression or explicitly match against a `&_` pattern and adjust the enclosed variable bindings
    = note: this error originates in the macro `matching_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/tests/ui/rename.fixed b/tests/ui/rename.fixed
index 13fbb6e2a6e..a66c2e587c8 100644
--- a/tests/ui/rename.fixed
+++ b/tests/ui/rename.fixed
@@ -8,6 +8,7 @@
 #![allow(clippy::redundant_static_lifetimes)]
 // warn for the old lint name here, to test if the renaming worked
 #![warn(clippy::cognitive_complexity)]
+#![warn(enum_intrinsics_non_enums)]
 
 #[warn(clippy::module_name_repetitions)]
 fn main() {}
diff --git a/tests/ui/rename.rs b/tests/ui/rename.rs
index cbd3b1e9166..fa81201a2da 100644
--- a/tests/ui/rename.rs
+++ b/tests/ui/rename.rs
@@ -8,6 +8,7 @@
 #![allow(clippy::redundant_static_lifetimes)]
 // warn for the old lint name here, to test if the renaming worked
 #![warn(clippy::cyclomatic_complexity)]
+#![warn(clippy::mem_discriminant_non_enum)]
 
 #[warn(clippy::stutter)]
 fn main() {}
diff --git a/tests/ui/rename.stderr b/tests/ui/rename.stderr
index c5d633ff86b..05c7854074c 100644
--- a/tests/ui/rename.stderr
+++ b/tests/ui/rename.stderr
@@ -6,23 +6,29 @@ LL | #![warn(clippy::cyclomatic_complexity)]
    |
    = note: `-D renamed-and-removed-lints` implied by `-D warnings`
 
+error: lint `clippy::mem_discriminant_non_enum` has been renamed to `enum_intrinsics_non_enums`
+  --> $DIR/rename.rs:11:9
+   |
+LL | #![warn(clippy::mem_discriminant_non_enum)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `enum_intrinsics_non_enums`
+
 error: lint `clippy::stutter` has been renamed to `clippy::module_name_repetitions`
-  --> $DIR/rename.rs:12:8
+  --> $DIR/rename.rs:13:8
    |
 LL | #[warn(clippy::stutter)]
    |        ^^^^^^^^^^^^^^^ help: use the new name: `clippy::module_name_repetitions`
 
 error: lint `clippy::new_without_default_derive` has been renamed to `clippy::new_without_default`
-  --> $DIR/rename.rs:15:8
+  --> $DIR/rename.rs:16:8
    |
 LL | #[warn(clippy::new_without_default_derive)]
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::new_without_default`
 
 error: lint `clippy::const_static_lifetime` has been renamed to `clippy::redundant_static_lifetimes`
-  --> $DIR/rename.rs:18:8
+  --> $DIR/rename.rs:19:8
    |
 LL | #[warn(clippy::const_static_lifetime)]
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::redundant_static_lifetimes`
 
-error: aborting due to 4 previous errors
+error: aborting due to 5 previous errors
 
diff --git a/tests/ui/toplevel_ref_arg.stderr b/tests/ui/toplevel_ref_arg.stderr
index 48e7d9ddd5a..9c853020ab0 100644
--- a/tests/ui/toplevel_ref_arg.stderr
+++ b/tests/ui/toplevel_ref_arg.stderr
@@ -37,7 +37,7 @@ LL |         let ref _y = 42;
    |         ----^^^^^^------ help: try: `let _y = &42;`
 ...
 LL |         gen_binding!();
-   |         --------------- in this macro invocation
+   |         -------------- in this macro invocation
    |
    = note: this error originates in the macro `gen_binding` (in Nightly builds, run with -Z macro-backtrace for more info)
 
diff --git a/tests/ui/toplevel_ref_arg_non_rustfix.stderr b/tests/ui/toplevel_ref_arg_non_rustfix.stderr
index 31f8c103ede..e97011c7fd5 100644
--- a/tests/ui/toplevel_ref_arg_non_rustfix.stderr
+++ b/tests/ui/toplevel_ref_arg_non_rustfix.stderr
@@ -13,7 +13,7 @@ LL |         fn fun_example(ref _x: usize) {}
    |                        ^^^^^^
 ...
 LL |         gen_function!();
-   |         ---------------- in this macro invocation
+   |         --------------- in this macro invocation
    |
    = note: this error originates in the macro `gen_function` (in Nightly builds, run with -Z macro-backtrace for more info)
 
diff --git a/tests/ui/try_err.stderr b/tests/ui/try_err.stderr
index 09efc16c154..0cb1328fbfc 100644
--- a/tests/ui/try_err.stderr
+++ b/tests/ui/try_err.stderr
@@ -35,7 +35,7 @@ LL |             Err(_) => Err(1)?,
    |                       ^^^^^^^ help: try this: `return Err(1)`
 ...
 LL |     try_validation!(Ok::<_, i32>(5));
-   |     --------------------------------- in this macro invocation
+   |     -------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `try_validation` (in Nightly builds, run with -Z macro-backtrace for more info)
 
@@ -46,7 +46,7 @@ LL |             Err(_) => Err(ret_one!())?,
    |                       ^^^^^^^^^^^^^^^^ help: try this: `return Err(ret_one!())`
 ...
 LL |     try_validation_in_macro!(Ok::<_, i32>(5));
-   |     ------------------------------------------ in this macro invocation
+   |     ----------------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `try_validation_in_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
 
diff --git a/tests/ui/undocumented_unsafe_blocks.stderr b/tests/ui/undocumented_unsafe_blocks.stderr
index b32069a334c..613e9ffca45 100644
--- a/tests/ui/undocumented_unsafe_blocks.stderr
+++ b/tests/ui/undocumented_unsafe_blocks.stderr
@@ -114,7 +114,7 @@ LL |             unsafe {}
    |             ^^^^^^^^^
 ...
 LL |     t!();
-   |     ----- in this macro invocation
+   |     ---- in this macro invocation
    |
    = help: consider adding a safety comment in the macro definition
    = note: this error originates in the macro `t` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/tests/ui/unit_cmp.stderr b/tests/ui/unit_cmp.stderr
index 75017cab057..2b5a7b348b9 100644
--- a/tests/ui/unit_cmp.stderr
+++ b/tests/ui/unit_cmp.stderr
@@ -32,7 +32,7 @@ LL | |         },
 ...  |
 LL | |         }
 LL | |     );
-   | |______^
+   | |_____^
    |
    = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
 
@@ -46,7 +46,7 @@ LL | |         },
 ...  |
 LL | |         }
 LL | |     );
-   | |______^
+   | |_____^
    |
    = note: this error originates in the macro `$crate::assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
 
@@ -60,7 +60,7 @@ LL | |         },
 ...  |
 LL | |         }
 LL | |     );
-   | |______^
+   | |_____^
    |
    = note: this error originates in the macro `assert_ne` (in Nightly builds, run with -Z macro-backtrace for more info)
 
@@ -74,7 +74,7 @@ LL | |         },
 ...  |
 LL | |         }
 LL | |     );
-   | |______^
+   | |_____^
    |
    = note: this error originates in the macro `$crate::assert_ne` (in Nightly builds, run with -Z macro-backtrace for more info)
 
diff --git a/tests/ui/useless_conversion.fixed b/tests/ui/useless_conversion.fixed
index 76aa82068d6..70ff08f3655 100644
--- a/tests/ui/useless_conversion.fixed
+++ b/tests/ui/useless_conversion.fixed
@@ -66,7 +66,7 @@ fn main() {
     let _ = vec![1, 2, 3].into_iter();
     let _: String = format!("Hello {}", "world");
 
-    // keep parenthesis around `a + b` for suggestion (see #4750)
+    // keep parentheses around `a + b` for suggestion (see #4750)
     let a: i32 = 1;
     let b: i32 = 1;
     let _ = (a + b) * 3;
diff --git a/tests/ui/useless_conversion.rs b/tests/ui/useless_conversion.rs
index ccee7abb404..f2444a8f436 100644
--- a/tests/ui/useless_conversion.rs
+++ b/tests/ui/useless_conversion.rs
@@ -66,7 +66,7 @@ fn main() {
     let _ = vec![1, 2, 3].into_iter().into_iter();
     let _: String = format!("Hello {}", "world").into();
 
-    // keep parenthesis around `a + b` for suggestion (see #4750)
+    // keep parentheses around `a + b` for suggestion (see #4750)
     let a: i32 = 1;
     let b: i32 = 1;
     let _ = i32::from(a + b) * 3;