about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/ci.yml9
-rw-r--r--Cargo.lock141
-rw-r--r--compiler/rustc_apfloat/src/lib.rs1
-rw-r--r--compiler/rustc_ast/src/ast.rs7
-rw-r--r--compiler/rustc_ast/src/ast/tests.rs11
-rw-r--r--compiler/rustc_ast/src/lib.rs1
-rw-r--r--compiler/rustc_ast_lowering/src/index.rs7
-rw-r--r--compiler/rustc_ast_lowering/src/item.rs11
-rw-r--r--compiler/rustc_ast_lowering/src/lib.rs107
-rw-r--r--compiler/rustc_ast_passes/src/ast_validation.rs12
-rw-r--r--compiler/rustc_borrowck/src/diagnostics/region_name.rs4
-rw-r--r--compiler/rustc_borrowck/src/universal_regions.rs4
-rw-r--r--compiler/rustc_builtin_macros/src/lib.rs1
-rw-r--r--compiler/rustc_codegen_llvm/src/lib.rs1
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm_util.rs70
-rw-r--r--compiler/rustc_codegen_ssa/Cargo.toml1
-rw-r--r--compiler/rustc_codegen_ssa/src/back/linker.rs20
-rw-r--r--compiler/rustc_codegen_ssa/src/lib.rs1
-rw-r--r--compiler/rustc_const_eval/src/interpret/memory.rs23
-rw-r--r--compiler/rustc_const_eval/src/interpret/operand.rs21
-rw-r--r--compiler/rustc_const_eval/src/interpret/terminator.rs7
-rw-r--r--compiler/rustc_const_eval/src/interpret/traits.rs19
-rw-r--r--compiler/rustc_data_structures/src/base_n/tests.rs4
-rw-r--r--compiler/rustc_data_structures/src/graph/scc/tests.rs3
-rw-r--r--compiler/rustc_data_structures/src/owning_ref/tests.rs4
-rw-r--r--compiler/rustc_data_structures/src/sip128.rs3
-rw-r--r--compiler/rustc_driver/Cargo.toml1
-rw-r--r--compiler/rustc_driver/src/lib.rs22
-rw-r--r--compiler/rustc_error_codes/src/error_codes.rs1
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0312.md4
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0432.md12
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0477.md4
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0495.md4
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0623.md65
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0713.md2
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0759.md4
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0772.md4
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0788.md26
-rw-r--r--compiler/rustc_errors/Cargo.toml2
-rw-r--r--compiler/rustc_errors/src/diagnostic.rs6
-rw-r--r--compiler/rustc_errors/src/json.rs36
-rw-r--r--compiler/rustc_errors/src/json/tests.rs26
-rw-r--r--compiler/rustc_errors/src/lib.rs1
-rw-r--r--compiler/rustc_feature/src/accepted.rs2
-rw-r--r--compiler/rustc_feature/src/active.rs2
-rw-r--r--compiler/rustc_graphviz/src/lib.rs1
-rw-r--r--compiler/rustc_hir/src/hir.rs77
-rw-r--r--compiler/rustc_hir/src/intravisit.rs8
-rw-r--r--compiler/rustc_hir_pretty/src/lib.rs35
-rw-r--r--compiler/rustc_incremental/src/lib.rs1
-rw-r--r--compiler/rustc_infer/src/infer/error_reporting/mod.rs2
-rw-r--r--compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs13
-rw-r--r--compiler/rustc_infer/src/infer/mod.rs25
-rw-r--r--compiler/rustc_interface/src/lib.rs1
-rw-r--r--compiler/rustc_interface/src/passes.rs9
-rw-r--r--compiler/rustc_interface/src/tests.rs3
-rw-r--r--compiler/rustc_lint/src/builtin.rs29
-rw-r--r--compiler/rustc_lint/src/lib.rs1
-rw-r--r--compiler/rustc_lint_defs/Cargo.toml1
-rw-r--r--compiler/rustc_lint_defs/src/lib.rs4
-rw-r--r--compiler/rustc_llvm/src/lib.rs1
-rw-r--r--compiler/rustc_macros/src/serialize.rs44
-rw-r--r--compiler/rustc_metadata/src/lib.rs1
-rw-r--r--compiler/rustc_metadata/src/rmeta/encoder.rs5
-rw-r--r--compiler/rustc_middle/src/hir/map/mod.rs24
-rw-r--r--compiler/rustc_middle/src/lib.rs1
-rw-r--r--compiler/rustc_middle/src/middle/region.rs5
-rw-r--r--compiler/rustc_middle/src/middle/resolve_lifetime.rs15
-rw-r--r--compiler/rustc_middle/src/mir/interpret/allocation.rs81
-rw-r--r--compiler/rustc_middle/src/mir/interpret/error.rs2
-rw-r--r--compiler/rustc_middle/src/mir/interpret/value.rs2
-rw-r--r--compiler/rustc_middle/src/mir/predecessors.rs4
-rw-r--r--compiler/rustc_middle/src/mir/switch_sources.rs4
-rw-r--r--compiler/rustc_middle/src/mir/traversal.rs10
-rw-r--r--compiler/rustc_middle/src/query/mod.rs11
-rw-r--r--compiler/rustc_middle/src/ty/context.rs57
-rw-r--r--compiler/rustc_middle/src/ty/mod.rs4
-rw-r--r--compiler/rustc_middle/src/ty/print/pretty.rs54
-rw-r--r--compiler/rustc_middle/src/ty/query.rs6
-rw-r--r--compiler/rustc_middle/src/ty/sty.rs7
-rw-r--r--compiler/rustc_mir_build/src/build/expr/as_place.rs4
-rw-r--r--compiler/rustc_mir_build/src/build/matches/mod.rs4
-rw-r--r--compiler/rustc_mir_transform/src/coverage/counters.rs8
-rw-r--r--compiler/rustc_mir_transform/src/coverage/debug.rs28
-rw-r--r--compiler/rustc_mir_transform/src/inline.rs25
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs64
-rw-r--r--compiler/rustc_passes/src/check_attr.rs52
-rw-r--r--compiler/rustc_passes/src/lib.rs1
-rw-r--r--compiler/rustc_passes/src/reachable.rs33
-rw-r--r--compiler/rustc_plugin_impl/src/lib.rs1
-rw-r--r--compiler/rustc_privacy/src/lib.rs1
-rw-r--r--compiler/rustc_query_impl/src/lib.rs1
-rw-r--r--compiler/rustc_query_impl/src/on_disk_cache.rs5
-rw-r--r--compiler/rustc_resolve/src/late.rs12
-rw-r--r--compiler/rustc_resolve/src/late/diagnostics.rs29
-rw-r--r--compiler/rustc_resolve/src/late/lifetimes.rs401
-rw-r--r--compiler/rustc_resolve/src/lib.rs6
-rw-r--r--compiler/rustc_resolve/src/macros.rs23
-rw-r--r--compiler/rustc_save_analysis/src/lib.rs1
-rw-r--r--compiler/rustc_serialize/src/collection_impls.rs94
-rw-r--r--compiler/rustc_serialize/src/json.rs2368
-rw-r--r--compiler/rustc_serialize/src/json/tests.rs147
-rw-r--r--compiler/rustc_serialize/src/lib.rs3
-rw-r--r--compiler/rustc_serialize/src/opaque.rs10
-rw-r--r--compiler/rustc_serialize/src/serialize.rs183
-rw-r--r--compiler/rustc_serialize/tests/json.rs978
-rw-r--r--compiler/rustc_session/src/config.rs12
-rw-r--r--compiler/rustc_session/src/options.rs9
-rw-r--r--compiler/rustc_span/src/def_id.rs7
-rw-r--r--compiler/rustc_span/src/lib.rs166
-rw-r--r--compiler/rustc_symbol_mangling/src/lib.rs1
-rw-r--r--compiler/rustc_target/Cargo.toml1
-rw-r--r--compiler/rustc_target/src/abi/mod.rs12
-rw-r--r--compiler/rustc_target/src/json.rs91
-rw-r--r--compiler/rustc_target/src/lib.rs2
-rw-r--r--compiler/rustc_target/src/spec/crt_objects.rs2
-rw-r--r--compiler/rustc_target/src/spec/mod.rs118
-rw-r--r--compiler/rustc_target/src/spec/riscv32imac_unknown_xous_elf.rs24
-rw-r--r--compiler/rustc_target/src/tests.rs8
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs56
-rw-r--r--compiler/rustc_trait_selection/src/traits/misc.rs4
-rw-r--r--compiler/rustc_trait_selection/src/traits/project.rs4
-rw-r--r--compiler/rustc_traits/src/lib.rs1
-rw-r--r--compiler/rustc_ty_utils/src/lib.rs1
-rw-r--r--compiler/rustc_type_ir/src/sty.rs222
-rw-r--r--compiler/rustc_typeck/src/astconv/mod.rs364
-rw-r--r--compiler/rustc_typeck/src/check/expr.rs2
-rw-r--r--compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs1
-rw-r--r--compiler/rustc_typeck/src/check/fn_ctxt/checks.rs7
-rw-r--r--compiler/rustc_typeck/src/check/generator_interior/drop_ranges/cfg_build.rs1
-rw-r--r--compiler/rustc_typeck/src/check/regionck.rs4
-rw-r--r--compiler/rustc_typeck/src/check/upvar.rs2
-rw-r--r--compiler/rustc_typeck/src/check_unused.rs56
-rw-r--r--compiler/rustc_typeck/src/coherence/builtin.rs6
-rw-r--r--compiler/rustc_typeck/src/collect.rs86
-rw-r--r--compiler/rustc_typeck/src/collect/type_of.rs19
-rw-r--r--compiler/rustc_typeck/src/lib.rs1
-rw-r--r--compiler/rustc_typeck/src/structured_errors/wrong_number_of_generic_args.rs105
-rw-r--r--config.toml.example6
-rw-r--r--library/alloc/src/boxed/thin.rs65
-rw-r--r--library/alloc/src/lib.rs2
-rw-r--r--library/alloc/tests/lib.rs3
-rw-r--r--library/alloc/tests/thin_box.rs229
-rw-r--r--library/core/src/ptr/const_ptr.rs4
-rw-r--r--library/core/src/ptr/mod.rs4
-rw-r--r--library/core/src/ptr/mut_ptr.rs4
-rw-r--r--library/core/tests/lib.rs1
-rw-r--r--library/core/tests/ptr.rs40
-rw-r--r--library/panic_abort/src/lib.rs1
-rw-r--r--library/panic_unwind/src/lib.rs1
-rw-r--r--library/proc_macro/src/bridge/buffer.rs13
-rw-r--r--library/proc_macro/src/lib.rs1
-rw-r--r--library/profiler_builtins/src/lib.rs1
-rw-r--r--library/std/src/collections/hash/set.rs6
-rw-r--r--library/std/src/keyword_docs.rs2
-rw-r--r--library/std/src/lib.rs2
-rw-r--r--library/std/src/sys/hermit/condvar.rs10
-rw-r--r--library/std/src/sys/hermit/mutex.rs3
-rw-r--r--library/std/src/sys/hermit/rwlock.rs6
-rw-r--r--library/std/src/sys/itron/condvar.rs2
-rw-r--r--library/std/src/sys/itron/mutex.rs4
-rw-r--r--library/std/src/sys/sgx/condvar.rs15
-rw-r--r--library/std/src/sys/sgx/mutex.rs12
-rw-r--r--library/std/src/sys/sgx/rwlock.rs12
-rw-r--r--library/std/src/sys/solid/rwlock.rs4
-rw-r--r--library/std/src/sys/unix/locks/futex.rs9
-rw-r--r--library/std/src/sys/unix/locks/futex_rwlock.rs3
-rw-r--r--library/std/src/sys/unix/locks/mod.rs10
-rw-r--r--library/std/src/sys/unix/locks/pthread_condvar.rs28
-rw-r--r--library/std/src/sys/unix/locks/pthread_mutex.rs22
-rw-r--r--library/std/src/sys/unix/locks/pthread_rwlock.rs18
-rw-r--r--library/std/src/sys/unix/mod.rs10
-rw-r--r--library/std/src/sys/unix/process/process_unix.rs82
-rw-r--r--library/std/src/sys/unix/process/process_unix/tests.rs6
-rw-r--r--library/std/src/sys/unsupported/locks/condvar.rs6
-rw-r--r--library/std/src/sys/unsupported/locks/mutex.rs3
-rw-r--r--library/std/src/sys/unsupported/locks/rwlock.rs3
-rw-r--r--library/std/src/sys/wasm/mod.rs4
-rw-r--r--library/std/src/sys/windows/locks/condvar.rs7
-rw-r--r--library/std/src/sys/windows/locks/mutex.rs5
-rw-r--r--library/std/src/sys/windows/locks/rwlock.rs5
-rw-r--r--library/std/src/sys/windows/mod.rs6
-rw-r--r--library/std/src/sys_common/condvar.rs10
-rw-r--r--library/std/src/sys_common/condvar/check.rs3
-rw-r--r--library/std/src/sys_common/lazy_box.rs77
-rw-r--r--library/std/src/sys_common/mod.rs1
-rw-r--r--library/std/src/sys_common/mutex.rs10
-rw-r--r--library/std/src/sys_common/remutex.rs7
-rw-r--r--library/std/src/sys_common/rwlock.rs8
-rw-r--r--library/test/src/lib.rs1
-rw-r--r--library/unwind/src/lib.rs1
-rw-r--r--src/bootstrap/Cargo.toml6
-rw-r--r--src/bootstrap/bootstrap.py3
-rw-r--r--src/bootstrap/builder.rs43
-rw-r--r--src/bootstrap/config.rs1
-rw-r--r--src/bootstrap/flags.rs2
-rw-r--r--src/bootstrap/lib.rs12
-rw-r--r--src/bootstrap/metrics.rs208
-rw-r--r--src/bootstrap/native.rs3
-rw-r--r--src/bootstrap/test.rs7
-rw-r--r--src/ci/azure-pipelines/auto.yml26
-rw-r--r--src/ci/azure-pipelines/try.yml22
-rw-r--r--src/ci/github-actions/ci.yml4
-rwxr-xr-xsrc/ci/init_repo.sh4
-rwxr-xr-xsrc/ci/pgo.sh46
-rwxr-xr-xsrc/ci/run.sh1
-rwxr-xr-xsrc/ci/scripts/clean-disk.sh16
-rwxr-xr-xsrc/ci/scripts/disable-git-crlf-conversion.sh2
-rwxr-xr-xsrc/ci/scripts/setup-environment.sh15
-rwxr-xr-xsrc/ci/scripts/symlink-build-dir.sh15
-rwxr-xr-xsrc/ci/scripts/upload-artifacts.sh13
-rw-r--r--src/ci/shared.sh31
-rw-r--r--src/doc/rustc/src/SUMMARY.md1
-rw-r--r--src/doc/rustc/src/platform-support.md1
-rw-r--r--src/doc/rustc/src/platform-support/riscv32imac-unknown-xous-elf.md50
-rw-r--r--src/etc/htmldocck.py47
-rw-r--r--src/librustdoc/clean/mod.rs23
-rw-r--r--src/librustdoc/formats/mod.rs17
-rw-r--r--src/librustdoc/html/render/mod.rs12
-rw-r--r--src/librustdoc/html/render/print_item.rs2
-rw-r--r--src/librustdoc/html/static/.eslintrc.js14
-rw-r--r--src/librustdoc/html/static/css/themes/ayu.css6
-rw-r--r--src/librustdoc/html/static/css/themes/dark.css1
-rw-r--r--src/librustdoc/html/static/css/themes/light.css1
-rw-r--r--src/librustdoc/html/static/js/main.js2
-rw-r--r--src/librustdoc/lib.rs2
-rw-r--r--src/librustdoc/passes/stripper.rs5
m---------src/llvm-project0
-rw-r--r--src/test/debuginfo/thread-names.rs51
-rw-r--r--src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir126
-rw-r--r--src/test/mir-opt/match_false_edges.full_tested_match2.PromoteTemps.before.mir120
-rw-r--r--src/test/mir-opt/match_false_edges.main.PromoteTemps.before.mir174
-rw-r--r--src/test/mir-opt/match_false_edges.rs2
-rw-r--r--src/test/mir-opt/nll/named-lifetimes-basic.rs4
-rw-r--r--src/test/mir-opt/nll/region-subtyping-basic.rs4
-rw-r--r--src/test/run-make-fulldeps/rustdoc-error-lines/input.rs6
-rw-r--r--src/test/rustdoc/empty-impl-block.rs20
-rw-r--r--src/test/ui-fulldeps/extern-mod-syntax.rs4
-rw-r--r--src/test/ui-fulldeps/issue-11881.rs66
-rw-r--r--src/test/ui-fulldeps/issue-15924.rs43
-rw-r--r--src/test/ui-fulldeps/issue-2804.rs33
-rw-r--r--src/test/ui/associated-type-bounds/implied-region-constraints.base.stderr21
-rw-r--r--src/test/ui/associated-type-bounds/implied-region-constraints.rs10
-rw-r--r--src/test/ui/associated-type-bounds/implied-region-constraints.stderr (renamed from src/test/ui/associated-type-bounds/implied-region-constraints.nll.stderr)4
-rw-r--r--src/test/ui/associated-types/associated-types-eq-hr.base.stderr92
-rw-r--r--src/test/ui/associated-types/associated-types-eq-hr.rs9
-rw-r--r--src/test/ui/associated-types/associated-types-eq-hr.stderr (renamed from src/test/ui/associated-types/associated-types-eq-hr.nll.stderr)12
-rw-r--r--src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.base.stderr14
-rw-r--r--src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.rs9
-rw-r--r--src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.stderr (renamed from src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.nll.stderr)4
-rw-r--r--src/test/ui/associated-types/associated-types-subtyping-1.base.stderr21
-rw-r--r--src/test/ui/associated-types/associated-types-subtyping-1.rs10
-rw-r--r--src/test/ui/associated-types/associated-types-subtyping-1.stderr (renamed from src/test/ui/associated-types/associated-types-subtyping-1.nll.stderr)4
-rw-r--r--src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.krisskross.stderr25
-rw-r--r--src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.rs55
-rw-r--r--src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.transmute.stderr11
-rw-r--r--src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.stderr31
-rw-r--r--src/test/ui/associated-types/cache/project-fn-ret-contravariant.rs12
-rw-r--r--src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.stderr9
-rw-r--r--src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.krisskross.stderr36
-rw-r--r--src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.oneuse.stderr36
-rw-r--r--src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.rs69
-rw-r--r--src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.transmute.stderr15
-rw-r--r--src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.stderr40
-rw-r--r--src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.stderr42
-rw-r--r--src/test/ui/associated-types/cache/project-fn-ret-invariant.rs17
-rw-r--r--src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr20
-rw-r--r--src/test/ui/associated-types/higher-ranked-projection.bad.nll.stderr17
-rw-r--r--src/test/ui/associated-types/higher-ranked-projection.bad.stderr6
-rw-r--r--src/test/ui/associated-types/higher-ranked-projection.badbase.stderr2
-rw-r--r--src/test/ui/associated-types/higher-ranked-projection.badnll.stderr17
-rw-r--r--src/test/ui/associated-types/higher-ranked-projection.rs9
-rw-r--r--src/test/ui/ast-json/ast-json-ice.rs56
-rw-r--r--src/test/ui/ast-json/ast-json-noexpand-output.rs10
-rw-r--r--src/test/ui/ast-json/ast-json-noexpand-output.stdout1
-rw-r--r--src/test/ui/ast-json/ast-json-output.rs10
-rw-r--r--src/test/ui/ast-json/ast-json-output.stdout1
-rw-r--r--src/test/ui/async-await/issue-76547.base.stderr31
-rw-r--r--src/test/ui/async-await/issue-76547.rs10
-rw-r--r--src/test/ui/async-await/issue-76547.stderr (renamed from src/test/ui/async-await/issue-76547.nll.stderr)4
-rw-r--r--src/test/ui/async-await/issues/issue-62097.base.stderr18
-rw-r--r--src/test/ui/async-await/issues/issue-62097.rs9
-rw-r--r--src/test/ui/async-await/issues/issue-62097.stderr (renamed from src/test/ui/async-await/issues/issue-62097.nll.stderr)7
-rw-r--r--src/test/ui/async-await/issues/issue-63388-1.base.stderr12
-rw-r--r--src/test/ui/async-await/issues/issue-63388-1.rs7
-rw-r--r--src/test/ui/async-await/issues/issue-63388-1.stderr (renamed from src/test/ui/async-await/issues/issue-63388-1.nll.stderr)3
-rw-r--r--src/test/ui/async-await/issues/issue-72312.base.stderr23
-rw-r--r--src/test/ui/async-await/issues/issue-72312.rs21
-rw-r--r--src/test/ui/async-await/issues/issue-72312.stderr (renamed from src/test/ui/async-await/issues/issue-72312.nll.stderr)3
-rw-r--r--src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.base.stderr34
-rw-r--r--src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.rs7
-rw-r--r--src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr (renamed from src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.nll.stderr)5
-rw-r--r--src/test/ui/attributes/attrs-on-params.rs2
-rw-r--r--src/test/ui/attributes/attrs-on-params.stderr2
-rw-r--r--src/test/ui/borrowck/borrowck-drop-from-guard.rs2
-rw-r--r--src/test/ui/borrowck/borrowck-drop-from-guard.stderr2
-rw-r--r--src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.edition.stderr13
-rw-r--r--src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.rs30
-rw-r--r--src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.zflag.stderr13
-rw-r--r--src/test/ui/borrowck/borrowck-local-borrow.rs3
-rw-r--r--src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.base.stderr13
-rw-r--r--src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.rs7
-rw-r--r--src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.stderr (renamed from src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.nll.stderr)2
-rw-r--r--src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.nll.stderr54
-rw-r--r--src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs26
-rw-r--r--src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr (renamed from src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.migrate.stderr)12
-rw-r--r--src/test/ui/borrowck/issue-71546.rs10
-rw-r--r--src/test/ui/borrowck/issue-71546.stderr59
-rw-r--r--src/test/ui/borrowck/two-phase-activation-sharing-interference.nll_target.stderr8
-rw-r--r--src/test/ui/borrowck/two-phase-activation-sharing-interference.rs4
-rw-r--r--src/test/ui/borrowck/two-phase-allow-access-during-reservation.nll_target.stderr4
-rw-r--r--src/test/ui/borrowck/two-phase-allow-access-during-reservation.rs4
-rw-r--r--src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.rs2
-rw-r--r--src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.stderr2
-rw-r--r--src/test/ui/borrowck/two-phase-method-receivers.rs2
-rw-r--r--src/test/ui/borrowck/two-phase-multiple-activations.rs2
-rw-r--r--src/test/ui/borrowck/two-phase-nonrecv-autoref.base.stderr22
-rw-r--r--src/test/ui/borrowck/two-phase-nonrecv-autoref.nll.stderr93
-rw-r--r--src/test/ui/borrowck/two-phase-nonrecv-autoref.rs5
-rw-r--r--src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2015.stderr25
-rw-r--r--src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2018.stderr25
-rw-r--r--src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll.stderr25
-rw-r--r--src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2015.stderr25
-rw-r--r--src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2018.stderr25
-rw-r--r--src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.rs14
-rw-r--r--src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.stderr (renamed from src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.base.stderr)4
-rw-r--r--src/test/ui/borrowck/two-phase-reservation-sharing-interference.nll_target.stderr2
-rw-r--r--src/test/ui/borrowck/two-phase-reservation-sharing-interference.rs4
-rw-r--r--src/test/ui/borrowck/two-phase-sneaky.rs2
-rw-r--r--src/test/ui/borrowck/two-phase-sneaky.stderr2
-rw-r--r--src/test/ui/cast/casts-issue-46365.rs3
-rw-r--r--src/test/ui/check-cfg/well-known-values.stderr2
-rw-r--r--src/test/ui/closure-expected-type/expect-fn-supply-fn.base.stderr68
-rw-r--r--src/test/ui/closure-expected-type/expect-fn-supply-fn.rs10
-rw-r--r--src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr (renamed from src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr)10
-rw-r--r--src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.base.stderr28
-rw-r--r--src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.rs9
-rw-r--r--src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.stderr (renamed from src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.nll.stderr)8
-rw-r--r--src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.base.stderr55
-rw-r--r--src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.rs10
-rw-r--r--src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.stderr (renamed from src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.nll.stderr)4
-rw-r--r--src/test/ui/codegen/auxiliary/issue-97708-aux.rs41
-rw-r--r--src/test/ui/codegen/issue-97708.rs9
-rw-r--r--src/test/ui/conditional-compilation/cfg_accessible-bugs.rs18
-rw-r--r--src/test/ui/conditional-compilation/cfg_accessible-bugs.stderr16
-rw-r--r--src/test/ui/conditional-compilation/cfg_accessible-not_sure.edition2015.stderr122
-rw-r--r--src/test/ui/conditional-compilation/cfg_accessible-not_sure.edition2021.stderr122
-rw-r--r--src/test/ui/conditional-compilation/cfg_accessible-not_sure.rs89
-rw-r--r--src/test/ui/conditional-compilation/cfg_accessible-private.rs21
-rw-r--r--src/test/ui/conditional-compilation/cfg_accessible.rs38
-rw-r--r--src/test/ui/conditional-compilation/cfg_accessible.stderr45
-rw-r--r--src/test/ui/const-generics/invariant.base.stderr26
-rw-r--r--src/test/ui/const-generics/invariant.rs4
-rw-r--r--src/test/ui/const-generics/invariant.stderr (renamed from src/test/ui/const-generics/invariant.nll.stderr)4
-rw-r--r--src/test/ui/consts/const-blocks/migrate-fail.rs2
-rw-r--r--src/test/ui/consts/const-blocks/migrate-fail.stderr4
-rw-r--r--src/test/ui/consts/const-blocks/migrate-pass.rs2
-rw-r--r--src/test/ui/consts/const-blocks/nll-fail.rs1
-rw-r--r--src/test/ui/consts/const-blocks/nll-fail.stderr4
-rw-r--r--src/test/ui/consts/const-blocks/nll-pass.rs1
-rw-r--r--src/test/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr144
-rw-r--r--src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs21
-rw-r--r--src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr16
-rw-r--r--src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr16
-rw-r--r--src/test/ui/consts/const-eval/ref_to_int_match.rs4
-rw-r--r--src/test/ui/consts/const-eval/ub-enum.32bit.stderr75
-rw-r--r--src/test/ui/consts/const-eval/ub-enum.64bit.stderr75
-rw-r--r--src/test/ui/consts/const-eval/ub-enum.rs16
-rw-r--r--src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr77
-rw-r--r--src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr77
-rw-r--r--src/test/ui/consts/const-eval/ub-ref-ptr.rs15
-rw-r--r--src/test/ui/consts/const-eval/ub-wide-ptr.32bit.stderr97
-rw-r--r--src/test/ui/consts/const-eval/ub-wide-ptr.64bit.stderr97
-rw-r--r--src/test/ui/consts/const-eval/ub-wide-ptr.rs13
-rw-r--r--src/test/ui/consts/miri_unleashed/ptr_arith.stderr2
-rw-r--r--src/test/ui/consts/ptr_comparisons.stderr2
-rw-r--r--src/test/ui/derives/issue-97343.rs2
-rw-r--r--src/test/ui/derives/issue-97343.stderr12
-rw-r--r--src/test/ui/error-codes/E0109.stderr12
-rw-r--r--src/test/ui/error-codes/E0110.stderr12
-rw-r--r--src/test/ui/error-codes/E0161.base.stderr (renamed from src/test/ui/error-codes/E0161.edition.stderr)2
-rw-r--r--src/test/ui/error-codes/E0161.migrate.stderr9
-rw-r--r--src/test/ui/error-codes/E0161.nll.stderr9
-rw-r--r--src/test/ui/error-codes/E0161.rs26
-rw-r--r--src/test/ui/error-codes/E0161.zflags.stderr9
-rw-r--r--src/test/ui/error-codes/E0490.base.stderr76
-rw-r--r--src/test/ui/error-codes/E0490.nll.stderr28
-rw-r--r--src/test/ui/error-codes/E0490.rs14
-rw-r--r--src/test/ui/feature-gates/feature-gate-nll.rs18
-rw-r--r--src/test/ui/feature-gates/feature-gate-nll.stderr14
-rw-r--r--src/test/ui/fn/implied-bounds-unnorm-associated-type.base.stderr13
-rw-r--r--src/test/ui/fn/implied-bounds-unnorm-associated-type.rs7
-rw-r--r--src/test/ui/fn/implied-bounds-unnorm-associated-type.stderr (renamed from src/test/ui/fn/implied-bounds-unnorm-associated-type.nll.stderr)2
-rw-r--r--src/test/ui/generator/auto-trait-regions.base.stderr38
-rw-r--r--src/test/ui/generator/auto-trait-regions.rs10
-rw-r--r--src/test/ui/generator/auto-trait-regions.stderr (renamed from src/test/ui/generator/auto-trait-regions.nll.stderr)8
-rw-r--r--src/test/ui/generator/generator-region-requirements.base.stderr15
-rw-r--r--src/test/ui/generator/generator-region-requirements.rs7
-rw-r--r--src/test/ui/generator/generator-region-requirements.stderr (renamed from src/test/ui/generator/generator-region-requirements.nll.stderr)2
-rw-r--r--src/test/ui/generator/issue-87142.rs32
-rw-r--r--src/test/ui/generator/resume-arg-late-bound.base.stderr49
-rw-r--r--src/test/ui/generator/resume-arg-late-bound.rs5
-rw-r--r--src/test/ui/generator/resume-arg-late-bound.stderr (renamed from src/test/ui/generator/resume-arg-late-bound.nll.stderr)4
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-89352.base.stderr22
-rw-r--r--src/test/ui/generic-associated-types/elided-in-expr-position.stderr4
-rw-r--r--src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr18
-rw-r--r--src/test/ui/generic-associated-types/extended/lending_iterator.rs3
-rw-r--r--src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs5
-rw-r--r--src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr31
-rw-r--r--src/test/ui/generic-associated-types/issue-81862.stderr2
-rw-r--r--src/test/ui/generic-associated-types/issue-89352.rs (renamed from src/test/ui/generic-associated-types/bugs/issue-89352.rs)14
-rw-r--r--src/test/ui/generic-associated-types/issue-91139.rs12
-rw-r--r--src/test/ui/generic-associated-types/issue-92096.rs8
-rw-r--r--src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.base.stderr33
-rw-r--r--src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs13
-rw-r--r--src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.stderr (renamed from src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.nll.stderr)6
-rw-r--r--src/test/ui/generic-associated-types/trait-objects.base.stderr4
-rw-r--r--src/test/ui/generic-associated-types/trait-objects.extended.stderr15
-rw-r--r--src/test/ui/generic-associated-types/trait-objects.rs4
-rw-r--r--src/test/ui/higher-rank-trait-bounds/issue-59311.base.stderr15
-rw-r--r--src/test/ui/higher-rank-trait-bounds/issue-59311.rs9
-rw-r--r--src/test/ui/higher-rank-trait-bounds/issue-59311.stderr (renamed from src/test/ui/higher-rank-trait-bounds/issue-59311.nll.stderr)6
-rw-r--r--src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.base.stderr20
-rw-r--r--src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.migrate.stderr77
-rw-r--r--src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.rs14
-rw-r--r--src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.stderr (renamed from src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.nll.stderr)24
-rw-r--r--src/test/ui/hr-subtype/hr-subtype-nll.bound_a_b_ret_a_vs_bound_a_ret_a.stderr17
-rw-r--r--src/test/ui/hr-subtype/hr-subtype-nll.bound_a_vs_free_x.stderr17
-rw-r--r--src/test/ui/hr-subtype/hr-subtype-nll.bound_inv_a_b_vs_bound_inv_a.stderr31
-rw-r--r--src/test/ui/hr-subtype/hr-subtype-nll.free_inv_x_vs_free_inv_y.stderr42
-rw-r--r--src/test/ui/hr-subtype/hr-subtype-nll.free_x_vs_free_y.stderr19
-rw-r--r--src/test/ui/hr-subtype/hr-subtype-nll.rs117
-rw-r--r--src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr4
-rw-r--r--src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr6
-rw-r--r--src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr20
-rw-r--r--src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr69
-rw-r--r--src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.stderr32
-rw-r--r--src/test/ui/hr-subtype/hr-subtype.rs10
-rw-r--r--src/test/ui/hr-subtype/placeholder-pattern-fail.base.stderr42
-rw-r--r--src/test/ui/hr-subtype/placeholder-pattern-fail.rs6
-rw-r--r--src/test/ui/hr-subtype/placeholder-pattern-fail.stderr (renamed from src/test/ui/hr-subtype/placeholder-pattern-fail.nll.stderr)2
-rw-r--r--src/test/ui/hrtb/hrtb-conflate-regions.base.stderr11
-rw-r--r--src/test/ui/hrtb/hrtb-conflate-regions.rs9
-rw-r--r--src/test/ui/hrtb/hrtb-conflate-regions.stderr (renamed from src/test/ui/hrtb/hrtb-conflate-regions.nll.stderr)4
-rw-r--r--src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.base.stderr11
-rw-r--r--src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.rs4
-rw-r--r--src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.stderr (renamed from src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.nll.stderr)2
-rw-r--r--src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.base.stderr11
-rw-r--r--src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.rs4
-rw-r--r--src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.stderr (renamed from src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.nll.stderr)2
-rw-r--r--src/test/ui/hrtb/hrtb-just-for-static.base.stderr20
-rw-r--r--src/test/ui/hrtb/hrtb-just-for-static.rs9
-rw-r--r--src/test/ui/hrtb/hrtb-just-for-static.stderr (renamed from src/test/ui/hrtb/hrtb-just-for-static.nll.stderr)6
-rw-r--r--src/test/ui/hrtb/hrtb-perfect-forwarding.base.stderr20
-rw-r--r--src/test/ui/hrtb/hrtb-perfect-forwarding.rs15
-rw-r--r--src/test/ui/hrtb/hrtb-perfect-forwarding.stderr (renamed from src/test/ui/hrtb/hrtb-perfect-forwarding.nll.stderr)14
-rw-r--r--src/test/ui/hrtb/issue-30786.nll.stderr53
-rw-r--r--src/test/ui/hrtb/issue-30786.rs4
-rw-r--r--src/test/ui/hrtb/issue-30786.stderr (renamed from src/test/ui/hrtb/issue-30786.base.stderr)28
-rw-r--r--src/test/ui/hrtb/issue-46989.base.stderr11
-rw-r--r--src/test/ui/hrtb/issue-46989.rs4
-rw-r--r--src/test/ui/hrtb/issue-46989.stderr (renamed from src/test/ui/hrtb/issue-46989.nll.stderr)2
-rw-r--r--src/test/ui/impl-header-lifetime-elision/dyn-trait.base.stderr17
-rw-r--r--src/test/ui/impl-header-lifetime-elision/dyn-trait.rs7
-rw-r--r--src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr (renamed from src/test/ui/impl-header-lifetime-elision/dyn-trait.nll.stderr)2
-rw-r--r--src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-elided.rs4
-rw-r--r--src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs2
-rw-r--r--src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original.rs2
-rw-r--r--src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-other.rs2
-rw-r--r--src/test/ui/impl-trait/must_outlive_least_region_or_bound.base.stderr227
-rw-r--r--src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs23
-rw-r--r--src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr (renamed from src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr)20
-rw-r--r--src/test/ui/impl-trait/type_parameters_captured.base.stderr14
-rw-r--r--src/test/ui/impl-trait/type_parameters_captured.rs7
-rw-r--r--src/test/ui/impl-trait/type_parameters_captured.stderr (renamed from src/test/ui/impl-trait/type_parameters_captured.nll.stderr)2
-rw-r--r--src/test/ui/impl-trait/universal_wrong_hrtb.rs8
-rw-r--r--src/test/ui/impl-trait/universal_wrong_hrtb.stderr14
-rw-r--r--src/test/ui/issues/issue-10291.base.stderr25
-rw-r--r--src/test/ui/issues/issue-10291.rs7
-rw-r--r--src/test/ui/issues/issue-10291.stderr (renamed from src/test/ui/issues/issue-10291.nll.stderr)2
-rw-r--r--src/test/ui/issues/issue-13058.base.stderr12
-rw-r--r--src/test/ui/issues/issue-13058.rs4
-rw-r--r--src/test/ui/issues/issue-13058.stderr (renamed from src/test/ui/issues/issue-13058.nll.stderr)2
-rw-r--r--src/test/ui/issues/issue-15034.base.stderr11
-rw-r--r--src/test/ui/issues/issue-15034.rs4
-rw-r--r--src/test/ui/issues/issue-15034.stderr (renamed from src/test/ui/issues/issue-15034.nll.stderr)2
-rw-r--r--src/test/ui/issues/issue-16683.base.stderr32
-rw-r--r--src/test/ui/issues/issue-16683.rs7
-rw-r--r--src/test/ui/issues/issue-16683.stderr (renamed from src/test/ui/issues/issue-16683.nll.stderr)2
-rw-r--r--src/test/ui/issues/issue-16922.base.stderr16
-rw-r--r--src/test/ui/issues/issue-16922.rs7
-rw-r--r--src/test/ui/issues/issue-16922.stderr (renamed from src/test/ui/issues/issue-16922.nll.stderr)2
-rw-r--r--src/test/ui/issues/issue-17728.base.stderr39
-rw-r--r--src/test/ui/issues/issue-17728.rs5
-rw-r--r--src/test/ui/issues/issue-17728.stderr (renamed from src/test/ui/issues/issue-17728.nll.stderr)2
-rw-r--r--src/test/ui/issues/issue-17758.base.stderr32
-rw-r--r--src/test/ui/issues/issue-17758.rs7
-rw-r--r--src/test/ui/issues/issue-17758.stderr (renamed from src/test/ui/issues/issue-17758.nll.stderr)2
-rw-r--r--src/test/ui/issues/issue-22706.rs2
-rw-r--r--src/test/ui/issues/issue-22706.stderr6
-rw-r--r--src/test/ui/issues/issue-26217.base.stderr9
-rw-r--r--src/test/ui/issues/issue-26217.rs7
-rw-r--r--src/test/ui/issues/issue-26217.stderr (renamed from src/test/ui/issues/issue-26217.nll.stderr)2
-rw-r--r--src/test/ui/issues/issue-40000.base.stderr12
-rw-r--r--src/test/ui/issues/issue-40000.rs8
-rw-r--r--src/test/ui/issues/issue-40000.stderr (renamed from src/test/ui/issues/issue-40000.nll.stderr)4
-rw-r--r--src/test/ui/issues/issue-46983.base.stderr11
-rw-r--r--src/test/ui/issues/issue-46983.rs7
-rw-r--r--src/test/ui/issues/issue-46983.stderr (renamed from src/test/ui/issues/issue-46983.nll.stderr)2
-rw-r--r--src/test/ui/issues/issue-52533.base.stderr20
-rw-r--r--src/test/ui/issues/issue-52533.rs7
-rw-r--r--src/test/ui/issues/issue-52533.stderr (renamed from src/test/ui/issues/issue-52533.nll.stderr)2
-rw-r--r--src/test/ui/issues/issue-54302-cases.base.stderr38
-rw-r--r--src/test/ui/issues/issue-54302-cases.rs4
-rw-r--r--src/test/ui/issues/issue-54302-cases.stderr (renamed from src/test/ui/issues/issue-54302-cases.nll.stderr)8
-rw-r--r--src/test/ui/issues/issue-54943.base.stderr15
-rw-r--r--src/test/ui/issues/issue-54943.rs4
-rw-r--r--src/test/ui/issues/issue-54943.stderr (renamed from src/test/ui/issues/issue-54943.nll.stderr)2
-rw-r--r--src/test/ui/issues/issue-55731.base.stderr11
-rw-r--r--src/test/ui/issues/issue-55731.rs4
-rw-r--r--src/test/ui/issues/issue-55731.stderr (renamed from src/test/ui/issues/issue-55731.nll.stderr)2
-rw-r--r--src/test/ui/issues/issue-55796.base.stderr53
-rw-r--r--src/test/ui/issues/issue-55796.rs10
-rw-r--r--src/test/ui/issues/issue-55796.stderr (renamed from src/test/ui/issues/issue-55796.nll.stderr)4
-rw-r--r--src/test/ui/issues/issue-57924.rs2
-rw-r--r--src/test/ui/issues/issue-57924.stderr6
-rw-r--r--src/test/ui/issues/issue-60989.rs4
-rw-r--r--src/test/ui/issues/issue-60989.stderr12
-rw-r--r--src/test/ui/issues/issue-75777.base.stderr30
-rw-r--r--src/test/ui/issues/issue-75777.rs7
-rw-r--r--src/test/ui/issues/issue-75777.stderr (renamed from src/test/ui/issues/issue-75777.nll.stderr)2
-rw-r--r--src/test/ui/kindck/kindck-impl-type-params.base.stderr112
-rw-r--r--src/test/ui/kindck/kindck-impl-type-params.rs5
-rw-r--r--src/test/ui/kindck/kindck-impl-type-params.stderr (renamed from src/test/ui/kindck/kindck-impl-type-params.nll.stderr)24
-rw-r--r--src/test/ui/kindck/kindck-send-object1.base.stderr45
-rw-r--r--src/test/ui/kindck/kindck-send-object1.rs5
-rw-r--r--src/test/ui/kindck/kindck-send-object1.stderr (renamed from src/test/ui/kindck/kindck-send-object1.nll.stderr)8
-rw-r--r--src/test/ui/lifetimes/copy_modulo_regions.rs2
-rw-r--r--src/test/ui/lifetimes/copy_modulo_regions.stderr2
-rw-r--r--src/test/ui/lifetimes/issue-79187-2.base.stderr60
-rw-r--r--src/test/ui/lifetimes/issue-79187-2.rs19
-rw-r--r--src/test/ui/lifetimes/issue-79187-2.stderr (renamed from src/test/ui/lifetimes/issue-79187-2.nll.stderr)20
-rw-r--r--src/test/ui/lifetimes/issue-79187.base.stderr11
-rw-r--r--src/test/ui/lifetimes/issue-79187.rs6
-rw-r--r--src/test/ui/lifetimes/issue-79187.stderr (renamed from src/test/ui/lifetimes/issue-79187.nll.stderr)8
-rw-r--r--src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.fixed15
-rw-r--r--src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.rs15
-rw-r--r--src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.stderr44
-rw-r--r--src/test/ui/lifetimes/issue-90170-elision-mismatch.fixed11
-rw-r--r--src/test/ui/lifetimes/issue-90170-elision-mismatch.rs11
-rw-r--r--src/test/ui/lifetimes/issue-90170-elision-mismatch.stderr37
-rw-r--r--src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.base.stderr14
-rw-r--r--src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.rs9
-rw-r--r--src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.stderr (renamed from src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.nll.stderr)6
-rw-r--r--src/test/ui/lifetimes/lifetime-bound-will-change-warning.base.stderr33
-rw-r--r--src/test/ui/lifetimes/lifetime-bound-will-change-warning.rs10
-rw-r--r--src/test/ui/lifetimes/lifetime-bound-will-change-warning.stderr (renamed from src/test/ui/lifetimes/lifetime-bound-will-change-warning.nll.stderr)4
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.base.stderr14
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.rs7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.base.stderr14
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.base.stderr14
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.rs7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.base.stderr11
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.rs4
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.base.stderr12
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs4
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.base.stderr11
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.rs4
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.base.stderr11
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.rs7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.base.stderr12
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.rs7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.base.stderr11
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.rs7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.base.stderr11
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.rs7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.base.stderr17
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.rs7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.base.stderr31
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.rs10
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.nll.stderr)4
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.base.stderr11
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.rs7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.base.stderr11
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.rs7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.base.stderr12
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.base.stderr11
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.rs7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.base.stderr11
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.rs7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.base.stderr11
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.rs7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.base.stderr13
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.rs9
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr)4
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.base.stderr11
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.rs7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.base.stderr11
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.base.stderr11
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.rs7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.base.stderr19
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.base.stderr19
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.base.stderr17
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.rs9
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr)4
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.base.stderr17
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.rs7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.base.stderr17
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs9
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr)4
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.base.stderr17
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.rs7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.nll.stderr)2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/issue_74400.base.stderr11
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/issue_74400.rs11
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/issue_74400.stderr (renamed from src/test/ui/lifetimes/lifetime-errors/issue_74400.nll.stderr)8
-rw-r--r--src/test/ui/lifetimes/re-empty-in-error.base.stderr15
-rw-r--r--src/test/ui/lifetimes/re-empty-in-error.rs10
-rw-r--r--src/test/ui/lifetimes/re-empty-in-error.stderr (renamed from src/test/ui/lifetimes/re-empty-in-error.nll.stderr)2
-rw-r--r--src/test/ui/lint/lint-unsafe-code.rs3
-rw-r--r--src/test/ui/lint/lint-unsafe-code.stderr48
-rw-r--r--src/test/ui/lint/no-coverage.rs55
-rw-r--r--src/test/ui/lint/no-coverage.stderr101
-rw-r--r--src/test/ui/lint/rfc-2383-lint-reason/expect_on_fn_params.rs15
-rw-r--r--src/test/ui/lint/rfc-2383-lint-reason/expect_on_fn_params.stderr10
-rw-r--r--src/test/ui/lub-glb/old-lub-glb-hr-noteq1.basenoleak.stderr15
-rw-r--r--src/test/ui/lub-glb/old-lub-glb-hr-noteq1.leak.stderr (renamed from src/test/ui/lub-glb/old-lub-glb-hr-noteq2.basenoleak.stderr)13
-rw-r--r--src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllleak.stderr21
-rw-r--r--src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllnoleak.stderr12
-rw-r--r--src/test/ui/lub-glb/old-lub-glb-hr-noteq1.noleak.stderr12
-rw-r--r--src/test/ui/lub-glb/old-lub-glb-hr-noteq1.rs13
-rw-r--r--src/test/ui/lub-glb/old-lub-glb-hr-noteq2.leak.stderr (renamed from src/test/ui/lub-glb/old-lub-glb-hr-noteq2.baseleak.stderr)4
-rw-r--r--src/test/ui/lub-glb/old-lub-glb-hr-noteq2.nllleak.stderr21
-rw-r--r--src/test/ui/lub-glb/old-lub-glb-hr-noteq2.rs13
-rw-r--r--src/test/ui/lub-glb/old-lub-glb-object.base.stderr19
-rw-r--r--src/test/ui/lub-glb/old-lub-glb-object.rs9
-rw-r--r--src/test/ui/lub-glb/old-lub-glb-object.stderr (renamed from src/test/ui/lub-glb/old-lub-glb-object.nll.stderr)4
-rw-r--r--src/test/ui/match/match-ref-mut-invariance.base.stderr22
-rw-r--r--src/test/ui/match/match-ref-mut-invariance.rs7
-rw-r--r--src/test/ui/match/match-ref-mut-invariance.stderr (renamed from src/test/ui/match/match-ref-mut-invariance.nll.stderr)2
-rw-r--r--src/test/ui/match/match-ref-mut-let-invariance.base.stderr22
-rw-r--r--src/test/ui/match/match-ref-mut-let-invariance.rs7
-rw-r--r--src/test/ui/match/match-ref-mut-let-invariance.stderr (renamed from src/test/ui/match/match-ref-mut-let-invariance.nll.stderr)2
-rw-r--r--src/test/ui/meta/meta-expected-error-wrong-rev.a.stderr2
-rw-r--r--src/test/ui/meta/meta-expected-error-wrong-rev.rs1
-rw-r--r--src/test/ui/mismatched_types/closure-arg-type-mismatch.base.stderr102
-rw-r--r--src/test/ui/mismatched_types/closure-arg-type-mismatch.rs8
-rw-r--r--src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr (renamed from src/test/ui/mismatched_types/closure-arg-type-mismatch.nll.stderr)6
-rw-r--r--src/test/ui/mismatched_types/closure-mismatch.base.stderr22
-rw-r--r--src/test/ui/mismatched_types/closure-mismatch.rs9
-rw-r--r--src/test/ui/mismatched_types/closure-mismatch.stderr (renamed from src/test/ui/mismatched_types/closure-mismatch.nll.stderr)8
-rw-r--r--src/test/ui/mod-subitem-as-enum-variant.rs2
-rw-r--r--src/test/ui/mod-subitem-as-enum-variant.stderr6
-rw-r--r--src/test/ui/nll/closure-requirements/escape-argument-callee.rs2
-rw-r--r--src/test/ui/nll/closure-requirements/escape-argument.rs2
-rw-r--r--src/test/ui/nll/closure-requirements/escape-upvar-nested.rs2
-rw-r--r--src/test/ui/nll/closure-requirements/escape-upvar-ref.rs2
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs2
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs2
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs2
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs2
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs2
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-approximated-val.rs2
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.rs2
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs2
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs2
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-from-trait-match.rs2
-rw-r--r--src/test/ui/nll/closure-requirements/region-lbr-anon-does-not-outlive-static.rs2
-rw-r--r--src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.rs2
-rw-r--r--src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.rs2
-rw-r--r--src/test/ui/nll/closure-requirements/region-lbr1-does-outlive-lbr2-because-implied-bound.rs2
-rw-r--r--src/test/ui/nll/closure-requirements/return-wrong-bound-region.rs2
-rw-r--r--src/test/ui/nll/constant.rs1
-rw-r--r--src/test/ui/nll/continue-after-missing-main.base.stderr19
-rw-r--r--src/test/ui/nll/continue-after-missing-main.rs5
-rw-r--r--src/test/ui/nll/continue-after-missing-main.stderr (renamed from src/test/ui/nll/continue-after-missing-main.nll.stderr)2
-rw-r--r--src/test/ui/nll/drop-may-dangle.rs1
-rw-r--r--src/test/ui/nll/drop-no-may-dangle.rs2
-rw-r--r--src/test/ui/nll/drop-no-may-dangle.stderr4
-rw-r--r--src/test/ui/nll/extra-unused-mut.rs2
-rw-r--r--src/test/ui/nll/generator-distinct-lifetime.rs2
-rw-r--r--src/test/ui/nll/generator-upvar-mutability.rs2
-rw-r--r--src/test/ui/nll/guarantor-issue-46974.rs2
-rw-r--r--src/test/ui/nll/guarantor-issue-46974.stderr4
-rw-r--r--src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.rs2
-rw-r--r--src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.stderr4
-rw-r--r--src/test/ui/nll/issue-45696-no-variant-box-recur.rs3
-rw-r--r--src/test/ui/nll/issue-48070.rs1
-rw-r--r--src/test/ui/nll/issue-50716.base.stderr18
-rw-r--r--src/test/ui/nll/issue-50716.rs4
-rw-r--r--src/test/ui/nll/issue-50716.stderr (renamed from src/test/ui/nll/issue-50716.nll.stderr)2
-rw-r--r--src/test/ui/nll/issue-51770.rs1
-rw-r--r--src/test/ui/nll/issue-52113.rs2
-rw-r--r--src/test/ui/nll/issue-52113.stderr2
-rw-r--r--src/test/ui/nll/issue-52213.base.stderr32
-rw-r--r--src/test/ui/nll/issue-52213.rs7
-rw-r--r--src/test/ui/nll/issue-52213.stderr (renamed from src/test/ui/nll/issue-52213.nll.stderr)4
-rw-r--r--src/test/ui/nll/issue-52533-1.base.stderr22
-rw-r--r--src/test/ui/nll/issue-52533-1.rs7
-rw-r--r--src/test/ui/nll/issue-52533-1.stderr (renamed from src/test/ui/nll/issue-52533-1.nll.stderr)2
-rw-r--r--src/test/ui/nll/issue-52742.base.stderr20
-rw-r--r--src/test/ui/nll/issue-52742.rs5
-rw-r--r--src/test/ui/nll/issue-52742.stderr (renamed from src/test/ui/nll/issue-52742.nll.stderr)2
-rw-r--r--src/test/ui/nll/issue-54779-anon-static-lifetime.rs2
-rw-r--r--src/test/ui/nll/issue-54779-anon-static-lifetime.stderr2
-rw-r--r--src/test/ui/nll/issue-54943-3.rs1
-rw-r--r--src/test/ui/nll/issue-55394.base.stderr32
-rw-r--r--src/test/ui/nll/issue-55394.rs4
-rw-r--r--src/test/ui/nll/issue-55394.stderr (renamed from src/test/ui/nll/issue-55394.nll.stderr)2
-rw-r--r--src/test/ui/nll/issue-55401.base.stderr16
-rw-r--r--src/test/ui/nll/issue-55401.rs4
-rw-r--r--src/test/ui/nll/issue-55401.stderr (renamed from src/test/ui/nll/issue-55401.nll.stderr)2
-rw-r--r--src/test/ui/nll/issue-55825-const-fn.rs2
-rw-r--r--src/test/ui/nll/issue-57642-higher-ranked-subtype.rs3
-rw-r--r--src/test/ui/nll/issue-57642-higher-ranked-subtype.stderr8
-rw-r--r--src/test/ui/nll/issue-58053.rs2
-rw-r--r--src/test/ui/nll/issue-58053.stderr4
-rw-r--r--src/test/ui/nll/issue-58299.rs2
-rw-r--r--src/test/ui/nll/issue-58299.stderr4
-rw-r--r--src/test/ui/nll/issue-67007-escaping-data.rs2
-rw-r--r--src/test/ui/nll/issue-67007-escaping-data.stderr2
-rw-r--r--src/test/ui/nll/issue-73159-rpit-static.rs2
-rw-r--r--src/test/ui/nll/issue-73159-rpit-static.stderr2
-rw-r--r--src/test/ui/nll/issue-95272.rs2
-rw-r--r--src/test/ui/nll/issue-95272.stderr2
-rw-r--r--src/test/ui/nll/lub-if.base.stderr29
-rw-r--r--src/test/ui/nll/lub-if.rs10
-rw-r--r--src/test/ui/nll/lub-if.stderr (renamed from src/test/ui/nll/lub-if.nll.stderr)4
-rw-r--r--src/test/ui/nll/lub-match.base.stderr29
-rw-r--r--src/test/ui/nll/lub-match.rs10
-rw-r--r--src/test/ui/nll/lub-match.stderr (renamed from src/test/ui/nll/lub-match.nll.stderr)4
-rw-r--r--src/test/ui/nll/match-cfg-fake-edges2.rs2
-rw-r--r--src/test/ui/nll/match-cfg-fake-edges2.stderr2
-rw-r--r--src/test/ui/nll/maybe-initialized-drop-uninitialized.rs1
-rw-r--r--src/test/ui/nll/maybe-initialized-drop-with-fragment.rs2
-rw-r--r--src/test/ui/nll/maybe-initialized-drop-with-fragment.stderr2
-rw-r--r--src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.rs2
-rw-r--r--src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.stderr2
-rw-r--r--src/test/ui/nll/maybe-initialized-drop.rs2
-rw-r--r--src/test/ui/nll/maybe-initialized-drop.stderr2
-rw-r--r--src/test/ui/nll/mir_check_cast_closure.rs2
-rw-r--r--src/test/ui/nll/mir_check_cast_closure.stderr2
-rw-r--r--src/test/ui/nll/mir_check_cast_reify.rs2
-rw-r--r--src/test/ui/nll/mir_check_cast_reify.stderr2
-rw-r--r--src/test/ui/nll/mir_check_cast_unsafe_fn.rs2
-rw-r--r--src/test/ui/nll/mir_check_cast_unsafe_fn.stderr2
-rw-r--r--src/test/ui/nll/mir_check_cast_unsize.rs2
-rw-r--r--src/test/ui/nll/mir_check_cast_unsize.stderr2
-rw-r--r--src/test/ui/nll/outlives-suggestion-more.rs2
-rw-r--r--src/test/ui/nll/outlives-suggestion-more.stderr14
-rw-r--r--src/test/ui/nll/outlives-suggestion-simple.rs2
-rw-r--r--src/test/ui/nll/outlives-suggestion-simple.stderr18
-rw-r--r--src/test/ui/nll/polonius/assignment-kills-loans.rs3
-rw-r--r--src/test/ui/nll/polonius/assignment-to-differing-field.rs3
-rw-r--r--src/test/ui/nll/polonius/assignment-to-differing-field.stderr8
-rw-r--r--src/test/ui/nll/polonius/call-kills-loans.rs3
-rw-r--r--src/test/ui/nll/polonius/issue-46589.rs3
-rw-r--r--src/test/ui/nll/polonius/polonius-smoke-test.rs3
-rw-r--r--src/test/ui/nll/polonius/polonius-smoke-test.stderr8
-rw-r--r--src/test/ui/nll/polonius/storagedead-kills-loans.rs3
-rw-r--r--src/test/ui/nll/polonius/subset-relations.rs3
-rw-r--r--src/test/ui/nll/polonius/subset-relations.stderr2
-rw-r--r--src/test/ui/nll/projection-return.rs1
-rw-r--r--src/test/ui/nll/relate_tys/fn-subtype.rs2
-rw-r--r--src/test/ui/nll/relate_tys/fn-subtype.stderr2
-rw-r--r--src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.rs2
-rw-r--r--src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.stderr4
-rw-r--r--src/test/ui/nll/relate_tys/hr-fn-aau-eq-abu.rs2
-rw-r--r--src/test/ui/nll/relate_tys/hr-fn-aba-as-aaa.rs2
-rw-r--r--src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.rs6
-rw-r--r--src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.stderr4
-rw-r--r--src/test/ui/nll/relate_tys/opaque-hrtb.rs2
-rw-r--r--src/test/ui/nll/relate_tys/opaque-hrtb.stderr2
-rw-r--r--src/test/ui/nll/relate_tys/trait-hrtb.rs2
-rw-r--r--src/test/ui/nll/relate_tys/trait-hrtb.stderr2
-rw-r--r--src/test/ui/nll/relate_tys/universe-violation.rs2
-rw-r--r--src/test/ui/nll/relate_tys/universe-violation.stderr2
-rw-r--r--src/test/ui/nll/ty-outlives/impl-trait-captures.rs2
-rw-r--r--src/test/ui/nll/ty-outlives/impl-trait-outlives.rs2
-rw-r--r--src/test/ui/nll/ty-outlives/projection-implied-bounds.rs2
-rw-r--r--src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs2
-rw-r--r--src/test/ui/nll/ty-outlives/projection-no-regions-fn.rs2
-rw-r--r--src/test/ui/nll/ty-outlives/projection-one-region-closure.rs2
-rw-r--r--src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.rs2
-rw-r--r--src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.rs2
-rw-r--r--src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs2
-rw-r--r--src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.base.stderr17
-rw-r--r--src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.rs4
-rw-r--r--src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.stderr (renamed from src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.nll.stderr)2
-rw-r--r--src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.base.stderr17
-rw-r--r--src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.rs7
-rw-r--r--src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.stderr (renamed from src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.nll.stderr)2
-rw-r--r--src/test/ui/nll/ty-outlives/projection-where-clause-none.rs2
-rw-r--r--src/test/ui/nll/ty-outlives/projection-where-clause-none.stderr2
-rw-r--r--src/test/ui/nll/ty-outlives/projection-where-clause-trait.rs2
-rw-r--r--src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs2
-rw-r--r--src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs2
-rw-r--r--src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs2
-rw-r--r--src/test/ui/nll/ty-outlives/ty-param-fn-body.rs2
-rw-r--r--src/test/ui/nll/ty-outlives/ty-param-fn-body.stderr2
-rw-r--r--src/test/ui/nll/ty-outlives/ty-param-fn.rs2
-rw-r--r--src/test/ui/nll/ty-outlives/ty-param-fn.stderr4
-rw-r--r--src/test/ui/nll/ty-outlives/ty-param-implied-bounds.rs2
-rw-r--r--src/test/ui/nll/ty-outlives/wf-unreachable.rs2
-rw-r--r--src/test/ui/nll/ty-outlives/wf-unreachable.stderr16
-rw-r--r--src/test/ui/nll/type-alias-free-regions.base.stderr65
-rw-r--r--src/test/ui/nll/type-alias-free-regions.rs4
-rw-r--r--src/test/ui/nll/type-alias-free-regions.stderr (renamed from src/test/ui/nll/type-alias-free-regions.nll.stderr)4
-rw-r--r--src/test/ui/nll/type-check-pointer-coercions.rs2
-rw-r--r--src/test/ui/nll/type-check-pointer-coercions.stderr16
-rw-r--r--src/test/ui/nll/type-check-pointer-comparisons.rs2
-rw-r--r--src/test/ui/nll/type-check-pointer-comparisons.stderr12
-rw-r--r--src/test/ui/nll/user-annotations/closure-substs.rs2
-rw-r--r--src/test/ui/nll/user-annotations/closure-substs.stderr8
-rw-r--r--src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.base.stderr11
-rw-r--r--src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.rs4
-rw-r--r--src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr (renamed from src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.nll.stderr)2
-rw-r--r--src/test/ui/nll/user-annotations/constant-in-expr-normalize.base.stderr16
-rw-r--r--src/test/ui/nll/user-annotations/constant-in-expr-normalize.rs4
-rw-r--r--src/test/ui/nll/user-annotations/constant-in-expr-normalize.stderr (renamed from src/test/ui/nll/user-annotations/constant-in-expr-normalize.nll.stderr)2
-rw-r--r--src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.base.stderr16
-rw-r--r--src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.rs4
-rw-r--r--src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.stderr (renamed from src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.nll.stderr)2
-rw-r--r--src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.base.stderr16
-rw-r--r--src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs4
-rw-r--r--src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.stderr (renamed from src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.nll.stderr)2
-rw-r--r--src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.base.stderr28
-rw-r--r--src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.rs4
-rw-r--r--src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr (renamed from src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.nll.stderr)2
-rw-r--r--src/test/ui/nll/user-annotations/dump-adt-brace-struct.rs1
-rw-r--r--src/test/ui/nll/user-annotations/dump-adt-brace-struct.stderr2
-rw-r--r--src/test/ui/nll/user-annotations/dump-fn-method.rs1
-rw-r--r--src/test/ui/nll/user-annotations/dump-fn-method.stderr8
-rw-r--r--src/test/ui/nll/user-annotations/inherent-associated-constants.rs2
-rw-r--r--src/test/ui/nll/user-annotations/inherent-associated-constants.stderr2
-rw-r--r--src/test/ui/nll/user-annotations/issue-54124.rs2
-rw-r--r--src/test/ui/nll/user-annotations/issue-54124.stderr4
-rw-r--r--src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.rs2
-rw-r--r--src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.stderr6
-rw-r--r--src/test/ui/nll/user-annotations/issue-57731-ascibed-coupled-types.rs2
-rw-r--r--src/test/ui/nll/user-annotations/method-ufcs-inherent-1.rs2
-rw-r--r--src/test/ui/nll/user-annotations/method-ufcs-inherent-1.stderr2
-rw-r--r--src/test/ui/nll/user-annotations/method-ufcs-inherent-3.rs2
-rw-r--r--src/test/ui/nll/user-annotations/method-ufcs-inherent-3.stderr2
-rw-r--r--src/test/ui/nll/user-annotations/patterns.rs2
-rw-r--r--src/test/ui/nll/user-annotations/patterns.stderr38
-rw-r--r--src/test/ui/nll/user-annotations/wf-self-type.rs2
-rw-r--r--src/test/ui/nll/user-annotations/wf-self-type.stderr2
-rw-r--r--src/test/ui/nll/where_clauses_in_functions.rs2
-rw-r--r--src/test/ui/nll/where_clauses_in_functions.stderr2
-rw-r--r--src/test/ui/nll/where_clauses_in_structs.rs2
-rw-r--r--src/test/ui/nll/where_clauses_in_structs.stderr2
-rw-r--r--src/test/ui/object-lifetime/object-lifetime-default-elision.base.stderr61
-rw-r--r--src/test/ui/object-lifetime/object-lifetime-default-elision.rs8
-rw-r--r--src/test/ui/object-lifetime/object-lifetime-default-elision.stderr (renamed from src/test/ui/object-lifetime/object-lifetime-default-elision.nll.stderr)2
-rw-r--r--src/test/ui/object-lifetime/object-lifetime-default-from-box-error.base.stderr35
-rw-r--r--src/test/ui/object-lifetime/object-lifetime-default-from-box-error.rs9
-rw-r--r--src/test/ui/object-lifetime/object-lifetime-default-from-box-error.stderr (renamed from src/test/ui/object-lifetime/object-lifetime-default-from-box-error.nll.stderr)6
-rw-r--r--src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.base.stderr18
-rw-r--r--src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.rs7
-rw-r--r--src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.stderr (renamed from src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.nll.stderr)2
-rw-r--r--src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.base.stderr18
-rw-r--r--src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.rs7
-rw-r--r--src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.stderr (renamed from src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.nll.stderr)2
-rw-r--r--src/test/ui/object-lifetime/object-lifetime-default-mybox.base.stderr31
-rw-r--r--src/test/ui/object-lifetime/object-lifetime-default-mybox.rs10
-rw-r--r--src/test/ui/object-lifetime/object-lifetime-default-mybox.stderr (renamed from src/test/ui/object-lifetime/object-lifetime-default-mybox.nll.stderr)4
-rw-r--r--src/test/ui/object-lifetime/object-lifetime-default.rs2
-rw-r--r--src/test/ui/object-lifetime/object-lifetime-default.stderr14
-rw-r--r--src/test/ui/parser/issues/issue-14303-fncall.full.stderr2
-rw-r--r--src/test/ui/parser/issues/issue-14303-fncall.generic_arg.stderr2
-rw-r--r--src/test/ui/parser/issues/issue-14303-fncall.rs1
-rw-r--r--src/test/ui/parser/labeled-no-colon-expr.stderr6
-rw-r--r--src/test/ui/parser/recover-labeled-non-block-expr.fixed27
-rw-r--r--src/test/ui/parser/recover-labeled-non-block-expr.rs26
-rw-r--r--src/test/ui/parser/recover-labeled-non-block-expr.stderr80
-rw-r--r--src/test/ui/regions/issue-28848.base.stderr20
-rw-r--r--src/test/ui/regions/issue-28848.rs7
-rw-r--r--src/test/ui/regions/issue-28848.stderr (renamed from src/test/ui/regions/issue-28848.nll.stderr)2
-rw-r--r--src/test/ui/regions/issue-78262.base.stderr (renamed from src/test/ui/regions/issue-78262.nll.stderr)2
-rw-r--r--src/test/ui/regions/issue-78262.default.stderr18
-rw-r--r--src/test/ui/regions/issue-78262.polonius.stderr2
-rw-r--r--src/test/ui/regions/issue-78262.rs10
-rw-r--r--src/test/ui/regions/region-invariant-static-error-reporting.base.stderr25
-rw-r--r--src/test/ui/regions/region-invariant-static-error-reporting.rs11
-rw-r--r--src/test/ui/regions/region-invariant-static-error-reporting.stderr (renamed from src/test/ui/regions/region-invariant-static-error-reporting.nll.stderr)2
-rw-r--r--src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.base.stderr31
-rw-r--r--src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.rs6
-rw-r--r--src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr (renamed from src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.nll.stderr)2
-rw-r--r--src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.base.stderr42
-rw-r--r--src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs8
-rw-r--r--src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr (renamed from src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr)2
-rw-r--r--src/test/ui/regions/region-object-lifetime-2.base.stderr30
-rw-r--r--src/test/ui/regions/region-object-lifetime-2.rs7
-rw-r--r--src/test/ui/regions/region-object-lifetime-2.stderr (renamed from src/test/ui/regions/region-object-lifetime-2.nll.stderr)2
-rw-r--r--src/test/ui/regions/region-object-lifetime-4.base.stderr30
-rw-r--r--src/test/ui/regions/region-object-lifetime-4.rs7
-rw-r--r--src/test/ui/regions/region-object-lifetime-4.stderr (renamed from src/test/ui/regions/region-object-lifetime-4.nll.stderr)2
-rw-r--r--src/test/ui/regions/region-object-lifetime-in-coercion.base.stderr98
-rw-r--r--src/test/ui/regions/region-object-lifetime-in-coercion.rs16
-rw-r--r--src/test/ui/regions/region-object-lifetime-in-coercion.stderr (renamed from src/test/ui/regions/region-object-lifetime-in-coercion.nll.stderr)8
-rw-r--r--src/test/ui/regions/regions-addr-of-self.base.stderr11
-rw-r--r--src/test/ui/regions/regions-addr-of-self.rs7
-rw-r--r--src/test/ui/regions/regions-addr-of-self.stderr (renamed from src/test/ui/regions/regions-addr-of-self.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-addr-of-upvar-self.base.stderr26
-rw-r--r--src/test/ui/regions/regions-addr-of-upvar-self.rs11
-rw-r--r--src/test/ui/regions/regions-addr-of-upvar-self.stderr (renamed from src/test/ui/regions/regions-addr-of-upvar-self.nll.stderr)6
-rw-r--r--src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.migrate.stderr20
-rw-r--r--src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.rs11
-rw-r--r--src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.stderr (renamed from src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-bounded-by-trait-requiring-static.base.stderr75
-rw-r--r--src/test/ui/regions/regions-bounded-by-trait-requiring-static.rs22
-rw-r--r--src/test/ui/regions/regions-bounded-by-trait-requiring-static.stderr (renamed from src/test/ui/regions/regions-bounded-by-trait-requiring-static.nll.stderr)12
-rw-r--r--src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.base.stderr12
-rw-r--r--src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.rs6
-rw-r--r--src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.stderr (renamed from src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.base.stderr12
-rw-r--r--src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.rs7
-rw-r--r--src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.stderr (renamed from src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-bounded-method-type-parameters.base.stderr15
-rw-r--r--src/test/ui/regions/regions-bounded-method-type-parameters.rs7
-rw-r--r--src/test/ui/regions/regions-bounded-method-type-parameters.stderr (renamed from src/test/ui/regions/regions-bounded-method-type-parameters.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-bounds.base.stderr41
-rw-r--r--src/test/ui/regions/regions-bounds.rs10
-rw-r--r--src/test/ui/regions/regions-bounds.stderr (renamed from src/test/ui/regions/regions-bounds.nll.stderr)4
-rw-r--r--src/test/ui/regions/regions-close-associated-type-into-object.base.stderr40
-rw-r--r--src/test/ui/regions/regions-close-associated-type-into-object.rs4
-rw-r--r--src/test/ui/regions/regions-close-associated-type-into-object.stderr (renamed from src/test/ui/regions/regions-close-associated-type-into-object.nll.stderr)8
-rw-r--r--src/test/ui/regions/regions-close-object-into-object-2.base.stderr27
-rw-r--r--src/test/ui/regions/regions-close-object-into-object-2.rs9
-rw-r--r--src/test/ui/regions/regions-close-object-into-object-2.stderr (renamed from src/test/ui/regions/regions-close-object-into-object-2.nll.stderr)4
-rw-r--r--src/test/ui/regions/regions-close-object-into-object-4.base.stderr27
-rw-r--r--src/test/ui/regions/regions-close-object-into-object-4.rs17
-rw-r--r--src/test/ui/regions/regions-close-object-into-object-4.stderr (renamed from src/test/ui/regions/regions-close-object-into-object-4.nll.stderr)12
-rw-r--r--src/test/ui/regions/regions-close-object-into-object-5.base.stderr95
-rw-r--r--src/test/ui/regions/regions-close-object-into-object-5.rs9
-rw-r--r--src/test/ui/regions/regions-close-object-into-object-5.stderr (renamed from src/test/ui/regions/regions-close-object-into-object-5.nll.stderr)10
-rw-r--r--src/test/ui/regions/regions-close-over-type-parameter-1.nll.stderr26
-rw-r--r--src/test/ui/regions/regions-close-over-type-parameter-1.rs4
-rw-r--r--src/test/ui/regions/regions-close-over-type-parameter-1.stderr (renamed from src/test/ui/regions/regions-close-over-type-parameter-1.base.stderr)4
-rw-r--r--src/test/ui/regions/regions-close-over-type-parameter-multiple.base.stderr32
-rw-r--r--src/test/ui/regions/regions-close-over-type-parameter-multiple.rs7
-rw-r--r--src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr (renamed from src/test/ui/regions/regions-close-over-type-parameter-multiple.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-close-param-into-object.base.stderr48
-rw-r--r--src/test/ui/regions/regions-close-param-into-object.rs4
-rw-r--r--src/test/ui/regions/regions-close-param-into-object.stderr (renamed from src/test/ui/regions/regions-close-param-into-object.nll.stderr)8
-rw-r--r--src/test/ui/regions/regions-creating-enums3.base.stderr13
-rw-r--r--src/test/ui/regions/regions-creating-enums3.rs7
-rw-r--r--src/test/ui/regions/regions-creating-enums3.stderr (renamed from src/test/ui/regions/regions-creating-enums3.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-creating-enums4.base.stderr34
-rw-r--r--src/test/ui/regions/regions-creating-enums4.rs7
-rw-r--r--src/test/ui/regions/regions-creating-enums4.stderr (renamed from src/test/ui/regions/regions-creating-enums4.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-early-bound-error-method.base.stderr20
-rw-r--r--src/test/ui/regions/regions-early-bound-error-method.rs7
-rw-r--r--src/test/ui/regions/regions-early-bound-error-method.stderr (renamed from src/test/ui/regions/regions-early-bound-error-method.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-early-bound-error.base.stderr20
-rw-r--r--src/test/ui/regions/regions-early-bound-error.rs7
-rw-r--r--src/test/ui/regions/regions-early-bound-error.stderr (renamed from src/test/ui/regions/regions-early-bound-error.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-fn-subtyping-return-static-fail.nll.stderr19
-rw-r--r--src/test/ui/regions/regions-fn-subtyping-return-static-fail.rs4
-rw-r--r--src/test/ui/regions/regions-fn-subtyping-return-static-fail.stderr (renamed from src/test/ui/regions/regions-fn-subtyping-return-static-fail.base.stderr)4
-rw-r--r--src/test/ui/regions/regions-free-region-ordering-callee.base.stderr25
-rw-r--r--src/test/ui/regions/regions-free-region-ordering-callee.rs10
-rw-r--r--src/test/ui/regions/regions-free-region-ordering-callee.stderr (renamed from src/test/ui/regions/regions-free-region-ordering-callee.nll.stderr)4
-rw-r--r--src/test/ui/regions/regions-free-region-ordering-caller.migrate.stderr54
-rw-r--r--src/test/ui/regions/regions-free-region-ordering-caller.rs20
-rw-r--r--src/test/ui/regions/regions-free-region-ordering-caller.stderr (renamed from src/test/ui/regions/regions-free-region-ordering-caller.nll.stderr)6
-rw-r--r--src/test/ui/regions/regions-free-region-ordering-incorrect.base.stderr33
-rw-r--r--src/test/ui/regions/regions-free-region-ordering-incorrect.rs8
-rw-r--r--src/test/ui/regions/regions-free-region-ordering-incorrect.stderr (renamed from src/test/ui/regions/regions-free-region-ordering-incorrect.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-implied-bounds-projection-gap-1.base.stderr14
-rw-r--r--src/test/ui/regions/regions-implied-bounds-projection-gap-1.rs4
-rw-r--r--src/test/ui/regions/regions-implied-bounds-projection-gap-1.stderr (renamed from src/test/ui/regions/regions-implied-bounds-projection-gap-1.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-infer-bound-from-trait-self.base.stderr17
-rw-r--r--src/test/ui/regions/regions-infer-bound-from-trait-self.rs4
-rw-r--r--src/test/ui/regions/regions-infer-bound-from-trait-self.stderr (renamed from src/test/ui/regions/regions-infer-bound-from-trait-self.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-infer-bound-from-trait.base.stderr35
-rw-r--r--src/test/ui/regions/regions-infer-bound-from-trait.rs4
-rw-r--r--src/test/ui/regions/regions-infer-bound-from-trait.stderr (renamed from src/test/ui/regions/regions-infer-bound-from-trait.nll.stderr)4
-rw-r--r--src/test/ui/regions/regions-infer-contravariance-due-to-decl.base.stderr15
-rw-r--r--src/test/ui/regions/regions-infer-contravariance-due-to-decl.rs7
-rw-r--r--src/test/ui/regions/regions-infer-contravariance-due-to-decl.stderr (renamed from src/test/ui/regions/regions-infer-contravariance-due-to-decl.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-infer-covariance-due-to-decl.base.stderr14
-rw-r--r--src/test/ui/regions/regions-infer-covariance-due-to-decl.rs7
-rw-r--r--src/test/ui/regions/regions-infer-covariance-due-to-decl.stderr (renamed from src/test/ui/regions/regions-infer-covariance-due-to-decl.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-infer-invariance-due-to-decl.base.stderr18
-rw-r--r--src/test/ui/regions/regions-infer-invariance-due-to-decl.rs7
-rw-r--r--src/test/ui/regions/regions-infer-invariance-due-to-decl.stderr (renamed from src/test/ui/regions/regions-infer-invariance-due-to-decl.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.base.stderr18
-rw-r--r--src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.rs7
-rw-r--r--src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.stderr (renamed from src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.base.stderr18
-rw-r--r--src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.rs7
-rw-r--r--src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.stderr (renamed from src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-infer-not-param.base.stderr60
-rw-r--r--src/test/ui/regions/regions-infer-not-param.rs17
-rw-r--r--src/test/ui/regions/regions-infer-not-param.stderr (renamed from src/test/ui/regions/regions-infer-not-param.nll.stderr)6
-rw-r--r--src/test/ui/regions/regions-infer-paramd-indirect.base.stderr22
-rw-r--r--src/test/ui/regions/regions-infer-paramd-indirect.rs10
-rw-r--r--src/test/ui/regions/regions-infer-paramd-indirect.stderr (renamed from src/test/ui/regions/regions-infer-paramd-indirect.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-lifetime-bounds-on-fns.base.stderr31
-rw-r--r--src/test/ui/regions/regions-lifetime-bounds-on-fns.rs6
-rw-r--r--src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr (renamed from src/test/ui/regions/regions-lifetime-bounds-on-fns.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-nested-fns.base.stderr78
-rw-r--r--src/test/ui/regions/regions-nested-fns.rs14
-rw-r--r--src/test/ui/regions/regions-nested-fns.stderr (renamed from src/test/ui/regions/regions-nested-fns.nll.stderr)8
-rw-r--r--src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.stderr37
-rw-r--r--src/test/ui/regions/regions-outlives-projection-container-hrtb.rs14
-rw-r--r--src/test/ui/regions/regions-outlives-projection-container-hrtb.stderr (renamed from src/test/ui/regions/regions-outlives-projection-container-hrtb.nll.stderr)4
-rw-r--r--src/test/ui/regions/regions-outlives-projection-container-wc.migrate.stderr20
-rw-r--r--src/test/ui/regions/regions-outlives-projection-container-wc.rs11
-rw-r--r--src/test/ui/regions/regions-outlives-projection-container-wc.stderr (renamed from src/test/ui/regions/regions-outlives-projection-container-wc.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-outlives-projection-container.base.stderr71
-rw-r--r--src/test/ui/regions/regions-outlives-projection-container.rs16
-rw-r--r--src/test/ui/regions/regions-outlives-projection-container.stderr (renamed from src/test/ui/regions/regions-outlives-projection-container.nll.stderr)8
-rw-r--r--src/test/ui/regions/regions-proc-bound-capture.base.stderr29
-rw-r--r--src/test/ui/regions/regions-proc-bound-capture.rs7
-rw-r--r--src/test/ui/regions/regions-proc-bound-capture.stderr (renamed from src/test/ui/regions/regions-proc-bound-capture.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.base.stderr13
-rw-r--r--src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.rs7
-rw-r--r--src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.stderr (renamed from src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.base.stderr13
-rw-r--r--src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.rs7
-rw-r--r--src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.stderr (renamed from src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-ret-borrowed-1.base.stderr32
-rw-r--r--src/test/ui/regions/regions-ret-borrowed-1.rs7
-rw-r--r--src/test/ui/regions/regions-ret-borrowed-1.stderr (renamed from src/test/ui/regions/regions-ret-borrowed-1.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-ret-borrowed.base.stderr32
-rw-r--r--src/test/ui/regions/regions-ret-borrowed.rs7
-rw-r--r--src/test/ui/regions/regions-ret-borrowed.stderr (renamed from src/test/ui/regions/regions-ret-borrowed.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-static-bound.base.stderr62
-rw-r--r--src/test/ui/regions/regions-static-bound.rs13
-rw-r--r--src/test/ui/regions/regions-static-bound.stderr (renamed from src/test/ui/regions/regions-static-bound.nll.stderr)10
-rw-r--r--src/test/ui/regions/regions-trait-object-subtyping.base.stderr69
-rw-r--r--src/test/ui/regions/regions-trait-object-subtyping.rs11
-rw-r--r--src/test/ui/regions/regions-trait-object-subtyping.stderr (renamed from src/test/ui/regions/regions-trait-object-subtyping.nll.stderr)4
-rw-r--r--src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.base.stderr12
-rw-r--r--src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.rs7
-rw-r--r--src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.stderr (renamed from src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-variance-contravariant-use-covariant.base.stderr15
-rw-r--r--src/test/ui/regions/regions-variance-contravariant-use-covariant.rs7
-rw-r--r--src/test/ui/regions/regions-variance-contravariant-use-covariant.stderr (renamed from src/test/ui/regions/regions-variance-contravariant-use-covariant.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-variance-covariant-use-contravariant.base.stderr14
-rw-r--r--src/test/ui/regions/regions-variance-covariant-use-contravariant.rs7
-rw-r--r--src/test/ui/regions/regions-variance-covariant-use-contravariant.stderr (renamed from src/test/ui/regions/regions-variance-covariant-use-contravariant.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-variance-invariant-use-contravariant.base.stderr14
-rw-r--r--src/test/ui/regions/regions-variance-invariant-use-contravariant.rs7
-rw-r--r--src/test/ui/regions/regions-variance-invariant-use-contravariant.stderr (renamed from src/test/ui/regions/regions-variance-invariant-use-contravariant.nll.stderr)2
-rw-r--r--src/test/ui/regions/regions-variance-invariant-use-covariant.base.stderr18
-rw-r--r--src/test/ui/regions/regions-variance-invariant-use-covariant.rs7
-rw-r--r--src/test/ui/regions/regions-variance-invariant-use-covariant.stderr (renamed from src/test/ui/regions/regions-variance-invariant-use-covariant.nll.stderr)2
-rw-r--r--src/test/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs40
-rw-r--r--src/test/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr40
-rw-r--r--src/test/ui/rfc1623.base.stderr11
-rw-r--r--src/test/ui/rfc1623.rs13
-rw-r--r--src/test/ui/rfc1623.stderr (renamed from src/test/ui/rfc1623.nll.stderr)8
-rw-r--r--src/test/ui/rustdoc/check-doc-alias-attr-location.stderr2
-rw-r--r--src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.base.stderr39
-rw-r--r--src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.rs12
-rw-r--r--src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.stderr (renamed from src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.nll.stderr)6
-rw-r--r--src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.base.stderr39
-rw-r--r--src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.rs13
-rw-r--r--src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.stderr (renamed from src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.nll.stderr)6
-rw-r--r--src/test/ui/self/elision/lt-ref-self-async.base.stderr99
-rw-r--r--src/test/ui/self/elision/lt-ref-self-async.rs21
-rw-r--r--src/test/ui/self/elision/lt-ref-self-async.stderr (renamed from src/test/ui/self/elision/lt-ref-self-async.nll.stderr)12
-rw-r--r--src/test/ui/self/elision/lt-ref-self.base.stderr99
-rw-r--r--src/test/ui/self/elision/lt-ref-self.rs22
-rw-r--r--src/test/ui/self/elision/lt-ref-self.stderr (renamed from src/test/ui/self/elision/lt-ref-self.nll.stderr)12
-rw-r--r--src/test/ui/self/elision/ref-mut-self-async.base.stderr99
-rw-r--r--src/test/ui/self/elision/ref-mut-self-async.rs21
-rw-r--r--src/test/ui/self/elision/ref-mut-self-async.stderr (renamed from src/test/ui/self/elision/ref-mut-self-async.nll.stderr)12
-rw-r--r--src/test/ui/self/elision/ref-mut-self.base.stderr99
-rw-r--r--src/test/ui/self/elision/ref-mut-self.rs22
-rw-r--r--src/test/ui/self/elision/ref-mut-self.stderr (renamed from src/test/ui/self/elision/ref-mut-self.nll.stderr)12
-rw-r--r--src/test/ui/self/elision/ref-mut-struct-async.base.stderr83
-rw-r--r--src/test/ui/self/elision/ref-mut-struct-async.rs18
-rw-r--r--src/test/ui/self/elision/ref-mut-struct-async.stderr (renamed from src/test/ui/self/elision/ref-mut-struct-async.nll.stderr)10
-rw-r--r--src/test/ui/self/elision/ref-mut-struct.base.stderr83
-rw-r--r--src/test/ui/self/elision/ref-mut-struct.rs19
-rw-r--r--src/test/ui/self/elision/ref-mut-struct.stderr (renamed from src/test/ui/self/elision/ref-mut-struct.nll.stderr)10
-rw-r--r--src/test/ui/self/elision/ref-self-async.base.stderr115
-rw-r--r--src/test/ui/self/elision/ref-self-async.rs24
-rw-r--r--src/test/ui/self/elision/ref-self-async.stderr (renamed from src/test/ui/self/elision/ref-self-async.nll.stderr)14
-rw-r--r--src/test/ui/self/elision/ref-self.base.stderr115
-rw-r--r--src/test/ui/self/elision/ref-self.rs25
-rw-r--r--src/test/ui/self/elision/ref-self.stderr (renamed from src/test/ui/self/elision/ref-self.nll.stderr)14
-rw-r--r--src/test/ui/self/elision/ref-struct-async.base.stderr83
-rw-r--r--src/test/ui/self/elision/ref-struct-async.rs18
-rw-r--r--src/test/ui/self/elision/ref-struct-async.stderr (renamed from src/test/ui/self/elision/ref-struct-async.nll.stderr)10
-rw-r--r--src/test/ui/self/elision/ref-struct.base.stderr83
-rw-r--r--src/test/ui/self/elision/ref-struct.rs19
-rw-r--r--src/test/ui/self/elision/ref-struct.stderr (renamed from src/test/ui/self/elision/ref-struct.nll.stderr)10
-rw-r--r--src/test/ui/structs/struct-path-associated-type.rs4
-rw-r--r--src/test/ui/structs/struct-path-associated-type.stderr12
-rw-r--r--src/test/ui/structs/struct-path-self.rs6
-rw-r--r--src/test/ui/structs/struct-path-self.stderr52
-rw-r--r--src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.base.stderr42
-rw-r--r--src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs6
-rw-r--r--src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr (renamed from src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.nll.stderr)6
-rw-r--r--src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-nll.rs118
-rw-r--r--src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-nll.stderr105
-rw-r--r--src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.fixed117
-rw-r--r--src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.rs19
-rw-r--r--src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr114
-rw-r--r--src/test/ui/suggestions/issue-97704.fixed19
-rw-r--r--src/test/ui/suggestions/issue-97704.rs19
-rw-r--r--src/test/ui/suggestions/issue-97704.stderr15
-rw-r--r--src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.base.stderr28
-rw-r--r--src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs4
-rw-r--r--src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr (renamed from src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.nll.stderr)6
-rw-r--r--src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.base.stderr114
-rw-r--r--src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs21
-rw-r--r--src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr (renamed from src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.nll.stderr)34
-rw-r--r--src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.base.stderr95
-rw-r--r--src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.rs16
-rw-r--r--src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr (renamed from src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.nll.stderr)12
-rw-r--r--src/test/ui/suggestions/missing-bound-in-derive-copy-impl-3.stderr6
-rw-r--r--src/test/ui/suggestions/missing-bound-in-derive-copy-impl.stderr6
-rw-r--r--src/test/ui/suggestions/missing-lifetime-specifier.stderr16
-rw-r--r--src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.fixed24
-rw-r--r--src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.rs24
-rw-r--r--src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.stderr14
-rw-r--r--src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed7
-rw-r--r--src/test/ui/suggestions/suggest-impl-trait-lifetime.rs7
-rw-r--r--src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr9
-rw-r--r--src/test/ui/traits/issue-97695-double-trivial-bound.rs24
-rw-r--r--src/test/ui/traits/object/supertrait-lifetime-bound.base.stderr15
-rw-r--r--src/test/ui/traits/object/supertrait-lifetime-bound.rs7
-rw-r--r--src/test/ui/traits/object/supertrait-lifetime-bound.stderr (renamed from src/test/ui/traits/object/supertrait-lifetime-bound.nll.stderr)2
-rw-r--r--src/test/ui/traits/trait-upcasting/lifetime.rs1
-rw-r--r--src/test/ui/traits/trait-upcasting/type-checking-test-3.base.stderr33
-rw-r--r--src/test/ui/traits/trait-upcasting/type-checking-test-3.rs10
-rw-r--r--src/test/ui/traits/trait-upcasting/type-checking-test-3.stderr (renamed from src/test/ui/traits/trait-upcasting/type-checking-test-3.nll.stderr)4
-rw-r--r--src/test/ui/traits/trait-upcasting/type-checking-test-4.base.stderr123
-rw-r--r--src/test/ui/traits/trait-upcasting/type-checking-test-4.rs22
-rw-r--r--src/test/ui/traits/trait-upcasting/type-checking-test-4.stderr (renamed from src/test/ui/traits/trait-upcasting/type-checking-test-4.nll.stderr)14
-rw-r--r--src/test/ui/type-alias-enum-variants/enum-variant-generic-args.rs54
-rw-r--r--src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr284
-rw-r--r--src/test/ui/type-alias-enum-variants/no-type-application-on-aliased-enum-variant.rs2
-rw-r--r--src/test/ui/type-alias-enum-variants/no-type-application-on-aliased-enum-variant.stderr6
-rw-r--r--src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr32
-rw-r--r--src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs4
-rw-r--r--src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr (renamed from src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.base.stderr)8
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.base.stderr11
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs4
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.stderr (renamed from src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.nll.stderr)6
-rw-r--r--src/test/ui/type/issue-91268.rs2
-rw-r--r--src/test/ui/type/issue-91268.stderr12
-rw-r--r--src/test/ui/typeck/prim-with-args.fixed28
-rw-r--r--src/test/ui/typeck/prim-with-args.rs45
-rw-r--r--src/test/ui/typeck/prim-with-args.stderr342
-rw-r--r--src/test/ui/unboxed-closures/issue-30906.base.stderr11
-rw-r--r--src/test/ui/unboxed-closures/issue-30906.rs4
-rw-r--r--src/test/ui/unboxed-closures/issue-30906.stderr (renamed from src/test/ui/unboxed-closures/issue-30906.nll.stderr)2
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.base.stderr30
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.rs7
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.stderr (renamed from src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.nll.stderr)2
-rw-r--r--src/test/ui/underscore-lifetime/dyn-trait-underscore.base.stderr27
-rw-r--r--src/test/ui/underscore-lifetime/dyn-trait-underscore.rs7
-rw-r--r--src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr (renamed from src/test/ui/underscore-lifetime/dyn-trait-underscore.nll.stderr)2
-rw-r--r--src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.base.stderr17
-rw-r--r--src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.rs7
-rw-r--r--src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.stderr (renamed from src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.nll.stderr)2
-rw-r--r--src/test/ui/union/union-copy.stderr4
-rw-r--r--src/test/ui/usize-generic-argument-parent.rs2
-rw-r--r--src/test/ui/usize-generic-argument-parent.stderr12
-rw-r--r--src/test/ui/variance/variance-associated-types2.base.stderr18
-rw-r--r--src/test/ui/variance/variance-associated-types2.rs7
-rw-r--r--src/test/ui/variance/variance-associated-types2.stderr (renamed from src/test/ui/variance/variance-associated-types2.nll.stderr)2
-rw-r--r--src/test/ui/variance/variance-btree-invariant-types.base.stderr243
-rw-r--r--src/test/ui/variance/variance-btree-invariant-types.rs52
-rw-r--r--src/test/ui/variance/variance-btree-invariant-types.stderr (renamed from src/test/ui/variance/variance-btree-invariant-types.nll.stderr)32
-rw-r--r--src/test/ui/variance/variance-cell-is-invariant.base.stderr15
-rw-r--r--src/test/ui/variance/variance-cell-is-invariant.rs7
-rw-r--r--src/test/ui/variance/variance-cell-is-invariant.stderr (renamed from src/test/ui/variance/variance-cell-is-invariant.nll.stderr)2
-rw-r--r--src/test/ui/variance/variance-contravariant-arg-object.base.stderr41
-rw-r--r--src/test/ui/variance/variance-contravariant-arg-object.rs10
-rw-r--r--src/test/ui/variance/variance-contravariant-arg-object.stderr (renamed from src/test/ui/variance/variance-contravariant-arg-object.nll.stderr)4
-rw-r--r--src/test/ui/variance/variance-contravariant-arg-trait-match.base.stderr41
-rw-r--r--src/test/ui/variance/variance-contravariant-arg-trait-match.rs10
-rw-r--r--src/test/ui/variance/variance-contravariant-arg-trait-match.stderr (renamed from src/test/ui/variance/variance-contravariant-arg-trait-match.nll.stderr)4
-rw-r--r--src/test/ui/variance/variance-contravariant-self-trait-match.base.stderr41
-rw-r--r--src/test/ui/variance/variance-contravariant-self-trait-match.rs10
-rw-r--r--src/test/ui/variance/variance-contravariant-self-trait-match.stderr (renamed from src/test/ui/variance/variance-contravariant-self-trait-match.nll.stderr)4
-rw-r--r--src/test/ui/variance/variance-covariant-arg-object.base.stderr41
-rw-r--r--src/test/ui/variance/variance-covariant-arg-object.rs10
-rw-r--r--src/test/ui/variance/variance-covariant-arg-object.stderr (renamed from src/test/ui/variance/variance-covariant-arg-object.nll.stderr)4
-rw-r--r--src/test/ui/variance/variance-covariant-arg-trait-match.base.stderr41
-rw-r--r--src/test/ui/variance/variance-covariant-arg-trait-match.rs10
-rw-r--r--src/test/ui/variance/variance-covariant-arg-trait-match.stderr (renamed from src/test/ui/variance/variance-invariant-arg-trait-match.nll.stderr)4
-rw-r--r--src/test/ui/variance/variance-covariant-self-trait-match.base.stderr41
-rw-r--r--src/test/ui/variance/variance-covariant-self-trait-match.rs10
-rw-r--r--src/test/ui/variance/variance-covariant-self-trait-match.stderr (renamed from src/test/ui/variance/variance-invariant-self-trait-match.nll.stderr)4
-rw-r--r--src/test/ui/variance/variance-invariant-arg-object.base.stderr41
-rw-r--r--src/test/ui/variance/variance-invariant-arg-object.rs10
-rw-r--r--src/test/ui/variance/variance-invariant-arg-object.stderr (renamed from src/test/ui/variance/variance-invariant-arg-object.nll.stderr)4
-rw-r--r--src/test/ui/variance/variance-invariant-arg-trait-match.base.stderr41
-rw-r--r--src/test/ui/variance/variance-invariant-arg-trait-match.rs10
-rw-r--r--src/test/ui/variance/variance-invariant-arg-trait-match.stderr (renamed from src/test/ui/variance/variance-covariant-arg-trait-match.nll.stderr)4
-rw-r--r--src/test/ui/variance/variance-invariant-self-trait-match.base.stderr41
-rw-r--r--src/test/ui/variance/variance-invariant-self-trait-match.rs10
-rw-r--r--src/test/ui/variance/variance-invariant-self-trait-match.stderr (renamed from src/test/ui/variance/variance-covariant-self-trait-match.nll.stderr)4
-rw-r--r--src/test/ui/variance/variance-trait-matching.base.stderr12
-rw-r--r--src/test/ui/variance/variance-trait-matching.rs4
-rw-r--r--src/test/ui/variance/variance-trait-matching.stderr (renamed from src/test/ui/variance/variance-trait-matching.nll.stderr)2
-rw-r--r--src/test/ui/variance/variance-use-contravariant-struct-1.base.stderr22
-rw-r--r--src/test/ui/variance/variance-use-contravariant-struct-1.rs7
-rw-r--r--src/test/ui/variance/variance-use-contravariant-struct-1.stderr (renamed from src/test/ui/variance/variance-use-contravariant-struct-1.nll.stderr)2
-rw-r--r--src/test/ui/variance/variance-use-covariant-struct-1.base.stderr22
-rw-r--r--src/test/ui/variance/variance-use-covariant-struct-1.rs7
-rw-r--r--src/test/ui/variance/variance-use-covariant-struct-1.stderr (renamed from src/test/ui/variance/variance-use-covariant-struct-1.nll.stderr)2
-rw-r--r--src/test/ui/variance/variance-use-invariant-struct-1.base.stderr41
-rw-r--r--src/test/ui/variance/variance-use-invariant-struct-1.rs10
-rw-r--r--src/test/ui/variance/variance-use-invariant-struct-1.stderr (renamed from src/test/ui/variance/variance-use-invariant-struct-1.nll.stderr)4
-rw-r--r--src/test/ui/wf/wf-static-method.base.stderr136
-rw-r--r--src/test/ui/wf/wf-static-method.rs22
-rw-r--r--src/test/ui/wf/wf-static-method.stderr (renamed from src/test/ui/wf/wf-static-method.nll.stderr)12
-rw-r--r--src/test/ui/where-clauses/where-for-self-2.base.stderr11
-rw-r--r--src/test/ui/where-clauses/where-for-self-2.rs4
-rw-r--r--src/test/ui/where-clauses/where-for-self-2.stderr (renamed from src/test/ui/where-clauses/where-for-self-2.nll.stderr)2
-rw-r--r--src/tools/clippy/CHANGELOG.md10
-rw-r--r--src/tools/clippy/Cargo.toml4
-rw-r--r--src/tools/clippy/clippy_dev/Cargo.toml2
-rw-r--r--src/tools/clippy/clippy_dev/src/main.rs156
-rw-r--r--src/tools/clippy/clippy_dev/src/serve.rs10
-rw-r--r--src/tools/clippy/clippy_lints/src/almost_complete_letter_range.rs100
-rw-r--r--src/tools/clippy/clippy_lints/src/approx_const.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/as_conversions.rs9
-rw-r--r--src/tools/clippy/clippy_lints/src/as_underscore.rs74
-rw-r--r--src/tools/clippy/clippy_lints/src/assign_ops.rs10
-rw-r--r--src/tools/clippy/clippy_lints/src/attrs.rs59
-rw-r--r--src/tools/clippy/clippy_lints/src/blocks_in_if_conditions.rs12
-rw-r--r--src/tools/clippy/clippy_lints/src/booleans.rs19
-rw-r--r--src/tools/clippy/clippy_lints/src/borrow_deref_ref.rs118
-rw-r--r--src/tools/clippy/clippy_lints/src/bytecount.rs8
-rw-r--r--src/tools/clippy/clippy_lints/src/casts/cast_abs_to_unsigned.rs46
-rw-r--r--src/tools/clippy/clippy_lints/src/checked_conversions.rs4
-rw-r--r--src/tools/clippy/clippy_lints/src/cognitive_complexity.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/collapsible_if.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/comparison_chain.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/copies.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/crate_in_macro_def.rs4
-rw-r--r--src/tools/clippy/clippy_lints/src/dbg_macro.rs21
-rw-r--r--src/tools/clippy/clippy_lints/src/derivable_impls.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/derive.rs47
-rw-r--r--src/tools/clippy/clippy_lints/src/doc_link_with_quotes.rs60
-rw-r--r--src/tools/clippy/clippy_lints/src/double_comparison.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/double_parens.rs14
-rw-r--r--src/tools/clippy/clippy_lints/src/duration_subsec.rs18
-rw-r--r--src/tools/clippy/clippy_lints/src/else_if_without_else.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/empty_enum.rs3
-rw-r--r--src/tools/clippy/clippy_lints/src/entry.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/enum_variants.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/eq_op.rs6
-rw-r--r--src/tools/clippy/clippy_lints/src/equatable_if_let.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/escape.rs6
-rw-r--r--src/tools/clippy/clippy_lints/src/excessive_bools.rs3
-rw-r--r--src/tools/clippy/clippy_lints/src/explicit_write.rs10
-rw-r--r--src/tools/clippy/clippy_lints/src/fallible_impl_from.rs3
-rw-r--r--src/tools/clippy/clippy_lints/src/float_literal.rs5
-rw-r--r--src/tools/clippy/clippy_lints/src/floating_point_arithmetic.rs3
-rw-r--r--src/tools/clippy/clippy_lints/src/format.rs7
-rw-r--r--src/tools/clippy/clippy_lints/src/formatting.rs16
-rw-r--r--src/tools/clippy/clippy_lints/src/get_first.rs69
-rw-r--r--src/tools/clippy/clippy_lints/src/get_last_with_len.rs107
-rw-r--r--src/tools/clippy/clippy_lints/src/identity_op.rs125
-rw-r--r--src/tools/clippy/clippy_lints/src/large_enum_variant.rs88
-rw-r--r--src/tools/clippy/clippy_lints/src/let_if_seq.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/lib.register_all.rs18
-rw-r--r--src/tools/clippy/clippy_lints/src/lib.register_complexity.rs6
-rw-r--r--src/tools/clippy/clippy_lints/src/lib.register_correctness.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/lib.register_lints.rs29
-rw-r--r--src/tools/clippy/clippy_lints/src/lib.register_nursery.rs3
-rw-r--r--src/tools/clippy/clippy_lints/src/lib.register_pedantic.rs4
-rw-r--r--src/tools/clippy/clippy_lints/src/lib.register_restriction.rs7
-rw-r--r--src/tools/clippy/clippy_lints/src/lib.register_style.rs5
-rw-r--r--src/tools/clippy/clippy_lints/src/lib.register_suspicious.rs5
-rw-r--r--src/tools/clippy/clippy_lints/src/lib.rs39
-rw-r--r--src/tools/clippy/clippy_lints/src/lifetimes.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/loops/mod.rs15
-rw-r--r--src/tools/clippy/clippy_lints/src/loops/needless_range_loop.rs57
-rw-r--r--src/tools/clippy/clippy_lints/src/loops/never_loop.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/manual_map.rs316
-rw-r--r--src/tools/clippy/clippy_lints/src/manual_non_exhaustive.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/manual_unwrap_or.rs123
-rw-r--r--src/tools/clippy/clippy_lints/src/match_on_vec_items.rs104
-rw-r--r--src/tools/clippy/clippy_lints/src/matches/collapsible_match.rs (renamed from src/tools/clippy/clippy_lints/src/collapsible_match.rs)70
-rw-r--r--src/tools/clippy/clippy_lints/src/matches/manual_map.rs306
-rw-r--r--src/tools/clippy/clippy_lints/src/matches/manual_unwrap_or.rs83
-rw-r--r--src/tools/clippy/clippy_lints/src/matches/match_bool.rs4
-rw-r--r--src/tools/clippy/clippy_lints/src/matches/match_like_matches.rs34
-rw-r--r--src/tools/clippy/clippy_lints/src/matches/match_on_vec_items.rs61
-rw-r--r--src/tools/clippy/clippy_lints/src/matches/match_str_case_mismatch.rs (renamed from src/tools/clippy/clippy_lints/src/match_str_case_mismatch.rs)75
-rw-r--r--src/tools/clippy/clippy_lints/src/matches/mod.rs351
-rw-r--r--src/tools/clippy/clippy_lints/src/matches/needless_match.rs30
-rw-r--r--src/tools/clippy/clippy_lints/src/matches/redundant_pattern_match.rs22
-rw-r--r--src/tools/clippy/clippy_lints/src/matches/significant_drop_in_scrutinee.rs (renamed from src/tools/clippy/clippy_lints/src/significant_drop_in_scrutinee.rs)216
-rw-r--r--src/tools/clippy/clippy_lints/src/matches/try_err.rs145
-rw-r--r--src/tools/clippy/clippy_lints/src/methods/get_last_with_len.rs55
-rw-r--r--src/tools/clippy/clippy_lints/src/methods/iter_next_slice.rs9
-rw-r--r--src/tools/clippy/clippy_lints/src/methods/mod.rs157
-rw-r--r--src/tools/clippy/clippy_lints/src/methods/no_effect_replace.rs47
-rw-r--r--src/tools/clippy/clippy_lints/src/methods/option_map_or_none.rs4
-rw-r--r--src/tools/clippy/clippy_lints/src/methods/unnecessary_to_owned.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/minmax.rs8
-rw-r--r--src/tools/clippy/clippy_lints/src/misc.rs14
-rw-r--r--src/tools/clippy/clippy_lints/src/mismatching_type_param_order.rs116
-rw-r--r--src/tools/clippy/clippy_lints/src/mixed_read_write_in_expression.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/mut_key.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/mutable_debug_assertion.rs7
-rw-r--r--src/tools/clippy/clippy_lints/src/needless_late_init.rs13
-rw-r--r--src/tools/clippy/clippy_lints/src/numeric_arithmetic.rs (renamed from src/tools/clippy/clippy_lints/src/arithmetic.rs)6
-rw-r--r--src/tools/clippy/clippy_lints/src/panic_in_result_fn.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/pass_by_ref_or_value.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/ptr.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/ranges.rs18
-rw-r--r--src/tools/clippy/clippy_lints/src/rc_clone_in_vec_init.rs56
-rw-r--r--src/tools/clippy/clippy_lints/src/redundant_clone.rs6
-rw-r--r--src/tools/clippy/clippy_lints/src/redundant_static_lifetimes.rs9
-rw-r--r--src/tools/clippy/clippy_lints/src/returns.rs14
-rw-r--r--src/tools/clippy/clippy_lints/src/shadow.rs53
-rw-r--r--src/tools/clippy/clippy_lints/src/size_of_in_element_count.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/swap_ptr_to_ref.rs80
-rw-r--r--src/tools/clippy/clippy_lints/src/trait_bounds.rs10
-rw-r--r--src/tools/clippy/clippy_lints/src/transmute/mod.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/transmute/useless_transmute.rs47
-rw-r--r--src/tools/clippy/clippy_lints/src/try_err.rs186
-rw-r--r--src/tools/clippy/clippy_lints/src/unused_rounding.rs69
-rw-r--r--src/tools/clippy/clippy_lints/src/use_self.rs18
-rw-r--r--src/tools/clippy/clippy_lints/src/utils/conf.rs4
-rw-r--r--src/tools/clippy/clippy_lints/src/utils/internal_lints.rs8
-rw-r--r--src/tools/clippy/clippy_lints/src/utils/internal_lints/metadata_collector.rs58
-rw-r--r--src/tools/clippy/clippy_utils/src/consts.rs2
-rw-r--r--src/tools/clippy/clippy_utils/src/higher.rs2
-rw-r--r--src/tools/clippy/clippy_utils/src/hir_utils.rs14
-rw-r--r--src/tools/clippy/clippy_utils/src/lib.rs19
-rw-r--r--src/tools/clippy/clippy_utils/src/msrvs.rs1
-rw-r--r--src/tools/clippy/clippy_utils/src/paths.rs2
-rw-r--r--src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs21
-rw-r--r--src/tools/clippy/clippy_utils/src/source.rs23
-rw-r--r--src/tools/clippy/clippy_utils/src/ty.rs22
-rw-r--r--src/tools/clippy/doc/adding_lints.md11
-rw-r--r--src/tools/clippy/doc/common_tools_writing_lints.md3
-rw-r--r--src/tools/clippy/lintcheck/Cargo.toml2
-rw-r--r--src/tools/clippy/lintcheck/src/config.rs22
-rw-r--r--src/tools/clippy/rust-toolchain2
-rw-r--r--src/tools/clippy/tests/compile-test.rs92
-rw-r--r--src/tools/clippy/tests/ui-internal/unnecessary_symbol_str.fixed1
-rw-r--r--src/tools/clippy/tests/ui-internal/unnecessary_symbol_str.rs1
-rw-r--r--src/tools/clippy/tests/ui-internal/unnecessary_symbol_str.stderr10
-rw-r--r--src/tools/clippy/tests/ui-toml/dbg_macro/clippy.toml1
-rw-r--r--src/tools/clippy/tests/ui-toml/dbg_macro/dbg_macro.rs39
-rw-r--r--src/tools/clippy/tests/ui-toml/dbg_macro/dbg_macro.stderr102
-rw-r--r--src/tools/clippy/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr1
-rw-r--r--src/tools/clippy/tests/ui-toml/unwrap_used/unwrap_used.rs2
-rw-r--r--src/tools/clippy/tests/ui/almost_complete_letter_range.fixed66
-rw-r--r--src/tools/clippy/tests/ui/almost_complete_letter_range.rs66
-rw-r--r--src/tools/clippy/tests/ui/almost_complete_letter_range.stderr100
-rw-r--r--src/tools/clippy/tests/ui/as_underscore.fixed13
-rw-r--r--src/tools/clippy/tests/ui/as_underscore.rs13
-rw-r--r--src/tools/clippy/tests/ui/as_underscore.stderr20
-rw-r--r--src/tools/clippy/tests/ui/auxiliary/proc_macro_attr.rs5
-rw-r--r--src/tools/clippy/tests/ui/bind_instead_of_map_multipart.fixed62
-rw-r--r--src/tools/clippy/tests/ui/bind_instead_of_map_multipart.rs1
-rw-r--r--src/tools/clippy/tests/ui/bind_instead_of_map_multipart.stderr12
-rw-r--r--src/tools/clippy/tests/ui/borrow_deref_ref.fixed59
-rw-r--r--src/tools/clippy/tests/ui/borrow_deref_ref.rs59
-rw-r--r--src/tools/clippy/tests/ui/borrow_deref_ref.stderr22
-rw-r--r--src/tools/clippy/tests/ui/borrow_deref_ref_unfixable.rs10
-rw-r--r--src/tools/clippy/tests/ui/borrow_deref_ref_unfixable.stderr18
-rw-r--r--src/tools/clippy/tests/ui/cast_abs_to_unsigned.fixed21
-rw-r--r--src/tools/clippy/tests/ui/cast_abs_to_unsigned.rs21
-rw-r--r--src/tools/clippy/tests/ui/cast_abs_to_unsigned.stderr92
-rw-r--r--src/tools/clippy/tests/ui/collapsible_match2.rs2
-rw-r--r--src/tools/clippy/tests/ui/collapsible_match2.stderr4
-rw-r--r--src/tools/clippy/tests/ui/crashes/ice-6256.stderr22
-rw-r--r--src/tools/clippy/tests/ui/crashes/ice-8850.rs27
-rw-r--r--src/tools/clippy/tests/ui/crashes/ice-8850.stderr45
-rw-r--r--src/tools/clippy/tests/ui/dbg_macro.stderr35
-rw-r--r--src/tools/clippy/tests/ui/debug_assert_with_mut_call.rs2
-rw-r--r--src/tools/clippy/tests/ui/deref_by_slicing.fixed1
-rw-r--r--src/tools/clippy/tests/ui/deref_by_slicing.rs1
-rw-r--r--src/tools/clippy/tests/ui/deref_by_slicing.stderr18
-rw-r--r--src/tools/clippy/tests/ui/derive_partial_eq_without_eq.fixed6
-rw-r--r--src/tools/clippy/tests/ui/derive_partial_eq_without_eq.rs6
-rw-r--r--src/tools/clippy/tests/ui/doc_link_with_quotes.rs12
-rw-r--r--src/tools/clippy/tests/ui/doc_link_with_quotes.stderr10
-rw-r--r--src/tools/clippy/tests/ui/empty_line_after_outer_attribute.rs7
-rw-r--r--src/tools/clippy/tests/ui/explicit_deref_methods.fixed7
-rw-r--r--src/tools/clippy/tests/ui/explicit_deref_methods.rs7
-rw-r--r--src/tools/clippy/tests/ui/explicit_deref_methods.stderr24
-rw-r--r--src/tools/clippy/tests/ui/forget_ref.rs1
-rw-r--r--src/tools/clippy/tests/ui/forget_ref.stderr36
-rw-r--r--src/tools/clippy/tests/ui/get_first.fixed42
-rw-r--r--src/tools/clippy/tests/ui/get_first.rs42
-rw-r--r--src/tools/clippy/tests/ui/get_first.stderr22
-rw-r--r--src/tools/clippy/tests/ui/get_last_with_len.fixed28
-rw-r--r--src/tools/clippy/tests/ui/get_last_with_len.rs28
-rw-r--r--src/tools/clippy/tests/ui/get_last_with_len.stderr36
-rw-r--r--src/tools/clippy/tests/ui/get_unwrap.fixed2
-rw-r--r--src/tools/clippy/tests/ui/get_unwrap.rs2
-rw-r--r--src/tools/clippy/tests/ui/identity_op.fixed119
-rw-r--r--src/tools/clippy/tests/ui/identity_op.rs63
-rw-r--r--src/tools/clippy/tests/ui/identity_op.stderr260
-rw-r--r--src/tools/clippy/tests/ui/implicit_clone.fixed118
-rw-r--r--src/tools/clippy/tests/ui/implicit_clone.rs3
-rw-r--r--src/tools/clippy/tests/ui/implicit_clone.stderr24
-rw-r--r--src/tools/clippy/tests/ui/issue_2356.fixed26
-rw-r--r--src/tools/clippy/tests/ui/issue_2356.rs2
-rw-r--r--src/tools/clippy/tests/ui/issue_2356.stderr4
-rw-r--r--src/tools/clippy/tests/ui/iter_next_slice.fixed8
-rw-r--r--src/tools/clippy/tests/ui/iter_next_slice.rs4
-rw-r--r--src/tools/clippy/tests/ui/iter_next_slice.stderr4
-rw-r--r--src/tools/clippy/tests/ui/large_enum_variant.rs32
-rw-r--r--src/tools/clippy/tests/ui/large_enum_variant.stderr68
-rw-r--r--src/tools/clippy/tests/ui/map_flatten_fixable.fixed37
-rw-r--r--src/tools/clippy/tests/ui/map_flatten_fixable.rs36
-rw-r--r--src/tools/clippy/tests/ui/map_flatten_fixable.stderr28
-rw-r--r--src/tools/clippy/tests/ui/match_ref_pats.fixed118
-rw-r--r--src/tools/clippy/tests/ui/match_ref_pats.rs3
-rw-r--r--src/tools/clippy/tests/ui/match_ref_pats.stderr10
-rw-r--r--src/tools/clippy/tests/ui/match_str_case_mismatch.fixed186
-rw-r--r--src/tools/clippy/tests/ui/match_str_case_mismatch.rs2
-rw-r--r--src/tools/clippy/tests/ui/match_str_case_mismatch.stderr14
-rw-r--r--src/tools/clippy/tests/ui/mismatching_type_param_order.rs60
-rw-r--r--src/tools/clippy/tests/ui/mismatching_type_param_order.stderr83
-rw-r--r--src/tools/clippy/tests/ui/modulo_one.rs2
-rw-r--r--src/tools/clippy/tests/ui/modulo_one.stderr10
-rw-r--r--src/tools/clippy/tests/ui/needless_late_init.fixed273
-rw-r--r--src/tools/clippy/tests/ui/needless_late_init.rs44
-rw-r--r--src/tools/clippy/tests/ui/needless_late_init.stderr93
-rw-r--r--src/tools/clippy/tests/ui/needless_late_init_fixable.fixed19
-rw-r--r--src/tools/clippy/tests/ui/needless_late_init_fixable.rs19
-rw-r--r--src/tools/clippy/tests/ui/needless_late_init_fixable.stderr70
-rw-r--r--src/tools/clippy/tests/ui/needless_lifetimes.rs3
-rw-r--r--src/tools/clippy/tests/ui/needless_lifetimes.stderr62
-rw-r--r--src/tools/clippy/tests/ui/needless_return.fixed10
-rw-r--r--src/tools/clippy/tests/ui/needless_return.rs6
-rw-r--r--src/tools/clippy/tests/ui/needless_return.stderr20
-rw-r--r--src/tools/clippy/tests/ui/no_effect_replace.rs51
-rw-r--r--src/tools/clippy/tests/ui/no_effect_replace.stderr52
-rw-r--r--src/tools/clippy/tests/ui/nonminimal_bool_methods.fixed111
-rw-r--r--src/tools/clippy/tests/ui/nonminimal_bool_methods.rs1
-rw-r--r--src/tools/clippy/tests/ui/nonminimal_bool_methods.stderr26
-rw-r--r--src/tools/clippy/tests/ui/range_contains.fixed7
-rw-r--r--src/tools/clippy/tests/ui/range_contains.rs7
-rw-r--r--src/tools/clippy/tests/ui/range_contains.stderr26
-rw-r--r--src/tools/clippy/tests/ui/rc_buffer.fixed28
-rw-r--r--src/tools/clippy/tests/ui/rc_buffer.rs2
-rw-r--r--src/tools/clippy/tests/ui/rc_buffer.stderr16
-rw-r--r--src/tools/clippy/tests/ui/rc_buffer_arc.fixed27
-rw-r--r--src/tools/clippy/tests/ui/rc_buffer_arc.rs2
-rw-r--r--src/tools/clippy/tests/ui/rc_buffer_arc.stderr16
-rw-r--r--src/tools/clippy/tests/ui/rc_clone_in_vec_init/arc.stderr16
-rw-r--r--src/tools/clippy/tests/ui/rc_clone_in_vec_init/rc.stderr16
-rw-r--r--src/tools/clippy/tests/ui/rc_clone_in_vec_init/weak.rs83
-rw-r--r--src/tools/clippy/tests/ui/rc_clone_in_vec_init/weak.stderr201
-rw-r--r--src/tools/clippy/tests/ui/recursive_format_impl.rs3
-rw-r--r--src/tools/clippy/tests/ui/recursive_format_impl.stderr20
-rw-r--r--src/tools/clippy/tests/ui/shadow.rs7
-rw-r--r--src/tools/clippy/tests/ui/significant_drop_in_scrutinee.rs39
-rw-r--r--src/tools/clippy/tests/ui/significant_drop_in_scrutinee.stderr60
-rw-r--r--src/tools/clippy/tests/ui/suspicious_operation_groupings.fixed209
-rw-r--r--src/tools/clippy/tests/ui/suspicious_operation_groupings.rs3
-rw-r--r--src/tools/clippy/tests/ui/suspicious_operation_groupings.stderr52
-rw-r--r--src/tools/clippy/tests/ui/swap_ptr_to_ref.fixed24
-rw-r--r--src/tools/clippy/tests/ui/swap_ptr_to_ref.rs24
-rw-r--r--src/tools/clippy/tests/ui/swap_ptr_to_ref.stderr28
-rw-r--r--src/tools/clippy/tests/ui/swap_ptr_to_ref_unfixable.rs18
-rw-r--r--src/tools/clippy/tests/ui/swap_ptr_to_ref_unfixable.stderr22
-rw-r--r--src/tools/clippy/tests/ui/transmute.rs19
-rw-r--r--src/tools/clippy/tests/ui/transmute.stderr88
-rw-r--r--src/tools/clippy/tests/ui/transmute_undefined_repr.rs2
-rw-r--r--src/tools/clippy/tests/ui/unicode.fixed36
-rw-r--r--src/tools/clippy/tests/ui/unicode.rs1
-rw-r--r--src/tools/clippy/tests/ui/unicode.stderr14
-rw-r--r--src/tools/clippy/tests/ui/unit_arg_empty_blocks.fixed30
-rw-r--r--src/tools/clippy/tests/ui/unit_arg_empty_blocks.rs1
-rw-r--r--src/tools/clippy/tests/ui/unit_arg_empty_blocks.stderr8
-rw-r--r--src/tools/clippy/tests/ui/unnecessary_cast.fixed91
-rw-r--r--src/tools/clippy/tests/ui/unnecessary_cast.rs54
-rw-r--r--src/tools/clippy/tests/ui/unnecessary_cast.stderr120
-rw-r--r--src/tools/clippy/tests/ui/unnecessary_cast_fixable.fixed50
-rw-r--r--src/tools/clippy/tests/ui/unnecessary_cast_fixable.rs50
-rw-r--r--src/tools/clippy/tests/ui/unnecessary_cast_fixable.stderr106
-rw-r--r--src/tools/clippy/tests/ui/unused_rounding.fixed9
-rw-r--r--src/tools/clippy/tests/ui/unused_rounding.rs9
-rw-r--r--src/tools/clippy/tests/ui/unused_rounding.stderr22
-rw-r--r--src/tools/clippy/tests/ui/use_self.fixed66
-rw-r--r--src/tools/clippy/tests/ui/use_self.rs66
-rw-r--r--src/tools/clippy/tests/ui/use_self.stderr62
-rw-r--r--src/tools/clippy/util/gh-pages/script.js37
-rw-r--r--src/tools/compiletest/src/common.rs3
-rw-r--r--src/tools/compiletest/src/header.rs1
-rw-r--r--src/tools/compiletest/src/read2.rs157
-rw-r--r--src/tools/compiletest/src/read2/tests.rs123
-rw-r--r--src/tools/compiletest/src/runtest.rs42
m---------src/tools/miri18
-rw-r--r--src/tools/rustc-workspace-hack/Cargo.toml1
-rw-r--r--src/tools/tidy/src/error_codes_check.rs4
-rw-r--r--triagebot.toml10
1530 files changed, 14820 insertions, 21088 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 451116f320d..a7be9978c0b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -98,9 +98,6 @@ jobs:
       - name: install WIX
         run: src/ci/scripts/install-wix.sh
         if: success() && !env.SKIP_JOB
-      - name: ensure the build happens on a partition with enough space
-        run: src/ci/scripts/symlink-build-dir.sh
-        if: success() && !env.SKIP_JOB
       - name: disable git crlf conversion
         run: src/ci/scripts/disable-git-crlf-conversion.sh
         if: success() && !env.SKIP_JOB
@@ -496,9 +493,6 @@ jobs:
       - name: install WIX
         run: src/ci/scripts/install-wix.sh
         if: success() && !env.SKIP_JOB
-      - name: ensure the build happens on a partition with enough space
-        run: src/ci/scripts/symlink-build-dir.sh
-        if: success() && !env.SKIP_JOB
       - name: disable git crlf conversion
         run: src/ci/scripts/disable-git-crlf-conversion.sh
         if: success() && !env.SKIP_JOB
@@ -609,9 +603,6 @@ jobs:
       - name: install WIX
         run: src/ci/scripts/install-wix.sh
         if: success() && !env.SKIP_JOB
-      - name: ensure the build happens on a partition with enough space
-        run: src/ci/scripts/symlink-build-dir.sh
-        if: success() && !env.SKIP_JOB
       - name: disable git crlf conversion
         run: src/ci/scripts/disable-git-crlf-conversion.sh
         if: success() && !env.SKIP_JOB
diff --git a/Cargo.lock b/Cargo.lock
index 7ed327e9f4c..4a9b35fe4ab 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -223,6 +223,7 @@ dependencies = [
  "pretty_assertions 0.7.2",
  "serde",
  "serde_json",
+ "sysinfo",
  "tar",
  "toml",
  "winapi",
@@ -353,7 +354,7 @@ dependencies = [
  "percent-encoding 2.1.0",
  "pretty_env_logger",
  "rustc-workspace-hack",
- "rustfix 0.6.0",
+ "rustfix",
  "semver",
  "serde",
  "serde_ignored",
@@ -637,7 +638,7 @@ dependencies = [
  "futures 0.3.19",
  "if_chain",
  "itertools",
- "parking_lot",
+ "parking_lot 0.12.1",
  "quote",
  "regex",
  "rustc-semver",
@@ -657,7 +658,7 @@ name = "clippy_dev"
 version = "0.0.1"
 dependencies = [
  "aho-corasick",
- "clap 2.34.0",
+ "clap 3.1.1",
  "indoc",
  "itertools",
  "opener",
@@ -766,7 +767,7 @@ dependencies = [
  "libc",
  "miow",
  "regex",
- "rustfix 0.6.0",
+ "rustfix",
  "serde",
  "serde_json",
  "tracing",
@@ -778,9 +779,9 @@ dependencies = [
 
 [[package]]
 name = "compiletest_rs"
-version = "0.7.1"
+version = "0.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29843cb8d351febf86557681d049d1e1652b81a086a190fa1173c07fd17fbf83"
+checksum = "262134ef87408da1ddfe45e33daa0ca43b75286d6b1076446e602d264cf9847e"
 dependencies = [
  "diff",
  "filetime",
@@ -790,7 +791,7 @@ dependencies = [
  "log",
  "miow",
  "regex",
- "rustfix 0.5.1",
+ "rustfix",
  "serde",
  "serde_derive",
  "serde_json",
@@ -2040,7 +2041,7 @@ dependencies = [
  "jsonrpc-server-utils",
  "log",
  "parity-tokio-ipc",
- "parking_lot",
+ "parking_lot 0.11.2",
  "tower-service",
 ]
 
@@ -2054,7 +2055,7 @@ dependencies = [
  "jsonrpc-core",
  "lazy_static",
  "log",
- "parking_lot",
+ "parking_lot 0.11.2",
  "rand 0.7.3",
  "serde",
 ]
@@ -2202,10 +2203,11 @@ version = "0.1.0"
 
 [[package]]
 name = "lock_api"
-version = "0.4.5"
+version = "0.4.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109"
+checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53"
 dependencies = [
+ "autocfg",
  "scopeguard",
 ]
 
@@ -2340,7 +2342,7 @@ checksum = "78f7a41bc6f856a2cf0e95094ad5121f82500e2d9a0f3c0171d98f6566d8117d"
 dependencies = [
  "log",
  "memmap2",
- "parking_lot",
+ "parking_lot 0.11.2",
  "perf-event-open-sys",
  "rustc-hash",
  "smallvec",
@@ -2354,7 +2356,7 @@ checksum = "bd460fad6e55ca82fa0cd9dab0d315294188fd9ec6efbf4105e5635d4872ef9c"
 dependencies = [
  "log",
  "memmap2",
- "parking_lot",
+ "parking_lot 0.11.2",
  "perf-event-open-sys",
  "rustc-hash",
  "smallvec",
@@ -2703,7 +2705,17 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
 dependencies = [
  "instant",
  "lock_api",
- "parking_lot_core",
+ "parking_lot_core 0.8.5",
+]
+
+[[package]]
+name = "parking_lot"
+version = "0.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
+dependencies = [
+ "lock_api",
+ "parking_lot_core 0.9.3",
 ]
 
 [[package]]
@@ -2721,6 +2733,19 @@ dependencies = [
 ]
 
 [[package]]
+name = "parking_lot_core"
+version = "0.9.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929"
+dependencies = [
+ "cfg-if 1.0.0",
+ "libc",
+ "redox_syscall",
+ "smallvec",
+ "windows-sys",
+]
+
+[[package]]
 name = "pathdiff"
 version = "0.2.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3686,6 +3711,7 @@ dependencies = [
  "rustc_span",
  "rustc_symbol_mangling",
  "rustc_target",
+ "serde_json",
  "smallvec",
  "snap",
  "tempfile",
@@ -3730,7 +3756,7 @@ dependencies = [
  "libc",
  "measureme 10.0.0",
  "memmap2",
- "parking_lot",
+ "parking_lot 0.11.2",
  "rustc-hash",
  "rustc-rayon",
  "rustc-rayon-core",
@@ -3774,6 +3800,7 @@ dependencies = [
  "rustc_span",
  "rustc_target",
  "rustc_typeck",
+ "serde_json",
  "tracing",
  "winapi",
 ]
@@ -3809,6 +3836,8 @@ dependencies = [
  "rustc_macros",
  "rustc_serialize",
  "rustc_span",
+ "serde",
+ "serde_json",
  "termcolor",
  "termize",
  "tracing",
@@ -4024,6 +4053,7 @@ dependencies = [
  "rustc_serialize",
  "rustc_span",
  "rustc_target",
+ "serde",
 ]
 
 [[package]]
@@ -4310,7 +4340,7 @@ dependencies = [
 name = "rustc_query_system"
 version = "0.0.0"
 dependencies = [
- "parking_lot",
+ "parking_lot 0.11.2",
  "rustc-rayon-core",
  "rustc_arena",
  "rustc_ast",
@@ -4445,6 +4475,7 @@ dependencies = [
  "rustc_macros",
  "rustc_serialize",
  "rustc_span",
+ "serde_json",
  "tracing",
 ]
 
@@ -4612,21 +4643,9 @@ dependencies = [
 
 [[package]]
 name = "rustfix"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2c50b74badcddeb8f7652fa8323ce440b95286f8e4b64ebfd871c609672704e"
-dependencies = [
- "anyhow",
- "log",
- "serde",
- "serde_json",
-]
-
-[[package]]
-name = "rustfix"
-version = "0.6.0"
+version = "0.6.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f0be05fc0675ef4f47119dc39cfc46636bb77d4fc4ef1bd851b9c3f7697f32a"
+checksum = "ecd2853d9e26988467753bd9912c3a126f642d05d229a4b53f5752ee36c56481"
 dependencies = [
  "anyhow",
  "log",
@@ -5016,7 +5035,7 @@ checksum = "33994d0838dc2d152d17a62adf608a869b5e846b65b389af7f3dbc1de45c5b26"
 dependencies = [
  "lazy_static",
  "new_debug_unreachable",
- "parking_lot",
+ "parking_lot 0.11.2",
  "phf_shared",
  "precomputed-hash",
  "serde",
@@ -5121,6 +5140,21 @@ dependencies = [
 ]
 
 [[package]]
+name = "sysinfo"
+version = "0.24.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a6a8e71535da31837213ac114531d31def75d7aebd133264e420a3451fa7f703"
+dependencies = [
+ "cfg-if 1.0.0",
+ "core-foundation-sys",
+ "libc",
+ "ntapi",
+ "once_cell",
+ "rayon",
+ "winapi",
+]
+
+[[package]]
 name = "tar"
 version = "0.4.37"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5445,7 +5479,7 @@ dependencies = [
  "ansi_term",
  "lazy_static",
  "matchers",
- "parking_lot",
+ "parking_lot 0.11.2",
  "regex",
  "sharded-slab",
  "smallvec",
@@ -5848,6 +5882,49 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
 
 [[package]]
+name = "windows-sys"
+version = "0.36.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2"
+dependencies = [
+ "windows_aarch64_msvc",
+ "windows_i686_gnu",
+ "windows_i686_msvc",
+ "windows_x86_64_gnu",
+ "windows_x86_64_msvc",
+]
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.36.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.36.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.36.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.36.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.36.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
+
+[[package]]
 name = "xattr"
 version = "0.2.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/compiler/rustc_apfloat/src/lib.rs b/compiler/rustc_apfloat/src/lib.rs
index 143c6f7610c..cfc3d5b15a6 100644
--- a/compiler/rustc_apfloat/src/lib.rs
+++ b/compiler/rustc_apfloat/src/lib.rs
@@ -33,7 +33,6 @@
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
 #![no_std]
 #![forbid(unsafe_code)]
-#![feature(nll)]
 
 #[macro_use]
 extern crate alloc;
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs
index b81f7a24270..b64f7b8ad1b 100644
--- a/compiler/rustc_ast/src/ast.rs
+++ b/compiler/rustc_ast/src/ast.rs
@@ -41,9 +41,6 @@ use std::convert::TryFrom;
 use std::fmt;
 use std::mem;
 
-#[cfg(test)]
-mod tests;
-
 /// A "Label" is an identifier of some point in sources,
 /// e.g. in the following code:
 ///
@@ -2476,8 +2473,8 @@ rustc_index::newtype_index! {
 }
 
 impl<S: Encoder> rustc_serialize::Encodable<S> for AttrId {
-    fn encode(&self, s: &mut S) -> Result<(), S::Error> {
-        s.emit_unit()
+    fn encode(&self, _s: &mut S) -> Result<(), S::Error> {
+        Ok(())
     }
 }
 
diff --git a/compiler/rustc_ast/src/ast/tests.rs b/compiler/rustc_ast/src/ast/tests.rs
deleted file mode 100644
index 8ba55bf037b..00000000000
--- a/compiler/rustc_ast/src/ast/tests.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-use super::*;
-
-// Are ASTs encodable?
-#[test]
-fn check_asts_encodable() {
-    fn assert_encodable<
-        T: for<'a> rustc_serialize::Encodable<rustc_serialize::json::Encoder<'a>>,
-    >() {
-    }
-    assert_encodable::<Crate>();
-}
diff --git a/compiler/rustc_ast/src/lib.rs b/compiler/rustc_ast/src/lib.rs
index 2015d635e56..4b94ec0d6d8 100644
--- a/compiler/rustc_ast/src/lib.rs
+++ b/compiler/rustc_ast/src/lib.rs
@@ -17,7 +17,6 @@
 #![feature(let_chains)]
 #![feature(min_specialization)]
 #![feature(negative_impls)]
-#![feature(nll)]
 #![feature(slice_internals)]
 #![feature(stmt_expr_attributes)]
 #![recursion_limit = "256"]
diff --git a/compiler/rustc_ast_lowering/src/index.rs b/compiler/rustc_ast_lowering/src/index.rs
index c506360aa8a..4da09c4ef48 100644
--- a/compiler/rustc_ast_lowering/src/index.rs
+++ b/compiler/rustc_ast_lowering/src/index.rs
@@ -313,6 +313,13 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
         });
     }
 
+    fn visit_assoc_type_binding(&mut self, type_binding: &'hir TypeBinding<'hir>) {
+        self.insert(type_binding.span, type_binding.hir_id, Node::TypeBinding(type_binding));
+        self.with_parent(type_binding.hir_id, |this| {
+            intravisit::walk_assoc_type_binding(this, type_binding)
+        })
+    }
+
     fn visit_trait_item_ref(&mut self, ii: &'hir TraitItemRef) {
         // Do not visit the duplicate information in TraitItemRef. We want to
         // map the actual nodes, not the duplicate ones in the *Ref.
diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs
index 85d3bf66d8e..dab4d76857a 100644
--- a/compiler/rustc_ast_lowering/src/item.rs
+++ b/compiler/rustc_ast_lowering/src/item.rs
@@ -266,7 +266,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
                     let body_id =
                         this.lower_maybe_async_body(span, &decl, asyncness, body.as_deref());
 
-                    let itctx = ImplTraitContext::Universal(this.current_hir_id_owner);
+                    let itctx = ImplTraitContext::Universal;
                     let (generics, decl) = this.lower_generics(generics, id, itctx, |this| {
                         let ret_id = asyncness.opt_return_id();
                         this.lower_fn_decl(&decl, Some(id), FnDeclKind::Fn, ret_id)
@@ -385,7 +385,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
                 // method, it will not be considered an in-band
                 // lifetime to be added, but rather a reference to a
                 // parent lifetime.
-                let itctx = ImplTraitContext::Universal(self.current_hir_id_owner);
+                let itctx = ImplTraitContext::Universal;
                 let (generics, (trait_ref, lowered_ty)) =
                     self.lower_generics(ast_generics, id, itctx, |this| {
                         let trait_ref = trait_ref.as_ref().map(|trait_ref| {
@@ -655,7 +655,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
             kind: match i.kind {
                 ForeignItemKind::Fn(box Fn { ref sig, ref generics, .. }) => {
                     let fdec = &sig.decl;
-                    let itctx = ImplTraitContext::Universal(self.current_hir_id_owner);
+                    let itctx = ImplTraitContext::Universal;
                     let (generics, (fn_dec, fn_args)) =
                         self.lower_generics(generics, i.id, itctx, |this| {
                             (
@@ -1237,7 +1237,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
         is_async: Option<NodeId>,
     ) -> (&'hir hir::Generics<'hir>, hir::FnSig<'hir>) {
         let header = self.lower_fn_header(sig.header);
-        let itctx = ImplTraitContext::Universal(self.current_hir_id_owner);
+        let itctx = ImplTraitContext::Universal;
         let (generics, decl) = self.lower_generics(generics, id, itctx, |this| {
             this.lower_fn_decl(&sig.decl, Some(id), kind, is_async)
         });
@@ -1374,7 +1374,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
                 .map(|predicate| self.lower_where_predicate(predicate)),
         );
 
-        let mut params: Vec<_> = self.lower_generic_params_mut(&generics.params).collect();
+        let mut params: SmallVec<[hir::GenericParam<'hir>; 4]> =
+            self.lower_generic_params_mut(&generics.params).collect();
         let has_where_clause = !generics.where_clause.predicates.is_empty();
         let where_clause_span = self.lower_span(generics.where_clause.span);
         let span = self.lower_span(generics.span);
diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs
index 96db40cb95b..51e5c3384a7 100644
--- a/compiler/rustc_ast_lowering/src/lib.rs
+++ b/compiler/rustc_ast_lowering/src/lib.rs
@@ -46,7 +46,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet};
 use rustc_data_structures::sorted_map::SortedMap;
 use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
 use rustc_data_structures::sync::Lrc;
-use rustc_errors::struct_span_err;
+use rustc_errors::{struct_span_err, Applicability};
 use rustc_hir as hir;
 use rustc_hir::def::{DefKind, Namespace, PartialRes, PerNS, Res};
 use rustc_hir::def_id::{DefId, DefPathHash, LocalDefId, CRATE_DEF_ID};
@@ -253,7 +253,7 @@ enum ImplTraitContext {
     /// equivalent to a fresh universal parameter like `fn foo<T: Debug>(x: T)`.
     ///
     /// Newly generated parameters should be inserted into the given `Vec`.
-    Universal(LocalDefId),
+    Universal,
 
     /// Treat `impl Trait` as shorthand for a new opaque type.
     /// Example: `fn foo() -> impl Debug`, where `impl Debug` is conceptually
@@ -672,9 +672,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
             LifetimeRes::Param { .. } => {
                 (hir::ParamName::Plain(ident), hir::LifetimeParamKind::Explicit)
             }
-            LifetimeRes::Fresh { param, .. } => {
-                (hir::ParamName::Fresh(param), hir::LifetimeParamKind::Elided)
-            }
+            LifetimeRes::Fresh { .. } => (hir::ParamName::Fresh, hir::LifetimeParamKind::Elided),
             LifetimeRes::Static | LifetimeRes::Error => return None,
             res => panic!(
                 "Unexpected lifetime resolution {:?} for {:?} at {:?}",
@@ -859,7 +857,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
         itctx: ImplTraitContext,
     ) -> hir::TypeBinding<'hir> {
         debug!("lower_assoc_ty_constraint(constraint={:?}, itctx={:?})", constraint, itctx);
-
         // lower generic arguments of identifier in constraint
         let gen_args = if let Some(ref gen_args) = constraint.gen_args {
             let gen_args_ctor = match gen_args {
@@ -867,12 +864,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
                     self.lower_angle_bracketed_parameter_data(data, ParamMode::Explicit, itctx).0
                 }
                 GenericArgs::Parenthesized(ref data) => {
-                    let mut err = self.sess.struct_span_err(
-                        gen_args.span(),
-                        "parenthesized generic arguments cannot be used in associated type constraints"
-                    );
-                    // FIXME: try to write a suggestion here
-                    err.emit();
+                    self.assoc_ty_contraint_param_error_emit(data);
                     self.lower_angle_bracketed_parameter_data(
                         &data.as_angle_bracketed_args(),
                         ParamMode::Explicit,
@@ -895,7 +887,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
                 hir::TypeBindingKind::Equality { term }
             }
             AssocConstraintKind::Bound { ref bounds } => {
-                let mut parent_def_id = self.current_hir_id_owner;
                 // Piggy-back on the `impl Trait` context to figure out the correct behavior.
                 let (desugar_to_impl_trait, itctx) = match itctx {
                     // We are in the return position:
@@ -915,10 +906,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
                     // so desugar to
                     //
                     //     fn foo(x: dyn Iterator<Item = impl Debug>)
-                    ImplTraitContext::Universal(parent) if self.is_in_dyn_type => {
-                        parent_def_id = parent;
-                        (true, itctx)
-                    }
+                    ImplTraitContext::Universal if self.is_in_dyn_type => (true, itctx),
 
                     // In `type Foo = dyn Iterator<Item: Debug>` we desugar to
                     // `type Foo = dyn Iterator<Item = impl Debug>` but we have to override the
@@ -944,6 +932,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
                     // Desugar `AssocTy: Bounds` into `AssocTy = impl Bounds`. We do this by
                     // constructing the HIR for `impl bounds...` and then lowering that.
 
+                    let parent_def_id = self.current_hir_id_owner;
                     let impl_trait_node_id = self.resolver.next_node_id();
                     self.resolver.create_def(
                         parent_def_id,
@@ -986,6 +975,42 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
         }
     }
 
+    fn assoc_ty_contraint_param_error_emit(&self, data: &ParenthesizedArgs) -> () {
+        let mut err = self.sess.struct_span_err(
+            data.span,
+            "parenthesized generic arguments cannot be used in associated type constraints",
+        );
+        // Suggest removing empty parentheses: "Trait()" -> "Trait"
+        if data.inputs.is_empty() {
+            let parentheses_span =
+                data.inputs_span.shrink_to_lo().to(data.inputs_span.shrink_to_hi());
+            err.multipart_suggestion(
+                "remove these parentheses",
+                vec![(parentheses_span, String::new())],
+                Applicability::MaybeIncorrect,
+            );
+        }
+        // Suggest replacing parentheses with angle brackets `Trait(params...)` to `Trait<params...>`
+        else {
+            // Start of parameters to the 1st argument
+            let open_param = data.inputs_span.shrink_to_lo().to(data
+                .inputs
+                .first()
+                .unwrap()
+                .span
+                .shrink_to_lo());
+            // End of last argument to end of parameters
+            let close_param =
+                data.inputs.last().unwrap().span.shrink_to_hi().to(data.inputs_span.shrink_to_hi());
+            err.multipart_suggestion(
+                &format!("use angle brackets instead",),
+                vec![(open_param, String::from("<")), (close_param, String::from(">"))],
+                Applicability::MaybeIncorrect,
+            );
+        }
+        err.emit();
+    }
+
     fn lower_generic_arg(
         &mut self,
         arg: &ast::GenericArg,
@@ -1186,12 +1211,12 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
                             |this| this.lower_param_bounds(bounds, nested_itctx),
                         )
                     }
-                    ImplTraitContext::Universal(parent_def_id) => {
+                    ImplTraitContext::Universal => {
                         // Add a definition for the in-band `Param`.
                         let def_id = self.resolver.local_def_id(def_node_id);
 
-                        let hir_bounds = self
-                            .lower_param_bounds(bounds, ImplTraitContext::Universal(parent_def_id));
+                        let hir_bounds =
+                            self.lower_param_bounds(bounds, ImplTraitContext::Universal);
                         // Set the name to `impl Bound1 + Bound2`.
                         let ident = Ident::from_str_and_span(&pprust::ty_to_string(t), span);
                         let param = hir::GenericParam {
@@ -1401,10 +1426,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
         }
         let inputs = self.arena.alloc_from_iter(inputs.iter().map(|param| {
             if fn_node_id.is_some() {
-                self.lower_ty_direct(
-                    &param.ty,
-                    ImplTraitContext::Universal(self.current_hir_id_owner),
-                )
+                self.lower_ty_direct(&param.ty, ImplTraitContext::Universal)
             } else {
                 self.lower_ty_direct(
                     &param.ty,
@@ -1576,10 +1598,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
                     (hir::ParamName::Plain(ident), LifetimeRes::Param { param, binder: fn_node_id })
                 }
                 // Input lifetime like `'1`:
-                LifetimeRes::Fresh { param, .. } => (
-                    hir::ParamName::Fresh(outer_def_id),
-                    LifetimeRes::Fresh { param, binder: fn_node_id },
-                ),
+                LifetimeRes::Fresh { param, .. } => {
+                    (hir::ParamName::Fresh, LifetimeRes::Fresh { param, binder: fn_node_id })
+                }
                 LifetimeRes::Static | LifetimeRes::Error => continue,
                 res => {
                     panic!("Unexpected lifetime resolution {:?} for {:?} at {:?}", res, ident, span)
@@ -1749,7 +1770,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
     ) -> hir::Lifetime {
         debug!(?self.captured_lifetimes);
         let name = match res {
-            LifetimeRes::Param { param, binder } => {
+            LifetimeRes::Param { mut param, binder } => {
                 debug_assert_ne!(ident.name, kw::UnderscoreLifetime);
                 let p_name = ParamName::Plain(ident);
                 if let Some(LifetimeCaptureContext { parent_def_id, captures, binders_to_ignore }) =
@@ -1757,10 +1778,10 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
                     && !binders_to_ignore.contains(&binder)
                 {
                     match captures.entry(param) {
-                        Entry::Occupied(_) => {}
+                        Entry::Occupied(o) => param = self.resolver.local_def_id(o.get().1),
                         Entry::Vacant(v) => {
                             let p_id = self.resolver.next_node_id();
-                            self.resolver.create_def(
+                            let p_def_id = self.resolver.create_def(
                                 *parent_def_id,
                                 p_id,
                                 DefPathData::LifetimeNs(p_name.ident().name),
@@ -1769,10 +1790,11 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
                             );
 
                             v.insert((span, p_id, p_name, res));
+                            param = p_def_id;
                         }
                     }
                 }
-                hir::LifetimeName::Param(p_name)
+                hir::LifetimeName::Param(param, p_name)
             }
             LifetimeRes::Fresh { mut param, binder } => {
                 debug_assert_eq!(ident.name, kw::UnderscoreLifetime);
@@ -1792,21 +1814,14 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
                                 span.with_parent(None),
                             );
 
-                            let p_name = ParamName::Fresh(param);
-                            v.insert((span, p_id, p_name, res));
+                            v.insert((span, p_id, ParamName::Fresh, res));
                             param = p_def_id;
                         }
                     }
                 }
-                let p_name = ParamName::Fresh(param);
-                hir::LifetimeName::Param(p_name)
+                hir::LifetimeName::Param(param, ParamName::Fresh)
             }
             LifetimeRes::Anonymous { binder, elided } => {
-                let l_name = if elided {
-                    hir::LifetimeName::Implicit
-                } else {
-                    hir::LifetimeName::Underscore
-                };
                 if let Some(LifetimeCaptureContext { parent_def_id, captures, binders_to_ignore }) =
                     &mut self.captured_lifetimes
                     && !binders_to_ignore.contains(&binder)
@@ -1819,11 +1834,12 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
                         ExpnId::root(),
                         span.with_parent(None),
                     );
-                    let p_name = ParamName::Fresh(p_def_id);
-                    captures.insert(p_def_id, (span, p_id, p_name, res));
-                    hir::LifetimeName::Param(p_name)
+                    captures.insert(p_def_id, (span, p_id, ParamName::Fresh, res));
+                    hir::LifetimeName::Param(p_def_id, ParamName::Fresh)
+                } else if elided {
+                    hir::LifetimeName::Implicit
                 } else {
-                    l_name
+                    hir::LifetimeName::Underscore
                 }
             }
             LifetimeRes::Static => hir::LifetimeName::Static,
@@ -1831,6 +1847,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
             res => panic!("Unexpected lifetime resolution {:?} for {:?} at {:?}", res, ident, span),
         };
         debug!(?self.captured_lifetimes);
+        debug!(?name);
         hir::Lifetime { hir_id: self.lower_node_id(id), span: self.lower_span(span), name }
     }
 
diff --git a/compiler/rustc_ast_passes/src/ast_validation.rs b/compiler/rustc_ast_passes/src/ast_validation.rs
index 0520c9ac60c..21db7d0eebc 100644
--- a/compiler/rustc_ast_passes/src/ast_validation.rs
+++ b/compiler/rustc_ast_passes/src/ast_validation.rs
@@ -420,7 +420,15 @@ impl<'a> AstValidator<'a> {
             .iter()
             .flat_map(|i| i.attrs.as_ref())
             .filter(|attr| {
-                let arr = [sym::allow, sym::cfg, sym::cfg_attr, sym::deny, sym::forbid, sym::warn];
+                let arr = [
+                    sym::allow,
+                    sym::cfg,
+                    sym::cfg_attr,
+                    sym::deny,
+                    sym::expect,
+                    sym::forbid,
+                    sym::warn,
+                ];
                 !arr.contains(&attr.name_or_empty()) && rustc_attr::is_builtin_attr(attr)
             })
             .for_each(|attr| {
@@ -435,7 +443,7 @@ impl<'a> AstValidator<'a> {
                 } else {
                     self.err_handler().span_err(
                         attr.span,
-                        "allow, cfg, cfg_attr, deny, \
+                        "allow, cfg, cfg_attr, deny, expect, \
                 forbid, and warn are the only allowed built-in attributes in function parameters",
                     );
                 }
diff --git a/compiler/rustc_borrowck/src/diagnostics/region_name.rs b/compiler/rustc_borrowck/src/diagnostics/region_name.rs
index cb4b154d271..fcb6ae438fe 100644
--- a/compiler/rustc_borrowck/src/diagnostics/region_name.rs
+++ b/compiler/rustc_borrowck/src/diagnostics/region_name.rs
@@ -567,14 +567,14 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
         let lifetime =
             self.try_match_adt_and_generic_args(substs, needle_fr, args, search_stack)?;
         match lifetime.name {
-            hir::LifetimeName::Param(hir::ParamName::Plain(_) | hir::ParamName::Error)
+            hir::LifetimeName::Param(_, hir::ParamName::Plain(_) | hir::ParamName::Error)
             | hir::LifetimeName::Error
             | hir::LifetimeName::Static => {
                 let lifetime_span = lifetime.span;
                 Some(RegionNameHighlight::MatchedAdtAndSegment(lifetime_span))
             }
 
-            hir::LifetimeName::Param(hir::ParamName::Fresh(_))
+            hir::LifetimeName::Param(_, hir::ParamName::Fresh)
             | hir::LifetimeName::ImplicitObjectLifetimeDefault
             | hir::LifetimeName::Implicit
             | hir::LifetimeName::Underscore => {
diff --git a/compiler/rustc_borrowck/src/universal_regions.rs b/compiler/rustc_borrowck/src/universal_regions.rs
index 7b63ec516b8..c2c093f9f2f 100644
--- a/compiler/rustc_borrowck/src/universal_regions.rs
+++ b/compiler/rustc_borrowck/src/universal_regions.rs
@@ -830,11 +830,11 @@ fn for_each_late_bound_region_defined_on<'tcx>(
     fn_def_id: DefId,
     mut f: impl FnMut(ty::Region<'tcx>),
 ) {
-    if let Some((owner, late_bounds)) = tcx.is_late_bound_map(fn_def_id.expect_local()) {
+    if let Some(late_bounds) = tcx.is_late_bound_map(fn_def_id.expect_local()) {
         for &region_def_id in late_bounds.iter() {
             let name = tcx.item_name(region_def_id.to_def_id());
             let liberated_region = tcx.mk_region(ty::ReFree(ty::FreeRegion {
-                scope: owner.to_def_id(),
+                scope: fn_def_id,
                 bound_region: ty::BoundRegionKind::BrNamed(region_def_id.to_def_id(), name),
             }));
             f(liberated_region);
diff --git a/compiler/rustc_builtin_macros/src/lib.rs b/compiler/rustc_builtin_macros/src/lib.rs
index 48b1470ced5..124d0d18cdb 100644
--- a/compiler/rustc_builtin_macros/src/lib.rs
+++ b/compiler/rustc_builtin_macros/src/lib.rs
@@ -9,7 +9,6 @@
 #![feature(is_sorted)]
 #![feature(let_chains)]
 #![feature(let_else)]
-#![feature(nll)]
 #![feature(proc_macro_internals)]
 #![feature(proc_macro_quote)]
 #![recursion_limit = "256"]
diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs
index 913cf4eea13..6713a756735 100644
--- a/compiler/rustc_codegen_llvm/src/lib.rs
+++ b/compiler/rustc_codegen_llvm/src/lib.rs
@@ -9,7 +9,6 @@
 #![feature(let_else)]
 #![feature(extern_types)]
 #![feature(once_cell)]
-#![feature(nll)]
 #![feature(iter_intersperse)]
 #![recursion_limit = "256"]
 #![allow(rustc::potential_query_instability)]
diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs
index 7b407c94e7b..ce6c6e3215c 100644
--- a/compiler/rustc_codegen_llvm/src/llvm_util.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs
@@ -218,15 +218,17 @@ pub fn check_tied_features(
     sess: &Session,
     features: &FxHashMap<&str, bool>,
 ) -> Option<&'static [&'static str]> {
-    for tied in tied_target_features(sess) {
-        // Tied features must be set to the same value, or not set at all
-        let mut tied_iter = tied.iter();
-        let enabled = features.get(tied_iter.next().unwrap());
-        if tied_iter.any(|f| enabled != features.get(f)) {
-            return Some(tied);
+    if !features.is_empty() {
+        for tied in tied_target_features(sess) {
+            // Tied features must be set to the same value, or not set at all
+            let mut tied_iter = tied.iter();
+            let enabled = features.get(tied_iter.next().unwrap());
+            if tied_iter.any(|f| enabled != features.get(f)) {
+                return Some(tied);
+            }
         }
     }
-    None
+    return None;
 }
 
 // Used to generate cfg variables and apply features
@@ -440,6 +442,7 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str
 
     // -Ctarget-features
     let supported_features = supported_target_features(sess);
+    let mut featsmap = FxHashMap::default();
     let feats = sess
         .opts
         .cg
@@ -485,35 +488,36 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str
                 }
                 diag.emit();
             }
-            Some((enable_disable, feature))
+
+            if diagnostics {
+                // FIXME(nagisa): figure out how to not allocate a full hashset here.
+                featsmap.insert(feature, enable_disable == '+');
+            }
+
+            // rustc-specific features do not get passed down to LLVM…
+            if RUSTC_SPECIFIC_FEATURES.contains(&feature) {
+                return None;
+            }
+            // ... otherwise though we run through `to_llvm_features` when
+            // passing requests down to LLVM. This means that all in-language
+            // features also work on the command line instead of having two
+            // different names when the LLVM name and the Rust name differ.
+            Some(
+                to_llvm_features(sess, feature)
+                    .into_iter()
+                    .map(move |f| format!("{}{}", enable_disable, f)),
+            )
         })
-        .collect::<SmallVec<[(char, &str); 8]>>();
-
-    if diagnostics {
-        // FIXME(nagisa): figure out how to not allocate a full hashset here.
-        let featmap = feats.iter().map(|&(flag, feat)| (feat, flag == '+')).collect();
-        if let Some(f) = check_tied_features(sess, &featmap) {
-            sess.err(&format!(
-                "target features {} must all be enabled or disabled together",
-                f.join(", ")
-            ));
-        }
+        .flatten();
+    features.extend(feats);
+
+    if diagnostics && let Some(f) = check_tied_features(sess, &featsmap) {
+        sess.err(&format!(
+            "target features {} must all be enabled or disabled together",
+            f.join(", ")
+        ));
     }
 
-    features.extend(feats.into_iter().flat_map(|(enable_disable, feature)| {
-        // rustc-specific features do not get passed down to LLVM…
-        if RUSTC_SPECIFIC_FEATURES.contains(&feature) {
-            return SmallVec::<[_; 2]>::new();
-        }
-        // ... otherwise though we run through `to_llvm_features` when
-        // passing requests down to LLVM. This means that all in-language
-        // features also work on the command line instead of having two
-        // different names when the LLVM name and the Rust name differ.
-        to_llvm_features(sess, feature)
-            .into_iter()
-            .map(|f| format!("{}{}", enable_disable, f))
-            .collect()
-    }));
     features
 }
 
diff --git a/compiler/rustc_codegen_ssa/Cargo.toml b/compiler/rustc_codegen_ssa/Cargo.toml
index 93b10a07e44..fd8c4f78b2f 100644
--- a/compiler/rustc_codegen_ssa/Cargo.toml
+++ b/compiler/rustc_codegen_ssa/Cargo.toml
@@ -16,6 +16,7 @@ jobserver = "0.1.22"
 tempfile = "3.2"
 thorin-dwp = "0.2"
 pathdiff = "0.2.0"
+serde_json = "1.0.59"
 snap = "1"
 smallvec = { version = "1.6.1", features = ["union", "may_dangle"] }
 regex = "1.4"
diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs
index e4236876463..a24e4347839 100644
--- a/compiler/rustc_codegen_ssa/src/back/linker.rs
+++ b/compiler/rustc_codegen_ssa/src/back/linker.rs
@@ -14,7 +14,6 @@ use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
 use rustc_middle::middle::dependency_format::Linkage;
 use rustc_middle::middle::exported_symbols::{ExportedSymbol, SymbolExportInfo, SymbolExportKind};
 use rustc_middle::ty::TyCtxt;
-use rustc_serialize::{json, Encoder};
 use rustc_session::config::{self, CrateType, DebugInfo, LinkerPluginLto, Lto, OptLevel, Strip};
 use rustc_session::Session;
 use rustc_span::symbol::Symbol;
@@ -1152,21 +1151,12 @@ impl<'a> Linker for EmLinker<'a> {
         self.cmd.arg("-s");
 
         let mut arg = OsString::from("EXPORTED_FUNCTIONS=");
-        let mut encoded = String::new();
-
-        {
-            let mut encoder = json::Encoder::new(&mut encoded);
-            let res = encoder.emit_seq(symbols.len(), |encoder| {
-                for (i, sym) in symbols.iter().enumerate() {
-                    encoder.emit_seq_elt(i, |encoder| encoder.emit_str(&("_".to_owned() + sym)))?;
-                }
-                Ok(())
-            });
-            if let Err(e) = res {
-                self.sess.fatal(&format!("failed to encode exported symbols: {}", e));
-            }
-        }
+        let encoded = serde_json::to_string(
+            &symbols.iter().map(|sym| "_".to_owned() + sym).collect::<Vec<_>>(),
+        )
+        .unwrap();
         debug!("{}", encoded);
+
         arg.push(encoded);
 
         self.cmd.arg(arg);
diff --git a/compiler/rustc_codegen_ssa/src/lib.rs b/compiler/rustc_codegen_ssa/src/lib.rs
index 7fde700be39..453c57b46d7 100644
--- a/compiler/rustc_codegen_ssa/src/lib.rs
+++ b/compiler/rustc_codegen_ssa/src/lib.rs
@@ -3,7 +3,6 @@
 #![feature(try_blocks)]
 #![feature(let_else)]
 #![feature(once_cell)]
-#![feature(nll)]
 #![feature(associated_type_bounds)]
 #![feature(strict_provenance)]
 #![feature(int_roundings)]
diff --git a/compiler/rustc_const_eval/src/interpret/memory.rs b/compiler/rustc_const_eval/src/interpret/memory.rs
index 9c032c55fe5..f3f3c5bf946 100644
--- a/compiler/rustc_const_eval/src/interpret/memory.rs
+++ b/compiler/rustc_const_eval/src/interpret/memory.rs
@@ -908,11 +908,15 @@ impl<'tcx, 'a, Tag: Provenance, Extra> AllocRefMut<'a, 'tcx, Tag, Extra> {
 }
 
 impl<'tcx, 'a, Tag: Provenance, Extra> AllocRef<'a, 'tcx, Tag, Extra> {
-    pub fn read_scalar(&self, range: AllocRange) -> InterpResult<'tcx, ScalarMaybeUninit<Tag>> {
+    pub fn read_scalar(
+        &self,
+        range: AllocRange,
+        read_provenance: bool,
+    ) -> InterpResult<'tcx, ScalarMaybeUninit<Tag>> {
         let range = self.range.subrange(range);
         let res = self
             .alloc
-            .read_scalar(&self.tcx, range)
+            .read_scalar(&self.tcx, range, read_provenance)
             .map_err(|e| e.to_interp_error(self.alloc_id))?;
         debug!(
             "read_scalar in {} at {:#x}, size {}: {:?}",
@@ -924,8 +928,19 @@ impl<'tcx, 'a, Tag: Provenance, Extra> AllocRef<'a, 'tcx, Tag, Extra> {
         Ok(res)
     }
 
-    pub fn read_ptr_sized(&self, offset: Size) -> InterpResult<'tcx, ScalarMaybeUninit<Tag>> {
-        self.read_scalar(alloc_range(offset, self.tcx.data_layout().pointer_size))
+    pub fn read_integer(
+        &self,
+        offset: Size,
+        size: Size,
+    ) -> InterpResult<'tcx, ScalarMaybeUninit<Tag>> {
+        self.read_scalar(alloc_range(offset, size), /*read_provenance*/ false)
+    }
+
+    pub fn read_pointer(&self, offset: Size) -> InterpResult<'tcx, ScalarMaybeUninit<Tag>> {
+        self.read_scalar(
+            alloc_range(offset, self.tcx.data_layout().pointer_size),
+            /*read_provenance*/ true,
+        )
     }
 
     pub fn check_bytes(
diff --git a/compiler/rustc_const_eval/src/interpret/operand.rs b/compiler/rustc_const_eval/src/interpret/operand.rs
index f5e1ee4e233..6338e08380f 100644
--- a/compiler/rustc_const_eval/src/interpret/operand.rs
+++ b/compiler/rustc_const_eval/src/interpret/operand.rs
@@ -15,8 +15,8 @@ use rustc_target::abi::{VariantIdx, Variants};
 
 use super::{
     alloc_range, from_known_layout, mir_assign_valid_types, AllocId, ConstValue, GlobalId,
-    InterpCx, InterpResult, MPlaceTy, Machine, MemPlace, Place, PlaceTy, Pointer, Provenance,
-    Scalar, ScalarMaybeUninit,
+    InterpCx, InterpResult, MPlaceTy, Machine, MemPlace, Place, PlaceTy, Pointer,
+    PointerArithmetic, Provenance, Scalar, ScalarMaybeUninit,
 };
 
 /// An `Immediate` represents a single immediate self-contained Rust value.
@@ -284,11 +284,18 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
             Abi::Scalar(s) if force => Some(s.primitive()),
             _ => None,
         };
-        if let Some(_s) = scalar_layout {
+        let read_provenance = |s: abi::Primitive, size| {
+            // Should be just `s.is_ptr()`, but we support a Miri flag that accepts more
+            // questionable ptr-int transmutes.
+            let number_may_have_provenance = !M::enforce_number_no_provenance(self);
+            s.is_ptr() || (number_may_have_provenance && size == self.pointer_size())
+        };
+        if let Some(s) = scalar_layout {
             //FIXME(#96185): let size = s.size(self);
             //FIXME(#96185): assert_eq!(size, mplace.layout.size, "abi::Scalar size does not match layout size");
             let size = mplace.layout.size; //FIXME(#96185): remove this line
-            let scalar = alloc.read_scalar(alloc_range(Size::ZERO, size))?;
+            let scalar =
+                alloc.read_scalar(alloc_range(Size::ZERO, size), read_provenance(s, size))?;
             return Ok(Some(ImmTy { imm: scalar.into(), layout: mplace.layout }));
         }
         let scalar_pair_layout = match mplace.layout.abi {
@@ -306,8 +313,10 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
             let (a_size, b_size) = (a.size(self), b.size(self));
             let b_offset = a_size.align_to(b.align(self).abi);
             assert!(b_offset.bytes() > 0); // in `operand_field` we use the offset to tell apart the fields
-            let a_val = alloc.read_scalar(alloc_range(Size::ZERO, a_size))?;
-            let b_val = alloc.read_scalar(alloc_range(b_offset, b_size))?;
+            let a_val =
+                alloc.read_scalar(alloc_range(Size::ZERO, a_size), read_provenance(a, a_size))?;
+            let b_val =
+                alloc.read_scalar(alloc_range(b_offset, b_size), read_provenance(b, b_size))?;
             return Ok(Some(ImmTy {
                 imm: Immediate::ScalarPair(a_val, b_val),
                 layout: mplace.layout,
diff --git a/compiler/rustc_const_eval/src/interpret/terminator.rs b/compiler/rustc_const_eval/src/interpret/terminator.rs
index 10da2f803af..57d06b48ca4 100644
--- a/compiler/rustc_const_eval/src/interpret/terminator.rs
+++ b/compiler/rustc_const_eval/src/interpret/terminator.rs
@@ -353,12 +353,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
                 // FIXME: for variadic support, do we have to somehow determine callee's extra_args?
                 let callee_fn_abi = self.fn_abi_of_instance(instance, ty::List::empty())?;
 
-                if callee_fn_abi.c_variadic != caller_fn_abi.c_variadic {
-                    throw_ub_format!(
-                        "calling a c-variadic function via a non-variadic call site, or vice versa"
-                    );
-                }
-                if callee_fn_abi.c_variadic {
+                if callee_fn_abi.c_variadic || caller_fn_abi.c_variadic {
                     throw_unsup_format!("calling a c-variadic function is not supported");
                 }
 
diff --git a/compiler/rustc_const_eval/src/interpret/traits.rs b/compiler/rustc_const_eval/src/interpret/traits.rs
index c4d1074e437..9c48f3e8337 100644
--- a/compiler/rustc_const_eval/src/interpret/traits.rs
+++ b/compiler/rustc_const_eval/src/interpret/traits.rs
@@ -50,7 +50,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
         let vtable_slot = self
             .get_ptr_alloc(vtable_slot, ptr_size, self.tcx.data_layout.pointer_align.abi)?
             .expect("cannot be a ZST");
-        let fn_ptr = self.scalar_to_ptr(vtable_slot.read_ptr_sized(Size::ZERO)?.check_init()?)?;
+        let fn_ptr = self.scalar_to_ptr(vtable_slot.read_pointer(Size::ZERO)?.check_init()?)?;
         self.get_ptr_fn(fn_ptr)
     }
 
@@ -69,9 +69,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
             )?
             .expect("cannot be a ZST");
         let drop_fn = vtable
-            .read_ptr_sized(
-                pointer_size * u64::try_from(COMMON_VTABLE_ENTRIES_DROPINPLACE).unwrap(),
-            )?
+            .read_pointer(pointer_size * u64::try_from(COMMON_VTABLE_ENTRIES_DROPINPLACE).unwrap())?
             .check_init()?;
         // We *need* an instance here, no other kind of function value, to be able
         // to determine the type.
@@ -104,12 +102,18 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
             )?
             .expect("cannot be a ZST");
         let size = vtable
-            .read_ptr_sized(pointer_size * u64::try_from(COMMON_VTABLE_ENTRIES_SIZE).unwrap())?
+            .read_integer(
+                pointer_size * u64::try_from(COMMON_VTABLE_ENTRIES_SIZE).unwrap(),
+                pointer_size,
+            )?
             .check_init()?;
         let size = size.to_machine_usize(self)?;
         let size = Size::from_bytes(size);
         let align = vtable
-            .read_ptr_sized(pointer_size * u64::try_from(COMMON_VTABLE_ENTRIES_ALIGN).unwrap())?
+            .read_integer(
+                pointer_size * u64::try_from(COMMON_VTABLE_ENTRIES_ALIGN).unwrap(),
+                pointer_size,
+            )?
             .check_init()?;
         let align = align.to_machine_usize(self)?;
         let align = Align::from_bytes(align).map_err(|e| err_ub!(InvalidVtableAlignment(e)))?;
@@ -132,8 +136,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
             .get_ptr_alloc(vtable_slot, pointer_size, self.tcx.data_layout.pointer_align.abi)?
             .expect("cannot be a ZST");
 
-        let new_vtable =
-            self.scalar_to_ptr(new_vtable.read_ptr_sized(Size::ZERO)?.check_init()?)?;
+        let new_vtable = self.scalar_to_ptr(new_vtable.read_pointer(Size::ZERO)?.check_init()?)?;
 
         Ok(new_vtable)
     }
diff --git a/compiler/rustc_data_structures/src/base_n/tests.rs b/compiler/rustc_data_structures/src/base_n/tests.rs
index b68ef1eb7f4..2be2f0532c9 100644
--- a/compiler/rustc_data_structures/src/base_n/tests.rs
+++ b/compiler/rustc_data_structures/src/base_n/tests.rs
@@ -15,7 +15,9 @@ fn test_encode() {
         test(u64::MAX as u128, base);
         test(u128::MAX, base);
 
-        for i in 0..1_000 {
+        const N: u128 = if cfg!(miri) { 10 } else { 1000 };
+
+        for i in 0..N {
             test(i * 983, base);
         }
     }
diff --git a/compiler/rustc_data_structures/src/graph/scc/tests.rs b/compiler/rustc_data_structures/src/graph/scc/tests.rs
index 364005e67e6..9940fee60d7 100644
--- a/compiler/rustc_data_structures/src/graph/scc/tests.rs
+++ b/compiler/rustc_data_structures/src/graph/scc/tests.rs
@@ -156,7 +156,10 @@ fn test_deep_linear() {
     v

      */
+    #[cfg(not(miri))]
     const NR_NODES: usize = 1 << 14;
+    #[cfg(miri)]
+    const NR_NODES: usize = 1 << 3;
     let mut nodes = vec![];
     for i in 1..NR_NODES {
         nodes.push((i - 1, i));
diff --git a/compiler/rustc_data_structures/src/owning_ref/tests.rs b/compiler/rustc_data_structures/src/owning_ref/tests.rs
index 7b8179e90bd..320c03d5139 100644
--- a/compiler/rustc_data_structures/src/owning_ref/tests.rs
+++ b/compiler/rustc_data_structures/src/owning_ref/tests.rs
@@ -1,3 +1,5 @@
+// FIXME: owning_ref is not sound under stacked borrows. Preferably, get rid of it.
+#[cfg(not(miri))]
 mod owning_ref {
     use super::super::OwningRef;
     use super::super::{BoxRef, Erased, ErasedBoxRef, RcRef};
@@ -361,6 +363,8 @@ mod owning_handle {
     }
 }
 
+// FIXME: owning_ref is not sound under stacked borrows. Preferably, get rid of it.
+#[cfg(not(miri))]
 mod owning_ref_mut {
     use super::super::BoxRef;
     use super::super::{BoxRefMut, Erased, ErasedBoxRefMut, OwningRefMut};
diff --git a/compiler/rustc_data_structures/src/sip128.rs b/compiler/rustc_data_structures/src/sip128.rs
index abd25f46ad5..90793a97ed0 100644
--- a/compiler/rustc_data_structures/src/sip128.rs
+++ b/compiler/rustc_data_structures/src/sip128.rs
@@ -255,8 +255,9 @@ impl SipHasher128 {
         // elements from spill (at most LEN - 1 bytes could have overflowed
         // into the spill). The memcpy call is optimized away because the size
         // is known. And the whole copy is optimized away for LEN == 1.
+        let dst = self.buf.as_mut_ptr() as *mut u8;
         let src = self.buf.get_unchecked(BUFFER_SPILL_INDEX) as *const _ as *const u8;
-        ptr::copy_nonoverlapping(src, self.buf.as_mut_ptr() as *mut u8, LEN - 1);
+        ptr::copy_nonoverlapping(src, dst, LEN - 1);
 
         // This function should only be called when the write fills the buffer.
         // Therefore, when LEN == 1, the new `self.nbuf` must be zero.
diff --git a/compiler/rustc_driver/Cargo.toml b/compiler/rustc_driver/Cargo.toml
index fd2ca5beade..a2cbd9abc90 100644
--- a/compiler/rustc_driver/Cargo.toml
+++ b/compiler/rustc_driver/Cargo.toml
@@ -9,6 +9,7 @@ crate-type = ["dylib"]
 [dependencies]
 libc = "0.2"
 tracing = { version = "0.1.28" }
+serde_json = "1.0.59"
 rustc_log = { path = "../rustc_log" }
 rustc_middle = { path = "../rustc_middle" }
 rustc_ast_pretty = { path = "../rustc_ast_pretty" }
diff --git a/compiler/rustc_driver/src/lib.rs b/compiler/rustc_driver/src/lib.rs
index 904d6f8cfd8..8cdbb1a6704 100644
--- a/compiler/rustc_driver/src/lib.rs
+++ b/compiler/rustc_driver/src/lib.rs
@@ -5,7 +5,6 @@
 //! This API is completely unstable and subject to change.
 
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
-#![feature(nll)]
 #![feature(let_else)]
 #![feature(once_cell)]
 #![recursion_limit = "256"]
@@ -30,7 +29,6 @@ use rustc_log::stdout_isatty;
 use rustc_metadata::locator;
 use rustc_save_analysis as save;
 use rustc_save_analysis::DumpHandler;
-use rustc_serialize::json::ToJson;
 use rustc_session::config::{nightly_options, CG_OPTIONS, DB_OPTIONS};
 use rustc_session::config::{ErrorOutputType, Input, OutputType, PrintRequest, TrimmedDefPaths};
 use rustc_session::cstore::MetadataLoader;
@@ -40,6 +38,7 @@ use rustc_session::{config, DiagnosticOutput, Session};
 use rustc_session::{early_error, early_error_no_abort, early_warn};
 use rustc_span::source_map::{FileLoader, FileName};
 use rustc_span::symbol::sym;
+use rustc_target::json::ToJson;
 
 use std::borrow::Cow;
 use std::cmp::max;
@@ -343,10 +342,7 @@ fn run_compiler(
                 return early_exit();
             }
 
-            if sess.opts.debugging_opts.parse_only
-                || sess.opts.debugging_opts.show_span.is_some()
-                || sess.opts.debugging_opts.ast_json_noexpand
-            {
+            if sess.opts.debugging_opts.parse_only || sess.opts.debugging_opts.show_span.is_some() {
                 return early_exit();
             }
 
@@ -375,7 +371,7 @@ fn run_compiler(
 
             queries.global_ctxt()?;
 
-            if sess.opts.debugging_opts.no_analysis || sess.opts.debugging_opts.ast_json {
+            if sess.opts.debugging_opts.no_analysis {
                 return early_exit();
             }
 
@@ -665,7 +661,9 @@ fn print_crate_info(
             }
             Sysroot => println!("{}", sess.sysroot.display()),
             TargetLibdir => println!("{}", sess.target_tlib_path.dir.display()),
-            TargetSpec => println!("{}", sess.target.to_json().pretty()),
+            TargetSpec => {
+                println!("{}", serde_json::to_string_pretty(&sess.target.to_json()).unwrap());
+            }
             FileNames | CrateName => {
                 let input = input.unwrap_or_else(|| {
                     early_error(ErrorOutputType::default(), "no input file provided")
@@ -1056,13 +1054,7 @@ pub fn handle_options(args: &[String]) -> Option<getopts::Matches> {
     }
 
     if cg_flags.iter().any(|x| *x == "passes=list") {
-        let backend_name = debug_flags.iter().find_map(|x| {
-            if x.starts_with("codegen-backend=") {
-                Some(&x["codegen-backends=".len()..])
-            } else {
-                None
-            }
-        });
+        let backend_name = debug_flags.iter().find_map(|x| x.strip_prefix("codegen-backend="));
         get_codegen_backend(&None, backend_name).print_passes();
         return None;
     }
diff --git a/compiler/rustc_error_codes/src/error_codes.rs b/compiler/rustc_error_codes/src/error_codes.rs
index 61a177f291b..0114461e388 100644
--- a/compiler/rustc_error_codes/src/error_codes.rs
+++ b/compiler/rustc_error_codes/src/error_codes.rs
@@ -491,6 +491,7 @@ E0784: include_str!("./error_codes/E0784.md"),
 E0785: include_str!("./error_codes/E0785.md"),
 E0786: include_str!("./error_codes/E0786.md"),
 E0787: include_str!("./error_codes/E0787.md"),
+E0788: include_str!("./error_codes/E0788.md"),
 ;
 //  E0006, // merged with E0005
 //  E0008, // cannot bind by-move into a pattern guard
diff --git a/compiler/rustc_error_codes/src/error_codes/E0312.md b/compiler/rustc_error_codes/src/error_codes/E0312.md
index cb090d01382..c5f7cf2e337 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0312.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0312.md
@@ -1,8 +1,10 @@
+#### Note: this error code is no longer emitted by the compiler.
+
 Reference's lifetime of borrowed content doesn't match the expected lifetime.
 
 Erroneous code example:
 
-```compile_fail,E0312
+```compile_fail
 pub fn opt_str<'a>(maybestr: &'a Option<String>) -> &'static str {
     if maybestr.is_none() {
         "(none)"
diff --git a/compiler/rustc_error_codes/src/error_codes/E0432.md b/compiler/rustc_error_codes/src/error_codes/E0432.md
index a6e2acac5d2..2920e2623fb 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0432.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0432.md
@@ -10,10 +10,10 @@ In Rust 2015, paths in `use` statements are relative to the crate root. To
 import items relative to the current and parent modules, use the `self::` and
 `super::` prefixes, respectively.
 
-In Rust 2018, paths in `use` statements are relative to the current module
-unless they begin with the name of a crate or a literal `crate::`, in which
-case they start from the crate root. As in Rust 2015 code, the `self::` and
-`super::` prefixes refer to the current and parent modules respectively.
+In Rust 2018 or later, paths in `use` statements are relative to the current
+module unless they begin with the name of a crate or a literal `crate::`, in
+which case they start from the crate root. As in Rust 2015 code, the `self::`
+and `super::` prefixes refer to the current and parent modules respectively.
 
 Also verify that you didn't misspell the import name and that the import exists
 in the module from where you tried to import it. Example:
@@ -38,8 +38,8 @@ use core::any;
 # fn main() {}
 ```
 
-In Rust 2018 the `extern crate` declaration is not required and you can instead
-just `use` it:
+Since Rust 2018 the `extern crate` declaration is not required and
+you can instead just `use` it:
 
 ```edition2018
 use core::any; // No extern crate required in Rust 2018.
diff --git a/compiler/rustc_error_codes/src/error_codes/E0477.md b/compiler/rustc_error_codes/src/error_codes/E0477.md
index 9cfefb1de63..c6be8dc705e 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0477.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0477.md
@@ -1,8 +1,10 @@
+#### Note: this error code is no longer emitted by the compiler.
+
 The type does not fulfill the required lifetime.
 
 Erroneous code example:
 
-```compile_fail,E0477
+```compile_fail
 use std::sync::Mutex;
 
 struct MyString<'a> {
diff --git a/compiler/rustc_error_codes/src/error_codes/E0495.md b/compiler/rustc_error_codes/src/error_codes/E0495.md
index f956237b80b..cd10e719312 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0495.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0495.md
@@ -1,8 +1,10 @@
+#### Note: this error code is no longer emitted by the compiler.
+
 A lifetime cannot be determined in the given situation.
 
 Erroneous code example:
 
-```compile_fail,E0495
+```compile_fail
 fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
     match (&t,) { // error!
         ((u,),) => u,
diff --git a/compiler/rustc_error_codes/src/error_codes/E0623.md b/compiler/rustc_error_codes/src/error_codes/E0623.md
index 1290edd0a0e..34db641bb90 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0623.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0623.md
@@ -3,39 +3,70 @@ A lifetime didn't match what was expected.
 Erroneous code example:
 
 ```compile_fail,E0623
-struct Foo<'a> {
-    x: &'a isize,
-}
+struct Foo<'a, 'b, T>(std::marker::PhantomData<(&'a (), &'b (), T)>)
+where
+    T: Convert<'a, 'b>;
 
-fn bar<'short, 'long>(c: Foo<'short>, l: &'long isize) {
-    let _: Foo<'long> = c; // error!
+trait Convert<'a, 'b>: Sized {
+    fn cast(&'a self) -> &'b Self;
+}
+impl<'long: 'short, 'short, T> Convert<'long, 'short> for T {
+    fn cast(&'long self) -> &'short T {
+        self
+    }
+}
+// error
+fn badboi<'in_, 'out, T>(
+    x: Foo<'in_, 'out, T>,
+    sadness: &'in_ T
+) -> &'out T {
+    sadness.cast()
 }
 ```
 
 In this example, we tried to set a value with an incompatible lifetime to
-another one (`'long` is unrelated to `'short`). We can solve this issue in
+another one (`'in_` is unrelated to `'out`). We can solve this issue in
 two different ways:
 
-Either we make `'short` live at least as long as `'long`:
+Either we make `'in_` live at least as long as `'out`:
 
 ```
-struct Foo<'a> {
-    x: &'a isize,
-}
+struct Foo<'a, 'b, T>(std::marker::PhantomData<(&'a (), &'b (), T)>)
+where
+    T: Convert<'a, 'b>;
 
-// we set 'short to live at least as long as 'long
-fn bar<'short: 'long, 'long>(c: Foo<'short>, l: &'long isize) {
-    let _: Foo<'long> = c; // ok!
+trait Convert<'a, 'b>: Sized {
+    fn cast(&'a self) -> &'b Self;
+}
+impl<'long: 'short, 'short, T> Convert<'long, 'short> for T {
+    fn cast(&'long self) -> &'short T {
+        self
+    }
+}
+fn badboi<'in_: 'out, 'out, T>(
+    x: Foo<'in_, 'out, T>,
+    sadness: &'in_ T
+) -> &'out T {
+    sadness.cast()
 }
 ```
 
 Or we use only one lifetime:
 
 ```
-struct Foo<'a> {
-    x: &'a isize,
+struct Foo<'a, 'b, T>(std::marker::PhantomData<(&'a (), &'b (), T)>)
+where
+    T: Convert<'a, 'b>;
+
+trait Convert<'a, 'b>: Sized {
+    fn cast(&'a self) -> &'b Self;
+}
+impl<'long: 'short, 'short, T> Convert<'long, 'short> for T {
+    fn cast(&'long self) -> &'short T {
+        self
+    }
 }
-fn bar<'short>(c: Foo<'short>, l: &'short isize) {
-    let _: Foo<'short> = c; // ok!
+fn badboi<'out, T>(x: Foo<'out, 'out, T>, sadness: &'out T) -> &'out T {
+    sadness.cast()
 }
 ```
diff --git a/compiler/rustc_error_codes/src/error_codes/E0713.md b/compiler/rustc_error_codes/src/error_codes/E0713.md
index 9361046943f..9b1b77f3bc7 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0713.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0713.md
@@ -4,8 +4,6 @@ lifetime of a type that implements the `Drop` trait.
 Erroneous code example:
 
 ```compile_fail,E0713
-#![feature(nll)]
-
 pub struct S<'a> { data: &'a mut String }
 
 impl<'a> Drop for S<'a> {
diff --git a/compiler/rustc_error_codes/src/error_codes/E0759.md b/compiler/rustc_error_codes/src/error_codes/E0759.md
index 6b16a7d415a..ce5d42b3c7f 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0759.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0759.md
@@ -1,8 +1,10 @@
+#### Note: this error code is no longer emitted by the compiler.
+
 Return type involving a trait did not require `'static` lifetime.
 
 Erroneous code examples:
 
-```compile_fail,E0759
+```compile_fail
 use std::fmt::Debug;
 
 fn foo(x: &i32) -> impl Debug { // error!
diff --git a/compiler/rustc_error_codes/src/error_codes/E0772.md b/compiler/rustc_error_codes/src/error_codes/E0772.md
index 3b73abaf776..5ffffd5112d 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0772.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0772.md
@@ -1,9 +1,11 @@
+#### Note: this error code is no longer emitted by the compiler.
+
 A trait object has some specific lifetime `'1`, but it was used in a way that
 requires it to have a `'static` lifetime.
 
 Example of erroneous code:
 
-```compile_fail,E0772
+```compile_fail
 trait BooleanLike {}
 trait Person {}
 
diff --git a/compiler/rustc_error_codes/src/error_codes/E0788.md b/compiler/rustc_error_codes/src/error_codes/E0788.md
new file mode 100644
index 00000000000..d26f9b59455
--- /dev/null
+++ b/compiler/rustc_error_codes/src/error_codes/E0788.md
@@ -0,0 +1,26 @@
+A `#[no_coverage]` attribute was applied to something which does not show up
+in code coverage, or is too granular to be excluded from the coverage report.
+
+For now, this attribute can only be applied to function, method, and closure
+definitions. In the future, it may be added to statements, blocks, and
+expressions, and for the time being, using this attribute in those places
+will just emit an `unused_attributes` lint instead of this error.
+
+Example of erroneous code:
+
+```compile_fail,E0788
+#[no_coverage]
+struct Foo;
+
+#[no_coverage]
+const FOO: Foo = Foo;
+```
+
+`#[no_coverage]` tells the compiler to not generate coverage instrumentation for
+a piece of code when the `-C instrument-coverage` flag is passed. Things like
+structs and consts are not coverable code, and thus cannot do anything with this
+attribute.
+
+If you wish to apply this attribute to all methods in an impl or module,
+manually annotate each method; it is not possible to annotate the entire impl
+with a `#[no_coverage]` attribute.
diff --git a/compiler/rustc_errors/Cargo.toml b/compiler/rustc_errors/Cargo.toml
index 5f919982890..89557626057 100644
--- a/compiler/rustc_errors/Cargo.toml
+++ b/compiler/rustc_errors/Cargo.toml
@@ -19,6 +19,8 @@ atty = "0.2"
 termcolor = "1.0"
 annotate-snippets = "0.8.0"
 termize = "0.1.1"
+serde = { version = "1.0.125", features = ["derive"] }
+serde_json = "1.0.59"
 
 [target.'cfg(windows)'.dependencies]
 winapi = { version = "0.3", features = ["handleapi", "synchapi", "winbase"] }
diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs
index 643f3c12134..eaceecc1667 100644
--- a/compiler/rustc_errors/src/diagnostic.rs
+++ b/compiler/rustc_errors/src/diagnostic.rs
@@ -827,7 +827,7 @@ impl Diagnostic {
         self
     }
 
-    pub fn styled_message(&self) -> &Vec<(DiagnosticMessage, Style)> {
+    pub fn styled_message(&self) -> &[(DiagnosticMessage, Style)] {
         &self.message
     }
 
@@ -888,11 +888,11 @@ impl Diagnostic {
         &self,
     ) -> (
         &Level,
-        &Vec<(DiagnosticMessage, Style)>,
+        &[(DiagnosticMessage, Style)],
         &Option<DiagnosticId>,
         &MultiSpan,
         &Result<Vec<CodeSuggestion>, SuggestionsDisabled>,
-        Option<&Vec<SubDiagnostic>>,
+        Option<&[SubDiagnostic]>,
     ) {
         (
             &self.level,
diff --git a/compiler/rustc_errors/src/json.rs b/compiler/rustc_errors/src/json.rs
index 6ff52182d6b..fff35ac6ac8 100644
--- a/compiler/rustc_errors/src/json.rs
+++ b/compiler/rustc_errors/src/json.rs
@@ -28,7 +28,7 @@ use std::path::Path;
 use std::sync::{Arc, Mutex};
 use std::vec;
 
-use rustc_serialize::json::{as_json, as_pretty_json};
+use serde::Serialize;
 
 #[cfg(test)]
 mod tests;
@@ -126,9 +126,9 @@ impl Emitter for JsonEmitter {
     fn emit_diagnostic(&mut self, diag: &crate::Diagnostic) {
         let data = Diagnostic::from_errors_diagnostic(diag, self);
         let result = if self.pretty {
-            writeln!(&mut self.dst, "{}", as_pretty_json(&data))
+            writeln!(&mut self.dst, "{}", serde_json::to_string_pretty(&data).unwrap())
         } else {
-            writeln!(&mut self.dst, "{}", as_json(&data))
+            writeln!(&mut self.dst, "{}", serde_json::to_string(&data).unwrap())
         }
         .and_then(|_| self.dst.flush());
         if let Err(e) = result {
@@ -139,9 +139,9 @@ impl Emitter for JsonEmitter {
     fn emit_artifact_notification(&mut self, path: &Path, artifact_type: &str) {
         let data = ArtifactNotification { artifact: path, emit: artifact_type };
         let result = if self.pretty {
-            writeln!(&mut self.dst, "{}", as_pretty_json(&data))
+            writeln!(&mut self.dst, "{}", serde_json::to_string_pretty(&data).unwrap())
         } else {
-            writeln!(&mut self.dst, "{}", as_json(&data))
+            writeln!(&mut self.dst, "{}", serde_json::to_string(&data).unwrap())
         }
         .and_then(|_| self.dst.flush());
         if let Err(e) = result {
@@ -161,9 +161,9 @@ impl Emitter for JsonEmitter {
             .collect();
         let report = FutureIncompatReport { future_incompat_report: data };
         let result = if self.pretty {
-            writeln!(&mut self.dst, "{}", as_pretty_json(&report))
+            writeln!(&mut self.dst, "{}", serde_json::to_string_pretty(&report).unwrap())
         } else {
-            writeln!(&mut self.dst, "{}", as_json(&report))
+            writeln!(&mut self.dst, "{}", serde_json::to_string(&report).unwrap())
         }
         .and_then(|_| self.dst.flush());
         if let Err(e) = result {
@@ -175,9 +175,9 @@ impl Emitter for JsonEmitter {
         let lint_level = lint_level.as_str();
         let data = UnusedExterns { lint_level, unused_extern_names: unused_externs };
         let result = if self.pretty {
-            writeln!(&mut self.dst, "{}", as_pretty_json(&data))
+            writeln!(&mut self.dst, "{}", serde_json::to_string_pretty(&data).unwrap())
         } else {
-            writeln!(&mut self.dst, "{}", as_json(&data))
+            writeln!(&mut self.dst, "{}", serde_json::to_string(&data).unwrap())
         }
         .and_then(|_| self.dst.flush());
         if let Err(e) = result {
@@ -204,7 +204,7 @@ impl Emitter for JsonEmitter {
 
 // The following data types are provided just for serialisation.
 
-#[derive(Encodable)]
+#[derive(Serialize)]
 struct Diagnostic {
     /// The primary error message.
     message: String,
@@ -218,7 +218,7 @@ struct Diagnostic {
     rendered: Option<String>,
 }
 
-#[derive(Encodable)]
+#[derive(Serialize)]
 struct DiagnosticSpan {
     file_name: String,
     byte_start: u32,
@@ -245,7 +245,7 @@ struct DiagnosticSpan {
     expansion: Option<Box<DiagnosticSpanMacroExpansion>>,
 }
 
-#[derive(Encodable)]
+#[derive(Serialize)]
 struct DiagnosticSpanLine {
     text: String,
 
@@ -255,7 +255,7 @@ struct DiagnosticSpanLine {
     highlight_end: usize,
 }
 
-#[derive(Encodable)]
+#[derive(Serialize)]
 struct DiagnosticSpanMacroExpansion {
     /// span where macro was applied to generate this code; note that
     /// this may itself derive from a macro (if
@@ -269,7 +269,7 @@ struct DiagnosticSpanMacroExpansion {
     def_site_span: DiagnosticSpan,
 }
 
-#[derive(Encodable)]
+#[derive(Serialize)]
 struct DiagnosticCode {
     /// The code itself.
     code: String,
@@ -277,7 +277,7 @@ struct DiagnosticCode {
     explanation: Option<&'static str>,
 }
 
-#[derive(Encodable)]
+#[derive(Serialize)]
 struct ArtifactNotification<'a> {
     /// The path of the artifact.
     artifact: &'a Path,
@@ -285,12 +285,12 @@ struct ArtifactNotification<'a> {
     emit: &'a str,
 }
 
-#[derive(Encodable)]
+#[derive(Serialize)]
 struct FutureBreakageItem {
     diagnostic: Diagnostic,
 }
 
-#[derive(Encodable)]
+#[derive(Serialize)]
 struct FutureIncompatReport {
     future_incompat_report: Vec<FutureBreakageItem>,
 }
@@ -299,7 +299,7 @@ struct FutureIncompatReport {
 // doctest component (as well as cargo).
 // We could unify this struct the one in rustdoc but they have different
 // ownership semantics, so doing so would create wasteful allocations.
-#[derive(Encodable)]
+#[derive(Serialize)]
 struct UnusedExterns<'a, 'b, 'c> {
     /// The severity level of the unused dependencies lint
     lint_level: &'a str,
diff --git a/compiler/rustc_errors/src/json/tests.rs b/compiler/rustc_errors/src/json/tests.rs
index 7eb6a4975fe..d940d14e1db 100644
--- a/compiler/rustc_errors/src/json/tests.rs
+++ b/compiler/rustc_errors/src/json/tests.rs
@@ -5,12 +5,18 @@ use rustc_span::source_map::{FilePathMapping, SourceMap};
 
 use crate::emitter::{ColorConfig, HumanReadableErrorType};
 use crate::Handler;
-use rustc_serialize::json;
 use rustc_span::{BytePos, Span};
 
 use std::str;
 
-#[derive(Debug, PartialEq, Eq)]
+use serde::Deserialize;
+
+#[derive(Deserialize, Debug, PartialEq, Eq)]
+struct TestData {
+    spans: Vec<SpanTestData>,
+}
+
+#[derive(Deserialize, Debug, PartialEq, Eq)]
 struct SpanTestData {
     pub byte_start: u32,
     pub byte_end: u32,
@@ -61,19 +67,11 @@ fn test_positions(code: &str, span: (u32, u32), expected_output: SpanTestData) {
 
         let bytes = output.lock().unwrap();
         let actual_output = str::from_utf8(&bytes).unwrap();
-        let actual_output = json::from_str(&actual_output).unwrap();
-        let spans = actual_output["spans"].as_array().unwrap();
+        let actual_output: TestData = serde_json::from_str(actual_output).unwrap();
+        let spans = actual_output.spans;
         assert_eq!(spans.len(), 1);
-        let obj = &spans[0];
-        let actual_output = SpanTestData {
-            byte_start: obj["byte_start"].as_u64().unwrap() as u32,
-            byte_end: obj["byte_end"].as_u64().unwrap() as u32,
-            line_start: obj["line_start"].as_u64().unwrap() as u32,
-            line_end: obj["line_end"].as_u64().unwrap() as u32,
-            column_start: obj["column_start"].as_u64().unwrap() as u32,
-            column_end: obj["column_end"].as_u64().unwrap() as u32,
-        };
-        assert_eq!(expected_output, actual_output);
+
+        assert_eq!(expected_output, spans[0])
     })
 }
 
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs
index fb02f1d68eb..3be6dd5af75 100644
--- a/compiler/rustc_errors/src/lib.rs
+++ b/compiler/rustc_errors/src/lib.rs
@@ -8,7 +8,6 @@
 #![feature(if_let_guard)]
 #![feature(let_else)]
 #![feature(never_type)]
-#![feature(nll)]
 #![feature(adt_const_params)]
 #![allow(incomplete_features)]
 #![allow(rustc::potential_query_instability)]
diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs
index 048039343a7..071e88e07fd 100644
--- a/compiler/rustc_feature/src/accepted.rs
+++ b/compiler/rustc_feature/src/accepted.rs
@@ -221,6 +221,8 @@ declare_features! (
     (accepted, native_link_modifiers, "1.61.0", Some(81490), None),
     /// Allows specifying the whole-archive link modifier
     (accepted, native_link_modifiers_whole_archive, "1.61.0", Some(81490), None),
+    /// Allows using non lexical lifetimes (RFC 2094).
+    (accepted, nll, "1.63.0", Some(43234), None),
     /// Allows using `#![no_std]`.
     (accepted, no_std, "1.6.0", None, None),
     /// Allows defining identifiers beyond ASCII.
diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs
index 1466e8dfc92..b6ab60f9f03 100644
--- a/compiler/rustc_feature/src/active.rs
+++ b/compiler/rustc_feature/src/active.rs
@@ -461,8 +461,6 @@ declare_features! (
     (active, never_type, "1.13.0", Some(35121), None),
     /// Allows diverging expressions to fall back to `!` rather than `()`.
     (active, never_type_fallback, "1.41.0", Some(65992), None),
-    /// Allows using non lexical lifetimes (RFC 2094).
-    (active, nll, "1.0.0", Some(43234), None),
     /// Allows `#![no_core]`.
     (active, no_core, "1.3.0", Some(29639), None),
     /// Allows function attribute `#[no_coverage]`, to bypass coverage
diff --git a/compiler/rustc_graphviz/src/lib.rs b/compiler/rustc_graphviz/src/lib.rs
index 676c66f41a9..6eaff5c2f74 100644
--- a/compiler/rustc_graphviz/src/lib.rs
+++ b/compiler/rustc_graphviz/src/lib.rs
@@ -273,7 +273,6 @@
     html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
     test(attr(allow(unused_variables), deny(warnings)))
 )]
-#![feature(nll)]
 
 use LabelText::*;
 
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs
index dbe6fe6ea84..9c314f67651 100644
--- a/compiler/rustc_hir/src/hir.rs
+++ b/compiler/rustc_hir/src/hir.rs
@@ -26,7 +26,7 @@ use rustc_target::spec::abi::Abi;
 use smallvec::SmallVec;
 use std::fmt;
 
-#[derive(Copy, Clone, Encodable, HashStable_Generic)]
+#[derive(Debug, Copy, Clone, Encodable, HashStable_Generic)]
 pub struct Lifetime {
     pub hir_id: HirId,
     pub span: Span,
@@ -60,7 +60,7 @@ pub enum ParamName {
     /// ```
     /// where `'f` is something like `Fresh(0)`. The indices are
     /// unique per impl, but not necessarily continuous.
-    Fresh(LocalDefId),
+    Fresh,
 
     /// Indicates an illegal name was given and an error has been
     /// reported (so we should squelch other derived errors). Occurs
@@ -72,9 +72,7 @@ impl ParamName {
     pub fn ident(&self) -> Ident {
         match *self {
             ParamName::Plain(ident) => ident,
-            ParamName::Fresh(_) | ParamName::Error => {
-                Ident::with_dummy_span(kw::UnderscoreLifetime)
-            }
+            ParamName::Fresh | ParamName::Error => Ident::with_dummy_span(kw::UnderscoreLifetime),
         }
     }
 
@@ -90,7 +88,7 @@ impl ParamName {
 #[derive(HashStable_Generic)]
 pub enum LifetimeName {
     /// User-given names or fresh (synthetic) names.
-    Param(ParamName),
+    Param(LocalDefId, ParamName),
 
     /// User wrote nothing (e.g., the lifetime in `&u32`).
     Implicit,
@@ -127,7 +125,7 @@ impl LifetimeName {
             | LifetimeName::Error => Ident::empty(),
             LifetimeName::Underscore => Ident::with_dummy_span(kw::UnderscoreLifetime),
             LifetimeName::Static => Ident::with_dummy_span(kw::StaticLifetime),
-            LifetimeName::Param(param_name) => param_name.ident(),
+            LifetimeName::Param(_, param_name) => param_name.ident(),
         }
     }
 
@@ -136,9 +134,9 @@ impl LifetimeName {
             LifetimeName::ImplicitObjectLifetimeDefault
             | LifetimeName::Implicit
             | LifetimeName::Underscore
-            | LifetimeName::Param(ParamName::Fresh(_))
+            | LifetimeName::Param(_, ParamName::Fresh)
             | LifetimeName::Error => true,
-            LifetimeName::Static | LifetimeName::Param(_) => false,
+            LifetimeName::Static | LifetimeName::Param(..) => false,
         }
     }
 
@@ -148,12 +146,12 @@ impl LifetimeName {
             | LifetimeName::Implicit
             | LifetimeName::Underscore => true,
 
-            // It might seem surprising that `Fresh(_)` counts as
+            // It might seem surprising that `Fresh` counts as
             // *not* elided -- but this is because, as far as the code
-            // in the compiler is concerned -- `Fresh(_)` variants act
+            // in the compiler is concerned -- `Fresh` variants act
             // equivalently to "some fresh name". They correspond to
             // early-bound regions on an impl, in other words.
-            LifetimeName::Error | LifetimeName::Param(_) | LifetimeName::Static => false,
+            LifetimeName::Error | LifetimeName::Param(..) | LifetimeName::Static => false,
         }
     }
 
@@ -163,8 +161,8 @@ impl LifetimeName {
 
     pub fn normalize_to_macros_2_0(&self) -> LifetimeName {
         match *self {
-            LifetimeName::Param(param_name) => {
-                LifetimeName::Param(param_name.normalize_to_macros_2_0())
+            LifetimeName::Param(def_id, param_name) => {
+                LifetimeName::Param(def_id, param_name.normalize_to_macros_2_0())
             }
             lifetime_name => lifetime_name,
         }
@@ -177,12 +175,6 @@ impl fmt::Display for Lifetime {
     }
 }
 
-impl fmt::Debug for Lifetime {
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        write!(f, "lifetime({}: {})", self.hir_id, self.name.ident())
-    }
-}
-
 impl Lifetime {
     pub fn is_elided(&self) -> bool {
         self.name.is_elided()
@@ -628,6 +620,16 @@ impl<'hir> Generics<'hir> {
         })
     }
 
+    pub fn outlives_for_param(
+        &self,
+        param_def_id: LocalDefId,
+    ) -> impl Iterator<Item = &WhereRegionPredicate<'_>> {
+        self.predicates.iter().filter_map(move |pred| match pred {
+            WherePredicate::RegionPredicate(rp) if rp.is_param_bound(param_def_id) => Some(rp),
+            _ => None,
+        })
+    }
+
     pub fn bounds_span_for_suggestions(&self, param_def_id: LocalDefId) -> Option<Span> {
         self.bounds_for_param(param_def_id).flat_map(|bp| bp.bounds.iter().rev()).find_map(
             |bound| {
@@ -732,7 +734,7 @@ impl<'hir> WherePredicate<'hir> {
     }
 }
 
-#[derive(Debug, HashStable_Generic, PartialEq, Eq)]
+#[derive(Copy, Clone, Debug, HashStable_Generic, PartialEq, Eq)]
 pub enum PredicateOrigin {
     WhereClause,
     GenericParam,
@@ -769,6 +771,16 @@ pub struct WhereRegionPredicate<'hir> {
     pub bounds: GenericBounds<'hir>,
 }
 
+impl<'hir> WhereRegionPredicate<'hir> {
+    /// Returns `true` if `param_def_id` matches the `lifetime` of this predicate.
+    pub fn is_param_bound(&self, param_def_id: LocalDefId) -> bool {
+        match self.lifetime.name {
+            LifetimeName::Param(id, _) => id == param_def_id,
+            _ => false,
+        }
+    }
+}
+
 /// An equality predicate (e.g., `T = int`); currently unsupported.
 #[derive(Debug, HashStable_Generic)]
 pub struct WhereEqPredicate<'hir> {
@@ -2992,13 +3004,12 @@ impl ItemKind<'_> {
         Some(match *self {
             ItemKind::Fn(_, ref generics, _)
             | ItemKind::TyAlias(_, ref generics)
-            | ItemKind::OpaqueTy(OpaqueTy {
-                ref generics, origin: OpaqueTyOrigin::TyAlias, ..
-            })
+            | ItemKind::OpaqueTy(OpaqueTy { ref generics, .. })
             | ItemKind::Enum(_, ref generics)
             | ItemKind::Struct(_, ref generics)
             | ItemKind::Union(_, ref generics)
             | ItemKind::Trait(_, _, ref generics, _, _)
+            | ItemKind::TraitAlias(ref generics, _)
             | ItemKind::Impl(Impl { ref generics, .. }) => generics,
             _ => return None,
         })
@@ -3198,13 +3209,8 @@ impl<'hir> OwnerNode<'hir> {
         }
     }
 
-    pub fn generics(&self) -> Option<&'hir Generics<'hir>> {
-        match self {
-            OwnerNode::TraitItem(TraitItem { generics, .. })
-            | OwnerNode::ImplItem(ImplItem { generics, .. }) => Some(generics),
-            OwnerNode::Item(item) => item.kind.generics(),
-            _ => None,
-        }
+    pub fn generics(self) -> Option<&'hir Generics<'hir>> {
+        Node::generics(self.into())
     }
 
     pub fn def_id(self) -> LocalDefId {
@@ -3296,6 +3302,7 @@ pub enum Node<'hir> {
     Stmt(&'hir Stmt<'hir>),
     PathSegment(&'hir PathSegment<'hir>),
     Ty(&'hir Ty<'hir>),
+    TypeBinding(&'hir TypeBinding<'hir>),
     TraitRef(&'hir TraitRef<'hir>),
     Binding(&'hir Pat<'hir>),
     Pat(&'hir Pat<'hir>),
@@ -3341,6 +3348,7 @@ impl<'hir> Node<'hir> {
             | Node::PathSegment(PathSegment { ident, .. }) => Some(*ident),
             Node::Lifetime(lt) => Some(lt.name.ident()),
             Node::GenericParam(p) => Some(p.name.ident()),
+            Node::TypeBinding(b) => Some(b.ident),
             Node::Param(..)
             | Node::AnonConst(..)
             | Node::Expr(..)
@@ -3391,9 +3399,12 @@ impl<'hir> Node<'hir> {
         }
     }
 
-    pub fn generics(&self) -> Option<&'hir Generics<'hir>> {
+    pub fn generics(self) -> Option<&'hir Generics<'hir>> {
         match self {
-            Node::TraitItem(TraitItem { generics, .. })
+            Node::ForeignItem(ForeignItem {
+                kind: ForeignItemKind::Fn(_, _, generics), ..
+            })
+            | Node::TraitItem(TraitItem { generics, .. })
             | Node::ImplItem(ImplItem { generics, .. }) => Some(generics),
             Node::Item(item) => item.kind.generics(),
             _ => None,
diff --git a/compiler/rustc_hir/src/intravisit.rs b/compiler/rustc_hir/src/intravisit.rs
index 5b83a29bb33..bd8587f1106 100644
--- a/compiler/rustc_hir/src/intravisit.rs
+++ b/compiler/rustc_hir/src/intravisit.rs
@@ -510,11 +510,11 @@ pub fn walk_label<'v, V: Visitor<'v>>(visitor: &mut V, label: &'v Label) {
 pub fn walk_lifetime<'v, V: Visitor<'v>>(visitor: &mut V, lifetime: &'v Lifetime) {
     visitor.visit_id(lifetime.hir_id);
     match lifetime.name {
-        LifetimeName::Param(ParamName::Plain(ident)) => {
+        LifetimeName::Param(_, ParamName::Plain(ident)) => {
             visitor.visit_ident(ident);
         }
-        LifetimeName::Param(ParamName::Fresh(_))
-        | LifetimeName::Param(ParamName::Error)
+        LifetimeName::Param(_, ParamName::Fresh)
+        | LifetimeName::Param(_, ParamName::Error)
         | LifetimeName::Static
         | LifetimeName::Error
         | LifetimeName::Implicit
@@ -879,7 +879,7 @@ pub fn walk_generic_param<'v, V: Visitor<'v>>(visitor: &mut V, param: &'v Generi
     visitor.visit_id(param.hir_id);
     match param.name {
         ParamName::Plain(ident) => visitor.visit_ident(ident),
-        ParamName::Error | ParamName::Fresh(_) => {}
+        ParamName::Error | ParamName::Fresh => {}
     }
     match param.kind {
         GenericParamKind::Lifetime { .. } => {}
diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs
index 4558a3d10c4..fb40008d60b 100644
--- a/compiler/rustc_hir_pretty/src/lib.rs
+++ b/compiler/rustc_hir_pretty/src/lib.rs
@@ -85,6 +85,7 @@ impl<'a> State<'a> {
             Node::Stmt(a) => self.print_stmt(&a),
             Node::PathSegment(a) => self.print_path_segment(&a),
             Node::Ty(a) => self.print_type(&a),
+            Node::TypeBinding(a) => self.print_type_binding(&a),
             Node::TraitRef(a) => self.print_trait_ref(&a),
             Node::Binding(a) | Node::Pat(a) => self.print_pat(&a),
             Node::Arm(a) => self.print_arm(&a),
@@ -1703,21 +1704,7 @@ impl<'a> State<'a> {
 
             for binding in generic_args.bindings.iter() {
                 start_or_comma(self);
-                self.print_ident(binding.ident);
-                self.print_generic_args(binding.gen_args, false, false);
-                self.space();
-                match generic_args.bindings[0].kind {
-                    hir::TypeBindingKind::Equality { ref term } => {
-                        self.word_space("=");
-                        match term {
-                            Term::Ty(ref ty) => self.print_type(ty),
-                            Term::Const(ref c) => self.print_anon_const(c),
-                        }
-                    }
-                    hir::TypeBindingKind::Constraint { bounds } => {
-                        self.print_bounds(":", bounds);
-                    }
-                }
+                self.print_type_binding(binding);
             }
 
             if !empty.get() {
@@ -1726,6 +1713,24 @@ impl<'a> State<'a> {
         }
     }
 
+    pub fn print_type_binding(&mut self, binding: &hir::TypeBinding<'_>) {
+        self.print_ident(binding.ident);
+        self.print_generic_args(binding.gen_args, false, false);
+        self.space();
+        match binding.kind {
+            hir::TypeBindingKind::Equality { ref term } => {
+                self.word_space("=");
+                match term {
+                    Term::Ty(ref ty) => self.print_type(ty),
+                    Term::Const(ref c) => self.print_anon_const(c),
+                }
+            }
+            hir::TypeBindingKind::Constraint { bounds } => {
+                self.print_bounds(":", bounds);
+            }
+        }
+    }
+
     pub fn print_pat(&mut self, pat: &hir::Pat<'_>) {
         self.maybe_print_comment(pat.span.lo());
         self.ann.pre(self, AnnNode::Pat(pat));
diff --git a/compiler/rustc_incremental/src/lib.rs b/compiler/rustc_incremental/src/lib.rs
index 01711345966..1e88e8091c3 100644
--- a/compiler/rustc_incremental/src/lib.rs
+++ b/compiler/rustc_incremental/src/lib.rs
@@ -3,7 +3,6 @@
 #![deny(missing_docs)]
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
 #![feature(let_else)]
-#![feature(nll)]
 #![recursion_limit = "256"]
 #![allow(rustc::potential_query_instability)]
 
diff --git a/compiler/rustc_infer/src/infer/error_reporting/mod.rs b/compiler/rustc_infer/src/infer/error_reporting/mod.rs
index 579d7efb568..97deb9d986d 100644
--- a/compiler/rustc_infer/src/infer/error_reporting/mod.rs
+++ b/compiler/rustc_infer/src/infer/error_reporting/mod.rs
@@ -352,7 +352,7 @@ pub fn same_type_modulo_infer<'tcx>(a: Ty<'tcx>, b: Ty<'tcx>) -> bool {
 }
 
 impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
-    pub fn report_region_errors(&self, errors: &Vec<RegionResolutionError<'tcx>>) {
+    pub fn report_region_errors(&self, errors: &[RegionResolutionError<'tcx>]) {
         debug!("report_region_errors(): {} errors to start", errors.len());
 
         // try to pre-process the errors, which will group some of them
diff --git a/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs b/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs
index 0f341a947ad..44cf9b6611e 100644
--- a/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs
+++ b/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs
@@ -42,18 +42,7 @@ pub(crate) fn resolve<'tcx>(
             let values = resolver.infer_variable_values(&mut errors);
             (values, errors)
         }
-        RegionckMode::Erase { suppress_errors: false } => {
-            // Do real inference to get errors, then erase the results.
-            let mut values = resolver.infer_variable_values(&mut errors);
-            let re_erased = region_rels.tcx.lifetimes.re_erased;
-
-            values.values.iter_mut().for_each(|v| match *v {
-                VarValue::Value(ref mut r) => *r = re_erased,
-                VarValue::ErrorValue => {}
-            });
-            (values, errors)
-        }
-        RegionckMode::Erase { suppress_errors: true } => {
+        RegionckMode::Erase => {
             // Skip region inference entirely.
             (resolver.erased_data(region_rels.tcx), Vec::new())
         }
diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs
index 4ef6f240c48..24a9b399eac 100644
--- a/compiler/rustc_infer/src/infer/mod.rs
+++ b/compiler/rustc_infer/src/infer/mod.rs
@@ -29,7 +29,6 @@ use rustc_middle::ty::subst::{GenericArg, GenericArgKind, InternalSubsts, Substs
 pub use rustc_middle::ty::IntVarValue;
 use rustc_middle::ty::{self, GenericParamDefKind, InferConst, Ty, TyCtxt};
 use rustc_middle::ty::{ConstVid, FloatVid, IntVid, TyVid};
-use rustc_session::config::BorrowckMode;
 use rustc_span::symbol::Symbol;
 use rustc_span::Span;
 
@@ -97,29 +96,7 @@ pub enum RegionckMode {
     #[default]
     Solve,
     /// Erase the results of region after solving.
-    Erase {
-        /// A flag that is used to suppress region errors, when we are doing
-        /// region checks that the NLL borrow checker will also do -- it might
-        /// be set to true.
-        suppress_errors: bool,
-    },
-}
-
-impl RegionckMode {
-    /// Indicates that the MIR borrowck will repeat these region
-    /// checks, so we should ignore errors if NLL is (unconditionally)
-    /// enabled.
-    pub fn for_item_body(tcx: TyCtxt<'_>) -> Self {
-        // FIXME(Centril): Once we actually remove `::Migrate` also make
-        // this always `true` and then proceed to eliminate the dead code.
-        match tcx.borrowck_mode() {
-            // If we're on Migrate mode, report AST region errors
-            BorrowckMode::Migrate => RegionckMode::Erase { suppress_errors: false },
-
-            // If we're on MIR, don't report AST region errors as they should be reported by NLL
-            BorrowckMode::Mir => RegionckMode::Erase { suppress_errors: true },
-        }
-    }
+    Erase,
 }
 
 /// This type contains all the things within `InferCtxt` that sit within a
diff --git a/compiler/rustc_interface/src/lib.rs b/compiler/rustc_interface/src/lib.rs
index 40e02f47bd1..d443057eb79 100644
--- a/compiler/rustc_interface/src/lib.rs
+++ b/compiler/rustc_interface/src/lib.rs
@@ -2,7 +2,6 @@
 #![feature(let_else)]
 #![feature(internal_output_capture)]
 #![feature(thread_spawn_unchecked)]
-#![feature(nll)]
 #![feature(once_cell)]
 #![recursion_limit = "256"]
 #![allow(rustc::potential_query_instability)]
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs
index e6c9c6693c5..3c867e308c4 100644
--- a/compiler/rustc_interface/src/passes.rs
+++ b/compiler/rustc_interface/src/passes.rs
@@ -27,7 +27,6 @@ use rustc_passes::{self, hir_stats, layout_test};
 use rustc_plugin_impl as plugin;
 use rustc_query_impl::{OnDiskCache, Queries as TcxQueries};
 use rustc_resolve::{Resolver, ResolverArenas};
-use rustc_serialize::json;
 use rustc_session::config::{CrateType, Input, OutputFilenames, OutputType};
 use rustc_session::cstore::{MetadataLoader, MetadataLoaderDyn};
 use rustc_session::output::{filename_for_input, filename_for_metadata};
@@ -59,10 +58,6 @@ pub fn parse<'a>(sess: &'a Session, input: &Input) -> PResult<'a, ast::Crate> {
         }
     })?;
 
-    if sess.opts.debugging_opts.ast_json_noexpand {
-        println!("{}", json::as_json(&krate));
-    }
-
     if sess.opts.debugging_opts.input_stats {
         eprintln!("Lines of code:             {}", sess.source_map().count_lines());
         eprintln!("Pre-expansion node count:  {}", count_nodes(&krate));
@@ -423,10 +418,6 @@ pub fn configure_and_expand(
         hir_stats::print_ast_stats(&krate, "POST EXPANSION AST STATS");
     }
 
-    if sess.opts.debugging_opts.ast_json {
-        println!("{}", json::as_json(&krate));
-    }
-
     resolver.resolve_crate(&krate);
 
     // Needs to go *after* expansion to be able to check the results of macro expansion.
diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs
index 1327bf6fcd4..f2cfbea207e 100644
--- a/compiler/rustc_interface/src/tests.rs
+++ b/compiler/rustc_interface/src/tests.rs
@@ -644,9 +644,6 @@ fn test_debugging_options_tracking_hash() {
     // Make sure that changing an [UNTRACKED] option leaves the hash unchanged.
     // This list is in alphabetical order.
     untracked!(assert_incr_state, Some(String::from("loaded")));
-    untracked!(ast_json, true);
-    untracked!(ast_json_noexpand, true);
-    untracked!(borrowck, String::from("other"));
     untracked!(deduplicate_diagnostics, false);
     untracked!(dep_tasks, true);
     untracked!(dlltool, Some(PathBuf::from("custom_dlltool.exe")));
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs
index 6be78c52f99..92cd8c2b611 100644
--- a/compiler/rustc_lint/src/builtin.rs
+++ b/compiler/rustc_lint/src/builtin.rs
@@ -338,6 +338,17 @@ impl UnsafeCode {
                 .emit();
         })
     }
+
+    fn report_overridden_symbol_section(&self, cx: &EarlyContext<'_>, span: Span, msg: &str) {
+        self.report_unsafe(cx, span, |lint| {
+            lint.build(msg)
+                .note(
+                    "the program's behavior with overridden link sections on items is unpredictable \
+                    and Rust cannot provide guarantees when you manually override them",
+                )
+                .emit();
+        })
+    }
 }
 
 impl EarlyLintPass for UnsafeCode {
@@ -385,6 +396,7 @@ impl EarlyLintPass for UnsafeCode {
                         "declaration of a `no_mangle` function",
                     );
                 }
+
                 if let Some(attr) = cx.sess().find_by_name(&it.attrs, sym::export_name) {
                     self.report_overridden_symbol_name(
                         cx,
@@ -392,6 +404,14 @@ impl EarlyLintPass for UnsafeCode {
                         "declaration of a function with `export_name`",
                     );
                 }
+
+                if let Some(attr) = cx.sess().find_by_name(&it.attrs, sym::link_section) {
+                    self.report_overridden_symbol_section(
+                        cx,
+                        attr.span,
+                        "declaration of a function with `link_section`",
+                    );
+                }
             }
 
             ast::ItemKind::Static(..) => {
@@ -402,6 +422,7 @@ impl EarlyLintPass for UnsafeCode {
                         "declaration of a `no_mangle` static",
                     );
                 }
+
                 if let Some(attr) = cx.sess().find_by_name(&it.attrs, sym::export_name) {
                     self.report_overridden_symbol_name(
                         cx,
@@ -409,6 +430,14 @@ impl EarlyLintPass for UnsafeCode {
                         "declaration of a static with `export_name`",
                     );
                 }
+
+                if let Some(attr) = cx.sess().find_by_name(&it.attrs, sym::link_section) {
+                    self.report_overridden_symbol_section(
+                        cx,
+                        attr.span,
+                        "declaration of a static with `link_section`",
+                    );
+                }
             }
 
             _ => {}
diff --git a/compiler/rustc_lint/src/lib.rs b/compiler/rustc_lint/src/lib.rs
index 7c68429e1e9..ff4ed94fab3 100644
--- a/compiler/rustc_lint/src/lib.rs
+++ b/compiler/rustc_lint/src/lib.rs
@@ -36,7 +36,6 @@
 #![feature(let_chains)]
 #![feature(let_else)]
 #![feature(never_type)]
-#![feature(nll)]
 #![recursion_limit = "256"]
 
 #[macro_use]
diff --git a/compiler/rustc_lint_defs/Cargo.toml b/compiler/rustc_lint_defs/Cargo.toml
index fcd8c37d677..2bf34d82f39 100644
--- a/compiler/rustc_lint_defs/Cargo.toml
+++ b/compiler/rustc_lint_defs/Cargo.toml
@@ -4,6 +4,7 @@ version = "0.0.0"
 edition = "2021"
 
 [dependencies]
+serde = { version = "1.0.125", features = ["derive"] }
 rustc_ast = { path = "../rustc_ast" }
 rustc_data_structures = { path = "../rustc_data_structures" }
 rustc_error_messages = { path = "../rustc_error_messages" }
diff --git a/compiler/rustc_lint_defs/src/lib.rs b/compiler/rustc_lint_defs/src/lib.rs
index e50abf6cf25..913dc58a102 100644
--- a/compiler/rustc_lint_defs/src/lib.rs
+++ b/compiler/rustc_lint_defs/src/lib.rs
@@ -14,6 +14,8 @@ use rustc_span::edition::Edition;
 use rustc_span::{sym, symbol::Ident, Span, Symbol};
 use rustc_target::spec::abi::Abi;
 
+use serde::{Deserialize, Serialize};
+
 pub mod builtin;
 
 #[macro_export]
@@ -34,7 +36,7 @@ macro_rules! pluralize {
 /// All suggestions are marked with an `Applicability`. Tools use the applicability of a suggestion
 /// to determine whether it should be automatically applied or if the user should be consulted
 /// before applying the suggestion.
-#[derive(Copy, Clone, Debug, PartialEq, Hash, Encodable, Decodable)]
+#[derive(Copy, Clone, Debug, PartialEq, Hash, Encodable, Decodable, Serialize, Deserialize)]
 pub enum Applicability {
     /// The suggestion is definitely what the user intended, or maintains the exact meaning of the code.
     /// This suggestion should be automatically applied.
diff --git a/compiler/rustc_llvm/src/lib.rs b/compiler/rustc_llvm/src/lib.rs
index b63f81bffaa..8eade02a408 100644
--- a/compiler/rustc_llvm/src/lib.rs
+++ b/compiler/rustc_llvm/src/lib.rs
@@ -1,4 +1,3 @@
-#![feature(nll)]
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
 
 // NOTE: This crate only exists to allow linking on mingw targets.
diff --git a/compiler/rustc_macros/src/serialize.rs b/compiler/rustc_macros/src/serialize.rs
index a39b4413981..e99fa6c113b 100644
--- a/compiler/rustc_macros/src/serialize.rs
+++ b/compiler/rustc_macros/src/serialize.rs
@@ -140,79 +140,56 @@ fn encodable_body(
 
     let encode_body = match s.variants() {
         [_] => {
-            let mut field_idx = 0usize;
             let encode_inner = s.each_variant(|vi| {
                 vi.bindings()
                     .iter()
                     .map(|binding| {
                         let bind_ident = &binding.binding;
-                        let field_name = binding
-                            .ast()
-                            .ident
-                            .as_ref()
-                            .map_or_else(|| field_idx.to_string(), |i| i.to_string());
-                        let first = field_idx == 0;
                         let result = quote! {
-                            match ::rustc_serialize::Encoder::emit_struct_field(
+                            match ::rustc_serialize::Encodable::<#encoder_ty>::encode(
+                                #bind_ident,
                                 __encoder,
-                                #field_name,
-                                #first,
-                                |__encoder|
-                                ::rustc_serialize::Encodable::<#encoder_ty>::encode(#bind_ident, __encoder),
                             ) {
                                 ::std::result::Result::Ok(()) => (),
                                 ::std::result::Result::Err(__err)
                                     => return ::std::result::Result::Err(__err),
                             }
                         };
-                        field_idx += 1;
                         result
                     })
                     .collect::<TokenStream>()
             });
-            let no_fields = field_idx == 0;
             quote! {
-                ::rustc_serialize::Encoder::emit_struct(__encoder, #no_fields, |__encoder| {
-                    ::std::result::Result::Ok(match *self { #encode_inner })
-                })
+                ::std::result::Result::Ok(match *self { #encode_inner })
             }
         }
         _ => {
             let mut variant_idx = 0usize;
             let encode_inner = s.each_variant(|vi| {
-                let variant_name = vi.ast().ident.to_string();
-                let mut field_idx = 0usize;
-
                 let encode_fields: TokenStream = vi
                     .bindings()
                     .iter()
                     .map(|binding| {
                         let bind_ident = &binding.binding;
-                        let first = field_idx == 0;
                         let result = quote! {
-                            match ::rustc_serialize::Encoder::emit_enum_variant_arg(
+                            match ::rustc_serialize::Encodable::<#encoder_ty>::encode(
+                                #bind_ident,
                                 __encoder,
-                                #first,
-                                |__encoder|
-                                ::rustc_serialize::Encodable::<#encoder_ty>::encode(#bind_ident, __encoder),
                             ) {
                                 ::std::result::Result::Ok(()) => (),
                                 ::std::result::Result::Err(__err)
                                     => return ::std::result::Result::Err(__err),
                             }
                         };
-                        field_idx += 1;
                         result
                     })
                     .collect();
 
-                let result = if field_idx != 0 {
+                let result = if !vi.bindings().is_empty() {
                     quote! {
                         ::rustc_serialize::Encoder::emit_enum_variant(
                             __encoder,
-                            #variant_name,
                             #variant_idx,
-                            #field_idx,
                             |__encoder| { ::std::result::Result::Ok({ #encode_fields }) }
                         )
                     }
@@ -220,7 +197,6 @@ fn encodable_body(
                     quote! {
                         ::rustc_serialize::Encoder::emit_fieldless_enum_variant::<#variant_idx>(
                             __encoder,
-                            #variant_name,
                         )
                     }
                 };
@@ -228,11 +204,9 @@ fn encodable_body(
                 result
             });
             quote! {
-                ::rustc_serialize::Encoder::emit_enum(__encoder, |__encoder| {
-                    match *self {
-                        #encode_inner
-                    }
-                })
+                match *self {
+                    #encode_inner
+                }
             }
         }
     };
diff --git a/compiler/rustc_metadata/src/lib.rs b/compiler/rustc_metadata/src/lib.rs
index eb008fd2693..5ad16398695 100644
--- a/compiler/rustc_metadata/src/lib.rs
+++ b/compiler/rustc_metadata/src/lib.rs
@@ -6,7 +6,6 @@
 #![feature(iter_from_generator)]
 #![feature(let_chains)]
 #![feature(let_else)]
-#![feature(nll)]
 #![feature(once_cell)]
 #![feature(proc_macro_internals)]
 #![feature(macro_metavar_expr)]
diff --git a/compiler/rustc_metadata/src/rmeta/encoder.rs b/compiler/rustc_metadata/src/rmeta/encoder.rs
index f67e1cab16d..1425c5467af 100644
--- a/compiler/rustc_metadata/src/rmeta/encoder.rs
+++ b/compiler/rustc_metadata/src/rmeta/encoder.rs
@@ -95,11 +95,6 @@ macro_rules! encoder_methods {
 impl<'a, 'tcx> Encoder for EncodeContext<'a, 'tcx> {
     type Error = <opaque::Encoder as Encoder>::Error;
 
-    #[inline]
-    fn emit_unit(&mut self) -> Result<(), Self::Error> {
-        Ok(())
-    }
-
     encoder_methods! {
         emit_usize(usize);
         emit_u128(u128);
diff --git a/compiler/rustc_middle/src/hir/map/mod.rs b/compiler/rustc_middle/src/hir/map/mod.rs
index 7a1bdd6beca..ebda9f7588d 100644
--- a/compiler/rustc_middle/src/hir/map/mod.rs
+++ b/compiler/rustc_middle/src/hir/map/mod.rs
@@ -298,6 +298,7 @@ impl<'hir> Map<'hir> {
             Node::Stmt(_)
             | Node::PathSegment(_)
             | Node::Ty(_)
+            | Node::TypeBinding(_)
             | Node::Infer(_)
             | Node::TraitRef(_)
             | Node::Pat(_)
@@ -323,7 +324,8 @@ impl<'hir> Map<'hir> {
     }
 
     pub fn get_parent_node(self, hir_id: HirId) -> HirId {
-        self.find_parent_node(hir_id).unwrap()
+        self.find_parent_node(hir_id)
+            .unwrap_or_else(|| bug!("No parent for node {:?}", self.node_to_string(hir_id)))
     }
 
     /// Retrieves the `Node` corresponding to `id`, returning `None` if cannot be found.
@@ -361,23 +363,7 @@ impl<'hir> Map<'hir> {
 
     pub fn get_generics(self, id: LocalDefId) -> Option<&'hir Generics<'hir>> {
         let node = self.tcx.hir_owner(id)?;
-        match node.node {
-            OwnerNode::ImplItem(impl_item) => Some(&impl_item.generics),
-            OwnerNode::TraitItem(trait_item) => Some(&trait_item.generics),
-            OwnerNode::Item(Item {
-                kind:
-                    ItemKind::Fn(_, generics, _)
-                    | ItemKind::TyAlias(_, generics)
-                    | ItemKind::Enum(_, generics)
-                    | ItemKind::Struct(_, generics)
-                    | ItemKind::Union(_, generics)
-                    | ItemKind::Trait(_, _, generics, ..)
-                    | ItemKind::TraitAlias(generics, _)
-                    | ItemKind::Impl(Impl { generics, .. }),
-                ..
-            }) => Some(generics),
-            _ => None,
-        }
+        node.node.generics()
     }
 
     pub fn item(self, id: ItemId) -> &'hir Item<'hir> {
@@ -989,6 +975,7 @@ impl<'hir> Map<'hir> {
                     .with_hi(seg.args.map_or_else(|| ident_span.hi(), |args| args.span_ext.hi()))
             }
             Node::Ty(ty) => ty.span,
+            Node::TypeBinding(tb) => tb.span,
             Node::TraitRef(tr) => tr.path.span,
             Node::Binding(pat) => pat.span,
             Node::Pat(pat) => pat.span,
@@ -1221,6 +1208,7 @@ fn hir_id_to_string(map: Map<'_>, id: HirId) -> String {
         Some(Node::Stmt(_)) => node_str("stmt"),
         Some(Node::PathSegment(_)) => node_str("path segment"),
         Some(Node::Ty(_)) => node_str("type"),
+        Some(Node::TypeBinding(_)) => node_str("type binding"),
         Some(Node::TraitRef(_)) => node_str("trait ref"),
         Some(Node::Binding(_)) => node_str("local"),
         Some(Node::Pat(_)) => node_str("pat"),
diff --git a/compiler/rustc_middle/src/lib.rs b/compiler/rustc_middle/src/lib.rs
index 17ca534d91b..8004319bf9b 100644
--- a/compiler/rustc_middle/src/lib.rs
+++ b/compiler/rustc_middle/src/lib.rs
@@ -39,7 +39,6 @@
 #![feature(never_type)]
 #![feature(extern_types)]
 #![feature(new_uninit)]
-#![feature(nll)]
 #![feature(once_cell)]
 #![feature(let_chains)]
 #![feature(let_else)]
diff --git a/compiler/rustc_middle/src/middle/region.rs b/compiler/rustc_middle/src/middle/region.rs
index 30ef6b775f5..c886175c6ea 100644
--- a/compiler/rustc_middle/src/middle/region.rs
+++ b/compiler/rustc_middle/src/middle/region.rs
@@ -16,6 +16,7 @@ use rustc_query_system::ich::StableHashingContext;
 use rustc_span::{Span, DUMMY_SP};
 
 use std::fmt;
+use std::ops::Deref;
 
 /// Represents a statically-describable scope that can be used to
 /// bound the lifetime/region for values.
@@ -407,8 +408,8 @@ impl ScopeTree {
 
     /// Checks whether the given scope contains a `yield`. If so,
     /// returns `Some(YieldData)`. If not, returns `None`.
-    pub fn yield_in_scope(&self, scope: Scope) -> Option<&Vec<YieldData>> {
-        self.yield_in_scope.get(&scope)
+    pub fn yield_in_scope(&self, scope: Scope) -> Option<&[YieldData]> {
+        self.yield_in_scope.get(&scope).map(Deref::deref)
     }
 
     /// Gives the number of expressions visited in a body.
diff --git a/compiler/rustc_middle/src/middle/resolve_lifetime.rs b/compiler/rustc_middle/src/middle/resolve_lifetime.rs
index 70586cefaee..c71ba7b1753 100644
--- a/compiler/rustc_middle/src/middle/resolve_lifetime.rs
+++ b/compiler/rustc_middle/src/middle/resolve_lifetime.rs
@@ -6,7 +6,6 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet};
 use rustc_hir::def_id::{DefId, LocalDefId};
 use rustc_hir::ItemLocalId;
 use rustc_macros::HashStable;
-use rustc_span::symbol::Symbol;
 
 #[derive(Clone, Copy, PartialEq, Eq, Hash, TyEncodable, TyDecodable, Debug, HashStable)]
 pub enum Region {
@@ -17,20 +16,6 @@ pub enum Region {
     Free(DefId, /* lifetime decl */ DefId),
 }
 
-/// This is used in diagnostics to improve suggestions for missing generic arguments.
-/// It gives information on the type of lifetimes that are in scope for a particular `PathSegment`,
-/// so that we can e.g. suggest elided-lifetimes-in-paths of the form <'_, '_> e.g.
-#[derive(Clone, PartialEq, Eq, Hash, TyEncodable, TyDecodable, Debug, HashStable)]
-pub enum LifetimeScopeForPath {
-    // Contains all lifetime names that are in scope and could possibly be used in generics
-    // arguments of path.
-    NonElided(Vec<Symbol>),
-
-    // Information that allows us to suggest args of the form `<'_>` in case
-    // no generic arguments were provided for a path.
-    Elided,
-}
-
 /// A set containing, at most, one known element.
 /// If two distinct values are inserted into a set, then it
 /// becomes `Many`, which can be used to detect ambiguities.
diff --git a/compiler/rustc_middle/src/mir/interpret/allocation.rs b/compiler/rustc_middle/src/mir/interpret/allocation.rs
index 6252dc1670c..fb4e17af494 100644
--- a/compiler/rustc_middle/src/mir/interpret/allocation.rs
+++ b/compiler/rustc_middle/src/mir/interpret/allocation.rs
@@ -264,9 +264,18 @@ impl<Tag, Extra> Allocation<Tag, Extra> {
 
 /// Byte accessors.
 impl<Tag: Provenance, Extra> Allocation<Tag, Extra> {
-    /// The last argument controls whether we error out when there are uninitialized
-    /// or pointer bytes. You should never call this, call `get_bytes` or
-    /// `get_bytes_with_uninit_and_ptr` instead,
+    /// This is the entirely abstraction-violating way to just grab the raw bytes without
+    /// caring about relocations. It just deduplicates some code between `read_scalar`
+    /// and `get_bytes_internal`.
+    fn get_bytes_even_more_internal(&self, range: AllocRange) -> &[u8] {
+        &self.bytes[range.start.bytes_usize()..range.end().bytes_usize()]
+    }
+
+    /// The last argument controls whether we error out when there are uninitialized or pointer
+    /// bytes. However, we *always* error when there are relocations overlapping the edges of the
+    /// range.
+    ///
+    /// You should never call this, call `get_bytes` or `get_bytes_with_uninit_and_ptr` instead,
     ///
     /// This function also guarantees that the resulting pointer will remain stable
     /// even when new allocations are pushed to the `HashMap`. `mem_copy_repeatedly` relies
@@ -287,7 +296,7 @@ impl<Tag: Provenance, Extra> Allocation<Tag, Extra> {
             self.check_relocation_edges(cx, range)?;
         }
 
-        Ok(&self.bytes[range.start.bytes_usize()..range.end().bytes_usize()])
+        Ok(self.get_bytes_even_more_internal(range))
     }
 
     /// Checks that these bytes are initialized and not pointer bytes, and then return them
@@ -373,6 +382,9 @@ impl<Tag: Provenance, Extra> Allocation<Tag, Extra> {
 
     /// Reads a *non-ZST* scalar.
     ///
+    /// If `read_provenance` is `true`, this will also read provenance; otherwise (if the machine
+    /// supports that) provenance is entirely ignored.
+    ///
     /// ZSTs can't be read because in order to obtain a `Pointer`, we need to check
     /// for ZSTness anyway due to integer pointers being valid for ZSTs.
     ///
@@ -382,35 +394,47 @@ impl<Tag: Provenance, Extra> Allocation<Tag, Extra> {
         &self,
         cx: &impl HasDataLayout,
         range: AllocRange,
+        read_provenance: bool,
     ) -> AllocResult<ScalarMaybeUninit<Tag>> {
-        // `get_bytes_with_uninit_and_ptr` tests relocation edges.
-        // We deliberately error when loading data that partially has provenance, or partially
-        // initialized data (that's the check below), into a scalar. The LLVM semantics of this are
-        // unclear so we are conservative. See <https://github.com/rust-lang/rust/issues/69488> for
-        // further discussion.
-        let bytes = self.get_bytes_with_uninit_and_ptr(cx, range)?;
-        // Uninit check happens *after* we established that the alignment is correct.
-        // We must not return `Ok()` for unaligned pointers!
+        if read_provenance {
+            assert_eq!(range.size, cx.data_layout().pointer_size);
+        }
+
+        // First and foremost, if anything is uninit, bail.
         if self.is_init(range).is_err() {
             // This inflates uninitialized bytes to the entire scalar, even if only a few
             // bytes are uninitialized.
             return Ok(ScalarMaybeUninit::Uninit);
         }
-        // Now we do the actual reading.
-        let bits = read_target_uint(cx.data_layout().endian, bytes).unwrap();
-        // See if we got a pointer.
-        if range.size != cx.data_layout().pointer_size {
-            // Not a pointer.
-            // *Now*, we better make sure that the inside is free of relocations too.
-            self.check_relocations(cx, range)?;
-        } else {
-            // Maybe a pointer.
-            if let Some(&prov) = self.relocations.get(&range.start) {
-                let ptr = Pointer::new(prov, Size::from_bytes(bits));
-                return Ok(ScalarMaybeUninit::from_pointer(ptr, cx));
-            }
+
+        // If we are doing a pointer read, and there is a relocation exactly where we
+        // are reading, then we can put data and relocation back together and return that.
+        if read_provenance && let Some(&prov) = self.relocations.get(&range.start) {
+            // We already checked init and relocations, so we can use this function.
+            let bytes = self.get_bytes_even_more_internal(range);
+            let bits = read_target_uint(cx.data_layout().endian, bytes).unwrap();
+            let ptr = Pointer::new(prov, Size::from_bytes(bits));
+            return Ok(ScalarMaybeUninit::from_pointer(ptr, cx));
         }
-        // We don't. Just return the bits.
+
+        // If we are *not* reading a pointer, and we can just ignore relocations,
+        // then do exactly that.
+        if !read_provenance && Tag::OFFSET_IS_ADDR {
+            // We just strip provenance.
+            let bytes = self.get_bytes_even_more_internal(range);
+            let bits = read_target_uint(cx.data_layout().endian, bytes).unwrap();
+            return Ok(ScalarMaybeUninit::Scalar(Scalar::from_uint(bits, range.size)));
+        }
+
+        // It's complicated. Better make sure there is no provenance anywhere.
+        // FIXME: If !OFFSET_IS_ADDR, this is the best we can do. But if OFFSET_IS_ADDR, then
+        // `read_pointer` is true and we ideally would distinguish the following two cases:
+        // - The entire `range` is covered by 2 relocations for the same provenance.
+        //   Then we should return a pointer with that provenance.
+        // - The range has inhomogeneous provenance. Then we should return just the
+        //   underlying bits.
+        let bytes = self.get_bytes(cx, range)?;
+        let bits = read_target_uint(cx.data_layout().endian, bytes).unwrap();
         Ok(ScalarMaybeUninit::Scalar(Scalar::from_uint(bits, range.size)))
     }
 
@@ -513,8 +537,9 @@ impl<Tag: Copy, Extra> Allocation<Tag, Extra> {
         let start = range.start;
         let end = range.end();
 
-        // We need to handle clearing the relocations from parts of a pointer. See
-        // <https://github.com/rust-lang/rust/issues/87184> for details.
+        // We need to handle clearing the relocations from parts of a pointer.
+        // FIXME: Miri should preserve partial relocations; see
+        // https://github.com/rust-lang/miri/issues/2181.
         if first < start {
             if Tag::ERR_ON_PARTIAL_PTR_OVERWRITE {
                 return Err(AllocError::PartialPointerOverwrite(first));
diff --git a/compiler/rustc_middle/src/mir/interpret/error.rs b/compiler/rustc_middle/src/mir/interpret/error.rs
index cb6fd006c3e..65de64c6328 100644
--- a/compiler/rustc_middle/src/mir/interpret/error.rs
+++ b/compiler/rustc_middle/src/mir/interpret/error.rs
@@ -428,7 +428,7 @@ pub enum UnsupportedOpInfo {
     /// Encountered a pointer where we needed raw bytes.
     ReadPointerAsBytes,
     /// Overwriting parts of a pointer; the resulting state cannot be represented in our
-    /// `Allocation` data structure.
+    /// `Allocation` data structure. See <https://github.com/rust-lang/miri/issues/2181>.
     PartialPointerOverwrite(Pointer<AllocId>),
     //
     // The variants below are only reachable from CTFE/const prop, miri will never emit them.
diff --git a/compiler/rustc_middle/src/mir/interpret/value.rs b/compiler/rustc_middle/src/mir/interpret/value.rs
index d00dae85367..146ae45e468 100644
--- a/compiler/rustc_middle/src/mir/interpret/value.rs
+++ b/compiler/rustc_middle/src/mir/interpret/value.rs
@@ -315,7 +315,7 @@ impl<Tag> Scalar<Tag> {
                 ScalarSizeMismatch { target_size: target_size.bytes(), data_size: size.bytes() }
             })?),
             Scalar::Ptr(ptr, sz) => {
-                if target_size.bytes() != sz.into() {
+                if target_size.bytes() != u64::from(sz) {
                     return Err(ScalarSizeMismatch {
                         target_size: target_size.bytes(),
                         data_size: sz.into(),
diff --git a/compiler/rustc_middle/src/mir/predecessors.rs b/compiler/rustc_middle/src/mir/predecessors.rs
index ad09328585d..0b9ddaf64d4 100644
--- a/compiler/rustc_middle/src/mir/predecessors.rs
+++ b/compiler/rustc_middle/src/mir/predecessors.rs
@@ -56,8 +56,8 @@ impl PredecessorCache {
 
 impl<S: serialize::Encoder> serialize::Encodable<S> for PredecessorCache {
     #[inline]
-    fn encode(&self, s: &mut S) -> Result<(), S::Error> {
-        s.emit_unit()
+    fn encode(&self, _s: &mut S) -> Result<(), S::Error> {
+        Ok(())
     }
 }
 
diff --git a/compiler/rustc_middle/src/mir/switch_sources.rs b/compiler/rustc_middle/src/mir/switch_sources.rs
index adeeec70d1c..fbb26800e29 100644
--- a/compiler/rustc_middle/src/mir/switch_sources.rs
+++ b/compiler/rustc_middle/src/mir/switch_sources.rs
@@ -56,8 +56,8 @@ impl SwitchSourceCache {
 
 impl<S: serialize::Encoder> serialize::Encodable<S> for SwitchSourceCache {
     #[inline]
-    fn encode(&self, s: &mut S) -> Result<(), S::Error> {
-        s.emit_unit()
+    fn encode(&self, _s: &mut S) -> Result<(), S::Error> {
+        Ok(())
     }
 }
 
diff --git a/compiler/rustc_middle/src/mir/traversal.rs b/compiler/rustc_middle/src/mir/traversal.rs
index 1cbfed62156..7e395902ad3 100644
--- a/compiler/rustc_middle/src/mir/traversal.rs
+++ b/compiler/rustc_middle/src/mir/traversal.rs
@@ -310,7 +310,7 @@ pub fn reachable_as_bitset<'tcx>(body: &Body<'tcx>) -> BitSet<BasicBlock> {
 #[derive(Clone)]
 pub struct ReversePostorderIter<'a, 'tcx> {
     body: &'a Body<'tcx>,
-    blocks: &'a Vec<BasicBlock>,
+    blocks: &'a [BasicBlock],
     idx: usize,
 }
 
@@ -358,17 +358,17 @@ impl PostorderCache {
         self.cache = OnceCell::new();
     }
 
-    /// Returns the &Vec<BasicBlocks> represents the postorder graph for this MIR.
+    /// Returns the `&[BasicBlocks]` represents the postorder graph for this MIR.
     #[inline]
-    pub(super) fn compute(&self, body: &Body<'_>) -> &Vec<BasicBlock> {
+    pub(super) fn compute(&self, body: &Body<'_>) -> &[BasicBlock] {
         self.cache.get_or_init(|| Postorder::new(body, START_BLOCK).map(|(bb, _)| bb).collect())
     }
 }
 
 impl<S: serialize::Encoder> serialize::Encodable<S> for PostorderCache {
     #[inline]
-    fn encode(&self, s: &mut S) -> Result<(), S::Error> {
-        s.emit_unit()
+    fn encode(&self, _s: &mut S) -> Result<(), S::Error> {
+        Ok(())
     }
 }
 
diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs
index 38d8e0b5819..5b48f164016 100644
--- a/compiler/rustc_middle/src/query/mod.rs
+++ b/compiler/rustc_middle/src/query/mod.rs
@@ -1584,7 +1584,7 @@ rustc_queries! {
         Option<&'tcx FxHashMap<ItemLocalId, Region>> {
         desc { "looking up a named region" }
     }
-    query is_late_bound_map(_: LocalDefId) -> Option<(LocalDefId, &'tcx FxHashSet<LocalDefId>)> {
+    query is_late_bound_map(_: LocalDefId) -> Option<&'tcx FxHashSet<LocalDefId>> {
         desc { "testing if a region is late bound" }
     }
     /// For a given item (like a struct), gets the default lifetimes to be used
@@ -1599,11 +1599,6 @@ rustc_queries! {
         desc { "looking up late bound vars" }
     }
 
-    query lifetime_scope_map(_: LocalDefId) -> Option<FxHashMap<ItemLocalId, LifetimeScopeForPath>> {
-        storage(ArenaCacheSelector<'tcx>)
-        desc { "finds the lifetime scope for an HirId of a PathSegment" }
-    }
-
     query visibility(def_id: DefId) -> ty::Visibility {
         desc { |tcx| "computing visibility of `{}`", tcx.def_path_str(def_id) }
         separate_provide_extern
@@ -1728,8 +1723,8 @@ rustc_queries! {
     query upvars_mentioned(def_id: DefId) -> Option<&'tcx FxIndexMap<hir::HirId, hir::Upvar>> {
         desc { |tcx| "collecting upvars mentioned in `{}`", tcx.def_path_str(def_id) }
     }
-    query maybe_unused_trait_import(def_id: LocalDefId) -> bool {
-        desc { |tcx| "maybe_unused_trait_import for `{}`", tcx.def_path_str(def_id.to_def_id()) }
+    query maybe_unused_trait_imports(_: ()) -> &'tcx FxIndexSet<LocalDefId> {
+        desc { "fetching potentially unused trait imports" }
     }
     query maybe_unused_extern_crates(_: ()) -> &'tcx [(LocalDefId, Span)] {
         desc { "looking up all possibly unused extern crates" }
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index a0d92e2a5dd..e668edad7c4 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
@@ -6,7 +6,7 @@ use crate::hir::place::Place as HirPlace;
 use crate::infer::canonical::{Canonical, CanonicalVarInfo, CanonicalVarInfos};
 use crate::lint::{struct_lint_level, LintDiagnosticBuilder, LintLevelSource};
 use crate::middle::codegen_fn_attrs::CodegenFnAttrs;
-use crate::middle::resolve_lifetime::{self, LifetimeScopeForPath};
+use crate::middle::resolve_lifetime;
 use crate::middle::stability;
 use crate::mir::interpret::{self, Allocation, ConstAllocation, ConstValue, Scalar};
 use crate::mir::{
@@ -49,7 +49,7 @@ use rustc_macros::HashStable;
 use rustc_middle::mir::FakeReadCause;
 use rustc_query_system::ich::StableHashingContext;
 use rustc_serialize::opaque::{FileEncodeResult, FileEncoder};
-use rustc_session::config::{BorrowckMode, CrateType, OutputFilenames};
+use rustc_session::config::{CrateType, OutputFilenames};
 use rustc_session::lint::{Level, Lint};
 use rustc_session::Limit;
 use rustc_session::Session;
@@ -1470,44 +1470,6 @@ impl<'tcx> TyCtxt<'tcx> {
         self.on_disk_cache.as_ref().map_or(Ok(()), |c| c.serialize(self, encoder))
     }
 
-    /// If `true`, we should use the MIR-based borrowck, but also
-    /// fall back on the AST borrowck if the MIR-based one errors.
-    pub fn migrate_borrowck(self) -> bool {
-        self.borrowck_mode().migrate()
-    }
-
-    /// What mode(s) of borrowck should we run? AST? MIR? both?
-    /// (Also considers the `#![feature(nll)]` setting.)
-    pub fn borrowck_mode(self) -> BorrowckMode {
-        // Here are the main constraints we need to deal with:
-        //
-        // 1. An opts.borrowck_mode of `BorrowckMode::Migrate` is
-        //    synonymous with no `-Z borrowck=...` flag at all.
-        //
-        // 2. We want to allow developers on the Nightly channel
-        //    to opt back into the "hard error" mode for NLL,
-        //    (which they can do via specifying `#![feature(nll)]`
-        //    explicitly in their crate).
-        //
-        // So, this precedence list is how pnkfelix chose to work with
-        // the above constraints:
-        //
-        // * `#![feature(nll)]` *always* means use NLL with hard
-        //   errors. (To simplify the code here, it now even overrides
-        //   a user's attempt to specify `-Z borrowck=compare`, which
-        //   we arguably do not need anymore and should remove.)
-        //
-        // * Otherwise, if no `-Z borrowck=...` then use migrate mode
-        //
-        // * Otherwise, use the behavior requested via `-Z borrowck=...`
-
-        if self.features().nll {
-            return BorrowckMode::Mir;
-        }
-
-        self.sess.opts.borrowck_mode
-    }
-
     /// If `true`, we should use lazy normalization for constants, otherwise
     /// we still evaluate them eagerly.
     #[inline]
@@ -2803,6 +2765,13 @@ impl<'tcx> TyCtxt<'tcx> {
         self.named_region_map(id.owner).and_then(|map| map.get(&id.local_id).cloned())
     }
 
+    pub fn is_late_bound(self, id: HirId) -> bool {
+        self.is_late_bound_map(id.owner).map_or(false, |set| {
+            let def_id = self.hir().local_def_id(id);
+            set.contains(&def_id)
+        })
+    }
+
     pub fn late_bound_vars(self, id: HirId) -> &'tcx List<ty::BoundVariableKind> {
         self.mk_bound_variable_kinds(
             self.late_bound_vars_map(id.owner)
@@ -2814,10 +2783,6 @@ impl<'tcx> TyCtxt<'tcx> {
         )
     }
 
-    pub fn lifetime_scope(self, id: HirId) -> Option<&'tcx LifetimeScopeForPath> {
-        self.lifetime_scope_map(id.owner).as_ref().and_then(|map| map.get(&id.local_id))
-    }
-
     /// Whether the `def_id` counts as const fn in the current crate, considering all active
     /// feature gates
     pub fn is_const_fn(self, def_id: DefId) -> bool {
@@ -2886,8 +2851,8 @@ pub fn provide(providers: &mut ty::query::Providers) {
         assert_eq!(id, LOCAL_CRATE);
         tcx.crate_name
     };
-    providers.maybe_unused_trait_import =
-        |tcx, id| tcx.resolutions(()).maybe_unused_trait_imports.contains(&id);
+    providers.maybe_unused_trait_imports =
+        |tcx, ()| &tcx.resolutions(()).maybe_unused_trait_imports;
     providers.maybe_unused_extern_crates =
         |tcx, ()| &tcx.resolutions(()).maybe_unused_extern_crates[..];
     providers.names_imported_by_glob_use = |tcx, id| {
diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs
index a493aaac276..3a2d3408b9d 100644
--- a/compiler/rustc_middle/src/ty/mod.rs
+++ b/compiler/rustc_middle/src/ty/mod.rs
@@ -28,7 +28,7 @@ pub use generics::*;
 use rustc_ast as ast;
 use rustc_attr as attr;
 use rustc_data_structures::fingerprint::Fingerprint;
-use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
+use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet};
 use rustc_data_structures::intern::{Interned, WithStableHash};
 use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
 use rustc_data_structures::tagged_ptr::CopyTaggedPtr;
@@ -138,7 +138,7 @@ pub struct ResolverOutputs {
     pub has_pub_restricted: bool,
     pub access_levels: AccessLevels,
     pub extern_crate_map: FxHashMap<LocalDefId, CrateNum>,
-    pub maybe_unused_trait_imports: FxHashSet<LocalDefId>,
+    pub maybe_unused_trait_imports: FxIndexSet<LocalDefId>,
     pub maybe_unused_extern_crates: Vec<(LocalDefId, Span)>,
     pub reexport_map: FxHashMap<LocalDefId, Vec<ModChild>>,
     pub glob_map: FxHashMap<LocalDefId, FxHashSet<Symbol>>,
diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs
index 64c63e3d567..08879afa64a 100644
--- a/compiler/rustc_middle/src/ty/print/pretty.rs
+++ b/compiler/rustc_middle/src/ty/print/pretty.rs
@@ -2190,34 +2190,40 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
         // this is not *quite* right and changes the ordering of some output
         // anyways.
         let (new_value, map) = if self.tcx().sess.verbose() {
-            // anon index + 1 (BrEnv takes 0) -> name
-            let mut region_map: FxHashMap<_, _> = Default::default();
-            let bound_vars = value.bound_vars();
-            for var in bound_vars {
-                let ty::BoundVariableKind::Region(var) = var else { continue };
-                match var {
-                    ty::BrAnon(_) | ty::BrEnv => {
-                        start_or_continue(&mut self, "for<", ", ");
-                        let name = next_name(&self);
-                        do_continue(&mut self, name);
-                        region_map.insert(var, ty::BrNamed(CRATE_DEF_ID.to_def_id(), name));
-                    }
-                    ty::BrNamed(def_id, kw::UnderscoreLifetime) => {
-                        start_or_continue(&mut self, "for<", ", ");
-                        let name = next_name(&self);
-                        do_continue(&mut self, name);
-                        region_map.insert(var, ty::BrNamed(def_id, name));
-                    }
-                    ty::BrNamed(_, name) => {
-                        start_or_continue(&mut self, "for<", ", ");
-                        do_continue(&mut self, name);
+            let regions: Vec<_> = value
+                .bound_vars()
+                .into_iter()
+                .map(|var| {
+                    let ty::BoundVariableKind::Region(var) = var else {
+                    // This doesn't really matter because it doesn't get used,
+                    // it's just an empty value
+                    return ty::BrAnon(0);
+                };
+                    match var {
+                        ty::BrAnon(_) | ty::BrEnv => {
+                            start_or_continue(&mut self, "for<", ", ");
+                            let name = next_name(&self);
+                            do_continue(&mut self, name);
+                            ty::BrNamed(CRATE_DEF_ID.to_def_id(), name)
+                        }
+                        ty::BrNamed(def_id, kw::UnderscoreLifetime) => {
+                            start_or_continue(&mut self, "for<", ", ");
+                            let name = next_name(&self);
+                            do_continue(&mut self, name);
+                            ty::BrNamed(def_id, name)
+                        }
+                        ty::BrNamed(def_id, name) => {
+                            start_or_continue(&mut self, "for<", ", ");
+                            do_continue(&mut self, name);
+                            ty::BrNamed(def_id, name)
+                        }
                     }
-                }
-            }
+                })
+                .collect();
             start_or_continue(&mut self, "", "> ");
 
             self.tcx.replace_late_bound_regions(value.clone(), |br| {
-                let kind = region_map[&br.kind];
+                let kind = regions[br.var.as_usize()];
                 self.tcx.mk_region(ty::ReLateBound(
                     ty::INNERMOST,
                     ty::BoundRegion { var: br.var, kind },
diff --git a/compiler/rustc_middle/src/ty/query.rs b/compiler/rustc_middle/src/ty/query.rs
index 65f41c5266d..3d662ed5de4 100644
--- a/compiler/rustc_middle/src/ty/query.rs
+++ b/compiler/rustc_middle/src/ty/query.rs
@@ -6,9 +6,7 @@ use crate::middle::codegen_fn_attrs::CodegenFnAttrs;
 use crate::middle::exported_symbols::{ExportedSymbol, SymbolExportInfo};
 use crate::middle::lib_features::LibFeatures;
 use crate::middle::privacy::AccessLevels;
-use crate::middle::resolve_lifetime::{
-    LifetimeScopeForPath, ObjectLifetimeDefault, Region, ResolveLifetimes,
-};
+use crate::middle::resolve_lifetime::{ObjectLifetimeDefault, Region, ResolveLifetimes};
 use crate::middle::stability::{self, DeprecationEntry};
 use crate::mir;
 use crate::mir::interpret::GlobalId;
@@ -37,7 +35,7 @@ use crate::ty::{self, AdtSizedConstraint, CrateInherentImpls, ParamEnvAnd, Ty, T
 use rustc_ast as ast;
 use rustc_ast::expand::allocator::AllocatorKind;
 use rustc_attr as attr;
-use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
+use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet};
 use rustc_data_structures::steal::Steal;
 use rustc_data_structures::svh::Svh;
 use rustc_data_structures::sync::Lrc;
diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs
index faeb729c884..09fe8415652 100644
--- a/compiler/rustc_middle/src/ty/sty.rs
+++ b/compiler/rustc_middle/src/ty/sty.rs
@@ -1032,6 +1032,13 @@ impl<'tcx, T> Binder<'tcx, T> {
         Binder(&self.0, self.1)
     }
 
+    pub fn as_deref(&self) -> Binder<'tcx, &T::Target>
+    where
+        T: Deref,
+    {
+        Binder(&self.0, self.1)
+    }
+
     pub fn map_bound_ref_unchecked<F, U>(&self, f: F) -> Binder<'tcx, U>
     where
         F: FnOnce(&T) -> U,
diff --git a/compiler/rustc_mir_build/src/build/expr/as_place.rs b/compiler/rustc_mir_build/src/build/expr/as_place.rs
index 045d6eb1c30..5d55c4d637b 100644
--- a/compiler/rustc_mir_build/src/build/expr/as_place.rs
+++ b/compiler/rustc_mir_build/src/build/expr/as_place.rs
@@ -133,7 +133,7 @@ fn convert_to_hir_projections_and_truncate_for_capture<'tcx>(
 ///        ancestor of `foo.x.y`. It's the caller's responsibility to ensure that both projections
 ///        list are being applied to the same root variable.
 fn is_ancestor_or_same_capture(
-    proj_possible_ancestor: &Vec<HirProjectionKind>,
+    proj_possible_ancestor: &[HirProjectionKind],
     proj_capture: &[HirProjectionKind],
 ) -> bool {
     // We want to make sure `is_ancestor_or_same_capture("x.0.0", "x.0")` to return false.
@@ -187,7 +187,7 @@ fn find_capture_matching_projections<'a, 'tcx>(
     // If an ancestor is found, `idx` is the index within the list of captured places
     // for root variable `var_hir_id` and `capture` is the `ty::CapturedPlace` itself.
     let (idx, capture) = root_variable_min_captures.iter().enumerate().find(|(_, capture)| {
-        let possible_ancestor_proj_kinds =
+        let possible_ancestor_proj_kinds: Vec<_> =
             capture.place.projections.iter().map(|proj| proj.kind).collect();
         is_ancestor_or_same_capture(&possible_ancestor_proj_kinds, &hir_projections)
     })?;
diff --git a/compiler/rustc_mir_build/src/build/matches/mod.rs b/compiler/rustc_mir_build/src/build/matches/mod.rs
index 15660365938..43a84f69699 100644
--- a/compiler/rustc_mir_build/src/build/matches/mod.rs
+++ b/compiler/rustc_mir_build/src/build/matches/mod.rs
@@ -409,7 +409,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
         outer_source_info: SourceInfo,
         candidate: Candidate<'_, 'tcx>,
         guard: Option<&Guard<'tcx>>,
-        fake_borrow_temps: &Vec<(Place<'tcx>, Local)>,
+        fake_borrow_temps: &[(Place<'tcx>, Local)],
         scrutinee_span: Span,
         arm_span: Option<Span>,
         arm_scope: Option<region::Scope>,
@@ -1826,7 +1826,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
         candidate: Candidate<'pat, 'tcx>,
         parent_bindings: &[(Vec<Binding<'tcx>>, Vec<Ascription<'tcx>>)],
         guard: Option<&Guard<'tcx>>,
-        fake_borrows: &Vec<(Place<'tcx>, Local)>,
+        fake_borrows: &[(Place<'tcx>, Local)],
         scrutinee_span: Span,
         arm_span: Option<Span>,
         match_scope: Option<region::Scope>,
diff --git a/compiler/rustc_mir_transform/src/coverage/counters.rs b/compiler/rustc_mir_transform/src/coverage/counters.rs
index 6726b669ff2..45de0c28035 100644
--- a/compiler/rustc_mir_transform/src/coverage/counters.rs
+++ b/compiler/rustc_mir_transform/src/coverage/counters.rs
@@ -43,7 +43,7 @@ impl CoverageCounters {
     pub fn make_bcb_counters(
         &mut self,
         basic_coverage_blocks: &mut CoverageGraph,
-        coverage_spans: &Vec<CoverageSpan>,
+        coverage_spans: &[CoverageSpan],
     ) -> Result<Vec<CoverageKind>, Error> {
         let mut bcb_counters = BcbCounters::new(self, basic_coverage_blocks);
         bcb_counters.make_bcb_counters(coverage_spans)
@@ -349,7 +349,7 @@ impl<'a> BcbCounters<'a> {
         // counters and/or expressions of its incoming edges. This will recursively get or create
         // counters for those incoming edges first, then call `make_expression()` to sum them up,
         // with additional intermediate expressions as needed.
-        let mut predecessors = self.bcb_predecessors(bcb).clone().into_iter();
+        let mut predecessors = self.bcb_predecessors(bcb).to_owned().into_iter();
         debug!(
             "{}{:?} has multiple incoming edges and will get an expression that sums them up...",
             NESTED_INDENT.repeat(debug_indent_level),
@@ -571,12 +571,12 @@ impl<'a> BcbCounters<'a> {
     }
 
     #[inline]
-    fn bcb_predecessors(&self, bcb: BasicCoverageBlock) -> &Vec<BasicCoverageBlock> {
+    fn bcb_predecessors(&self, bcb: BasicCoverageBlock) -> &[BasicCoverageBlock] {
         &self.basic_coverage_blocks.predecessors[bcb]
     }
 
     #[inline]
-    fn bcb_successors(&self, bcb: BasicCoverageBlock) -> &Vec<BasicCoverageBlock> {
+    fn bcb_successors(&self, bcb: BasicCoverageBlock) -> &[BasicCoverageBlock] {
         &self.basic_coverage_blocks.successors[bcb]
     }
 
diff --git a/compiler/rustc_mir_transform/src/coverage/debug.rs b/compiler/rustc_mir_transform/src/coverage/debug.rs
index 434bf9d849e..d31ac04274c 100644
--- a/compiler/rustc_mir_transform/src/coverage/debug.rs
+++ b/compiler/rustc_mir_transform/src/coverage/debug.rs
@@ -124,6 +124,7 @@ use rustc_span::Span;
 
 use std::iter;
 use std::lazy::SyncOnceCell;
+use std::ops::Deref;
 
 pub const NESTED_INDENT: &str = "    ";
 
@@ -434,11 +435,11 @@ impl GraphvizData {
     pub fn get_bcb_coverage_spans_with_counters(
         &self,
         bcb: BasicCoverageBlock,
-    ) -> Option<&Vec<(CoverageSpan, CoverageKind)>> {
+    ) -> Option<&[(CoverageSpan, CoverageKind)]> {
         if let Some(bcb_to_coverage_spans_with_counters) =
             self.some_bcb_to_coverage_spans_with_counters.as_ref()
         {
-            bcb_to_coverage_spans_with_counters.get(&bcb)
+            bcb_to_coverage_spans_with_counters.get(&bcb).map(Deref::deref)
         } else {
             None
         }
@@ -457,12 +458,9 @@ impl GraphvizData {
         }
     }
 
-    pub fn get_bcb_dependency_counters(
-        &self,
-        bcb: BasicCoverageBlock,
-    ) -> Option<&Vec<CoverageKind>> {
+    pub fn get_bcb_dependency_counters(&self, bcb: BasicCoverageBlock) -> Option<&[CoverageKind]> {
         if let Some(bcb_to_dependency_counters) = self.some_bcb_to_dependency_counters.as_ref() {
-            bcb_to_dependency_counters.get(&bcb)
+            bcb_to_dependency_counters.get(&bcb).map(Deref::deref)
         } else {
             None
         }
@@ -571,11 +569,11 @@ impl UsedExpressions {
     /// associated with a coverage span).
     pub fn validate(
         &mut self,
-        bcb_counters_without_direct_coverage_spans: &Vec<(
+        bcb_counters_without_direct_coverage_spans: &[(
             Option<BasicCoverageBlock>,
             BasicCoverageBlock,
             CoverageKind,
-        )>,
+        )],
     ) {
         if self.is_enabled() {
             let mut not_validated = bcb_counters_without_direct_coverage_spans
@@ -634,7 +632,7 @@ pub(super) fn dump_coverage_spanview<'tcx>(
     basic_coverage_blocks: &CoverageGraph,
     pass_name: &str,
     body_span: Span,
-    coverage_spans: &Vec<CoverageSpan>,
+    coverage_spans: &[CoverageSpan],
 ) {
     let mir_source = mir_body.source;
     let def_id = mir_source.def_id();
@@ -654,7 +652,7 @@ fn span_viewables<'tcx>(
     tcx: TyCtxt<'tcx>,
     mir_body: &mir::Body<'tcx>,
     basic_coverage_blocks: &CoverageGraph,
-    coverage_spans: &Vec<CoverageSpan>,
+    coverage_spans: &[CoverageSpan],
 ) -> Vec<SpanViewable> {
     let mut span_viewables = Vec::new();
     for coverage_span in coverage_spans {
@@ -676,7 +674,7 @@ pub(super) fn dump_coverage_graphviz<'tcx>(
     basic_coverage_blocks: &CoverageGraph,
     debug_counters: &DebugCounters,
     graphviz_data: &GraphvizData,
-    intermediate_expressions: &Vec<CoverageKind>,
+    intermediate_expressions: &[CoverageKind],
     debug_used_expressions: &UsedExpressions,
 ) {
     let mir_source = mir_body.source;
@@ -753,9 +751,9 @@ fn bcb_to_string_sections<'tcx>(
     mir_body: &mir::Body<'tcx>,
     debug_counters: &DebugCounters,
     bcb_data: &BasicCoverageBlockData,
-    some_coverage_spans_with_counters: Option<&Vec<(CoverageSpan, CoverageKind)>>,
-    some_dependency_counters: Option<&Vec<CoverageKind>>,
-    some_intermediate_expressions: Option<&Vec<CoverageKind>>,
+    some_coverage_spans_with_counters: Option<&[(CoverageSpan, CoverageKind)]>,
+    some_dependency_counters: Option<&[CoverageKind]>,
+    some_intermediate_expressions: Option<&[CoverageKind]>,
 ) -> Vec<String> {
     let len = bcb_data.basic_blocks.len();
     let mut sections = Vec::new();
diff --git a/compiler/rustc_mir_transform/src/inline.rs b/compiler/rustc_mir_transform/src/inline.rs
index 9526c0acc66..a1490d77ccb 100644
--- a/compiler/rustc_mir_transform/src/inline.rs
+++ b/compiler/rustc_mir_transform/src/inline.rs
@@ -158,11 +158,13 @@ impl<'tcx> Inliner<'tcx> {
             return Err("optimization fuel exhausted");
         }
 
-        let callee_body = callsite.callee.subst_mir_and_normalize_erasing_regions(
+        let Ok(callee_body) = callsite.callee.try_subst_mir_and_normalize_erasing_regions(
             self.tcx,
             self.param_env,
             callee_body.clone(),
-        );
+        ) else {
+            return Err("failed to normalize callee body");
+        };
 
         let old_blocks = caller_body.basic_blocks().next_index();
         self.inline_call(caller_body, &callsite, callee_body);
@@ -253,7 +255,7 @@ impl<'tcx> Inliner<'tcx> {
             let func_ty = func.ty(caller_body, self.tcx);
             if let ty::FnDef(def_id, substs) = *func_ty.kind() {
                 // To resolve an instance its substs have to be fully normalized.
-                let substs = self.tcx.normalize_erasing_regions(self.param_env, substs);
+                let substs = self.tcx.try_normalize_erasing_regions(self.param_env, substs).ok()?;
                 let callee =
                     Instance::resolve(self.tcx, self.param_env, def_id, substs).ok().flatten()?;
 
@@ -408,14 +410,17 @@ impl<'tcx> Inliner<'tcx> {
                     if let ty::FnDef(def_id, substs) =
                         *callsite.callee.subst_mir(self.tcx, &f.literal.ty()).kind()
                     {
-                        let substs = self.tcx.normalize_erasing_regions(self.param_env, substs);
-                        if let Ok(Some(instance)) =
-                            Instance::resolve(self.tcx, self.param_env, def_id, substs)
+                        if let Ok(substs) =
+                            self.tcx.try_normalize_erasing_regions(self.param_env, substs)
                         {
-                            if callsite.callee.def_id() == instance.def_id() {
-                                return Err("self-recursion");
-                            } else if self.history.contains(&instance) {
-                                return Err("already inlined");
+                            if let Ok(Some(instance)) =
+                                Instance::resolve(self.tcx, self.param_env, def_id, substs)
+                            {
+                                if callsite.callee.def_id() == instance.def_id() {
+                                    return Err("self-recursion");
+                                } else if self.history.contains(&instance) {
+                                    return Err("already inlined");
+                                }
                             }
                         }
                         // Don't give intrinsics the extra penalty for calls
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index 63c7decbb2f..b786c52e688 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -13,10 +13,13 @@ use rustc_ast::tokenstream::Spacing;
 use rustc_ast::util::classify;
 use rustc_ast::util::literal::LitError;
 use rustc_ast::util::parser::{prec_let_scrutinee_needs_par, AssocOp, Fixity};
+use rustc_ast::visit::Visitor;
+use rustc_ast::StmtKind;
 use rustc_ast::{self as ast, AttrStyle, AttrVec, CaptureBy, ExprField, Lit, UnOp, DUMMY_NODE_ID};
 use rustc_ast::{AnonConst, BinOp, BinOpKind, FnDecl, FnRetTy, MacCall, Param, Ty, TyKind};
 use rustc_ast::{Arm, Async, BlockCheckMode, Expr, ExprKind, Label, Movability, RangeLimits};
 use rustc_ast_pretty::pprust;
+use rustc_data_structures::thin_vec::ThinVec;
 use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder, ErrorGuaranteed, PResult};
 use rustc_session::lint::builtin::BREAK_WITH_LABEL_AND_LOOP;
 use rustc_session::lint::BuiltinLintDiagnostics;
@@ -1548,9 +1551,66 @@ impl<'a> Parser<'a> {
             Ok(self.mk_expr_err(lo))
         } else {
             let msg = "expected `while`, `for`, `loop` or `{` after a label";
-            self.struct_span_err(self.token.span, msg).span_label(self.token.span, msg).emit();
+
+            let mut err = self.struct_span_err(self.token.span, msg);
+            err.span_label(self.token.span, msg);
+
             // Continue as an expression in an effort to recover on `'label: non_block_expr`.
-            self.parse_expr()
+            let expr = self.parse_expr().map(|expr| {
+                let span = expr.span;
+
+                let found_labeled_breaks = {
+                    struct FindLabeledBreaksVisitor(bool);
+
+                    impl<'ast> Visitor<'ast> for FindLabeledBreaksVisitor {
+                        fn visit_expr_post(&mut self, ex: &'ast Expr) {
+                            if let ExprKind::Break(Some(_label), _) = ex.kind {
+                                self.0 = true;
+                            }
+                        }
+                    }
+
+                    let mut vis = FindLabeledBreaksVisitor(false);
+                    vis.visit_expr(&expr);
+                    vis.0
+                };
+
+                // Suggestion involves adding a (as of time of writing this, unstable) labeled block.
+                //
+                // If there are no breaks that may use this label, suggest removing the label and
+                // recover to the unmodified expression.
+                if !found_labeled_breaks {
+                    let msg = "consider removing the label";
+                    err.span_suggestion_verbose(
+                        lo.until(span),
+                        msg,
+                        "",
+                        Applicability::MachineApplicable,
+                    );
+
+                    return expr;
+                }
+
+                let sugg_msg = "consider enclosing expression in a block";
+                let suggestions = vec![
+                    (span.shrink_to_lo(), "{ ".to_owned()),
+                    (span.shrink_to_hi(), " }".to_owned()),
+                ];
+
+                err.multipart_suggestion_verbose(
+                    sugg_msg,
+                    suggestions,
+                    Applicability::MachineApplicable,
+                );
+
+                // Replace `'label: non_block_expr` with `'label: {non_block_expr}` in order to supress future errors about `break 'label`.
+                let stmt = self.mk_stmt(span, StmtKind::Expr(expr));
+                let blk = self.mk_block(vec![stmt], BlockCheckMode::Default, span);
+                self.mk_expr(span, ExprKind::Block(blk, label), ThinVec::new())
+            });
+
+            err.emit();
+            expr
         }?;
 
         if !ate_colon && consume_colon {
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs
index 0fe6d58b86d..5cc97d326d3 100644
--- a/compiler/rustc_passes/src/check_attr.rs
+++ b/compiler/rustc_passes/src/check_attr.rs
@@ -77,6 +77,7 @@ impl CheckAttrVisitor<'_> {
         for attr in attrs {
             let attr_is_valid = match attr.name_or_empty() {
                 sym::inline => self.check_inline(hir_id, attr, span, target),
+                sym::no_coverage => self.check_no_coverage(hir_id, attr, span, target),
                 sym::non_exhaustive => self.check_non_exhaustive(hir_id, attr, span, target),
                 sym::marker => self.check_marker(hir_id, attr, span, target),
                 sym::rustc_must_implement_one_of => {
@@ -291,6 +292,57 @@ impl CheckAttrVisitor<'_> {
         }
     }
 
+    /// Checks if a `#[no_coverage]` is applied directly to a function
+    fn check_no_coverage(
+        &self,
+        hir_id: HirId,
+        attr: &Attribute,
+        span: Span,
+        target: Target,
+    ) -> bool {
+        match target {
+            // no_coverage on function is fine
+            Target::Fn
+            | Target::Closure
+            | Target::Method(MethodKind::Trait { body: true } | MethodKind::Inherent) => true,
+
+            // function prototypes can't be covered
+            Target::Method(MethodKind::Trait { body: false }) | Target::ForeignFn => {
+                self.tcx.struct_span_lint_hir(UNUSED_ATTRIBUTES, hir_id, attr.span, |lint| {
+                    lint.build("`#[no_coverage]` is ignored on function prototypes").emit();
+                });
+                true
+            }
+
+            Target::Mod | Target::ForeignMod | Target::Impl | Target::Trait => {
+                self.tcx.struct_span_lint_hir(UNUSED_ATTRIBUTES, hir_id, attr.span, |lint| {
+                    lint.build("`#[no_coverage]` does not propagate into items and must be applied to the contained functions directly").emit();
+                });
+                true
+            }
+
+            Target::Expression | Target::Statement | Target::Arm => {
+                self.tcx.struct_span_lint_hir(UNUSED_ATTRIBUTES, hir_id, attr.span, |lint| {
+                    lint.build("`#[no_coverage]` may only be applied to function definitions")
+                        .emit();
+                });
+                true
+            }
+
+            _ => {
+                struct_span_err!(
+                    self.tcx.sess,
+                    attr.span,
+                    E0788,
+                    "`#[no_coverage]` must be applied to coverable code",
+                )
+                .span_label(span, "not coverable code")
+                .emit();
+                false
+            }
+        }
+    }
+
     fn check_generic_attr(
         &self,
         hir_id: HirId,
diff --git a/compiler/rustc_passes/src/lib.rs b/compiler/rustc_passes/src/lib.rs
index a2d8e5168c4..497c0931c21 100644
--- a/compiler/rustc_passes/src/lib.rs
+++ b/compiler/rustc_passes/src/lib.rs
@@ -11,7 +11,6 @@
 #![feature(let_chains)]
 #![feature(map_try_insert)]
 #![feature(min_specialization)]
-#![feature(nll)]
 #![feature(try_blocks)]
 #![recursion_limit = "256"]
 
diff --git a/compiler/rustc_passes/src/reachable.rs b/compiler/rustc_passes/src/reachable.rs
index 0ded6a421f5..75376cdc592 100644
--- a/compiler/rustc_passes/src/reachable.rs
+++ b/compiler/rustc_passes/src/reachable.rs
@@ -148,32 +148,15 @@ impl<'tcx> ReachableContext<'tcx> {
                 hir::TraitItemKind::Fn(_, hir::TraitFn::Required(_))
                 | hir::TraitItemKind::Type(..) => false,
             },
-            Some(Node::ImplItem(impl_item)) => {
-                match impl_item.kind {
-                    hir::ImplItemKind::Const(..) => true,
-                    hir::ImplItemKind::Fn(..) => {
-                        let attrs = self.tcx.codegen_fn_attrs(def_id);
-                        let generics = self.tcx.generics_of(def_id);
-                        if generics.requires_monomorphization(self.tcx) || attrs.requests_inline() {
-                            true
-                        } else {
-                            let hir_id = self.tcx.hir().local_def_id_to_hir_id(def_id);
-                            let impl_did = self.tcx.hir().get_parent_item(hir_id);
-                            // Check the impl. If the generics on the self
-                            // type of the impl require inlining, this method
-                            // does too.
-                            match self.tcx.hir().expect_item(impl_did).kind {
-                                hir::ItemKind::Impl { .. } => {
-                                    let generics = self.tcx.generics_of(impl_did);
-                                    generics.requires_monomorphization(self.tcx)
-                                }
-                                _ => false,
-                            }
-                        }
-                    }
-                    hir::ImplItemKind::TyAlias(_) => false,
+            Some(Node::ImplItem(impl_item)) => match impl_item.kind {
+                hir::ImplItemKind::Const(..) => true,
+                hir::ImplItemKind::Fn(..) => {
+                    let hir_id = self.tcx.hir().local_def_id_to_hir_id(def_id);
+                    let impl_did = self.tcx.hir().get_parent_item(hir_id);
+                    method_might_be_inlined(self.tcx, impl_item, impl_did)
                 }
-            }
+                hir::ImplItemKind::TyAlias(_) => false,
+            },
             Some(_) => false,
             None => false, // This will happen for default methods.
         }
diff --git a/compiler/rustc_plugin_impl/src/lib.rs b/compiler/rustc_plugin_impl/src/lib.rs
index a1e13a1abb6..1195045bdea 100644
--- a/compiler/rustc_plugin_impl/src/lib.rs
+++ b/compiler/rustc_plugin_impl/src/lib.rs
@@ -7,7 +7,6 @@
 //! of the Unstable Book for some examples.
 
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
-#![feature(nll)]
 #![recursion_limit = "256"]
 
 use rustc_lint::LintStore;
diff --git a/compiler/rustc_privacy/src/lib.rs b/compiler/rustc_privacy/src/lib.rs
index e6c7b4064fb..82ea78648c7 100644
--- a/compiler/rustc_privacy/src/lib.rs
+++ b/compiler/rustc_privacy/src/lib.rs
@@ -1,5 +1,4 @@
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
-#![feature(nll)]
 #![feature(control_flow_enum)]
 #![feature(try_blocks)]
 #![feature(associated_type_defaults)]
diff --git a/compiler/rustc_query_impl/src/lib.rs b/compiler/rustc_query_impl/src/lib.rs
index bfc51dedbc7..5e28c229aa5 100644
--- a/compiler/rustc_query_impl/src/lib.rs
+++ b/compiler/rustc_query_impl/src/lib.rs
@@ -1,7 +1,6 @@
 //! Support for serializing the dep-graph and reloading it.
 
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
-#![feature(nll)]
 #![feature(min_specialization)]
 #![feature(once_cell)]
 #![feature(rustc_attrs)]
diff --git a/compiler/rustc_query_impl/src/on_disk_cache.rs b/compiler/rustc_query_impl/src/on_disk_cache.rs
index 5a915933dc5..e93bf1a4752 100644
--- a/compiler/rustc_query_impl/src/on_disk_cache.rs
+++ b/compiler/rustc_query_impl/src/on_disk_cache.rs
@@ -993,11 +993,6 @@ where
 {
     type Error = E::Error;
 
-    #[inline]
-    fn emit_unit(&mut self) -> Result<(), Self::Error> {
-        Ok(())
-    }
-
     encoder_methods! {
         emit_usize(usize);
         emit_u128(u128);
diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs
index 288c89b0189..771eeee965b 100644
--- a/compiler/rustc_resolve/src/late.rs
+++ b/compiler/rustc_resolve/src/late.rs
@@ -631,7 +631,7 @@ impl<'a: 'ast, 'ast> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast> {
                         span,
                     },
                     |this| {
-                        this.visit_generic_param_vec(&bare_fn.generic_params, false);
+                        this.visit_generic_params(&bare_fn.generic_params, false);
                         this.with_lifetime_rib(
                             LifetimeRibKind::AnonymousPassThrough(ty.id, false),
                             |this| walk_list!(this, visit_param, &bare_fn.decl.inputs),
@@ -662,7 +662,7 @@ impl<'a: 'ast, 'ast> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast> {
                 span,
             },
             |this| {
-                this.visit_generic_param_vec(&tref.bound_generic_params, false);
+                this.visit_generic_params(&tref.bound_generic_params, false);
                 this.smart_resolve_path(
                     tref.trait_ref.ref_id,
                     None,
@@ -833,7 +833,7 @@ impl<'a: 'ast, 'ast> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast> {
     }
 
     fn visit_generics(&mut self, generics: &'ast Generics) {
-        self.visit_generic_param_vec(
+        self.visit_generic_params(
             &generics.params,
             self.diagnostic_metadata.current_self_item.is_some(),
         );
@@ -941,7 +941,7 @@ impl<'a: 'ast, 'ast> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast> {
                         span,
                     },
                     |this| {
-                        this.visit_generic_param_vec(&bound_generic_params, false);
+                        this.visit_generic_params(&bound_generic_params, false);
                         this.visit_ty(bounded_ty);
                         for bound in bounds {
                             this.visit_param_bound(bound, BoundKind::Bound)
@@ -1116,7 +1116,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
         }
     }
 
-    fn visit_generic_param_vec(&mut self, params: &'ast Vec<GenericParam>, add_self_upper: bool) {
+    fn visit_generic_params(&mut self, params: &'ast [GenericParam], add_self_upper: bool) {
         // For type parameter defaults, we have to ban access
         // to following type parameters, as the InternalSubsts can only
         // provide previous type parameters as they're built. We
@@ -1870,7 +1870,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
 
     fn with_generic_param_rib<'c, F>(
         &'c mut self,
-        params: &'c Vec<GenericParam>,
+        params: &'c [GenericParam],
         kind: RibKind<'a>,
         lifetime_kind: LifetimeRibKind,
         f: F,
diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs
index 9213652e35f..cb39eb5416b 100644
--- a/compiler/rustc_resolve/src/late/diagnostics.rs
+++ b/compiler/rustc_resolve/src/late/diagnostics.rs
@@ -13,7 +13,7 @@ use rustc_ast::{
 };
 use rustc_ast_lowering::ResolverAstLowering;
 use rustc_ast_pretty::pprust::path_segment_to_string;
-use rustc_data_structures::fx::FxHashSet;
+use rustc_data_structures::fx::{FxHashSet, FxIndexSet};
 use rustc_errors::{
     pluralize, struct_span_err, Applicability, Diagnostic, DiagnosticBuilder, ErrorGuaranteed,
     MultiSpan,
@@ -21,7 +21,7 @@ use rustc_errors::{
 use rustc_hir as hir;
 use rustc_hir::def::Namespace::{self, *};
 use rustc_hir::def::{self, CtorKind, CtorOf, DefKind};
-use rustc_hir::def_id::{DefId, CRATE_DEF_ID, LOCAL_CRATE};
+use rustc_hir::def_id::{DefId, LocalDefId, CRATE_DEF_ID, LOCAL_CRATE};
 use rustc_hir::PrimTy;
 use rustc_session::lint;
 use rustc_session::parse::feature_err;
@@ -2082,7 +2082,7 @@ impl<'tcx> LifetimeContext<'_, 'tcx> {
 
     /// Returns whether to add `'static` lifetime to the suggested lifetime list.
     pub(crate) fn report_elision_failure(
-        &mut self,
+        &self,
         diag: &mut Diagnostic,
         params: &[ElisionFailureInfo],
     ) -> bool {
@@ -2187,10 +2187,27 @@ impl<'tcx> LifetimeContext<'_, 'tcx> {
         &self,
         err: &mut Diagnostic,
         mut spans_with_counts: Vec<(Span, usize)>,
-        lifetime_names: &FxHashSet<Symbol>,
-        lifetime_spans: Vec<Span>,
-        params: &[ElisionFailureInfo],
+        in_scope_lifetimes: FxIndexSet<LocalDefId>,
+        params: Option<&[ElisionFailureInfo]>,
     ) {
+        let (mut lifetime_names, lifetime_spans): (FxHashSet<_>, Vec<_>) = in_scope_lifetimes
+            .iter()
+            .filter_map(|def_id| {
+                let name = self.tcx.item_name(def_id.to_def_id());
+                let span = self.tcx.def_ident_span(def_id.to_def_id())?;
+                Some((name, span))
+            })
+            .filter(|&(n, _)| n != kw::UnderscoreLifetime)
+            .unzip();
+
+        if let Some(params) = params {
+            // If there's no lifetime available, suggest `'static`.
+            if self.report_elision_failure(err, params) && lifetime_names.is_empty() {
+                lifetime_names.insert(kw::StaticLifetime);
+            }
+        }
+        let params = params.unwrap_or(&[]);
+
         let snippets: Vec<Option<String>> = spans_with_counts
             .iter()
             .map(|(span, _)| self.tcx.sess.source_map().span_to_snippet(*span).ok())
diff --git a/compiler/rustc_resolve/src/late/lifetimes.rs b/compiler/rustc_resolve/src/late/lifetimes.rs
index 59c2db25b8e..447f4174c10 100644
--- a/compiler/rustc_resolve/src/late/lifetimes.rs
+++ b/compiler/rustc_resolve/src/late/lifetimes.rs
@@ -8,19 +8,18 @@
 
 use crate::late::diagnostics::{ForLifetimeSpanType, MissingLifetimeSpot};
 use rustc_ast::walk_list;
-use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
+use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet};
 use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_hir::def::{DefKind, Res};
 use rustc_hir::def_id::{DefIdMap, LocalDefId};
-use rustc_hir::hir_id::ItemLocalId;
 use rustc_hir::intravisit::{self, Visitor};
-use rustc_hir::{GenericArg, GenericParam, LifetimeName, Node, ParamName};
-use rustc_hir::{GenericParamKind, HirIdMap, HirIdSet};
+use rustc_hir::{GenericArg, GenericParam, LifetimeName, Node};
+use rustc_hir::{GenericParamKind, HirIdMap};
 use rustc_middle::hir::map::Map;
 use rustc_middle::hir::nested_filter;
 use rustc_middle::middle::resolve_lifetime::*;
-use rustc_middle::ty::{self, DefIdTree, GenericParamDefKind, TyCtxt};
+use rustc_middle::ty::{self, GenericParamDefKind, TyCtxt};
 use rustc_middle::{bug, span_bug};
 use rustc_span::def_id::DefId;
 use rustc_span::symbol::{kw, sym, Ident};
@@ -33,9 +32,9 @@ use std::mem::take;
 use tracing::{debug, span, Level};
 
 trait RegionExt {
-    fn early(hir_map: Map<'_>, index: &mut u32, param: &GenericParam<'_>) -> (ParamName, Region);
+    fn early(hir_map: Map<'_>, index: &mut u32, param: &GenericParam<'_>) -> (LocalDefId, Region);
 
-    fn late(index: u32, hir_map: Map<'_>, param: &GenericParam<'_>) -> (ParamName, Region);
+    fn late(index: u32, hir_map: Map<'_>, param: &GenericParam<'_>) -> (LocalDefId, Region);
 
     fn late_anon(named_late_bound_vars: u32, index: &Cell<u32>) -> Region;
 
@@ -51,22 +50,22 @@ trait RegionExt {
 }
 
 impl RegionExt for Region {
-    fn early(hir_map: Map<'_>, index: &mut u32, param: &GenericParam<'_>) -> (ParamName, Region) {
+    fn early(hir_map: Map<'_>, index: &mut u32, param: &GenericParam<'_>) -> (LocalDefId, Region) {
         let i = *index;
         *index += 1;
         let def_id = hir_map.local_def_id(param.hir_id);
         debug!("Region::early: index={} def_id={:?}", i, def_id);
-        (param.name.normalize_to_macros_2_0(), Region::EarlyBound(i, def_id.to_def_id()))
+        (def_id, Region::EarlyBound(i, def_id.to_def_id()))
     }
 
-    fn late(idx: u32, hir_map: Map<'_>, param: &GenericParam<'_>) -> (ParamName, Region) {
+    fn late(idx: u32, hir_map: Map<'_>, param: &GenericParam<'_>) -> (LocalDefId, Region) {
         let depth = ty::INNERMOST;
         let def_id = hir_map.local_def_id(param.hir_id);
         debug!(
             "Region::late: idx={:?}, param={:?} depth={:?} def_id={:?}",
             idx, param, depth, def_id,
         );
-        (param.name.normalize_to_macros_2_0(), Region::LateBound(depth, idx, def_id.to_def_id()))
+        (def_id, Region::LateBound(depth, idx, def_id.to_def_id()))
     }
 
     fn late_anon(named_late_bound_vars: u32, index: &Cell<u32>) -> Region {
@@ -134,11 +133,6 @@ struct NamedRegionMap {
     // `Region` describing how that region is bound
     defs: HirIdMap<Region>,
 
-    // the set of lifetime def ids that are late-bound; a region can
-    // be late-bound if (a) it does NOT appear in a where-clause and
-    // (b) it DOES appear in the arguments.
-    late_bound: HirIdSet,
-
     // Maps relevant hir items to the bound vars on them. These include:
     // - function defs
     // - function pointers
@@ -146,9 +140,6 @@ struct NamedRegionMap {
     // - trait refs
     // - bound types (like `T` in `for<'a> T<'a>: Foo`)
     late_bound_vars: HirIdMap<Vec<ty::BoundVariableKind>>,
-
-    // maps `PathSegment` `HirId`s to lifetime scopes.
-    scope_for_path: Option<FxHashMap<LocalDefId, FxHashMap<ItemLocalId, LifetimeScopeForPath>>>,
 }
 
 pub(crate) struct LifetimeContext<'a, 'tcx> {
@@ -178,7 +169,7 @@ enum Scope<'a> {
     Binder {
         /// We use an IndexMap here because we want these lifetimes in order
         /// for diagnostics.
-        lifetimes: FxIndexMap<hir::ParamName, Region>,
+        lifetimes: FxIndexMap<LocalDefId, Region>,
 
         /// if we extend this scope with another scope, what is the next index
         /// we should use for an early-bound region?
@@ -212,6 +203,13 @@ enum Scope<'a> {
         /// In some cases not allowing late bounds allows us to avoid ICEs.
         /// This is almost ways set to true.
         allow_late_bound: bool,
+
+        /// If this binder comes from a where clause, specify how it was created.
+        /// This is used to diagnose inaccessible lifetimes in APIT:
+        /// ```ignore (illustrative)
+        /// fn foo(x: impl for<'a> Trait<'a, Assoc = impl Copy + 'a>) {}
+        /// ```
+        where_bound_origin: Option<hir::PredicateOrigin>,
     },
 
     /// Lifetimes introduced by a fn are scoped to the call-site for that fn,
@@ -282,8 +280,9 @@ impl<'a> fmt::Debug for TruncatedScopeDebug<'a> {
                 opaque_type_parent,
                 scope_type,
                 hir_id,
-                s: _,
                 allow_late_bound,
+                where_bound_origin,
+                s: _,
             } => f
                 .debug_struct("Binder")
                 .field("lifetimes", lifetimes)
@@ -291,8 +290,9 @@ impl<'a> fmt::Debug for TruncatedScopeDebug<'a> {
                 .field("opaque_type_parent", opaque_type_parent)
                 .field("scope_type", scope_type)
                 .field("hir_id", hir_id)
-                .field("s", &"..")
                 .field("allow_late_bound", allow_late_bound)
+                .field("where_bound_origin", where_bound_origin)
+                .field("s", &"..")
                 .finish(),
             Scope::Body { id, s: _ } => {
                 f.debug_struct("Body").field("id", id).field("s", &"..").finish()
@@ -358,10 +358,6 @@ pub fn provide(providers: &mut ty::query::Providers) {
             _ => None,
         },
         late_bound_vars_map: |tcx, id| resolve_lifetimes_for(tcx, id).late_bound_vars.get(&id),
-        lifetime_scope_map: |tcx, id| {
-            let item_id = item_for(tcx, id);
-            do_resolve(tcx, item_id, false, true).scope_for_path.unwrap().remove(&id)
-        },
 
         ..*providers
     };
@@ -402,7 +398,7 @@ fn resolve_lifetimes_trait_definition(
     tcx: TyCtxt<'_>,
     local_def_id: LocalDefId,
 ) -> ResolveLifetimes {
-    convert_named_region_map(tcx, do_resolve(tcx, local_def_id, true, false))
+    convert_named_region_map(do_resolve(tcx, local_def_id, true))
 }
 
 /// Computes the `ResolveLifetimes` map that contains data for an entire `Item`.
@@ -410,22 +406,17 @@ fn resolve_lifetimes_trait_definition(
 /// `named_region_map`, `is_late_bound_map`, etc.
 #[tracing::instrument(level = "debug", skip(tcx))]
 fn resolve_lifetimes(tcx: TyCtxt<'_>, local_def_id: LocalDefId) -> ResolveLifetimes {
-    convert_named_region_map(tcx, do_resolve(tcx, local_def_id, false, false))
+    convert_named_region_map(do_resolve(tcx, local_def_id, false))
 }
 
 fn do_resolve(
     tcx: TyCtxt<'_>,
     local_def_id: LocalDefId,
     trait_definition_only: bool,
-    with_scope_for_path: bool,
 ) -> NamedRegionMap {
     let item = tcx.hir().expect_item(local_def_id);
-    let mut named_region_map = NamedRegionMap {
-        defs: Default::default(),
-        late_bound: Default::default(),
-        late_bound_vars: Default::default(),
-        scope_for_path: with_scope_for_path.then(|| Default::default()),
-    };
+    let mut named_region_map =
+        NamedRegionMap { defs: Default::default(), late_bound_vars: Default::default() };
     let mut visitor = LifetimeContext {
         tcx,
         map: &mut named_region_map,
@@ -439,18 +430,13 @@ fn do_resolve(
     named_region_map
 }
 
-fn convert_named_region_map(tcx: TyCtxt<'_>, named_region_map: NamedRegionMap) -> ResolveLifetimes {
+fn convert_named_region_map(named_region_map: NamedRegionMap) -> ResolveLifetimes {
     let mut rl = ResolveLifetimes::default();
 
     for (hir_id, v) in named_region_map.defs {
         let map = rl.defs.entry(hir_id.owner).or_default();
         map.insert(hir_id.local_id, v);
     }
-    for hir_id in named_region_map.late_bound {
-        let map = rl.late_bound.entry(hir_id.owner).or_default();
-        let def_id = tcx.hir().local_def_id(hir_id);
-        map.insert(def_id);
-    }
     for (hir_id, v) in named_region_map.late_bound_vars {
         let map = rl.late_bound_vars.entry(hir_id.owner).or_default();
         map.insert(hir_id.local_id, v);
@@ -506,28 +492,6 @@ fn item_for(tcx: TyCtxt<'_>, local_def_id: LocalDefId) -> LocalDefId {
     item
 }
 
-fn is_late_bound_map<'tcx>(
-    tcx: TyCtxt<'tcx>,
-    def_id: LocalDefId,
-) -> Option<(LocalDefId, &'tcx FxHashSet<LocalDefId>)> {
-    match tcx.def_kind(def_id) {
-        DefKind::AnonConst | DefKind::InlineConst => {
-            let mut def_id = tcx.local_parent(def_id);
-            // We search for the next outer anon const or fn here
-            // while skipping closures.
-            //
-            // Note that for `AnonConst` we still just recurse until we
-            // find a function body, but who cares :shrug:
-            while tcx.is_closure(def_id.to_def_id()) {
-                def_id = tcx.local_parent(def_id);
-            }
-
-            tcx.is_late_bound_map(def_id)
-        }
-        _ => resolve_lifetimes_for(tcx, def_id).late_bound.get(&def_id).map(|lt| (def_id, lt)),
-    }
-}
-
 /// In traits, there is an implicit `Self` type parameter which comes before the generics.
 /// We have to account for this when computing the index of the other generic parameters.
 /// This function returns whether there is such an implicit parameter defined on the given item.
@@ -548,41 +512,6 @@ fn late_region_as_bound_region<'tcx>(tcx: TyCtxt<'tcx>, region: &Region) -> ty::
     }
 }
 
-#[tracing::instrument(level = "debug")]
-fn get_lifetime_scopes_for_path(mut scope: &Scope<'_>) -> LifetimeScopeForPath {
-    let mut available_lifetimes = vec![];
-    loop {
-        match scope {
-            Scope::Binder { lifetimes, s, .. } => {
-                available_lifetimes.extend(lifetimes.keys().filter_map(|p| match p {
-                    hir::ParamName::Plain(ident) => Some(ident.name),
-                    _ => None,
-                }));
-                scope = s;
-            }
-            Scope::Body { s, .. } => {
-                scope = s;
-            }
-            Scope::Elision { elide, s } => {
-                if let Elide::Exact(_) = elide {
-                    return LifetimeScopeForPath::Elided;
-                } else {
-                    scope = s;
-                }
-            }
-            Scope::ObjectLifetimeDefault { s, .. } => {
-                scope = s;
-            }
-            Scope::Root => {
-                return LifetimeScopeForPath::NonElided(available_lifetimes);
-            }
-            Scope::Supertrait { s, .. } | Scope::TraitRefBoundary { s, .. } => {
-                scope = s;
-            }
-        }
-    }
-}
-
 impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
     /// Returns the binders in scope and the type of `Binder` that should be created for a poly trait ref.
     fn poly_trait_ref_binder_info(&mut self) -> (Vec<ty::BoundVariableKind>, BinderScopeType) {
@@ -674,6 +603,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
                     opaque_type_parent: false,
                     scope_type: BinderScopeType::Normal,
                     allow_late_bound: true,
+                    where_bound_origin: None,
                 };
                 self.with(scope, move |this| intravisit::walk_fn(this, fk, fd, b, s, hir_id));
             }
@@ -690,9 +620,9 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
             _ => {}
         }
         match item.kind {
-            hir::ItemKind::Fn(ref sig, ref generics, _) => {
+            hir::ItemKind::Fn(_, ref generics, _) => {
                 self.missing_named_lifetime_spots.push(generics.into());
-                self.visit_early_late(None, item.hir_id(), &sig.decl, generics, |this| {
+                self.visit_early_late(None, item.hir_id(), generics, |this| {
                     intravisit::walk_item(this, item);
                 });
                 self.missing_named_lifetime_spots.pop();
@@ -734,13 +664,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
                                     self.map.defs.insert(hir::HirId { owner, local_id }, *region);
                                 });
                             }
-                            for (&owner, late_bound) in resolved_lifetimes.late_bound.iter() {
-                                late_bound.iter().for_each(|&id| {
-                                    let hir_id = self.tcx.local_def_id_to_hir_id(id);
-                                    debug_assert_eq!(owner, hir_id.owner);
-                                    self.map.late_bound.insert(hir_id);
-                                });
-                            }
                             for (&owner, late_bound_vars) in
                                 resolved_lifetimes.late_bound_vars.iter()
                             {
@@ -796,6 +719,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
                     scope_type: BinderScopeType::Normal,
                     s: ROOT_SCOPE,
                     allow_late_bound: false,
+                    where_bound_origin: None,
                 };
                 self.with(scope, |this| {
                     let scope = Scope::TraitRefBoundary { s: this.scope };
@@ -810,8 +734,8 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
 
     fn visit_foreign_item(&mut self, item: &'tcx hir::ForeignItem<'tcx>) {
         match item.kind {
-            hir::ForeignItemKind::Fn(ref decl, _, ref generics) => {
-                self.visit_early_late(None, item.hir_id(), decl, generics, |this| {
+            hir::ForeignItemKind::Fn(_, _, ref generics) => {
+                self.visit_early_late(None, item.hir_id(), generics, |this| {
                     intravisit::walk_foreign_item(this, item);
                 })
             }
@@ -841,7 +765,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
                 };
                 self.missing_named_lifetime_spots
                     .push(MissingLifetimeSpot::HigherRanked { span, span_type });
-                let (lifetimes, binders): (FxIndexMap<hir::ParamName, Region>, Vec<_>) = c
+                let (lifetimes, binders): (FxIndexMap<LocalDefId, Region>, Vec<_>) = c
                     .generic_params
                     .iter()
                     .filter(|param| matches!(param.kind, GenericParamKind::Lifetime { .. }))
@@ -861,6 +785,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
                     opaque_type_parent: false,
                     scope_type: BinderScopeType::Normal,
                     allow_late_bound: true,
+                    where_bound_origin: None,
                 };
                 self.with(scope, |this| {
                     // a bare fn has no bounds, so everything
@@ -898,7 +823,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
                         // cc #48468
                         self.resolve_elided_lifetimes(&[lifetime])
                     }
-                    LifetimeName::Param(_) | LifetimeName::Static => {
+                    LifetimeName::Param(..) | LifetimeName::Static => {
                         // If the user wrote an explicit name, use that.
                         self.visit_lifetime(lifetime);
                     }
@@ -1016,17 +941,17 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
                 for param in generics.params {
                     match param.kind {
                         GenericParamKind::Lifetime { .. } => {
-                            let (name, reg) = Region::early(self.tcx.hir(), &mut index, &param);
+                            let (def_id, reg) = Region::early(self.tcx.hir(), &mut index, &param);
                             if let hir::ParamName::Plain(Ident {
                                 name: kw::UnderscoreLifetime,
                                 ..
-                            }) = name
+                            }) = param.name
                             {
                                 // Pick the elided lifetime "definition" if one exists
                                 // and use it to make an elision scope.
                                 elision = Some(reg);
                             } else {
-                                lifetimes.insert(name, reg);
+                                lifetimes.insert(def_id, reg);
                             }
                         }
                         GenericParamKind::Type { .. } | GenericParamKind::Const { .. } => {
@@ -1049,6 +974,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
                             opaque_type_parent: false,
                             scope_type: BinderScopeType::Normal,
                             allow_late_bound: false,
+                            where_bound_origin: None,
                         };
                         this.with(scope, |this| {
                             this.visit_generics(generics);
@@ -1069,6 +995,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
                         opaque_type_parent: false,
                         scope_type: BinderScopeType::Normal,
                         allow_late_bound: false,
+                        where_bound_origin: None,
                     };
                     self.with(scope, |this| {
                         let scope = Scope::TraitRefBoundary { s: this.scope };
@@ -1088,13 +1015,12 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
     fn visit_trait_item(&mut self, trait_item: &'tcx hir::TraitItem<'tcx>) {
         use self::hir::TraitItemKind::*;
         match trait_item.kind {
-            Fn(ref sig, _) => {
+            Fn(_, _) => {
                 self.missing_named_lifetime_spots.push((&trait_item.generics).into());
                 let tcx = self.tcx;
                 self.visit_early_late(
                     Some(tcx.hir().get_parent_item(trait_item.hir_id())),
                     trait_item.hir_id(),
-                    &sig.decl,
                     &trait_item.generics,
                     |this| intravisit::walk_trait_item(this, trait_item),
                 );
@@ -1128,6 +1054,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
                     opaque_type_parent: true,
                     scope_type: BinderScopeType::Normal,
                     allow_late_bound: false,
+                    where_bound_origin: None,
                 };
                 self.with(scope, |this| {
                     let scope = Scope::TraitRefBoundary { s: this.scope };
@@ -1156,13 +1083,12 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
     fn visit_impl_item(&mut self, impl_item: &'tcx hir::ImplItem<'tcx>) {
         use self::hir::ImplItemKind::*;
         match impl_item.kind {
-            Fn(ref sig, _) => {
+            Fn(..) => {
                 self.missing_named_lifetime_spots.push((&impl_item.generics).into());
                 let tcx = self.tcx;
                 self.visit_early_late(
                     Some(tcx.hir().get_parent_item(impl_item.hir_id())),
                     impl_item.hir_id(),
-                    &sig.decl,
                     &impl_item.generics,
                     |this| intravisit::walk_impl_item(this, impl_item),
                 );
@@ -1174,7 +1100,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
                 let mut index = self.next_early_index();
                 let mut non_lifetime_count = 0;
                 debug!("visit_ty: index = {}", index);
-                let lifetimes: FxIndexMap<hir::ParamName, Region> = generics
+                let lifetimes: FxIndexMap<LocalDefId, Region> = generics
                     .params
                     .iter()
                     .filter_map(|param| match param.kind {
@@ -1196,6 +1122,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
                     opaque_type_parent: true,
                     scope_type: BinderScopeType::Normal,
                     allow_late_bound: true,
+                    where_bound_origin: None,
                 };
                 self.with(scope, |this| {
                     let scope = Scope::TraitRefBoundary { s: this.scope };
@@ -1218,27 +1145,17 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
 
     #[tracing::instrument(level = "debug", skip(self))]
     fn visit_lifetime(&mut self, lifetime_ref: &'tcx hir::Lifetime) {
-        if lifetime_ref.is_elided() {
-            self.resolve_elided_lifetimes(&[lifetime_ref]);
-            return;
-        }
-        if lifetime_ref.is_static() {
-            self.insert_lifetime(lifetime_ref, Region::Static);
-            return;
-        }
-        self.resolve_lifetime_ref(lifetime_ref);
-    }
-
-    fn visit_assoc_type_binding(&mut self, type_binding: &'tcx hir::TypeBinding<'_>) {
-        let scope = self.scope;
-        if let Some(scope_for_path) = self.map.scope_for_path.as_mut() {
-            // We add lifetime scope information for `Ident`s in associated type bindings and use
-            // the `HirId` of the type binding as the key in `LifetimeMap`
-            let lifetime_scope = get_lifetime_scopes_for_path(scope);
-            let map = scope_for_path.entry(type_binding.hir_id.owner).or_default();
-            map.insert(type_binding.hir_id.local_id, lifetime_scope);
+        match lifetime_ref.name {
+            hir::LifetimeName::ImplicitObjectLifetimeDefault
+            | hir::LifetimeName::Implicit
+            | hir::LifetimeName::Underscore => self.resolve_elided_lifetimes(&[lifetime_ref]),
+            hir::LifetimeName::Static => self.insert_lifetime(lifetime_ref, Region::Static),
+            hir::LifetimeName::Param(param_def_id, _) => {
+                self.resolve_lifetime_ref(param_def_id, lifetime_ref)
+            }
+            // If we've already reported an error, just ignore `lifetime_ref`.
+            hir::LifetimeName::Error => {}
         }
-        hir::intravisit::walk_assoc_type_binding(self, type_binding);
     }
 
     fn visit_path(&mut self, path: &'tcx hir::Path<'tcx>, _: hir::HirId) {
@@ -1247,35 +1164,9 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
             if let Some(ref args) = segment.args {
                 self.visit_segment_args(path.res, depth, args);
             }
-
-            let scope = self.scope;
-            if let Some(scope_for_path) = self.map.scope_for_path.as_mut() {
-                // Add lifetime scope information to path segment. Note we cannot call `visit_path_segment`
-                // here because that call would yield to resolution problems due to `walk_path_segment`
-                // being called, which processes the path segments generic args, which we have already
-                // processed using `visit_segment_args`.
-                let lifetime_scope = get_lifetime_scopes_for_path(scope);
-                if let Some(hir_id) = segment.hir_id {
-                    let map = scope_for_path.entry(hir_id.owner).or_default();
-                    map.insert(hir_id.local_id, lifetime_scope);
-                }
-            }
         }
     }
 
-    fn visit_path_segment(&mut self, path_span: Span, path_segment: &'tcx hir::PathSegment<'tcx>) {
-        let scope = self.scope;
-        if let Some(scope_for_path) = self.map.scope_for_path.as_mut() {
-            let lifetime_scope = get_lifetime_scopes_for_path(scope);
-            if let Some(hir_id) = path_segment.hir_id {
-                let map = scope_for_path.entry(hir_id.owner).or_default();
-                map.insert(hir_id.local_id, lifetime_scope);
-            }
-        }
-
-        intravisit::walk_path_segment(self, path_span, path_segment);
-    }
-
     fn visit_fn_decl(&mut self, fd: &'tcx hir::FnDecl<'tcx>) {
         let output = match fd.output {
             hir::FnRetTy::DefaultReturn(_) => None,
@@ -1309,9 +1200,10 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
                         ref bounded_ty,
                         bounds,
                         ref bound_generic_params,
+                        origin,
                         ..
                     }) => {
-                        let (lifetimes, binders): (FxIndexMap<hir::ParamName, Region>, Vec<_>) =
+                        let (lifetimes, binders): (FxIndexMap<LocalDefId, Region>, Vec<_>) =
                             bound_generic_params
                                 .iter()
                                 .filter(|param| {
@@ -1339,6 +1231,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
                             opaque_type_parent: false,
                             scope_type: BinderScopeType::Normal,
                             allow_late_bound: true,
+                            where_bound_origin: Some(origin),
                         };
                         this.with(scope, |this| {
                             this.visit_ty(&bounded_ty);
@@ -1411,6 +1304,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
                     opaque_type_parent: false,
                     scope_type,
                     allow_late_bound: true,
+                    where_bound_origin: None,
                 };
                 self.with(scope, |this| {
                     intravisit::walk_param_bound(this, bound);
@@ -1433,7 +1327,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
         let (mut binders, scope_type) = self.poly_trait_ref_binder_info();
 
         let initial_bound_vars = binders.len() as u32;
-        let mut lifetimes: FxIndexMap<hir::ParamName, Region> = FxIndexMap::default();
+        let mut lifetimes: FxIndexMap<LocalDefId, Region> = FxIndexMap::default();
         let binders_iter = trait_ref
             .bound_generic_params
             .iter()
@@ -1463,6 +1357,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
             opaque_type_parent: false,
             scope_type,
             allow_late_bound: true,
+            where_bound_origin: None,
         };
         self.with(scope, |this| {
             walk_list!(this, visit_generic_param, trait_ref.bound_generic_params);
@@ -1580,14 +1475,17 @@ fn object_lifetime_defaults_for_item<'tcx>(
                             .iter()
                             .filter_map(|param| match param.kind {
                                 GenericParamKind::Lifetime { .. } => {
-                                    Some((param.hir_id, hir::LifetimeName::Param(param.name)))
+                                    let param_def_id = tcx.hir().local_def_id(param.hir_id);
+                                    Some((
+                                        param_def_id,
+                                        hir::LifetimeName::Param(param_def_id, param.name),
+                                    ))
                                 }
                                 _ => None,
                             })
                             .enumerate()
                             .find(|&(_, (_, lt_name))| lt_name == name)
-                            .map_or(Set1::Many, |(i, (id, _))| {
-                                let def_id = tcx.hir().local_def_id(id);
+                            .map_or(Set1::Many, |(i, (def_id, _))| {
                                 Set1::One(Region::EarlyBound(i as u32, def_id.to_def_id()))
                             })
                     }
@@ -1654,14 +1552,11 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
         &mut self,
         parent_id: Option<LocalDefId>,
         hir_id: hir::HirId,
-        decl: &'tcx hir::FnDecl<'tcx>,
         generics: &'tcx hir::Generics<'tcx>,
         walk: F,
     ) where
         F: for<'b, 'c> FnOnce(&'b mut LifetimeContext<'c, 'tcx>),
     {
-        insert_late_bound_lifetimes(self.map, decl, generics);
-
         // Find the start of nested early scopes, e.g., in methods.
         let mut next_early_index = 0;
         if let Some(parent_id) = parent_id {
@@ -1680,12 +1575,12 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
 
         let mut non_lifetime_count = 0;
         let mut named_late_bound_vars = 0;
-        let lifetimes: FxIndexMap<hir::ParamName, Region> = generics
+        let lifetimes: FxIndexMap<LocalDefId, Region> = generics
             .params
             .iter()
             .filter_map(|param| match param.kind {
                 GenericParamKind::Lifetime { .. } => {
-                    if self.map.late_bound.contains(&param.hir_id) {
+                    if self.tcx.is_late_bound(param.hir_id) {
                         let late_bound_idx = named_late_bound_vars;
                         named_late_bound_vars += 1;
                         Some(Region::late(late_bound_idx, self.tcx.hir(), param))
@@ -1706,7 +1601,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
             .iter()
             .filter(|param| {
                 matches!(param.kind, GenericParamKind::Lifetime { .. })
-                    && self.map.late_bound.contains(&param.hir_id)
+                    && self.tcx.is_late_bound(param.hir_id)
             })
             .enumerate()
             .map(|(late_bound_idx, param)| {
@@ -1723,6 +1618,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
             opaque_type_parent: true,
             scope_type: BinderScopeType::Normal,
             allow_late_bound: true,
+            where_bound_origin: None,
         };
         self.with(scope, walk);
     }
@@ -1763,14 +1659,12 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
         self.next_early_index_helper(false)
     }
 
-    fn resolve_lifetime_ref(&mut self, lifetime_ref: &'tcx hir::Lifetime) {
-        debug!("resolve_lifetime_ref(lifetime_ref={:?})", lifetime_ref);
-
-        // If we've already reported an error, just ignore `lifetime_ref`.
-        if let LifetimeName::Error = lifetime_ref.name {
-            return;
-        }
-
+    #[tracing::instrument(level = "debug", skip(self))]
+    fn resolve_lifetime_ref(
+        &mut self,
+        region_def_id: LocalDefId,
+        lifetime_ref: &'tcx hir::Lifetime,
+    ) {
         // Walk up the scope chain, tracking the number of fn scopes
         // that we pass through, until we find a lifetime with the
         // given name or we run out of scopes.
@@ -1790,14 +1684,8 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
                 }
 
                 Scope::Binder { ref lifetimes, scope_type, s, .. } => {
-                    match lifetime_ref.name {
-                        LifetimeName::Param(param_name) => {
-                            if let Some(&def) = lifetimes.get(&param_name.normalize_to_macros_2_0())
-                            {
-                                break Some(def.shifted(late_depth));
-                            }
-                        }
-                        _ => bug!("expected LifetimeName::Param"),
+                    if let Some(&def) = lifetimes.get(&region_def_id) {
+                        break Some(def.shifted(late_depth));
                     }
                     match scope_type {
                         BinderScopeType::Normal => late_depth += 1,
@@ -1834,12 +1722,48 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
             }
 
             self.insert_lifetime(lifetime_ref, def);
-        } else {
-            self.tcx.sess.delay_span_bug(
-                lifetime_ref.span,
-                &format!("Could not resolve {:?} in scope {:#?}", lifetime_ref, self.scope,),
-            );
+            return;
+        }
+
+        // We may fail to resolve higher-ranked lifetimes that are mentionned by APIT.
+        // AST-based resolution does not care for impl-trait desugaring, which are the
+        // responibility of lowering.  This may create a mismatch between the resolution
+        // AST found (`region_def_id`) which points to HRTB, and what HIR allows.
+        // ```
+        // fn foo(x: impl for<'a> Trait<'a, Assoc = impl Copy + 'a>) {}
+        // ```
+        //
+        // In such case, walk back the binders to diagnose it properly.
+        let mut scope = self.scope;
+        loop {
+            match *scope {
+                Scope::Binder {
+                    where_bound_origin: Some(hir::PredicateOrigin::ImplTrait), ..
+                } => {
+                    let mut err = self.tcx.sess.struct_span_err(
+                        lifetime_ref.span,
+                        "`impl Trait` can only mention lifetimes bound at the fn or impl level",
+                    );
+                    err.span_note(self.tcx.def_span(region_def_id), "lifetime declared here");
+                    err.emit();
+                    return;
+                }
+                Scope::Root => break,
+                Scope::Binder { s, .. }
+                | Scope::Body { s, .. }
+                | Scope::Elision { s, .. }
+                | Scope::ObjectLifetimeDefault { s, .. }
+                | Scope::Supertrait { s, .. }
+                | Scope::TraitRefBoundary { s, .. } => {
+                    scope = s;
+                }
+            }
         }
+
+        self.tcx.sess.delay_span_bug(
+            lifetime_ref.span,
+            &format!("Could not resolve {:?} in scope {:#?}", lifetime_ref, self.scope,),
+        );
     }
 
     fn visit_segment_args(
@@ -2221,6 +2145,9 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
 
             // Foreign functions, `fn(...) -> R` and `Trait(...) -> R` (both types and bounds).
             Node::ForeignItem(_) | Node::Ty(_) | Node::TraitRef(_) => None,
+
+            Node::TypeBinding(_) if let Node::TraitRef(_) = self.tcx.hir().get(self.tcx.hir().get_parent_node(parent)) => None,
+
             // Everything else (only closures?) doesn't
             // actually enjoy elision in return types.
             _ => {
@@ -2473,8 +2400,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
 
         let mut late_depth = 0;
         let mut scope = self.scope;
-        let mut lifetime_names = FxHashSet::default();
-        let mut lifetime_spans = vec![];
+        let mut in_scope_lifetimes = FxIndexSet::default();
         let error = loop {
             match *scope {
                 // Do not assign any resolution, it will be inferred.
@@ -2484,12 +2410,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
 
                 Scope::Binder { s, ref lifetimes, scope_type, .. } => {
                     // collect named lifetimes for suggestions
-                    for name in lifetimes.keys() {
-                        if let hir::ParamName::Plain(name) = name {
-                            lifetime_names.insert(name.name);
-                            lifetime_spans.push(name.span);
-                        }
-                    }
+                    in_scope_lifetimes.extend(lifetimes.keys().copied());
                     match scope_type {
                         BinderScopeType::Normal => late_depth += 1,
                         BinderScopeType::Concatenating => {}
@@ -2524,12 +2445,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
                         match scope {
                             Scope::Binder { ref lifetimes, s, .. } => {
                                 // Collect named lifetimes for suggestions.
-                                for name in lifetimes.keys() {
-                                    if let hir::ParamName::Plain(name) = name {
-                                        lifetime_names.insert(name.name);
-                                        lifetime_spans.push(name.span);
-                                    }
-                                }
+                                in_scope_lifetimes.extend(lifetimes.keys().copied());
                                 scope = s;
                             }
                             Scope::ObjectLifetimeDefault { ref s, .. }
@@ -2553,16 +2469,6 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
             }
         };
 
-        // If we specifically need the `scope_for_path` map, then we're in the
-        // diagnostic pass and we don't want to emit more errors.
-        if self.map.scope_for_path.is_some() {
-            self.tcx.sess.delay_span_bug(
-                rustc_span::DUMMY_SP,
-                "Encountered unexpected errors during diagnostics related part",
-            );
-            return;
-        }
-
         let mut spans: Vec<_> = lifetime_refs.iter().map(|lt| lt.span).collect();
         spans.sort();
         let mut spans_dedup = spans.clone();
@@ -2574,19 +2480,11 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
 
         let mut err = self.report_missing_lifetime_specifiers(spans.clone(), lifetime_refs.len());
 
-        if let Some(params) = error {
-            // If there's no lifetime available, suggest `'static`.
-            if self.report_elision_failure(&mut err, params) && lifetime_names.is_empty() {
-                lifetime_names.insert(kw::StaticLifetime);
-            }
-        }
-
         self.add_missing_lifetime_specifiers_label(
             &mut err,
             spans_with_counts,
-            &lifetime_names,
-            lifetime_spans,
-            error.unwrap_or(&[]),
+            in_scope_lifetimes,
+            error,
         );
         err.emit();
     }
@@ -2638,7 +2536,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
 }
 
 /// Detects late-bound lifetimes and inserts them into
-/// `map.late_bound`.
+/// `late_bound`.
 ///
 /// A region declared on a fn is **late-bound** if:
 /// - it is constrained by an argument type;
@@ -2647,12 +2545,13 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
 /// "Constrained" basically means that it appears in any type but
 /// not amongst the inputs to a projection. In other words, `<&'a
 /// T as Trait<''b>>::Foo` does not constrain `'a` or `'b`.
-#[tracing::instrument(level = "debug", skip(map))]
-fn insert_late_bound_lifetimes(
-    map: &mut NamedRegionMap,
-    decl: &hir::FnDecl<'_>,
-    generics: &hir::Generics<'_>,
-) {
+fn is_late_bound_map(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<&FxHashSet<LocalDefId>> {
+    let hir_id = tcx.hir().local_def_id_to_hir_id(def_id);
+    let decl = tcx.hir().fn_decl_by_hir_id(hir_id)?;
+    let generics = tcx.hir().get_generics(def_id)?;
+
+    let mut late_bound = FxHashSet::default();
+
     let mut constrained_by_input = ConstrainedCollector::default();
     for arg_ty in decl.inputs {
         constrained_by_input.visit_ty(arg_ty);
@@ -2683,30 +2582,32 @@ fn insert_late_bound_lifetimes(
             hir::GenericParamKind::Type { .. } | hir::GenericParamKind::Const { .. } => continue,
         }
 
-        let lt_name = hir::LifetimeName::Param(param.name.normalize_to_macros_2_0());
+        let param_def_id = tcx.hir().local_def_id(param.hir_id);
+
         // appears in the where clauses? early-bound.
-        if appears_in_where_clause.regions.contains(&lt_name) {
+        if appears_in_where_clause.regions.contains(&param_def_id) {
             continue;
         }
 
         // does not appear in the inputs, but appears in the return type? early-bound.
-        if !constrained_by_input.regions.contains(&lt_name)
-            && appears_in_output.regions.contains(&lt_name)
+        if !constrained_by_input.regions.contains(&param_def_id)
+            && appears_in_output.regions.contains(&param_def_id)
         {
             continue;
         }
 
         debug!("lifetime {:?} with id {:?} is late-bound", param.name.ident(), param.hir_id);
 
-        let inserted = map.late_bound.insert(param.hir_id);
+        let inserted = late_bound.insert(param_def_id);
         assert!(inserted, "visited lifetime {:?} twice", param.hir_id);
     }
 
-    return;
+    debug!(?late_bound);
+    return Some(tcx.arena.alloc(late_bound));
 
     #[derive(Default)]
     struct ConstrainedCollector {
-        regions: FxHashSet<hir::LifetimeName>,
+        regions: FxHashSet<LocalDefId>,
     }
 
     impl<'v> Visitor<'v> for ConstrainedCollector {
@@ -2738,18 +2639,22 @@ fn insert_late_bound_lifetimes(
         }
 
         fn visit_lifetime(&mut self, lifetime_ref: &'v hir::Lifetime) {
-            self.regions.insert(lifetime_ref.name.normalize_to_macros_2_0());
+            if let hir::LifetimeName::Param(def_id, _) = lifetime_ref.name {
+                self.regions.insert(def_id);
+            }
         }
     }
 
     #[derive(Default)]
     struct AllCollector {
-        regions: FxHashSet<hir::LifetimeName>,
+        regions: FxHashSet<LocalDefId>,
     }
 
     impl<'v> Visitor<'v> for AllCollector {
         fn visit_lifetime(&mut self, lifetime_ref: &'v hir::Lifetime) {
-            self.regions.insert(lifetime_ref.name.normalize_to_macros_2_0());
+            if let hir::LifetimeName::Param(def_id, _) = lifetime_ref.name {
+                self.regions.insert(def_id);
+            }
         }
     }
 }
diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs
index 73c8a9d28bd..92a65fe249f 100644
--- a/compiler/rustc_resolve/src/lib.rs
+++ b/compiler/rustc_resolve/src/lib.rs
@@ -13,7 +13,7 @@
 #![feature(let_chains)]
 #![feature(let_else)]
 #![feature(never_type)]
-#![feature(nll)]
+#![cfg_attr(bootstrap, feature(nll))]
 #![recursion_limit = "256"]
 #![allow(rustdoc::private_intra_doc_links)]
 #![allow(rustc::potential_query_instability)]
@@ -28,7 +28,7 @@ use rustc_ast::node_id::NodeMap;
 use rustc_ast::{self as ast, NodeId, CRATE_NODE_ID};
 use rustc_ast::{AngleBracketedArg, Crate, Expr, ExprKind, GenericArg, GenericArgs, LitKind, Path};
 use rustc_ast_lowering::{LifetimeRes, ResolverAstLowering};
-use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
+use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet};
 use rustc_data_structures::intern::Interned;
 use rustc_data_structures::sync::Lrc;
 use rustc_errors::{Applicability, DiagnosticBuilder, ErrorGuaranteed};
@@ -941,7 +941,7 @@ pub struct Resolver<'a> {
     visibilities: FxHashMap<LocalDefId, ty::Visibility>,
     has_pub_restricted: bool,
     used_imports: FxHashSet<NodeId>,
-    maybe_unused_trait_imports: FxHashSet<LocalDefId>,
+    maybe_unused_trait_imports: FxIndexSet<LocalDefId>,
     maybe_unused_extern_crates: Vec<(LocalDefId, Span)>,
 
     /// Privacy errors are delayed until the end in order to deduplicate them.
diff --git a/compiler/rustc_resolve/src/macros.rs b/compiler/rustc_resolve/src/macros.rs
index 7e6375968ae..2e2d3674560 100644
--- a/compiler/rustc_resolve/src/macros.rs
+++ b/compiler/rustc_resolve/src/macros.rs
@@ -443,11 +443,22 @@ impl<'a> ResolverExpand for Resolver<'a> {
                 PathResult::NonModule(partial_res) if partial_res.unresolved_segments() == 0 => {
                     return Ok(true);
                 }
+                PathResult::NonModule(..) |
+                // HACK(Urgau): This shouldn't be necessary
+                PathResult::Failed { is_error_from_last_segment: false, .. } => {
+                    self.session
+                        .struct_span_err(span, "not sure whether the path is accessible or not")
+                        .note("the type may have associated items, but we are currently not checking them")
+                        .emit();
+
+                    // If we get a partially resolved NonModule in one namespace, we should get the
+                    // same result in any other namespaces, so we can return early.
+                    return Ok(false);
+                }
                 PathResult::Indeterminate => indeterminate = true,
-                // FIXME: `resolve_path` is not ready to report partially resolved paths
-                // correctly, so we just report an error if the path was reported as unresolved.
-                // This needs to be fixed for `cfg_accessible` to be useful.
-                PathResult::NonModule(..) | PathResult::Failed { .. } => {}
+                // We can only be sure that a path doesn't exist after having tested all the
+                // posibilities, only at that time we can return false.
+                PathResult::Failed { .. } => {}
                 PathResult::Module(_) => panic!("unexpected path resolution"),
             }
         }
@@ -456,10 +467,6 @@ impl<'a> ResolverExpand for Resolver<'a> {
             return Err(Indeterminate);
         }
 
-        self.session
-            .struct_span_err(span, "not sure whether the path is accessible or not")
-            .span_note(span, "`cfg_accessible` is not fully implemented")
-            .emit();
         Ok(false)
     }
 
diff --git a/compiler/rustc_save_analysis/src/lib.rs b/compiler/rustc_save_analysis/src/lib.rs
index 5d94884e0f6..99f38b3222d 100644
--- a/compiler/rustc_save_analysis/src/lib.rs
+++ b/compiler/rustc_save_analysis/src/lib.rs
@@ -1,6 +1,5 @@
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
 #![feature(if_let_guard)]
-#![feature(nll)]
 #![feature(let_else)]
 #![recursion_limit = "256"]
 #![allow(rustc::potential_query_instability)]
diff --git a/compiler/rustc_serialize/src/collection_impls.rs b/compiler/rustc_serialize/src/collection_impls.rs
index 761e988360a..c4541bbcac9 100644
--- a/compiler/rustc_serialize/src/collection_impls.rs
+++ b/compiler/rustc_serialize/src/collection_impls.rs
@@ -25,12 +25,11 @@ impl<D: Decoder, A: Array<Item: Decodable<D>>> Decodable<D> for SmallVec<A> {
 
 impl<S: Encoder, T: Encodable<S>> Encodable<S> for LinkedList<T> {
     fn encode(&self, s: &mut S) -> Result<(), S::Error> {
-        s.emit_seq(self.len(), |s| {
-            for (i, e) in self.iter().enumerate() {
-                s.emit_seq_elt(i, |s| e.encode(s))?;
-            }
-            Ok(())
-        })
+        s.emit_usize(self.len())?;
+        for e in self.iter() {
+            e.encode(s)?;
+        }
+        Ok(())
     }
 }
 
@@ -43,12 +42,11 @@ impl<D: Decoder, T: Decodable<D>> Decodable<D> for LinkedList<T> {
 
 impl<S: Encoder, T: Encodable<S>> Encodable<S> for VecDeque<T> {
     fn encode(&self, s: &mut S) -> Result<(), S::Error> {
-        s.emit_seq(self.len(), |s| {
-            for (i, e) in self.iter().enumerate() {
-                s.emit_seq_elt(i, |s| e.encode(s))?;
-            }
-            Ok(())
-        })
+        s.emit_usize(self.len())?;
+        for e in self.iter() {
+            e.encode(s)?;
+        }
+        Ok(())
     }
 }
 
@@ -65,13 +63,12 @@ where
     V: Encodable<S>,
 {
     fn encode(&self, e: &mut S) -> Result<(), S::Error> {
-        e.emit_map(self.len(), |e| {
-            for (i, (key, val)) in self.iter().enumerate() {
-                e.emit_map_elt_key(i, |e| key.encode(e))?;
-                e.emit_map_elt_val(|e| val.encode(e))?;
-            }
-            Ok(())
-        })
+        e.emit_usize(self.len())?;
+        for (key, val) in self.iter() {
+            key.encode(e)?;
+            val.encode(e)?;
+        }
+        Ok(())
     }
 }
 
@@ -97,12 +94,11 @@ where
     T: Encodable<S> + PartialEq + Ord,
 {
     fn encode(&self, s: &mut S) -> Result<(), S::Error> {
-        s.emit_seq(self.len(), |s| {
-            for (i, e) in self.iter().enumerate() {
-                s.emit_seq_elt(i, |s| e.encode(s))?;
-            }
-            Ok(())
-        })
+        s.emit_usize(self.len())?;
+        for e in self.iter() {
+            e.encode(s)?;
+        }
+        Ok(())
     }
 }
 
@@ -127,13 +123,12 @@ where
     S: BuildHasher,
 {
     fn encode(&self, e: &mut E) -> Result<(), E::Error> {
-        e.emit_map(self.len(), |e| {
-            for (i, (key, val)) in self.iter().enumerate() {
-                e.emit_map_elt_key(i, |e| key.encode(e))?;
-                e.emit_map_elt_val(|e| val.encode(e))?;
-            }
-            Ok(())
-        })
+        e.emit_usize(self.len())?;
+        for (key, val) in self.iter() {
+            key.encode(e)?;
+            val.encode(e)?;
+        }
+        Ok(())
     }
 }
 
@@ -162,12 +157,11 @@ where
     S: BuildHasher,
 {
     fn encode(&self, s: &mut E) -> Result<(), E::Error> {
-        s.emit_seq(self.len(), |s| {
-            for (i, e) in self.iter().enumerate() {
-                s.emit_seq_elt(i, |s| e.encode(s))?;
-            }
-            Ok(())
-        })
+        s.emit_usize(self.len())?;
+        for e in self.iter() {
+            e.encode(s)?;
+        }
+        Ok(())
     }
 }
 
@@ -194,13 +188,12 @@ where
     S: BuildHasher,
 {
     fn encode(&self, e: &mut E) -> Result<(), E::Error> {
-        e.emit_map(self.len(), |e| {
-            for (i, (key, val)) in self.iter().enumerate() {
-                e.emit_map_elt_key(i, |e| key.encode(e))?;
-                e.emit_map_elt_val(|e| val.encode(e))?;
-            }
-            Ok(())
-        })
+        e.emit_usize(self.len())?;
+        for (key, val) in self.iter() {
+            key.encode(e)?;
+            val.encode(e)?;
+        }
+        Ok(())
     }
 }
 
@@ -229,12 +222,11 @@ where
     S: BuildHasher,
 {
     fn encode(&self, s: &mut E) -> Result<(), E::Error> {
-        s.emit_seq(self.len(), |s| {
-            for (i, e) in self.iter().enumerate() {
-                s.emit_seq_elt(i, |s| e.encode(s))?;
-            }
-            Ok(())
-        })
+        s.emit_usize(self.len())?;
+        for e in self.iter() {
+            e.encode(s)?;
+        }
+        Ok(())
     }
 }
 
diff --git a/compiler/rustc_serialize/src/json.rs b/compiler/rustc_serialize/src/json.rs
deleted file mode 100644
index c915dd5bbf6..00000000000
--- a/compiler/rustc_serialize/src/json.rs
+++ /dev/null
@@ -1,2368 +0,0 @@
-// Rust JSON serialization library.
-// Copyright (c) 2011 Google Inc.
-
-#![forbid(non_camel_case_types)]
-#![allow(missing_docs)]
-
-//! JSON parsing and serialization
-//!
-//! # What is JSON?
-//!
-//! JSON (JavaScript Object Notation) is a way to write data in Javascript.
-//! Like XML, it allows to encode structured data in a text format that can be easily read by humans
-//! Its simple syntax and native compatibility with JavaScript have made it a widely used format.
-//!
-//! Data types that can be encoded are JavaScript types (see the `Json` enum for more details):
-//!
-//! * `Boolean`: equivalent to rust's `bool`
-//! * `Number`: equivalent to rust's `f64`
-//! * `String`: equivalent to rust's `String`
-//! * `Array`: equivalent to rust's `Vec<T>`, but also allowing objects of different types in the
-//!   same array
-//! * `Object`: equivalent to rust's `BTreeMap<String, json::Json>`
-//! * `Null`
-//!
-//! An object is a series of string keys mapping to values, in `"key": value` format.
-//! Arrays are enclosed in square brackets ([ ... ]) and objects in curly brackets ({ ... }).
-//! A simple JSON document encoding a person, their age, address and phone numbers could look like
-//!
-//! ```json
-//! {
-//!     "FirstName": "John",
-//!     "LastName": "Doe",
-//!     "Age": 43,
-//!     "Address": {
-//!         "Street": "Downing Street 10",
-//!         "City": "London",
-//!         "Country": "Great Britain"
-//!     },
-//!     "PhoneNumbers": [
-//!         "+44 1234567",
-//!         "+44 2345678"
-//!     ]
-//! }
-//! ```
-//!
-//! # Rust Type-based Encoding and Decoding
-//!
-//! To be able to encode a piece of data, it must implement the
-//! `serialize::Encodable` trait.  The `rustc_macros` crate provides an
-//! annotation to automatically generate the code for this trait: `#[derive(Encodable)]`.
-//!
-//! The JSON API provides an enum `json::Json` and a trait `ToJson` to encode objects.
-//! The `ToJson` trait provides a `to_json` method to convert an object into a `json::Json` value.
-//! A `json::Json` value can be encoded as a string or buffer using the functions described above.
-//! You can also use the `json::Encoder` object, which implements the `Encoder` trait.
-//!
-//! When using `ToJson` the `Encodable` trait implementation is not mandatory.
-//!
-//! # Examples of use
-//!
-//! ## Using Autoserialization
-//!
-//! Create a struct called `TestStruct` and serialize and deserialize it to and from JSON using the
-//! serialization API, using the derived serialization code.
-//!
-//! ```rust
-//! # #![feature(rustc_private)]
-//! use rustc_macros::{Encodable};
-//! use rustc_serialize::json;
-//!
-//! // Automatically generate `Encodable` trait implementations
-//! #[derive(Encodable)]
-//! pub struct TestStruct  {
-//!     data_int: u8,
-//!     data_str: String,
-//!     data_vector: Vec<u8>,
-//! }
-//!
-//! let object = TestStruct {
-//!     data_int: 1,
-//!     data_str: "homura".to_string(),
-//!     data_vector: vec![2,3,4,5],
-//! };
-//!
-//! // Serialize using `json::encode`
-//! let encoded = json::encode(&object).unwrap();
-//! ```
-//!
-//! ## Using the `ToJson` trait
-//!
-//! The examples above use the `ToJson` trait to generate the JSON string, which is required
-//! for custom mappings.
-//!
-//! ### Simple example of `ToJson` usage
-//!
-//! ```rust
-//! # #![feature(rustc_private)]
-//! use rustc_macros::Encodable;
-//! use rustc_serialize::json::{self, ToJson, Json};
-//!
-//! // A custom data structure
-//! struct ComplexNum {
-//!     a: f64,
-//!     b: f64,
-//! }
-//!
-//! // JSON value representation
-//! impl ToJson for ComplexNum {
-//!     fn to_json(&self) -> Json {
-//!         Json::String(format!("{}+{}i", self.a, self.b))
-//!     }
-//! }
-//!
-//! // Only generate `Encodable` trait implementation
-//! #[derive(Encodable)]
-//! pub struct ComplexNumRecord {
-//!     uid: u8,
-//!     dsc: String,
-//!     val: Json,
-//! }
-//!
-//! let num = ComplexNum { a: 0.0001, b: 12.539 };
-//! let data: String = json::encode(&ComplexNumRecord{
-//!     uid: 1,
-//!     dsc: "test".to_string(),
-//!     val: num.to_json(),
-//! }).unwrap();
-//! println!("data: {}", data);
-//! // data: {"uid":1,"dsc":"test","val":"0.0001+12.539i"};
-//! ```
-//!
-//! ### Verbose example of `ToJson` usage
-//!
-//! ```rust
-//! # #![feature(rustc_private)]
-//! use std::collections::BTreeMap;
-//! use rustc_serialize::json::{Json, ToJson};
-//!
-//! pub struct TestStruct {
-//!     data_int: u8,
-//!     data_str: String,
-//!     data_vector: Vec<u8>,
-//! }
-//!
-//! // Specify encoding method manually
-//! impl ToJson for TestStruct {
-//!     fn to_json(&self) -> Json {
-//!         let mut d = BTreeMap::new();
-//!         // All standard types implement `to_json()`, so use it
-//!         d.insert("data_int".to_string(), self.data_int.to_json());
-//!         d.insert("data_str".to_string(), self.data_str.to_json());
-//!         d.insert("data_vector".to_string(), self.data_vector.to_json());
-//!         Json::Object(d)
-//!     }
-//! }
-//!
-//! // Serialize using `ToJson`
-//! let input_data = TestStruct {
-//!     data_int: 1,
-//!     data_str: "madoka".to_string(),
-//!     data_vector: vec![2,3,4,5],
-//! };
-//! let json_obj: Json = input_data.to_json();
-//! let json_str: String = json_obj.to_string();
-//! ```
-
-use self::ErrorCode::*;
-use self::InternalStackElement::*;
-use self::JsonEvent::*;
-use self::ParserError::*;
-use self::ParserState::*;
-
-use std::borrow::Cow;
-use std::collections::{BTreeMap, HashMap};
-use std::mem::swap;
-use std::num::FpCategory as Fp;
-use std::ops::Index;
-use std::str::FromStr;
-use std::string;
-use std::{char, fmt, str};
-
-use crate::Encodable;
-
-/// Represents a json value
-#[derive(Clone, PartialEq, PartialOrd, Debug)]
-pub enum Json {
-    I64(i64),
-    U64(u64),
-    F64(f64),
-    String(string::String),
-    Boolean(bool),
-    Array(self::Array),
-    Object(self::Object),
-    Null,
-}
-
-pub type Array = Vec<Json>;
-pub type Object = BTreeMap<string::String, Json>;
-
-pub struct PrettyJson<'a> {
-    inner: &'a Json,
-}
-
-pub struct AsJson<'a, T> {
-    inner: &'a T,
-}
-pub struct AsPrettyJson<'a, T> {
-    inner: &'a T,
-    indent: Option<usize>,
-}
-
-/// The errors that can arise while parsing a JSON stream.
-#[derive(Clone, Copy, PartialEq, Debug)]
-pub enum ErrorCode {
-    InvalidSyntax,
-    InvalidNumber,
-    EOFWhileParsingObject,
-    EOFWhileParsingArray,
-    EOFWhileParsingValue,
-    EOFWhileParsingString,
-    KeyMustBeAString,
-    ExpectedColon,
-    TrailingCharacters,
-    TrailingComma,
-    InvalidEscape,
-    InvalidUnicodeCodePoint,
-    LoneLeadingSurrogateInHexEscape,
-    UnexpectedEndOfHexEscape,
-    UnrecognizedHex,
-    NotFourDigit,
-    NotUtf8,
-}
-
-#[derive(Clone, PartialEq, Debug)]
-pub enum ParserError {
-    /// msg, line, col
-    SyntaxError(ErrorCode, usize, usize),
-}
-
-// Builder and Parser have the same errors.
-pub type BuilderError = ParserError;
-
-#[derive(Copy, Clone, Debug)]
-pub enum EncoderError {
-    FmtError(fmt::Error),
-    BadHashmapKey,
-}
-
-/// Returns a readable error string for a given error code.
-pub fn error_str(error: ErrorCode) -> &'static str {
-    match error {
-        InvalidSyntax => "invalid syntax",
-        InvalidNumber => "invalid number",
-        EOFWhileParsingObject => "EOF While parsing object",
-        EOFWhileParsingArray => "EOF While parsing array",
-        EOFWhileParsingValue => "EOF While parsing value",
-        EOFWhileParsingString => "EOF While parsing string",
-        KeyMustBeAString => "key must be a string",
-        ExpectedColon => "expected `:`",
-        TrailingCharacters => "trailing characters",
-        TrailingComma => "trailing comma",
-        InvalidEscape => "invalid escape",
-        UnrecognizedHex => "invalid \\u{ esc}ape (unrecognized hex)",
-        NotFourDigit => "invalid \\u{ esc}ape (not four digits)",
-        NotUtf8 => "contents not utf-8",
-        InvalidUnicodeCodePoint => "invalid Unicode code point",
-        LoneLeadingSurrogateInHexEscape => "lone leading surrogate in hex escape",
-        UnexpectedEndOfHexEscape => "unexpected end of hex escape",
-    }
-}
-
-/// Shortcut function to encode a `T` into a JSON `String`
-pub fn encode<T: for<'r> crate::Encodable<Encoder<'r>>>(
-    object: &T,
-) -> Result<string::String, EncoderError> {
-    let mut s = String::new();
-    {
-        let mut encoder = Encoder::new(&mut s);
-        object.encode(&mut encoder)?;
-    }
-    Ok(s)
-}
-
-impl fmt::Display for ErrorCode {
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        error_str(*self).fmt(f)
-    }
-}
-
-impl fmt::Display for ParserError {
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        // FIXME this should be a nicer error
-        fmt::Debug::fmt(self, f)
-    }
-}
-
-impl fmt::Display for EncoderError {
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        // FIXME this should be a nicer error
-        fmt::Debug::fmt(self, f)
-    }
-}
-
-impl std::error::Error for EncoderError {}
-
-impl From<fmt::Error> for EncoderError {
-    /// Converts a [`fmt::Error`] into `EncoderError`
-    ///
-    /// This conversion does not allocate memory.
-    fn from(err: fmt::Error) -> EncoderError {
-        EncoderError::FmtError(err)
-    }
-}
-
-pub type EncodeResult = Result<(), EncoderError>;
-
-fn escape_str(wr: &mut dyn fmt::Write, v: &str) -> EncodeResult {
-    wr.write_str("\"")?;
-
-    let mut start = 0;
-
-    for (i, byte) in v.bytes().enumerate() {
-        let escaped = match byte {
-            b'"' => "\\\"",
-            b'\\' => "\\\\",
-            b'\x00' => "\\u0000",
-            b'\x01' => "\\u0001",
-            b'\x02' => "\\u0002",
-            b'\x03' => "\\u0003",
-            b'\x04' => "\\u0004",
-            b'\x05' => "\\u0005",
-            b'\x06' => "\\u0006",
-            b'\x07' => "\\u0007",
-            b'\x08' => "\\b",
-            b'\t' => "\\t",
-            b'\n' => "\\n",
-            b'\x0b' => "\\u000b",
-            b'\x0c' => "\\f",
-            b'\r' => "\\r",
-            b'\x0e' => "\\u000e",
-            b'\x0f' => "\\u000f",
-            b'\x10' => "\\u0010",
-            b'\x11' => "\\u0011",
-            b'\x12' => "\\u0012",
-            b'\x13' => "\\u0013",
-            b'\x14' => "\\u0014",
-            b'\x15' => "\\u0015",
-            b'\x16' => "\\u0016",
-            b'\x17' => "\\u0017",
-            b'\x18' => "\\u0018",
-            b'\x19' => "\\u0019",
-            b'\x1a' => "\\u001a",
-            b'\x1b' => "\\u001b",
-            b'\x1c' => "\\u001c",
-            b'\x1d' => "\\u001d",
-            b'\x1e' => "\\u001e",
-            b'\x1f' => "\\u001f",
-            b'\x7f' => "\\u007f",
-            _ => {
-                continue;
-            }
-        };
-
-        if start < i {
-            wr.write_str(&v[start..i])?;
-        }
-
-        wr.write_str(escaped)?;
-
-        start = i + 1;
-    }
-
-    if start != v.len() {
-        wr.write_str(&v[start..])?;
-    }
-
-    wr.write_str("\"")?;
-    Ok(())
-}
-
-fn escape_char(writer: &mut dyn fmt::Write, v: char) -> EncodeResult {
-    escape_str(writer, v.encode_utf8(&mut [0; 4]))
-}
-
-fn spaces(wr: &mut dyn fmt::Write, mut n: usize) -> EncodeResult {
-    const BUF: &str = "                ";
-
-    while n >= BUF.len() {
-        wr.write_str(BUF)?;
-        n -= BUF.len();
-    }
-
-    if n > 0 {
-        wr.write_str(&BUF[..n])?;
-    }
-    Ok(())
-}
-
-fn fmt_number_or_null(v: f64) -> string::String {
-    match v.classify() {
-        Fp::Nan | Fp::Infinite => string::String::from("null"),
-        _ if v.fract() != 0f64 => v.to_string(),
-        _ => v.to_string() + ".0",
-    }
-}
-
-/// A structure for implementing serialization to JSON.
-pub struct Encoder<'a> {
-    writer: &'a mut (dyn fmt::Write + 'a),
-    is_emitting_map_key: bool,
-}
-
-impl<'a> Encoder<'a> {
-    /// Creates a new JSON encoder whose output will be written to the writer
-    /// specified.
-    pub fn new(writer: &'a mut dyn fmt::Write) -> Encoder<'a> {
-        Encoder { writer, is_emitting_map_key: false }
-    }
-}
-
-macro_rules! emit_enquoted_if_mapkey {
-    ($enc:ident,$e:expr) => {{
-        if $enc.is_emitting_map_key {
-            write!($enc.writer, "\"{}\"", $e)?;
-        } else {
-            write!($enc.writer, "{}", $e)?;
-        }
-        Ok(())
-    }};
-}
-
-impl<'a> crate::Encoder for Encoder<'a> {
-    type Error = EncoderError;
-
-    fn emit_unit(&mut self) -> EncodeResult {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        write!(self.writer, "null")?;
-        Ok(())
-    }
-
-    fn emit_usize(&mut self, v: usize) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-    fn emit_u128(&mut self, v: u128) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-    fn emit_u64(&mut self, v: u64) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-    fn emit_u32(&mut self, v: u32) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-    fn emit_u16(&mut self, v: u16) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-    fn emit_u8(&mut self, v: u8) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-
-    fn emit_isize(&mut self, v: isize) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-    fn emit_i128(&mut self, v: i128) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-    fn emit_i64(&mut self, v: i64) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-    fn emit_i32(&mut self, v: i32) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-    fn emit_i16(&mut self, v: i16) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-    fn emit_i8(&mut self, v: i8) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-
-    fn emit_bool(&mut self, v: bool) -> EncodeResult {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        if v {
-            write!(self.writer, "true")?;
-        } else {
-            write!(self.writer, "false")?;
-        }
-        Ok(())
-    }
-
-    fn emit_f64(&mut self, v: f64) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, fmt_number_or_null(v))
-    }
-    fn emit_f32(&mut self, v: f32) -> EncodeResult {
-        self.emit_f64(f64::from(v))
-    }
-
-    fn emit_char(&mut self, v: char) -> EncodeResult {
-        escape_char(self.writer, v)
-    }
-    fn emit_str(&mut self, v: &str) -> EncodeResult {
-        escape_str(self.writer, v)
-    }
-    fn emit_raw_bytes(&mut self, s: &[u8]) -> Result<(), Self::Error> {
-        for &c in s.iter() {
-            self.emit_u8(c)?;
-        }
-        Ok(())
-    }
-
-    fn emit_enum<F>(&mut self, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut Encoder<'a>) -> EncodeResult,
-    {
-        f(self)
-    }
-
-    fn emit_enum_variant<F>(&mut self, name: &str, _id: usize, cnt: usize, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut Encoder<'a>) -> EncodeResult,
-    {
-        // enums are encoded as strings or objects
-        // Bunny => "Bunny"
-        // Kangaroo(34,"William") => {"variant": "Kangaroo", "fields": [34,"William"]}
-        if cnt == 0 {
-            escape_str(self.writer, name)
-        } else {
-            if self.is_emitting_map_key {
-                return Err(EncoderError::BadHashmapKey);
-            }
-            write!(self.writer, "{{\"variant\":")?;
-            escape_str(self.writer, name)?;
-            write!(self.writer, ",\"fields\":[")?;
-            f(self)?;
-            write!(self.writer, "]}}")?;
-            Ok(())
-        }
-    }
-
-    fn emit_fieldless_enum_variant<const ID: usize>(
-        &mut self,
-        name: &str,
-    ) -> Result<(), Self::Error> {
-        escape_str(self.writer, name)
-    }
-
-    fn emit_enum_variant_arg<F>(&mut self, first: bool, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut Encoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        if !first {
-            write!(self.writer, ",")?;
-        }
-        f(self)
-    }
-
-    fn emit_struct<F>(&mut self, _: bool, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut Encoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        write!(self.writer, "{{")?;
-        f(self)?;
-        write!(self.writer, "}}")?;
-        Ok(())
-    }
-
-    fn emit_struct_field<F>(&mut self, name: &str, first: bool, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut Encoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        if !first {
-            write!(self.writer, ",")?;
-        }
-        escape_str(self.writer, name)?;
-        write!(self.writer, ":")?;
-        f(self)
-    }
-
-    fn emit_tuple<F>(&mut self, len: usize, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut Encoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        self.emit_seq(len, f)
-    }
-    fn emit_tuple_arg<F>(&mut self, idx: usize, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut Encoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        self.emit_seq_elt(idx, f)
-    }
-
-    fn emit_option<F>(&mut self, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut Encoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        f(self)
-    }
-    fn emit_option_none(&mut self) -> EncodeResult {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        self.emit_unit()
-    }
-    fn emit_option_some<F>(&mut self, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut Encoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        f(self)
-    }
-
-    fn emit_seq<F>(&mut self, _len: usize, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut Encoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        write!(self.writer, "[")?;
-        f(self)?;
-        write!(self.writer, "]")?;
-        Ok(())
-    }
-
-    fn emit_seq_elt<F>(&mut self, idx: usize, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut Encoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        if idx != 0 {
-            write!(self.writer, ",")?;
-        }
-        f(self)
-    }
-
-    fn emit_map<F>(&mut self, _len: usize, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut Encoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        write!(self.writer, "{{")?;
-        f(self)?;
-        write!(self.writer, "}}")?;
-        Ok(())
-    }
-
-    fn emit_map_elt_key<F>(&mut self, idx: usize, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut Encoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        if idx != 0 {
-            write!(self.writer, ",")?
-        }
-        self.is_emitting_map_key = true;
-        f(self)?;
-        self.is_emitting_map_key = false;
-        Ok(())
-    }
-
-    fn emit_map_elt_val<F>(&mut self, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut Encoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        write!(self.writer, ":")?;
-        f(self)
-    }
-}
-
-/// Another encoder for JSON, but prints out human-readable JSON instead of
-/// compact data
-pub struct PrettyEncoder<'a> {
-    writer: &'a mut (dyn fmt::Write + 'a),
-    curr_indent: usize,
-    indent: usize,
-    is_emitting_map_key: bool,
-}
-
-impl<'a> PrettyEncoder<'a> {
-    /// Creates a new encoder whose output will be written to the specified writer
-    pub fn new(writer: &'a mut dyn fmt::Write) -> PrettyEncoder<'a> {
-        PrettyEncoder { writer, curr_indent: 0, indent: 2, is_emitting_map_key: false }
-    }
-
-    /// Sets the number of spaces to indent for each level.
-    /// This is safe to set during encoding.
-    pub fn set_indent(&mut self, indent: usize) {
-        // self.indent very well could be 0 so we need to use checked division.
-        let level = self.curr_indent.checked_div(self.indent).unwrap_or(0);
-        self.indent = indent;
-        self.curr_indent = level * self.indent;
-    }
-}
-
-impl<'a> crate::Encoder for PrettyEncoder<'a> {
-    type Error = EncoderError;
-
-    fn emit_unit(&mut self) -> EncodeResult {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        write!(self.writer, "null")?;
-        Ok(())
-    }
-
-    fn emit_usize(&mut self, v: usize) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-    fn emit_u128(&mut self, v: u128) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-    fn emit_u64(&mut self, v: u64) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-    fn emit_u32(&mut self, v: u32) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-    fn emit_u16(&mut self, v: u16) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-    fn emit_u8(&mut self, v: u8) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-
-    fn emit_isize(&mut self, v: isize) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-    fn emit_i128(&mut self, v: i128) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-    fn emit_i64(&mut self, v: i64) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-    fn emit_i32(&mut self, v: i32) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-    fn emit_i16(&mut self, v: i16) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-    fn emit_i8(&mut self, v: i8) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, v)
-    }
-
-    fn emit_bool(&mut self, v: bool) -> EncodeResult {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        if v {
-            write!(self.writer, "true")?;
-        } else {
-            write!(self.writer, "false")?;
-        }
-        Ok(())
-    }
-
-    fn emit_f64(&mut self, v: f64) -> EncodeResult {
-        emit_enquoted_if_mapkey!(self, fmt_number_or_null(v))
-    }
-    fn emit_f32(&mut self, v: f32) -> EncodeResult {
-        self.emit_f64(f64::from(v))
-    }
-
-    fn emit_char(&mut self, v: char) -> EncodeResult {
-        escape_char(self.writer, v)
-    }
-    fn emit_str(&mut self, v: &str) -> EncodeResult {
-        escape_str(self.writer, v)
-    }
-    fn emit_raw_bytes(&mut self, s: &[u8]) -> Result<(), Self::Error> {
-        for &c in s.iter() {
-            self.emit_u8(c)?;
-        }
-        Ok(())
-    }
-
-    fn emit_enum<F>(&mut self, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult,
-    {
-        f(self)
-    }
-
-    fn emit_enum_variant<F>(&mut self, name: &str, _id: usize, cnt: usize, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult,
-    {
-        if cnt == 0 {
-            escape_str(self.writer, name)
-        } else {
-            if self.is_emitting_map_key {
-                return Err(EncoderError::BadHashmapKey);
-            }
-            writeln!(self.writer, "{{")?;
-            self.curr_indent += self.indent;
-            spaces(self.writer, self.curr_indent)?;
-            write!(self.writer, "\"variant\": ")?;
-            escape_str(self.writer, name)?;
-            writeln!(self.writer, ",")?;
-            spaces(self.writer, self.curr_indent)?;
-            writeln!(self.writer, "\"fields\": [")?;
-            self.curr_indent += self.indent;
-            f(self)?;
-            self.curr_indent -= self.indent;
-            writeln!(self.writer)?;
-            spaces(self.writer, self.curr_indent)?;
-            self.curr_indent -= self.indent;
-            writeln!(self.writer, "]")?;
-            spaces(self.writer, self.curr_indent)?;
-            write!(self.writer, "}}")?;
-            Ok(())
-        }
-    }
-
-    fn emit_fieldless_enum_variant<const ID: usize>(
-        &mut self,
-        name: &str,
-    ) -> Result<(), Self::Error> {
-        escape_str(self.writer, name)
-    }
-
-    fn emit_enum_variant_arg<F>(&mut self, first: bool, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        if !first {
-            writeln!(self.writer, ",")?;
-        }
-        spaces(self.writer, self.curr_indent)?;
-        f(self)
-    }
-
-    fn emit_struct<F>(&mut self, no_fields: bool, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        if no_fields {
-            write!(self.writer, "{{}}")?;
-        } else {
-            write!(self.writer, "{{")?;
-            self.curr_indent += self.indent;
-            f(self)?;
-            self.curr_indent -= self.indent;
-            writeln!(self.writer)?;
-            spaces(self.writer, self.curr_indent)?;
-            write!(self.writer, "}}")?;
-        }
-        Ok(())
-    }
-
-    fn emit_struct_field<F>(&mut self, name: &str, first: bool, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        if first {
-            writeln!(self.writer)?;
-        } else {
-            writeln!(self.writer, ",")?;
-        }
-        spaces(self.writer, self.curr_indent)?;
-        escape_str(self.writer, name)?;
-        write!(self.writer, ": ")?;
-        f(self)
-    }
-
-    fn emit_tuple<F>(&mut self, len: usize, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        self.emit_seq(len, f)
-    }
-    fn emit_tuple_arg<F>(&mut self, idx: usize, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        self.emit_seq_elt(idx, f)
-    }
-
-    fn emit_option<F>(&mut self, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        f(self)
-    }
-    fn emit_option_none(&mut self) -> EncodeResult {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        self.emit_unit()
-    }
-    fn emit_option_some<F>(&mut self, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        f(self)
-    }
-
-    fn emit_seq<F>(&mut self, len: usize, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        if len == 0 {
-            write!(self.writer, "[]")?;
-        } else {
-            write!(self.writer, "[")?;
-            self.curr_indent += self.indent;
-            f(self)?;
-            self.curr_indent -= self.indent;
-            writeln!(self.writer)?;
-            spaces(self.writer, self.curr_indent)?;
-            write!(self.writer, "]")?;
-        }
-        Ok(())
-    }
-
-    fn emit_seq_elt<F>(&mut self, idx: usize, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        if idx == 0 {
-            writeln!(self.writer)?;
-        } else {
-            writeln!(self.writer, ",")?;
-        }
-        spaces(self.writer, self.curr_indent)?;
-        f(self)
-    }
-
-    fn emit_map<F>(&mut self, len: usize, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        if len == 0 {
-            write!(self.writer, "{{}}")?;
-        } else {
-            write!(self.writer, "{{")?;
-            self.curr_indent += self.indent;
-            f(self)?;
-            self.curr_indent -= self.indent;
-            writeln!(self.writer)?;
-            spaces(self.writer, self.curr_indent)?;
-            write!(self.writer, "}}")?;
-        }
-        Ok(())
-    }
-
-    fn emit_map_elt_key<F>(&mut self, idx: usize, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        if idx == 0 {
-            writeln!(self.writer)?;
-        } else {
-            writeln!(self.writer, ",")?;
-        }
-        spaces(self.writer, self.curr_indent)?;
-        self.is_emitting_map_key = true;
-        f(self)?;
-        self.is_emitting_map_key = false;
-        Ok(())
-    }
-
-    fn emit_map_elt_val<F>(&mut self, f: F) -> EncodeResult
-    where
-        F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult,
-    {
-        if self.is_emitting_map_key {
-            return Err(EncoderError::BadHashmapKey);
-        }
-        write!(self.writer, ": ")?;
-        f(self)
-    }
-}
-
-impl<E: crate::Encoder> Encodable<E> for Json {
-    fn encode(&self, e: &mut E) -> Result<(), E::Error> {
-        match *self {
-            Json::I64(v) => v.encode(e),
-            Json::U64(v) => v.encode(e),
-            Json::F64(v) => v.encode(e),
-            Json::String(ref v) => v.encode(e),
-            Json::Boolean(v) => v.encode(e),
-            Json::Array(ref v) => v.encode(e),
-            Json::Object(ref v) => v.encode(e),
-            Json::Null => e.emit_unit(),
-        }
-    }
-}
-
-/// Creates an `AsJson` wrapper which can be used to print a value as JSON
-/// on-the-fly via `write!`
-pub fn as_json<T>(t: &T) -> AsJson<'_, T> {
-    AsJson { inner: t }
-}
-
-/// Creates an `AsPrettyJson` wrapper which can be used to print a value as JSON
-/// on-the-fly via `write!`
-pub fn as_pretty_json<T>(t: &T) -> AsPrettyJson<'_, T> {
-    AsPrettyJson { inner: t, indent: None }
-}
-
-impl Json {
-    /// Borrow this json object as a pretty object to generate a pretty
-    /// representation for it via `Display`.
-    pub fn pretty(&self) -> PrettyJson<'_> {
-        PrettyJson { inner: self }
-    }
-
-    /// If the Json value is an Object, returns the value associated with the provided key.
-    /// Otherwise, returns None.
-    pub fn find(&self, key: &str) -> Option<&Json> {
-        match *self {
-            Json::Object(ref map) => map.get(key),
-            _ => None,
-        }
-    }
-
-    /// If the Json value is an Object, deletes the value associated with the
-    /// provided key from the Object and returns it. Otherwise, returns None.
-    pub fn remove_key(&mut self, key: &str) -> Option<Json> {
-        match *self {
-            Json::Object(ref mut map) => map.remove(key),
-            _ => None,
-        }
-    }
-
-    /// Attempts to get a nested Json Object for each key in `keys`.
-    /// If any key is found not to exist, `find_path` will return `None`.
-    /// Otherwise, it will return the Json value associated with the final key.
-    pub fn find_path<'a>(&'a self, keys: &[&str]) -> Option<&'a Json> {
-        let mut target = self;
-        for key in keys {
-            target = target.find(*key)?;
-        }
-        Some(target)
-    }
-
-    /// If the Json value is an Object, performs a depth-first search until
-    /// a value associated with the provided key is found. If no value is found
-    /// or the Json value is not an Object, returns `None`.
-    pub fn search(&self, key: &str) -> Option<&Json> {
-        match *self {
-            Json::Object(ref map) => match map.get(key) {
-                Some(json_value) => Some(json_value),
-                None => {
-                    for v in map.values() {
-                        match v.search(key) {
-                            x if x.is_some() => return x,
-                            _ => (),
-                        }
-                    }
-                    None
-                }
-            },
-            _ => None,
-        }
-    }
-
-    /// Returns `true` if the Json value is an `Object`.
-    pub fn is_object(&self) -> bool {
-        self.as_object().is_some()
-    }
-
-    /// If the Json value is an `Object`, returns the associated `BTreeMap`;
-    /// returns `None` otherwise.
-    pub fn as_object(&self) -> Option<&Object> {
-        match *self {
-            Json::Object(ref map) => Some(map),
-            _ => None,
-        }
-    }
-
-    /// Returns `true` if the Json value is an `Array`.
-    pub fn is_array(&self) -> bool {
-        self.as_array().is_some()
-    }
-
-    /// If the Json value is an `Array`, returns the associated vector;
-    /// returns `None` otherwise.
-    pub fn as_array(&self) -> Option<&Array> {
-        match *self {
-            Json::Array(ref array) => Some(&*array),
-            _ => None,
-        }
-    }
-
-    /// Returns `true` if the Json value is a `String`.
-    pub fn is_string(&self) -> bool {
-        self.as_string().is_some()
-    }
-
-    /// If the Json value is a `String`, returns the associated `str`;
-    /// returns `None` otherwise.
-    pub fn as_string(&self) -> Option<&str> {
-        match *self {
-            Json::String(ref s) => Some(&s[..]),
-            _ => None,
-        }
-    }
-
-    /// Returns `true` if the Json value is a `Number`.
-    pub fn is_number(&self) -> bool {
-        matches!(*self, Json::I64(_) | Json::U64(_) | Json::F64(_))
-    }
-
-    /// Returns `true` if the Json value is an `i64`.
-    pub fn is_i64(&self) -> bool {
-        matches!(*self, Json::I64(_))
-    }
-
-    /// Returns `true` if the Json value is a `u64`.
-    pub fn is_u64(&self) -> bool {
-        matches!(*self, Json::U64(_))
-    }
-
-    /// Returns `true` if the Json value is a `f64`.
-    pub fn is_f64(&self) -> bool {
-        matches!(*self, Json::F64(_))
-    }
-
-    /// If the Json value is a number, returns or cast it to an `i64`;
-    /// returns `None` otherwise.
-    pub fn as_i64(&self) -> Option<i64> {
-        match *self {
-            Json::I64(n) => Some(n),
-            Json::U64(n) => Some(n as i64),
-            _ => None,
-        }
-    }
-
-    /// If the Json value is a number, returns or cast it to a `u64`;
-    /// returns `None` otherwise.
-    pub fn as_u64(&self) -> Option<u64> {
-        match *self {
-            Json::I64(n) => Some(n as u64),
-            Json::U64(n) => Some(n),
-            _ => None,
-        }
-    }
-
-    /// If the Json value is a number, returns or cast it to a `f64`;
-    /// returns `None` otherwise.
-    pub fn as_f64(&self) -> Option<f64> {
-        match *self {
-            Json::I64(n) => Some(n as f64),
-            Json::U64(n) => Some(n as f64),
-            Json::F64(n) => Some(n),
-            _ => None,
-        }
-    }
-
-    /// Returns `true` if the Json value is a `Boolean`.
-    pub fn is_boolean(&self) -> bool {
-        self.as_boolean().is_some()
-    }
-
-    /// If the Json value is a `Boolean`, returns the associated `bool`;
-    /// returns `None` otherwise.
-    pub fn as_boolean(&self) -> Option<bool> {
-        match *self {
-            Json::Boolean(b) => Some(b),
-            _ => None,
-        }
-    }
-
-    /// Returns `true` if the Json value is a `Null`.
-    pub fn is_null(&self) -> bool {
-        self.as_null().is_some()
-    }
-
-    /// If the Json value is a `Null`, returns `()`;
-    /// returns `None` otherwise.
-    pub fn as_null(&self) -> Option<()> {
-        match *self {
-            Json::Null => Some(()),
-            _ => None,
-        }
-    }
-}
-
-impl<'a> Index<&'a str> for Json {
-    type Output = Json;
-
-    fn index(&self, idx: &'a str) -> &Json {
-        self.find(idx).unwrap()
-    }
-}
-
-impl Index<usize> for Json {
-    type Output = Json;
-
-    fn index(&self, idx: usize) -> &Json {
-        match *self {
-            Json::Array(ref v) => &v[idx],
-            _ => panic!("can only index Json with usize if it is an array"),
-        }
-    }
-}
-
-/// The output of the streaming parser.
-#[derive(PartialEq, Clone, Debug)]
-pub enum JsonEvent {
-    ObjectStart,
-    ObjectEnd,
-    ArrayStart,
-    ArrayEnd,
-    BooleanValue(bool),
-    I64Value(i64),
-    U64Value(u64),
-    F64Value(f64),
-    StringValue(string::String),
-    NullValue,
-    Error(ParserError),
-}
-
-#[derive(PartialEq, Debug)]
-enum ParserState {
-    // Parse a value in an array, true means first element.
-    ParseArray(bool),
-    // Parse ',' or ']' after an element in an array.
-    ParseArrayComma,
-    // Parse a key:value in an object, true means first element.
-    ParseObject(bool),
-    // Parse ',' or ']' after an element in an object.
-    ParseObjectComma,
-    // Initial state.
-    ParseStart,
-    // Expecting the stream to end.
-    ParseBeforeFinish,
-    // Parsing can't continue.
-    ParseFinished,
-}
-
-/// A Stack represents the current position of the parser in the logical
-/// structure of the JSON stream.
-///
-/// An example is `foo.bar[3].x`.
-#[derive(Default)]
-pub struct Stack {
-    stack: Vec<InternalStackElement>,
-    str_buffer: Vec<u8>,
-}
-
-/// StackElements compose a Stack.
-///
-/// As an example, `StackElement::Key("foo")`, `StackElement::Key("bar")`,
-/// `StackElement::Index(3)`, and `StackElement::Key("x")` are the
-/// StackElements composing the stack that represents `foo.bar[3].x`.
-#[derive(PartialEq, Clone, Debug)]
-pub enum StackElement<'l> {
-    Index(u32),
-    Key(&'l str),
-}
-
-// Internally, Key elements are stored as indices in a buffer to avoid
-// allocating a string for every member of an object.
-#[derive(PartialEq, Clone, Debug)]
-enum InternalStackElement {
-    InternalIndex(u32),
-    InternalKey(u16, u16), // start, size
-}
-
-impl Stack {
-    pub fn new() -> Stack {
-        Self::default()
-    }
-
-    /// Returns The number of elements in the Stack.
-    pub fn len(&self) -> usize {
-        self.stack.len()
-    }
-
-    /// Returns `true` if the stack is empty.
-    pub fn is_empty(&self) -> bool {
-        self.stack.is_empty()
-    }
-
-    /// Provides access to the StackElement at a given index.
-    /// lower indices are at the bottom of the stack while higher indices are
-    /// at the top.
-    pub fn get(&self, idx: usize) -> StackElement<'_> {
-        match self.stack[idx] {
-            InternalIndex(i) => StackElement::Index(i),
-            InternalKey(start, size) => StackElement::Key(
-                str::from_utf8(&self.str_buffer[start as usize..start as usize + size as usize])
-                    .unwrap(),
-            ),
-        }
-    }
-
-    /// Compares this stack with an array of StackElement<'_>s.
-    pub fn is_equal_to(&self, rhs: &[StackElement<'_>]) -> bool {
-        if self.stack.len() != rhs.len() {
-            return false;
-        }
-        for (i, r) in rhs.iter().enumerate() {
-            if self.get(i) != *r {
-                return false;
-            }
-        }
-        true
-    }
-
-    /// Returns `true` if the bottom-most elements of this stack are the same as
-    /// the ones passed as parameter.
-    pub fn starts_with(&self, rhs: &[StackElement<'_>]) -> bool {
-        if self.stack.len() < rhs.len() {
-            return false;
-        }
-        for (i, r) in rhs.iter().enumerate() {
-            if self.get(i) != *r {
-                return false;
-            }
-        }
-        true
-    }
-
-    /// Returns `true` if the top-most elements of this stack are the same as
-    /// the ones passed as parameter.
-    pub fn ends_with(&self, rhs: &[StackElement<'_>]) -> bool {
-        if self.stack.len() < rhs.len() {
-            return false;
-        }
-        let offset = self.stack.len() - rhs.len();
-        for (i, r) in rhs.iter().enumerate() {
-            if self.get(i + offset) != *r {
-                return false;
-            }
-        }
-        true
-    }
-
-    /// Returns the top-most element (if any).
-    pub fn top(&self) -> Option<StackElement<'_>> {
-        match self.stack.last() {
-            None => None,
-            Some(&InternalIndex(i)) => Some(StackElement::Index(i)),
-            Some(&InternalKey(start, size)) => Some(StackElement::Key(
-                str::from_utf8(&self.str_buffer[start as usize..(start + size) as usize]).unwrap(),
-            )),
-        }
-    }
-
-    // Used by Parser to insert StackElement::Key elements at the top of the stack.
-    fn push_key(&mut self, key: string::String) {
-        self.stack.push(InternalKey(self.str_buffer.len() as u16, key.len() as u16));
-        self.str_buffer.extend(key.as_bytes());
-    }
-
-    // Used by Parser to insert StackElement::Index elements at the top of the stack.
-    fn push_index(&mut self, index: u32) {
-        self.stack.push(InternalIndex(index));
-    }
-
-    // Used by Parser to remove the top-most element of the stack.
-    fn pop(&mut self) {
-        assert!(!self.is_empty());
-        match *self.stack.last().unwrap() {
-            InternalKey(_, sz) => {
-                let new_size = self.str_buffer.len() - sz as usize;
-                self.str_buffer.truncate(new_size);
-            }
-            InternalIndex(_) => {}
-        }
-        self.stack.pop();
-    }
-
-    // Used by Parser to test whether the top-most element is an index.
-    fn last_is_index(&self) -> bool {
-        matches!(self.stack.last(), Some(InternalIndex(_)))
-    }
-
-    // Used by Parser to increment the index of the top-most element.
-    fn bump_index(&mut self) {
-        let len = self.stack.len();
-        let idx = match *self.stack.last().unwrap() {
-            InternalIndex(i) => i + 1,
-            _ => {
-                panic!();
-            }
-        };
-        self.stack[len - 1] = InternalIndex(idx);
-    }
-}
-
-/// A streaming JSON parser implemented as an iterator of JsonEvent, consuming
-/// an iterator of char.
-pub struct Parser<T> {
-    rdr: T,
-    ch: Option<char>,
-    line: usize,
-    col: usize,
-    // We maintain a stack representing where we are in the logical structure
-    // of the JSON stream.
-    stack: Stack,
-    // A state machine is kept to make it possible to interrupt and resume parsing.
-    state: ParserState,
-}
-
-impl<T: Iterator<Item = char>> Iterator for Parser<T> {
-    type Item = JsonEvent;
-
-    fn next(&mut self) -> Option<JsonEvent> {
-        if self.state == ParseFinished {
-            return None;
-        }
-
-        if self.state == ParseBeforeFinish {
-            self.parse_whitespace();
-            // Make sure there is no trailing characters.
-            if self.eof() {
-                self.state = ParseFinished;
-                return None;
-            } else {
-                return Some(self.error_event(TrailingCharacters));
-            }
-        }
-
-        Some(self.parse())
-    }
-}
-
-impl<T: Iterator<Item = char>> Parser<T> {
-    /// Creates the JSON parser.
-    pub fn new(rdr: T) -> Parser<T> {
-        let mut p = Parser {
-            rdr,
-            ch: Some('\x00'),
-            line: 1,
-            col: 0,
-            stack: Stack::new(),
-            state: ParseStart,
-        };
-        p.bump();
-        p
-    }
-
-    /// Provides access to the current position in the logical structure of the
-    /// JSON stream.
-    pub fn stack(&self) -> &Stack {
-        &self.stack
-    }
-
-    fn eof(&self) -> bool {
-        self.ch.is_none()
-    }
-    fn ch_or_null(&self) -> char {
-        self.ch.unwrap_or('\x00')
-    }
-    fn bump(&mut self) {
-        self.ch = self.rdr.next();
-
-        if self.ch_is('\n') {
-            self.line += 1;
-            self.col = 1;
-        } else {
-            self.col += 1;
-        }
-    }
-
-    fn next_char(&mut self) -> Option<char> {
-        self.bump();
-        self.ch
-    }
-    fn ch_is(&self, c: char) -> bool {
-        self.ch == Some(c)
-    }
-
-    fn error<U>(&self, reason: ErrorCode) -> Result<U, ParserError> {
-        Err(SyntaxError(reason, self.line, self.col))
-    }
-
-    fn parse_whitespace(&mut self) {
-        while self.ch_is(' ') || self.ch_is('\n') || self.ch_is('\t') || self.ch_is('\r') {
-            self.bump();
-        }
-    }
-
-    fn parse_number(&mut self) -> JsonEvent {
-        let neg = if self.ch_is('-') {
-            self.bump();
-            true
-        } else {
-            false
-        };
-
-        let res = match self.parse_u64() {
-            Ok(res) => res,
-            Err(e) => {
-                return Error(e);
-            }
-        };
-
-        if self.ch_is('.') || self.ch_is('e') || self.ch_is('E') {
-            let mut res = res as f64;
-
-            if self.ch_is('.') {
-                res = match self.parse_decimal(res) {
-                    Ok(res) => res,
-                    Err(e) => {
-                        return Error(e);
-                    }
-                };
-            }
-
-            if self.ch_is('e') || self.ch_is('E') {
-                res = match self.parse_exponent(res) {
-                    Ok(res) => res,
-                    Err(e) => {
-                        return Error(e);
-                    }
-                };
-            }
-
-            if neg {
-                res *= -1.0;
-            }
-
-            F64Value(res)
-        } else if neg {
-            let res = (res as i64).wrapping_neg();
-
-            // Make sure we didn't underflow.
-            if res > 0 {
-                Error(SyntaxError(InvalidNumber, self.line, self.col))
-            } else {
-                I64Value(res)
-            }
-        } else {
-            U64Value(res)
-        }
-    }
-
-    fn parse_u64(&mut self) -> Result<u64, ParserError> {
-        let mut accum = 0u64;
-        let last_accum = 0; // necessary to detect overflow.
-
-        match self.ch_or_null() {
-            '0' => {
-                self.bump();
-
-                // A leading '0' must be the only digit before the decimal point.
-                if let '0'..='9' = self.ch_or_null() {
-                    return self.error(InvalidNumber);
-                }
-            }
-            '1'..='9' => {
-                while !self.eof() {
-                    match self.ch_or_null() {
-                        c @ '0'..='9' => {
-                            accum = accum.wrapping_mul(10);
-                            accum = accum.wrapping_add((c as u64) - ('0' as u64));
-
-                            // Detect overflow by comparing to the last value.
-                            if accum <= last_accum {
-                                return self.error(InvalidNumber);
-                            }
-
-                            self.bump();
-                        }
-                        _ => break,
-                    }
-                }
-            }
-            _ => return self.error(InvalidNumber),
-        }
-
-        Ok(accum)
-    }
-
-    fn parse_decimal(&mut self, mut res: f64) -> Result<f64, ParserError> {
-        self.bump();
-
-        // Make sure a digit follows the decimal place.
-        match self.ch_or_null() {
-            '0'..='9' => (),
-            _ => return self.error(InvalidNumber),
-        }
-
-        let mut dec = 1.0;
-        while !self.eof() {
-            match self.ch_or_null() {
-                c @ '0'..='9' => {
-                    dec /= 10.0;
-                    res += (((c as isize) - ('0' as isize)) as f64) * dec;
-                    self.bump();
-                }
-                _ => break,
-            }
-        }
-
-        Ok(res)
-    }
-
-    fn parse_exponent(&mut self, mut res: f64) -> Result<f64, ParserError> {
-        self.bump();
-
-        let mut exp = 0;
-        let mut neg_exp = false;
-
-        if self.ch_is('+') {
-            self.bump();
-        } else if self.ch_is('-') {
-            self.bump();
-            neg_exp = true;
-        }
-
-        // Make sure a digit follows the exponent place.
-        match self.ch_or_null() {
-            '0'..='9' => (),
-            _ => return self.error(InvalidNumber),
-        }
-        while !self.eof() {
-            match self.ch_or_null() {
-                c @ '0'..='9' => {
-                    exp *= 10;
-                    exp += (c as usize) - ('0' as usize);
-
-                    self.bump();
-                }
-                _ => break,
-            }
-        }
-
-        let exp = 10_f64.powi(exp as i32);
-        if neg_exp {
-            res /= exp;
-        } else {
-            res *= exp;
-        }
-
-        Ok(res)
-    }
-
-    fn decode_hex_escape(&mut self) -> Result<u16, ParserError> {
-        let mut i = 0;
-        let mut n = 0;
-        while i < 4 && !self.eof() {
-            self.bump();
-            n = match self.ch_or_null() {
-                c @ '0'..='9' => n * 16 + ((c as u16) - ('0' as u16)),
-                'a' | 'A' => n * 16 + 10,
-                'b' | 'B' => n * 16 + 11,
-                'c' | 'C' => n * 16 + 12,
-                'd' | 'D' => n * 16 + 13,
-                'e' | 'E' => n * 16 + 14,
-                'f' | 'F' => n * 16 + 15,
-                _ => return self.error(InvalidEscape),
-            };
-
-            i += 1;
-        }
-
-        // Error out if we didn't parse 4 digits.
-        if i != 4 {
-            return self.error(InvalidEscape);
-        }
-
-        Ok(n)
-    }
-
-    fn parse_str(&mut self) -> Result<string::String, ParserError> {
-        let mut escape = false;
-        let mut res = string::String::new();
-
-        loop {
-            self.bump();
-            if self.eof() {
-                return self.error(EOFWhileParsingString);
-            }
-
-            if escape {
-                match self.ch_or_null() {
-                    '"' => res.push('"'),
-                    '\\' => res.push('\\'),
-                    '/' => res.push('/'),
-                    'b' => res.push('\x08'),
-                    'f' => res.push('\x0c'),
-                    'n' => res.push('\n'),
-                    'r' => res.push('\r'),
-                    't' => res.push('\t'),
-                    'u' => match self.decode_hex_escape()? {
-                        0xDC00..=0xDFFF => return self.error(LoneLeadingSurrogateInHexEscape),
-
-                        // Non-BMP characters are encoded as a sequence of
-                        // two hex escapes, representing UTF-16 surrogates.
-                        n1 @ 0xD800..=0xDBFF => {
-                            match (self.next_char(), self.next_char()) {
-                                (Some('\\'), Some('u')) => (),
-                                _ => return self.error(UnexpectedEndOfHexEscape),
-                            }
-
-                            let n2 = self.decode_hex_escape()?;
-                            if !(0xDC00..=0xDFFF).contains(&n2) {
-                                return self.error(LoneLeadingSurrogateInHexEscape);
-                            }
-                            let c =
-                                (u32::from(n1 - 0xD800) << 10 | u32::from(n2 - 0xDC00)) + 0x1_0000;
-                            res.push(char::from_u32(c).unwrap());
-                        }
-
-                        n => match char::from_u32(u32::from(n)) {
-                            Some(c) => res.push(c),
-                            None => return self.error(InvalidUnicodeCodePoint),
-                        },
-                    },
-                    _ => return self.error(InvalidEscape),
-                }
-                escape = false;
-            } else if self.ch_is('\\') {
-                escape = true;
-            } else {
-                match self.ch {
-                    Some('"') => {
-                        self.bump();
-                        return Ok(res);
-                    }
-                    Some(c) => res.push(c),
-                    None => unreachable!(),
-                }
-            }
-        }
-    }
-
-    // Invoked at each iteration, consumes the stream until it has enough
-    // information to return a JsonEvent.
-    // Manages an internal state so that parsing can be interrupted and resumed.
-    // Also keeps track of the position in the logical structure of the json
-    // stream isize the form of a stack that can be queried by the user using the
-    // stack() method.
-    fn parse(&mut self) -> JsonEvent {
-        loop {
-            // The only paths where the loop can spin a new iteration
-            // are in the cases ParseArrayComma and ParseObjectComma if ','
-            // is parsed. In these cases the state is set to (respectively)
-            // ParseArray(false) and ParseObject(false), which always return,
-            // so there is no risk of getting stuck in an infinite loop.
-            // All other paths return before the end of the loop's iteration.
-            self.parse_whitespace();
-
-            match self.state {
-                ParseStart => {
-                    return self.parse_start();
-                }
-                ParseArray(first) => {
-                    return self.parse_array(first);
-                }
-                ParseArrayComma => {
-                    if let Some(evt) = self.parse_array_comma_or_end() {
-                        return evt;
-                    }
-                }
-                ParseObject(first) => {
-                    return self.parse_object(first);
-                }
-                ParseObjectComma => {
-                    self.stack.pop();
-                    if self.ch_is(',') {
-                        self.state = ParseObject(false);
-                        self.bump();
-                    } else {
-                        return self.parse_object_end();
-                    }
-                }
-                _ => {
-                    return self.error_event(InvalidSyntax);
-                }
-            }
-        }
-    }
-
-    fn parse_start(&mut self) -> JsonEvent {
-        let val = self.parse_value();
-        self.state = match val {
-            Error(_) => ParseFinished,
-            ArrayStart => ParseArray(true),
-            ObjectStart => ParseObject(true),
-            _ => ParseBeforeFinish,
-        };
-        val
-    }
-
-    fn parse_array(&mut self, first: bool) -> JsonEvent {
-        if self.ch_is(']') {
-            if !first {
-                self.error_event(InvalidSyntax)
-            } else {
-                self.state = if self.stack.is_empty() {
-                    ParseBeforeFinish
-                } else if self.stack.last_is_index() {
-                    ParseArrayComma
-                } else {
-                    ParseObjectComma
-                };
-                self.bump();
-                ArrayEnd
-            }
-        } else {
-            if first {
-                self.stack.push_index(0);
-            }
-            let val = self.parse_value();
-            self.state = match val {
-                Error(_) => ParseFinished,
-                ArrayStart => ParseArray(true),
-                ObjectStart => ParseObject(true),
-                _ => ParseArrayComma,
-            };
-            val
-        }
-    }
-
-    fn parse_array_comma_or_end(&mut self) -> Option<JsonEvent> {
-        if self.ch_is(',') {
-            self.stack.bump_index();
-            self.state = ParseArray(false);
-            self.bump();
-            None
-        } else if self.ch_is(']') {
-            self.stack.pop();
-            self.state = if self.stack.is_empty() {
-                ParseBeforeFinish
-            } else if self.stack.last_is_index() {
-                ParseArrayComma
-            } else {
-                ParseObjectComma
-            };
-            self.bump();
-            Some(ArrayEnd)
-        } else if self.eof() {
-            Some(self.error_event(EOFWhileParsingArray))
-        } else {
-            Some(self.error_event(InvalidSyntax))
-        }
-    }
-
-    fn parse_object(&mut self, first: bool) -> JsonEvent {
-        if self.ch_is('}') {
-            if !first {
-                if self.stack.is_empty() {
-                    return self.error_event(TrailingComma);
-                } else {
-                    self.stack.pop();
-                }
-            }
-            self.state = if self.stack.is_empty() {
-                ParseBeforeFinish
-            } else if self.stack.last_is_index() {
-                ParseArrayComma
-            } else {
-                ParseObjectComma
-            };
-            self.bump();
-            return ObjectEnd;
-        }
-        if self.eof() {
-            return self.error_event(EOFWhileParsingObject);
-        }
-        if !self.ch_is('"') {
-            return self.error_event(KeyMustBeAString);
-        }
-        let s = match self.parse_str() {
-            Ok(s) => s,
-            Err(e) => {
-                self.state = ParseFinished;
-                return Error(e);
-            }
-        };
-        self.parse_whitespace();
-        if self.eof() {
-            return self.error_event(EOFWhileParsingObject);
-        } else if self.ch_or_null() != ':' {
-            return self.error_event(ExpectedColon);
-        }
-        self.stack.push_key(s);
-        self.bump();
-        self.parse_whitespace();
-
-        let val = self.parse_value();
-
-        self.state = match val {
-            Error(_) => ParseFinished,
-            ArrayStart => ParseArray(true),
-            ObjectStart => ParseObject(true),
-            _ => ParseObjectComma,
-        };
-        val
-    }
-
-    fn parse_object_end(&mut self) -> JsonEvent {
-        if self.ch_is('}') {
-            self.state = if self.stack.is_empty() {
-                ParseBeforeFinish
-            } else if self.stack.last_is_index() {
-                ParseArrayComma
-            } else {
-                ParseObjectComma
-            };
-            self.bump();
-            ObjectEnd
-        } else if self.eof() {
-            self.error_event(EOFWhileParsingObject)
-        } else {
-            self.error_event(InvalidSyntax)
-        }
-    }
-
-    fn parse_value(&mut self) -> JsonEvent {
-        if self.eof() {
-            return self.error_event(EOFWhileParsingValue);
-        }
-        match self.ch_or_null() {
-            'n' => self.parse_ident("ull", NullValue),
-            't' => self.parse_ident("rue", BooleanValue(true)),
-            'f' => self.parse_ident("alse", BooleanValue(false)),
-            '0'..='9' | '-' => self.parse_number(),
-            '"' => match self.parse_str() {
-                Ok(s) => StringValue(s),
-                Err(e) => Error(e),
-            },
-            '[' => {
-                self.bump();
-                ArrayStart
-            }
-            '{' => {
-                self.bump();
-                ObjectStart
-            }
-            _ => self.error_event(InvalidSyntax),
-        }
-    }
-
-    fn parse_ident(&mut self, ident: &str, value: JsonEvent) -> JsonEvent {
-        if ident.chars().all(|c| Some(c) == self.next_char()) {
-            self.bump();
-            value
-        } else {
-            Error(SyntaxError(InvalidSyntax, self.line, self.col))
-        }
-    }
-
-    fn error_event(&mut self, reason: ErrorCode) -> JsonEvent {
-        self.state = ParseFinished;
-        Error(SyntaxError(reason, self.line, self.col))
-    }
-}
-
-/// A Builder consumes a json::Parser to create a generic Json structure.
-pub struct Builder<T> {
-    parser: Parser<T>,
-    token: Option<JsonEvent>,
-}
-
-impl<T: Iterator<Item = char>> Builder<T> {
-    /// Creates a JSON Builder.
-    pub fn new(src: T) -> Builder<T> {
-        Builder { parser: Parser::new(src), token: None }
-    }
-
-    // Decode a Json value from a Parser.
-    pub fn build(&mut self) -> Result<Json, BuilderError> {
-        self.bump();
-        let result = self.build_value();
-        self.bump();
-        match self.token {
-            None => {}
-            Some(Error(ref e)) => {
-                return Err(e.clone());
-            }
-            ref tok => {
-                panic!("unexpected token {:?}", tok.clone());
-            }
-        }
-        result
-    }
-
-    fn bump(&mut self) {
-        self.token = self.parser.next();
-    }
-
-    fn build_value(&mut self) -> Result<Json, BuilderError> {
-        match self.token {
-            Some(NullValue) => Ok(Json::Null),
-            Some(I64Value(n)) => Ok(Json::I64(n)),
-            Some(U64Value(n)) => Ok(Json::U64(n)),
-            Some(F64Value(n)) => Ok(Json::F64(n)),
-            Some(BooleanValue(b)) => Ok(Json::Boolean(b)),
-            Some(StringValue(ref mut s)) => {
-                let mut temp = string::String::new();
-                swap(s, &mut temp);
-                Ok(Json::String(temp))
-            }
-            Some(Error(ref e)) => Err(e.clone()),
-            Some(ArrayStart) => self.build_array(),
-            Some(ObjectStart) => self.build_object(),
-            Some(ObjectEnd) => self.parser.error(InvalidSyntax),
-            Some(ArrayEnd) => self.parser.error(InvalidSyntax),
-            None => self.parser.error(EOFWhileParsingValue),
-        }
-    }
-
-    fn build_array(&mut self) -> Result<Json, BuilderError> {
-        self.bump();
-        let mut values = Vec::new();
-
-        loop {
-            if self.token == Some(ArrayEnd) {
-                return Ok(Json::Array(values.into_iter().collect()));
-            }
-            match self.build_value() {
-                Ok(v) => values.push(v),
-                Err(e) => return Err(e),
-            }
-            self.bump();
-        }
-    }
-
-    fn build_object(&mut self) -> Result<Json, BuilderError> {
-        self.bump();
-
-        let mut values = BTreeMap::new();
-
-        loop {
-            match self.token {
-                Some(ObjectEnd) => {
-                    return Ok(Json::Object(values));
-                }
-                Some(Error(ref e)) => {
-                    return Err(e.clone());
-                }
-                None => {
-                    break;
-                }
-                _ => {}
-            }
-            let key = match self.parser.stack().top() {
-                Some(StackElement::Key(k)) => k.to_owned(),
-                _ => {
-                    panic!("invalid state");
-                }
-            };
-            match self.build_value() {
-                Ok(value) => {
-                    values.insert(key, value);
-                }
-                Err(e) => {
-                    return Err(e);
-                }
-            }
-            self.bump();
-        }
-        self.parser.error(EOFWhileParsingObject)
-    }
-}
-
-/// Decodes a json value from a string
-pub fn from_str(s: &str) -> Result<Json, BuilderError> {
-    let mut builder = Builder::new(s.chars());
-    builder.build()
-}
-
-/// A trait for converting values to JSON
-pub trait ToJson {
-    /// Converts the value of `self` to an instance of JSON
-    fn to_json(&self) -> Json;
-}
-
-macro_rules! to_json_impl_i64 {
-    ($($t:ty), +) => (
-        $(impl ToJson for $t {
-            fn to_json(&self) -> Json {
-                Json::I64(*self as i64)
-            }
-        })+
-    )
-}
-
-to_json_impl_i64! { isize, i8, i16, i32, i64 }
-
-macro_rules! to_json_impl_u64 {
-    ($($t:ty), +) => (
-        $(impl ToJson for $t {
-            fn to_json(&self) -> Json {
-                Json::U64(*self as u64)
-            }
-        })+
-    )
-}
-
-to_json_impl_u64! { usize, u8, u16, u32, u64 }
-
-impl ToJson for Json {
-    fn to_json(&self) -> Json {
-        self.clone()
-    }
-}
-
-impl ToJson for f32 {
-    fn to_json(&self) -> Json {
-        f64::from(*self).to_json()
-    }
-}
-
-impl ToJson for f64 {
-    fn to_json(&self) -> Json {
-        match self.classify() {
-            Fp::Nan | Fp::Infinite => Json::Null,
-            _ => Json::F64(*self),
-        }
-    }
-}
-
-impl ToJson for () {
-    fn to_json(&self) -> Json {
-        Json::Null
-    }
-}
-
-impl ToJson for bool {
-    fn to_json(&self) -> Json {
-        Json::Boolean(*self)
-    }
-}
-
-impl ToJson for str {
-    fn to_json(&self) -> Json {
-        Json::String(self.to_string())
-    }
-}
-
-impl ToJson for string::String {
-    fn to_json(&self) -> Json {
-        Json::String((*self).clone())
-    }
-}
-
-impl<'a> ToJson for Cow<'a, str> {
-    fn to_json(&self) -> Json {
-        Json::String(self.to_string())
-    }
-}
-
-macro_rules! tuple_impl {
-    // use variables to indicate the arity of the tuple
-    ($($tyvar:ident),* ) => {
-        // the trailing commas are for the 1 tuple
-        impl<
-            $( $tyvar : ToJson ),*
-            > ToJson for ( $( $tyvar ),* , ) {
-
-            #[inline]
-            #[allow(non_snake_case)]
-            fn to_json(&self) -> Json {
-                match *self {
-                    ($(ref $tyvar),*,) => Json::Array(vec![$($tyvar.to_json()),*])
-                }
-            }
-        }
-    }
-}
-
-tuple_impl! {A}
-tuple_impl! {A, B}
-tuple_impl! {A, B, C}
-tuple_impl! {A, B, C, D}
-tuple_impl! {A, B, C, D, E}
-tuple_impl! {A, B, C, D, E, F}
-tuple_impl! {A, B, C, D, E, F, G}
-tuple_impl! {A, B, C, D, E, F, G, H}
-tuple_impl! {A, B, C, D, E, F, G, H, I}
-tuple_impl! {A, B, C, D, E, F, G, H, I, J}
-tuple_impl! {A, B, C, D, E, F, G, H, I, J, K}
-tuple_impl! {A, B, C, D, E, F, G, H, I, J, K, L}
-
-impl<A: ToJson> ToJson for [A] {
-    fn to_json(&self) -> Json {
-        Json::Array(self.iter().map(|elt| elt.to_json()).collect())
-    }
-}
-
-impl<A: ToJson> ToJson for Vec<A> {
-    fn to_json(&self) -> Json {
-        Json::Array(self.iter().map(|elt| elt.to_json()).collect())
-    }
-}
-
-impl<'a, A: ToJson> ToJson for Cow<'a, [A]>
-where
-    [A]: ToOwned,
-{
-    fn to_json(&self) -> Json {
-        Json::Array(self.iter().map(|elt| elt.to_json()).collect())
-    }
-}
-
-impl<T: ToString, A: ToJson> ToJson for BTreeMap<T, A> {
-    fn to_json(&self) -> Json {
-        let mut d = BTreeMap::new();
-        for (key, value) in self {
-            d.insert(key.to_string(), value.to_json());
-        }
-        Json::Object(d)
-    }
-}
-
-impl<A: ToJson> ToJson for HashMap<string::String, A> {
-    fn to_json(&self) -> Json {
-        let mut d = BTreeMap::new();
-        for (key, value) in self {
-            d.insert((*key).clone(), value.to_json());
-        }
-        Json::Object(d)
-    }
-}
-
-impl<A: ToJson> ToJson for Option<A> {
-    fn to_json(&self) -> Json {
-        match *self {
-            None => Json::Null,
-            Some(ref value) => value.to_json(),
-        }
-    }
-}
-
-struct FormatShim<'a, 'b> {
-    inner: &'a mut fmt::Formatter<'b>,
-}
-
-impl<'a, 'b> fmt::Write for FormatShim<'a, 'b> {
-    fn write_str(&mut self, s: &str) -> fmt::Result {
-        match self.inner.write_str(s) {
-            Ok(_) => Ok(()),
-            Err(_) => Err(fmt::Error),
-        }
-    }
-}
-
-impl fmt::Display for Json {
-    /// Encodes a json value into a string
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        let mut shim = FormatShim { inner: f };
-        let mut encoder = Encoder::new(&mut shim);
-        match self.encode(&mut encoder) {
-            Ok(_) => Ok(()),
-            Err(_) => Err(fmt::Error),
-        }
-    }
-}
-
-impl<'a> fmt::Display for PrettyJson<'a> {
-    /// Encodes a json value into a string
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        let mut shim = FormatShim { inner: f };
-        let mut encoder = PrettyEncoder::new(&mut shim);
-        match self.inner.encode(&mut encoder) {
-            Ok(_) => Ok(()),
-            Err(_) => Err(fmt::Error),
-        }
-    }
-}
-
-impl<'a, T: for<'r> Encodable<Encoder<'r>>> fmt::Display for AsJson<'a, T> {
-    /// Encodes a json value into a string
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        let mut shim = FormatShim { inner: f };
-        let mut encoder = Encoder::new(&mut shim);
-        match self.inner.encode(&mut encoder) {
-            Ok(_) => Ok(()),
-            Err(_) => Err(fmt::Error),
-        }
-    }
-}
-
-impl<'a, T> AsPrettyJson<'a, T> {
-    /// Sets the indentation level for the emitted JSON
-    pub fn indent(mut self, indent: usize) -> AsPrettyJson<'a, T> {
-        self.indent = Some(indent);
-        self
-    }
-}
-
-impl<'a, T: for<'x> Encodable<PrettyEncoder<'x>>> fmt::Display for AsPrettyJson<'a, T> {
-    /// Encodes a json value into a string
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        let mut shim = FormatShim { inner: f };
-        let mut encoder = PrettyEncoder::new(&mut shim);
-        if let Some(n) = self.indent {
-            encoder.set_indent(n);
-        }
-        match self.inner.encode(&mut encoder) {
-            Ok(_) => Ok(()),
-            Err(_) => Err(fmt::Error),
-        }
-    }
-}
-
-impl FromStr for Json {
-    type Err = BuilderError;
-    fn from_str(s: &str) -> Result<Json, BuilderError> {
-        from_str(s)
-    }
-}
-
-#[cfg(test)]
-mod tests;
diff --git a/compiler/rustc_serialize/src/json/tests.rs b/compiler/rustc_serialize/src/json/tests.rs
deleted file mode 100644
index 01678fbf0b7..00000000000
--- a/compiler/rustc_serialize/src/json/tests.rs
+++ /dev/null
@@ -1,147 +0,0 @@
-// Benchmarks and tests that require private items
-
-extern crate test;
-use super::{from_str, Parser, Stack, StackElement};
-use std::string;
-use test::Bencher;
-
-#[test]
-fn test_stack() {
-    let mut stack = Stack::new();
-
-    assert!(stack.is_empty());
-    assert!(stack.is_empty());
-    assert!(!stack.last_is_index());
-
-    stack.push_index(0);
-    stack.bump_index();
-
-    assert!(stack.len() == 1);
-    assert!(stack.is_equal_to(&[StackElement::Index(1)]));
-    assert!(stack.starts_with(&[StackElement::Index(1)]));
-    assert!(stack.ends_with(&[StackElement::Index(1)]));
-    assert!(stack.last_is_index());
-    assert!(stack.get(0) == StackElement::Index(1));
-
-    stack.push_key("foo".to_string());
-
-    assert!(stack.len() == 2);
-    assert!(stack.is_equal_to(&[StackElement::Index(1), StackElement::Key("foo")]));
-    assert!(stack.starts_with(&[StackElement::Index(1), StackElement::Key("foo")]));
-    assert!(stack.starts_with(&[StackElement::Index(1)]));
-    assert!(stack.ends_with(&[StackElement::Index(1), StackElement::Key("foo")]));
-    assert!(stack.ends_with(&[StackElement::Key("foo")]));
-    assert!(!stack.last_is_index());
-    assert!(stack.get(0) == StackElement::Index(1));
-    assert!(stack.get(1) == StackElement::Key("foo"));
-
-    stack.push_key("bar".to_string());
-
-    assert!(stack.len() == 3);
-    assert!(stack.is_equal_to(&[
-        StackElement::Index(1),
-        StackElement::Key("foo"),
-        StackElement::Key("bar")
-    ]));
-    assert!(stack.starts_with(&[StackElement::Index(1)]));
-    assert!(stack.starts_with(&[StackElement::Index(1), StackElement::Key("foo")]));
-    assert!(stack.starts_with(&[
-        StackElement::Index(1),
-        StackElement::Key("foo"),
-        StackElement::Key("bar")
-    ]));
-    assert!(stack.ends_with(&[StackElement::Key("bar")]));
-    assert!(stack.ends_with(&[StackElement::Key("foo"), StackElement::Key("bar")]));
-    assert!(stack.ends_with(&[
-        StackElement::Index(1),
-        StackElement::Key("foo"),
-        StackElement::Key("bar")
-    ]));
-    assert!(!stack.last_is_index());
-    assert!(stack.get(0) == StackElement::Index(1));
-    assert!(stack.get(1) == StackElement::Key("foo"));
-    assert!(stack.get(2) == StackElement::Key("bar"));
-
-    stack.pop();
-
-    assert!(stack.len() == 2);
-    assert!(stack.is_equal_to(&[StackElement::Index(1), StackElement::Key("foo")]));
-    assert!(stack.starts_with(&[StackElement::Index(1), StackElement::Key("foo")]));
-    assert!(stack.starts_with(&[StackElement::Index(1)]));
-    assert!(stack.ends_with(&[StackElement::Index(1), StackElement::Key("foo")]));
-    assert!(stack.ends_with(&[StackElement::Key("foo")]));
-    assert!(!stack.last_is_index());
-    assert!(stack.get(0) == StackElement::Index(1));
-    assert!(stack.get(1) == StackElement::Key("foo"));
-}
-
-#[bench]
-fn bench_streaming_small(b: &mut Bencher) {
-    b.iter(|| {
-        let mut parser = Parser::new(
-            r#"{
-                "a": 1.0,
-                "b": [
-                    true,
-                    "foo\nbar",
-                    { "c": {"d": null} }
-                ]
-            }"#
-            .chars(),
-        );
-        loop {
-            match parser.next() {
-                None => return,
-                _ => {}
-            }
-        }
-    });
-}
-#[bench]
-fn bench_small(b: &mut Bencher) {
-    b.iter(|| {
-        let _ = from_str(
-            r#"{
-            "a": 1.0,
-            "b": [
-                true,
-                "foo\nbar",
-                { "c": {"d": null} }
-            ]
-        }"#,
-        );
-    });
-}
-
-fn big_json() -> string::String {
-    let mut src = "[\n".to_string();
-    for _ in 0..500 {
-        src.push_str(
-            r#"{ "a": true, "b": null, "c":3.1415, "d": "Hello world", "e": \
-                        [1,2,3]},"#,
-        );
-    }
-    src.push_str("{}]");
-    return src;
-}
-
-#[bench]
-fn bench_streaming_large(b: &mut Bencher) {
-    let src = big_json();
-    b.iter(|| {
-        let mut parser = Parser::new(src.chars());
-        loop {
-            match parser.next() {
-                None => return,
-                _ => {}
-            }
-        }
-    });
-}
-#[bench]
-fn bench_large(b: &mut Bencher) {
-    let src = big_json();
-    b.iter(|| {
-        let _ = from_str(&src);
-    });
-}
diff --git a/compiler/rustc_serialize/src/lib.rs b/compiler/rustc_serialize/src/lib.rs
index bd257dc6464..e606f427335 100644
--- a/compiler/rustc_serialize/src/lib.rs
+++ b/compiler/rustc_serialize/src/lib.rs
@@ -10,7 +10,6 @@ Core encoding and decoding interfaces.
     test(attr(allow(unused_variables), deny(warnings)))
 )]
 #![feature(never_type)]
-#![feature(nll)]
 #![feature(associated_type_bounds)]
 #![feature(min_specialization)]
 #![feature(core_intrinsics)]
@@ -25,7 +24,5 @@ pub use self::serialize::{Decodable, Decoder, Encodable, Encoder};
 mod collection_impls;
 mod serialize;
 
-pub mod json;
-
 pub mod leb128;
 pub mod opaque;
diff --git a/compiler/rustc_serialize/src/opaque.rs b/compiler/rustc_serialize/src/opaque.rs
index 5e5cbacbcff..3bcb7cc3650 100644
--- a/compiler/rustc_serialize/src/opaque.rs
+++ b/compiler/rustc_serialize/src/opaque.rs
@@ -65,11 +65,6 @@ impl serialize::Encoder for Encoder {
     type Error = !;
 
     #[inline]
-    fn emit_unit(&mut self) -> EncodeResult {
-        Ok(())
-    }
-
-    #[inline]
     fn emit_usize(&mut self, v: usize) -> EncodeResult {
         write_leb128!(self, v, usize, write_usize_leb128)
     }
@@ -420,11 +415,6 @@ impl serialize::Encoder for FileEncoder {
     type Error = io::Error;
 
     #[inline]
-    fn emit_unit(&mut self) -> FileEncodeResult {
-        Ok(())
-    }
-
-    #[inline]
     fn emit_usize(&mut self, v: usize) -> FileEncodeResult {
         file_encoder_write_leb128!(self, v, usize, write_usize_leb128)
     }
diff --git a/compiler/rustc_serialize/src/serialize.rs b/compiler/rustc_serialize/src/serialize.rs
index 36e575b2427..817a0c9dcb1 100644
--- a/compiler/rustc_serialize/src/serialize.rs
+++ b/compiler/rustc_serialize/src/serialize.rs
@@ -15,7 +15,6 @@ pub trait Encoder {
     type Error;
 
     // Primitive types:
-    fn emit_unit(&mut self) -> Result<(), Self::Error>;
     fn emit_usize(&mut self, v: usize) -> Result<(), Self::Error>;
     fn emit_u128(&mut self, v: u128) -> Result<(), Self::Error>;
     fn emit_u64(&mut self, v: u64) -> Result<(), Self::Error>;
@@ -35,22 +34,8 @@ pub trait Encoder {
     fn emit_str(&mut self, v: &str) -> Result<(), Self::Error>;
     fn emit_raw_bytes(&mut self, s: &[u8]) -> Result<(), Self::Error>;
 
-    // Compound types:
-    #[inline]
-    fn emit_enum<F>(&mut self, f: F) -> Result<(), Self::Error>
-    where
-        F: FnOnce(&mut Self) -> Result<(), Self::Error>,
-    {
-        f(self)
-    }
-
-    fn emit_enum_variant<F>(
-        &mut self,
-        _v_name: &str,
-        v_id: usize,
-        _len: usize,
-        f: F,
-    ) -> Result<(), Self::Error>
+    // Convenience for the derive macro:
+    fn emit_enum_variant<F>(&mut self, v_id: usize, f: F) -> Result<(), Self::Error>
     where
         F: FnOnce(&mut Self) -> Result<(), Self::Error>,
     {
@@ -65,112 +50,9 @@ pub trait Encoder {
     // optimization that would otherwise be necessary here, likely due to the
     // multiple levels of inlining and const-prop that are needed.
     #[inline]
-    fn emit_fieldless_enum_variant<const ID: usize>(
-        &mut self,
-        _v_name: &str,
-    ) -> Result<(), Self::Error> {
+    fn emit_fieldless_enum_variant<const ID: usize>(&mut self) -> Result<(), Self::Error> {
         self.emit_usize(ID)
     }
-
-    #[inline]
-    fn emit_enum_variant_arg<F>(&mut self, _first: bool, f: F) -> Result<(), Self::Error>
-    where
-        F: FnOnce(&mut Self) -> Result<(), Self::Error>,
-    {
-        f(self)
-    }
-
-    #[inline]
-    fn emit_struct<F>(&mut self, _no_fields: bool, f: F) -> Result<(), Self::Error>
-    where
-        F: FnOnce(&mut Self) -> Result<(), Self::Error>,
-    {
-        f(self)
-    }
-
-    #[inline]
-    fn emit_struct_field<F>(&mut self, _f_name: &str, _first: bool, f: F) -> Result<(), Self::Error>
-    where
-        F: FnOnce(&mut Self) -> Result<(), Self::Error>,
-    {
-        f(self)
-    }
-
-    #[inline]
-    fn emit_tuple<F>(&mut self, _len: usize, f: F) -> Result<(), Self::Error>
-    where
-        F: FnOnce(&mut Self) -> Result<(), Self::Error>,
-    {
-        f(self)
-    }
-
-    #[inline]
-    fn emit_tuple_arg<F>(&mut self, _idx: usize, f: F) -> Result<(), Self::Error>
-    where
-        F: FnOnce(&mut Self) -> Result<(), Self::Error>,
-    {
-        f(self)
-    }
-
-    // Specialized types:
-    fn emit_option<F>(&mut self, f: F) -> Result<(), Self::Error>
-    where
-        F: FnOnce(&mut Self) -> Result<(), Self::Error>,
-    {
-        self.emit_enum(f)
-    }
-
-    #[inline]
-    fn emit_option_none(&mut self) -> Result<(), Self::Error> {
-        self.emit_enum_variant("None", 0, 0, |_| Ok(()))
-    }
-
-    fn emit_option_some<F>(&mut self, f: F) -> Result<(), Self::Error>
-    where
-        F: FnOnce(&mut Self) -> Result<(), Self::Error>,
-    {
-        self.emit_enum_variant("Some", 1, 1, f)
-    }
-
-    fn emit_seq<F>(&mut self, len: usize, f: F) -> Result<(), Self::Error>
-    where
-        F: FnOnce(&mut Self) -> Result<(), Self::Error>,
-    {
-        self.emit_usize(len)?;
-        f(self)
-    }
-
-    #[inline]
-    fn emit_seq_elt<F>(&mut self, _idx: usize, f: F) -> Result<(), Self::Error>
-    where
-        F: FnOnce(&mut Self) -> Result<(), Self::Error>,
-    {
-        f(self)
-    }
-
-    fn emit_map<F>(&mut self, len: usize, f: F) -> Result<(), Self::Error>
-    where
-        F: FnOnce(&mut Self) -> Result<(), Self::Error>,
-    {
-        self.emit_usize(len)?;
-        f(self)
-    }
-
-    #[inline]
-    fn emit_map_elt_key<F>(&mut self, _idx: usize, f: F) -> Result<(), Self::Error>
-    where
-        F: FnOnce(&mut Self) -> Result<(), Self::Error>,
-    {
-        f(self)
-    }
-
-    #[inline]
-    fn emit_map_elt_val<F>(&mut self, f: F) -> Result<(), Self::Error>
-    where
-        F: FnOnce(&mut Self) -> Result<(), Self::Error>,
-    {
-        f(self)
-    }
 }
 
 // Note: all the methods in this trait are infallible, which may be surprising.
@@ -320,8 +202,8 @@ impl<D: Decoder> Decodable<D> for String {
 }
 
 impl<S: Encoder> Encodable<S> for () {
-    fn encode(&self, s: &mut S) -> Result<(), S::Error> {
-        s.emit_unit()
+    fn encode(&self, _s: &mut S) -> Result<(), S::Error> {
+        Ok(())
     }
 }
 
@@ -330,8 +212,8 @@ impl<D: Decoder> Decodable<D> for () {
 }
 
 impl<S: Encoder, T> Encodable<S> for PhantomData<T> {
-    fn encode(&self, s: &mut S) -> Result<(), S::Error> {
-        s.emit_unit()
+    fn encode(&self, _s: &mut S) -> Result<(), S::Error> {
+        Ok(())
     }
 }
 
@@ -362,12 +244,11 @@ impl<D: Decoder, T: Decodable<D>> Decodable<D> for Rc<T> {
 
 impl<S: Encoder, T: Encodable<S>> Encodable<S> for [T] {
     default fn encode(&self, s: &mut S) -> Result<(), S::Error> {
-        s.emit_seq(self.len(), |s| {
-            for (i, e) in self.iter().enumerate() {
-                s.emit_seq_elt(i, |s| e.encode(s))?
-            }
-            Ok(())
-        })
+        s.emit_usize(self.len())?;
+        for e in self.iter() {
+            e.encode(s)?
+        }
+        Ok(())
     }
 }
 
@@ -450,10 +331,10 @@ impl<'a, D: Decoder> Decodable<D> for Cow<'a, str> {
 
 impl<S: Encoder, T: Encodable<S>> Encodable<S> for Option<T> {
     fn encode(&self, s: &mut S) -> Result<(), S::Error> {
-        s.emit_option(|s| match *self {
-            None => s.emit_option_none(),
-            Some(ref v) => s.emit_option_some(|s| v.encode(s)),
-        })
+        match *self {
+            None => s.emit_enum_variant(0, |_| Ok(())),
+            Some(ref v) => s.emit_enum_variant(1, |s| v.encode(s)),
+        }
     }
 }
 
@@ -469,14 +350,10 @@ impl<D: Decoder, T: Decodable<D>> Decodable<D> for Option<T> {
 
 impl<S: Encoder, T1: Encodable<S>, T2: Encodable<S>> Encodable<S> for Result<T1, T2> {
     fn encode(&self, s: &mut S) -> Result<(), S::Error> {
-        s.emit_enum(|s| match *self {
-            Ok(ref v) => {
-                s.emit_enum_variant("Ok", 0, 1, |s| s.emit_enum_variant_arg(true, |s| v.encode(s)))
-            }
-            Err(ref v) => {
-                s.emit_enum_variant("Err", 1, 1, |s| s.emit_enum_variant_arg(true, |s| v.encode(s)))
-            }
-        })
+        match *self {
+            Ok(ref v) => s.emit_enum_variant(0, |s| v.encode(s)),
+            Err(ref v) => s.emit_enum_variant(1, |s| v.encode(s)),
+        }
     }
 }
 
@@ -494,18 +371,6 @@ macro_rules! peel {
     ($name:ident, $($other:ident,)*) => (tuple! { $($other,)* })
 }
 
-/// Evaluates to the number of tokens passed to it.
-///
-/// Logarithmic counting: every one or two recursive expansions, the number of
-/// tokens to count is divided by two, instead of being reduced by one.
-/// Therefore, the recursion depth is the binary logarithm of the number of
-/// tokens to count, and the expanded tree is likewise very small.
-macro_rules! count {
-    ($one:tt)              => (1usize);
-    ($($pairs:tt $_p:tt)*) => (count!($($pairs)*) << 1usize);
-    ($odd:tt $($rest:tt)*) => (count!($($rest)*) | 1usize);
-}
-
 macro_rules! tuple {
     () => ();
     ( $($name:ident,)+ ) => (
@@ -518,12 +383,8 @@ macro_rules! tuple {
             #[allow(non_snake_case)]
             fn encode(&self, s: &mut S) -> Result<(), S::Error> {
                 let ($(ref $name,)+) = *self;
-                let len: usize = count!($($name)+);
-                s.emit_tuple(len, |s| {
-                    let mut i = 0;
-                    $(s.emit_tuple_arg({ i+=1; i-1 }, |s| $name.encode(s))?;)+
-                    Ok(())
-                })
+                $($name.encode(s)?;)+
+                Ok(())
             }
         }
         peel! { $($name,)+ }
diff --git a/compiler/rustc_serialize/tests/json.rs b/compiler/rustc_serialize/tests/json.rs
deleted file mode 100644
index 944fe460632..00000000000
--- a/compiler/rustc_serialize/tests/json.rs
+++ /dev/null
@@ -1,978 +0,0 @@
-#![allow(rustc::internal)]
-
-use json::ErrorCode::*;
-use json::Json::*;
-use json::JsonEvent::*;
-use json::ParserError::*;
-use json::{from_str, Encoder, EncoderError, Json, JsonEvent, Parser, StackElement};
-use rustc_macros::Encodable;
-use rustc_serialize::json;
-use rustc_serialize::Encodable;
-
-use std::collections::BTreeMap;
-use std::io::prelude::*;
-use std::string;
-use Animal::*;
-
-#[derive(Eq, PartialEq, Debug)]
-struct OptionData {
-    opt: Option<usize>,
-}
-
-#[derive(PartialEq, Encodable, Debug)]
-enum Animal {
-    Dog,
-    Frog(string::String, isize),
-}
-
-#[derive(PartialEq, Encodable, Debug)]
-struct Inner {
-    a: (),
-    b: usize,
-    c: Vec<string::String>,
-}
-
-#[derive(PartialEq, Encodable, Debug)]
-struct Outer {
-    inner: Vec<Inner>,
-}
-
-fn mk_object(items: &[(string::String, Json)]) -> Json {
-    let mut d = BTreeMap::new();
-
-    for item in items {
-        match *item {
-            (ref key, ref value) => {
-                d.insert((*key).clone(), (*value).clone());
-            }
-        }
-    }
-
-    Object(d)
-}
-
-#[test]
-fn test_from_str_trait() {
-    let s = "null";
-    assert!(s.parse::<Json>().unwrap() == s.parse().unwrap());
-}
-
-#[test]
-fn test_write_null() {
-    assert_eq!(Null.to_string(), "null");
-    assert_eq!(Null.pretty().to_string(), "null");
-}
-
-#[test]
-fn test_write_i64() {
-    assert_eq!(U64(0).to_string(), "0");
-    assert_eq!(U64(0).pretty().to_string(), "0");
-
-    assert_eq!(U64(1234).to_string(), "1234");
-    assert_eq!(U64(1234).pretty().to_string(), "1234");
-
-    assert_eq!(I64(-5678).to_string(), "-5678");
-    assert_eq!(I64(-5678).pretty().to_string(), "-5678");
-
-    assert_eq!(U64(7650007200025252000).to_string(), "7650007200025252000");
-    assert_eq!(U64(7650007200025252000).pretty().to_string(), "7650007200025252000");
-}
-
-#[test]
-fn test_write_f64() {
-    assert_eq!(F64(3.0).to_string(), "3.0");
-    assert_eq!(F64(3.0).pretty().to_string(), "3.0");
-
-    assert_eq!(F64(3.1).to_string(), "3.1");
-    assert_eq!(F64(3.1).pretty().to_string(), "3.1");
-
-    assert_eq!(F64(-1.5).to_string(), "-1.5");
-    assert_eq!(F64(-1.5).pretty().to_string(), "-1.5");
-
-    assert_eq!(F64(0.5).to_string(), "0.5");
-    assert_eq!(F64(0.5).pretty().to_string(), "0.5");
-
-    assert_eq!(F64(f64::NAN).to_string(), "null");
-    assert_eq!(F64(f64::NAN).pretty().to_string(), "null");
-
-    assert_eq!(F64(f64::INFINITY).to_string(), "null");
-    assert_eq!(F64(f64::INFINITY).pretty().to_string(), "null");
-
-    assert_eq!(F64(f64::NEG_INFINITY).to_string(), "null");
-    assert_eq!(F64(f64::NEG_INFINITY).pretty().to_string(), "null");
-}
-
-#[test]
-fn test_write_str() {
-    assert_eq!(String("".to_string()).to_string(), "\"\"");
-    assert_eq!(String("".to_string()).pretty().to_string(), "\"\"");
-
-    assert_eq!(String("homura".to_string()).to_string(), "\"homura\"");
-    assert_eq!(String("madoka".to_string()).pretty().to_string(), "\"madoka\"");
-}
-
-#[test]
-fn test_write_bool() {
-    assert_eq!(Boolean(true).to_string(), "true");
-    assert_eq!(Boolean(true).pretty().to_string(), "true");
-
-    assert_eq!(Boolean(false).to_string(), "false");
-    assert_eq!(Boolean(false).pretty().to_string(), "false");
-}
-
-#[test]
-fn test_write_array() {
-    assert_eq!(Array(vec![]).to_string(), "[]");
-    assert_eq!(Array(vec![]).pretty().to_string(), "[]");
-
-    assert_eq!(Array(vec![Boolean(true)]).to_string(), "[true]");
-    assert_eq!(
-        Array(vec![Boolean(true)]).pretty().to_string(),
-        "\
-        [\n  \
-            true\n\
-        ]"
-    );
-
-    let long_test_array =
-        Array(vec![Boolean(false), Null, Array(vec![String("foo\nbar".to_string()), F64(3.5)])]);
-
-    assert_eq!(long_test_array.to_string(), "[false,null,[\"foo\\nbar\",3.5]]");
-    assert_eq!(
-        long_test_array.pretty().to_string(),
-        "\
-        [\n  \
-            false,\n  \
-            null,\n  \
-            [\n    \
-                \"foo\\nbar\",\n    \
-                3.5\n  \
-            ]\n\
-        ]"
-    );
-}
-
-#[test]
-fn test_write_object() {
-    assert_eq!(mk_object(&[]).to_string(), "{}");
-    assert_eq!(mk_object(&[]).pretty().to_string(), "{}");
-
-    assert_eq!(mk_object(&[("a".to_string(), Boolean(true))]).to_string(), "{\"a\":true}");
-    assert_eq!(
-        mk_object(&[("a".to_string(), Boolean(true))]).pretty().to_string(),
-        "\
-        {\n  \
-            \"a\": true\n\
-        }"
-    );
-
-    let complex_obj = mk_object(&[(
-        "b".to_string(),
-        Array(vec![
-            mk_object(&[("c".to_string(), String("\x0c\r".to_string()))]),
-            mk_object(&[("d".to_string(), String("".to_string()))]),
-        ]),
-    )]);
-
-    assert_eq!(
-        complex_obj.to_string(),
-        "{\
-            \"b\":[\
-                {\"c\":\"\\f\\r\"},\
-                {\"d\":\"\"}\
-            ]\
-        }"
-    );
-    assert_eq!(
-        complex_obj.pretty().to_string(),
-        "\
-        {\n  \
-            \"b\": [\n    \
-                {\n      \
-                    \"c\": \"\\f\\r\"\n    \
-                },\n    \
-                {\n      \
-                    \"d\": \"\"\n    \
-                }\n  \
-            ]\n\
-        }"
-    );
-
-    let a = mk_object(&[
-        ("a".to_string(), Boolean(true)),
-        (
-            "b".to_string(),
-            Array(vec![
-                mk_object(&[("c".to_string(), String("\x0c\r".to_string()))]),
-                mk_object(&[("d".to_string(), String("".to_string()))]),
-            ]),
-        ),
-    ]);
-
-    // We can't compare the strings directly because the object fields be
-    // printed in a different order.
-    assert_eq!(a.clone(), a.to_string().parse().unwrap());
-    assert_eq!(a.clone(), a.pretty().to_string().parse().unwrap());
-}
-
-#[test]
-fn test_write_enum() {
-    let animal = Dog;
-    assert_eq!(json::as_json(&animal).to_string(), "\"Dog\"");
-    assert_eq!(json::as_pretty_json(&animal).to_string(), "\"Dog\"");
-
-    let animal = Frog("Henry".to_string(), 349);
-    assert_eq!(
-        json::as_json(&animal).to_string(),
-        "{\"variant\":\"Frog\",\"fields\":[\"Henry\",349]}"
-    );
-    assert_eq!(
-        json::as_pretty_json(&animal).to_string(),
-        "{\n  \
-           \"variant\": \"Frog\",\n  \
-           \"fields\": [\n    \
-             \"Henry\",\n    \
-             349\n  \
-           ]\n\
-         }"
-    );
-}
-
-macro_rules! check_encoder_for_simple {
-    ($value:expr, $expected:expr) => {{
-        let s = json::as_json(&$value).to_string();
-        assert_eq!(s, $expected);
-
-        let s = json::as_pretty_json(&$value).to_string();
-        assert_eq!(s, $expected);
-    }};
-}
-
-#[test]
-fn test_write_some() {
-    check_encoder_for_simple!(Some("jodhpurs".to_string()), "\"jodhpurs\"");
-}
-
-#[test]
-fn test_write_none() {
-    check_encoder_for_simple!(None::<string::String>, "null");
-}
-
-#[test]
-fn test_write_char() {
-    check_encoder_for_simple!('a', "\"a\"");
-    check_encoder_for_simple!('\t', "\"\\t\"");
-    check_encoder_for_simple!('\u{0000}', "\"\\u0000\"");
-    check_encoder_for_simple!('\u{001b}', "\"\\u001b\"");
-    check_encoder_for_simple!('\u{007f}', "\"\\u007f\"");
-    check_encoder_for_simple!('\u{00a0}', "\"\u{00a0}\"");
-    check_encoder_for_simple!('\u{abcd}', "\"\u{abcd}\"");
-    check_encoder_for_simple!('\u{10ffff}', "\"\u{10ffff}\"");
-}
-
-#[test]
-fn test_trailing_characters() {
-    assert_eq!(from_str("nulla"), Err(SyntaxError(TrailingCharacters, 1, 5)));
-    assert_eq!(from_str("truea"), Err(SyntaxError(TrailingCharacters, 1, 5)));
-    assert_eq!(from_str("falsea"), Err(SyntaxError(TrailingCharacters, 1, 6)));
-    assert_eq!(from_str("1a"), Err(SyntaxError(TrailingCharacters, 1, 2)));
-    assert_eq!(from_str("[]a"), Err(SyntaxError(TrailingCharacters, 1, 3)));
-    assert_eq!(from_str("{}a"), Err(SyntaxError(TrailingCharacters, 1, 3)));
-}
-
-#[test]
-fn test_read_identifiers() {
-    assert_eq!(from_str("n"), Err(SyntaxError(InvalidSyntax, 1, 2)));
-    assert_eq!(from_str("nul"), Err(SyntaxError(InvalidSyntax, 1, 4)));
-    assert_eq!(from_str("t"), Err(SyntaxError(InvalidSyntax, 1, 2)));
-    assert_eq!(from_str("truz"), Err(SyntaxError(InvalidSyntax, 1, 4)));
-    assert_eq!(from_str("f"), Err(SyntaxError(InvalidSyntax, 1, 2)));
-    assert_eq!(from_str("faz"), Err(SyntaxError(InvalidSyntax, 1, 3)));
-
-    assert_eq!(from_str("null"), Ok(Null));
-    assert_eq!(from_str("true"), Ok(Boolean(true)));
-    assert_eq!(from_str("false"), Ok(Boolean(false)));
-    assert_eq!(from_str(" null "), Ok(Null));
-    assert_eq!(from_str(" true "), Ok(Boolean(true)));
-    assert_eq!(from_str(" false "), Ok(Boolean(false)));
-}
-
-#[test]
-fn test_read_number() {
-    assert_eq!(from_str("+"), Err(SyntaxError(InvalidSyntax, 1, 1)));
-    assert_eq!(from_str("."), Err(SyntaxError(InvalidSyntax, 1, 1)));
-    assert_eq!(from_str("NaN"), Err(SyntaxError(InvalidSyntax, 1, 1)));
-    assert_eq!(from_str("-"), Err(SyntaxError(InvalidNumber, 1, 2)));
-    assert_eq!(from_str("00"), Err(SyntaxError(InvalidNumber, 1, 2)));
-    assert_eq!(from_str("1."), Err(SyntaxError(InvalidNumber, 1, 3)));
-    assert_eq!(from_str("1e"), Err(SyntaxError(InvalidNumber, 1, 3)));
-    assert_eq!(from_str("1e+"), Err(SyntaxError(InvalidNumber, 1, 4)));
-
-    assert_eq!(from_str("18446744073709551616"), Err(SyntaxError(InvalidNumber, 1, 20)));
-    assert_eq!(from_str("-9223372036854775809"), Err(SyntaxError(InvalidNumber, 1, 21)));
-
-    assert_eq!(from_str("3"), Ok(U64(3)));
-    assert_eq!(from_str("3.1"), Ok(F64(3.1)));
-    assert_eq!(from_str("-1.2"), Ok(F64(-1.2)));
-    assert_eq!(from_str("0.4"), Ok(F64(0.4)));
-    assert_eq!(from_str("0.4e5"), Ok(F64(0.4e5)));
-    assert_eq!(from_str("0.4e+15"), Ok(F64(0.4e15)));
-    assert_eq!(from_str("0.4e-01"), Ok(F64(0.4e-01)));
-    assert_eq!(from_str(" 3 "), Ok(U64(3)));
-
-    assert_eq!(from_str("-9223372036854775808"), Ok(I64(i64::MIN)));
-    assert_eq!(from_str("9223372036854775807"), Ok(U64(i64::MAX as u64)));
-    assert_eq!(from_str("18446744073709551615"), Ok(U64(u64::MAX)));
-}
-
-#[test]
-fn test_read_str() {
-    assert_eq!(from_str("\""), Err(SyntaxError(EOFWhileParsingString, 1, 2)));
-    assert_eq!(from_str("\"lol"), Err(SyntaxError(EOFWhileParsingString, 1, 5)));
-
-    assert_eq!(from_str("\"\""), Ok(String("".to_string())));
-    assert_eq!(from_str("\"foo\""), Ok(String("foo".to_string())));
-    assert_eq!(from_str("\"\\\"\""), Ok(String("\"".to_string())));
-    assert_eq!(from_str("\"\\b\""), Ok(String("\x08".to_string())));
-    assert_eq!(from_str("\"\\n\""), Ok(String("\n".to_string())));
-    assert_eq!(from_str("\"\\r\""), Ok(String("\r".to_string())));
-    assert_eq!(from_str("\"\\t\""), Ok(String("\t".to_string())));
-    assert_eq!(from_str(" \"foo\" "), Ok(String("foo".to_string())));
-    assert_eq!(from_str("\"\\u12ab\""), Ok(String("\u{12ab}".to_string())));
-    assert_eq!(from_str("\"\\uAB12\""), Ok(String("\u{AB12}".to_string())));
-}
-
-#[test]
-fn test_read_array() {
-    assert_eq!(from_str("["), Err(SyntaxError(EOFWhileParsingValue, 1, 2)));
-    assert_eq!(from_str("[1"), Err(SyntaxError(EOFWhileParsingArray, 1, 3)));
-    assert_eq!(from_str("[1,"), Err(SyntaxError(EOFWhileParsingValue, 1, 4)));
-    assert_eq!(from_str("[1,]"), Err(SyntaxError(InvalidSyntax, 1, 4)));
-    assert_eq!(from_str("[6 7]"), Err(SyntaxError(InvalidSyntax, 1, 4)));
-
-    assert_eq!(from_str("[]"), Ok(Array(vec![])));
-    assert_eq!(from_str("[ ]"), Ok(Array(vec![])));
-    assert_eq!(from_str("[true]"), Ok(Array(vec![Boolean(true)])));
-    assert_eq!(from_str("[ false ]"), Ok(Array(vec![Boolean(false)])));
-    assert_eq!(from_str("[null]"), Ok(Array(vec![Null])));
-    assert_eq!(from_str("[3, 1]"), Ok(Array(vec![U64(3), U64(1)])));
-    assert_eq!(from_str("\n[3, 2]\n"), Ok(Array(vec![U64(3), U64(2)])));
-    assert_eq!(from_str("[2, [4, 1]]"), Ok(Array(vec![U64(2), Array(vec![U64(4), U64(1)])])));
-}
-
-#[test]
-fn test_read_object() {
-    assert_eq!(from_str("{"), Err(SyntaxError(EOFWhileParsingObject, 1, 2)));
-    assert_eq!(from_str("{ "), Err(SyntaxError(EOFWhileParsingObject, 1, 3)));
-    assert_eq!(from_str("{1"), Err(SyntaxError(KeyMustBeAString, 1, 2)));
-    assert_eq!(from_str("{ \"a\""), Err(SyntaxError(EOFWhileParsingObject, 1, 6)));
-    assert_eq!(from_str("{\"a\""), Err(SyntaxError(EOFWhileParsingObject, 1, 5)));
-    assert_eq!(from_str("{\"a\" "), Err(SyntaxError(EOFWhileParsingObject, 1, 6)));
-
-    assert_eq!(from_str("{\"a\" 1"), Err(SyntaxError(ExpectedColon, 1, 6)));
-    assert_eq!(from_str("{\"a\":"), Err(SyntaxError(EOFWhileParsingValue, 1, 6)));
-    assert_eq!(from_str("{\"a\":1"), Err(SyntaxError(EOFWhileParsingObject, 1, 7)));
-    assert_eq!(from_str("{\"a\":1 1"), Err(SyntaxError(InvalidSyntax, 1, 8)));
-    assert_eq!(from_str("{\"a\":1,"), Err(SyntaxError(EOFWhileParsingObject, 1, 8)));
-
-    assert_eq!(from_str("{}").unwrap(), mk_object(&[]));
-    assert_eq!(from_str("{\"a\": 3}").unwrap(), mk_object(&[("a".to_string(), U64(3))]));
-
-    assert_eq!(
-        from_str("{ \"a\": null, \"b\" : true }").unwrap(),
-        mk_object(&[("a".to_string(), Null), ("b".to_string(), Boolean(true))])
-    );
-    assert_eq!(
-        from_str("\n{ \"a\": null, \"b\" : true }\n").unwrap(),
-        mk_object(&[("a".to_string(), Null), ("b".to_string(), Boolean(true))])
-    );
-    assert_eq!(
-        from_str("{\"a\" : 1.0 ,\"b\": [ true ]}").unwrap(),
-        mk_object(&[("a".to_string(), F64(1.0)), ("b".to_string(), Array(vec![Boolean(true)]))])
-    );
-    assert_eq!(
-        from_str(
-            "{\
-                        \"a\": 1.0, \
-                        \"b\": [\
-                            true,\
-                            \"foo\\nbar\", \
-                            { \"c\": {\"d\": null} } \
-                        ]\
-                    }"
-        )
-        .unwrap(),
-        mk_object(&[
-            ("a".to_string(), F64(1.0)),
-            (
-                "b".to_string(),
-                Array(vec![
-                    Boolean(true),
-                    String("foo\nbar".to_string()),
-                    mk_object(&[("c".to_string(), mk_object(&[("d".to_string(), Null)]))])
-                ])
-            )
-        ])
-    );
-}
-
-#[test]
-fn test_multiline_errors() {
-    assert_eq!(from_str("{\n  \"foo\":\n \"bar\""), Err(SyntaxError(EOFWhileParsingObject, 3, 8)));
-}
-
-#[test]
-fn test_find() {
-    let json_value = from_str("{\"dog\" : \"cat\"}").unwrap();
-    let found_str = json_value.find("dog");
-    assert!(found_str.unwrap().as_string().unwrap() == "cat");
-}
-
-#[test]
-fn test_find_path() {
-    let json_value = from_str("{\"dog\":{\"cat\": {\"mouse\" : \"cheese\"}}}").unwrap();
-    let found_str = json_value.find_path(&["dog", "cat", "mouse"]);
-    assert!(found_str.unwrap().as_string().unwrap() == "cheese");
-}
-
-#[test]
-fn test_search() {
-    let json_value = from_str("{\"dog\":{\"cat\": {\"mouse\" : \"cheese\"}}}").unwrap();
-    let found_str = json_value.search("mouse").and_then(|j| j.as_string());
-    assert!(found_str.unwrap() == "cheese");
-}
-
-#[test]
-fn test_index() {
-    let json_value = from_str("{\"animals\":[\"dog\",\"cat\",\"mouse\"]}").unwrap();
-    let ref array = json_value["animals"];
-    assert_eq!(array[0].as_string().unwrap(), "dog");
-    assert_eq!(array[1].as_string().unwrap(), "cat");
-    assert_eq!(array[2].as_string().unwrap(), "mouse");
-}
-
-#[test]
-fn test_is_object() {
-    let json_value = from_str("{}").unwrap();
-    assert!(json_value.is_object());
-}
-
-#[test]
-fn test_as_object() {
-    let json_value = from_str("{}").unwrap();
-    let json_object = json_value.as_object();
-    assert!(json_object.is_some());
-}
-
-#[test]
-fn test_is_array() {
-    let json_value = from_str("[1, 2, 3]").unwrap();
-    assert!(json_value.is_array());
-}
-
-#[test]
-fn test_as_array() {
-    let json_value = from_str("[1, 2, 3]").unwrap();
-    let json_array = json_value.as_array();
-    let expected_length = 3;
-    assert!(json_array.is_some() && json_array.unwrap().len() == expected_length);
-}
-
-#[test]
-fn test_is_string() {
-    let json_value = from_str("\"dog\"").unwrap();
-    assert!(json_value.is_string());
-}
-
-#[test]
-fn test_as_string() {
-    let json_value = from_str("\"dog\"").unwrap();
-    let json_str = json_value.as_string();
-    let expected_str = "dog";
-    assert_eq!(json_str, Some(expected_str));
-}
-
-#[test]
-fn test_is_number() {
-    let json_value = from_str("12").unwrap();
-    assert!(json_value.is_number());
-}
-
-#[test]
-fn test_is_i64() {
-    let json_value = from_str("-12").unwrap();
-    assert!(json_value.is_i64());
-
-    let json_value = from_str("12").unwrap();
-    assert!(!json_value.is_i64());
-
-    let json_value = from_str("12.0").unwrap();
-    assert!(!json_value.is_i64());
-}
-
-#[test]
-fn test_is_u64() {
-    let json_value = from_str("12").unwrap();
-    assert!(json_value.is_u64());
-
-    let json_value = from_str("-12").unwrap();
-    assert!(!json_value.is_u64());
-
-    let json_value = from_str("12.0").unwrap();
-    assert!(!json_value.is_u64());
-}
-
-#[test]
-fn test_is_f64() {
-    let json_value = from_str("12").unwrap();
-    assert!(!json_value.is_f64());
-
-    let json_value = from_str("-12").unwrap();
-    assert!(!json_value.is_f64());
-
-    let json_value = from_str("12.0").unwrap();
-    assert!(json_value.is_f64());
-
-    let json_value = from_str("-12.0").unwrap();
-    assert!(json_value.is_f64());
-}
-
-#[test]
-fn test_as_i64() {
-    let json_value = from_str("-12").unwrap();
-    let json_num = json_value.as_i64();
-    assert_eq!(json_num, Some(-12));
-}
-
-#[test]
-fn test_as_u64() {
-    let json_value = from_str("12").unwrap();
-    let json_num = json_value.as_u64();
-    assert_eq!(json_num, Some(12));
-}
-
-#[test]
-fn test_as_f64() {
-    let json_value = from_str("12.0").unwrap();
-    let json_num = json_value.as_f64();
-    assert_eq!(json_num, Some(12f64));
-}
-
-#[test]
-fn test_is_boolean() {
-    let json_value = from_str("false").unwrap();
-    assert!(json_value.is_boolean());
-}
-
-#[test]
-fn test_as_boolean() {
-    let json_value = from_str("false").unwrap();
-    let json_bool = json_value.as_boolean();
-    let expected_bool = false;
-    assert!(json_bool.is_some() && json_bool.unwrap() == expected_bool);
-}
-
-#[test]
-fn test_is_null() {
-    let json_value = from_str("null").unwrap();
-    assert!(json_value.is_null());
-}
-
-#[test]
-fn test_as_null() {
-    let json_value = from_str("null").unwrap();
-    let json_null = json_value.as_null();
-    let expected_null = ();
-    assert!(json_null.is_some() && json_null.unwrap() == expected_null);
-}
-
-#[test]
-fn test_encode_hashmap_with_numeric_key() {
-    use std::collections::HashMap;
-    use std::str::from_utf8;
-    let mut hm: HashMap<usize, bool> = HashMap::new();
-    hm.insert(1, true);
-    let mut mem_buf = Vec::new();
-    write!(&mut mem_buf, "{}", json::as_pretty_json(&hm)).unwrap();
-    let json_str = from_utf8(&mem_buf[..]).unwrap();
-    match from_str(json_str) {
-        Err(_) => panic!("Unable to parse json_str: {:?}", json_str),
-        _ => {} // it parsed and we are good to go
-    }
-}
-
-#[test]
-fn test_prettyencode_hashmap_with_numeric_key() {
-    use std::collections::HashMap;
-    use std::str::from_utf8;
-    let mut hm: HashMap<usize, bool> = HashMap::new();
-    hm.insert(1, true);
-    let mut mem_buf = Vec::new();
-    write!(&mut mem_buf, "{}", json::as_pretty_json(&hm)).unwrap();
-    let json_str = from_utf8(&mem_buf[..]).unwrap();
-    match from_str(json_str) {
-        Err(_) => panic!("Unable to parse json_str: {:?}", json_str),
-        _ => {} // it parsed and we are good to go
-    }
-}
-
-#[test]
-fn test_prettyencoder_indent_level_param() {
-    use std::collections::BTreeMap;
-    use std::str::from_utf8;
-
-    let mut tree = BTreeMap::new();
-
-    tree.insert("hello".to_string(), String("guten tag".to_string()));
-    tree.insert("goodbye".to_string(), String("sayonara".to_string()));
-
-    let json = Array(
-        // The following layout below should look a lot like
-        // the pretty-printed JSON (indent * x)
-        vec![
-            // 0x
-            String("greetings".to_string()), // 1x
-            Object(tree),                    // 1x + 2x + 2x + 1x
-        ], // 0x
-           // End JSON array (7 lines)
-    );
-
-    // Helper function for counting indents
-    fn indents(source: &str) -> usize {
-        let trimmed = source.trim_start_matches(' ');
-        source.len() - trimmed.len()
-    }
-
-    // Test up to 4 spaces of indents (more?)
-    for i in 0..4 {
-        let mut writer = Vec::new();
-        write!(&mut writer, "{}", json::as_pretty_json(&json).indent(i)).unwrap();
-
-        let printed = from_utf8(&writer[..]).unwrap();
-
-        // Check for indents at each line
-        let lines: Vec<&str> = printed.lines().collect();
-        assert_eq!(lines.len(), 7); // JSON should be 7 lines
-
-        assert_eq!(indents(lines[0]), 0 * i); // [
-        assert_eq!(indents(lines[1]), 1 * i); //   "greetings",
-        assert_eq!(indents(lines[2]), 1 * i); //   {
-        assert_eq!(indents(lines[3]), 2 * i); //     "hello": "guten tag",
-        assert_eq!(indents(lines[4]), 2 * i); //     "goodbye": "sayonara"
-        assert_eq!(indents(lines[5]), 1 * i); //   },
-        assert_eq!(indents(lines[6]), 0 * i); // ]
-
-        // Finally, test that the pretty-printed JSON is valid
-        from_str(printed).ok().expect("Pretty-printed JSON is invalid!");
-    }
-}
-
-#[test]
-fn test_hashmap_with_enum_key() {
-    use std::collections::HashMap;
-    #[derive(Encodable, Eq, Hash, PartialEq, Debug)]
-    enum Enum {
-        Foo,
-        #[allow(dead_code)]
-        Bar,
-    }
-    let mut map = HashMap::new();
-    map.insert(Enum::Foo, 0);
-    let result = json::encode(&map).unwrap();
-    assert_eq!(&result[..], r#"{"Foo":0}"#);
-}
-
-fn assert_stream_equal(src: &str, expected: Vec<(JsonEvent, Vec<StackElement<'_>>)>) {
-    let mut parser = Parser::new(src.chars());
-    let mut i = 0;
-    loop {
-        let evt = match parser.next() {
-            Some(e) => e,
-            None => {
-                break;
-            }
-        };
-        let (ref expected_evt, ref expected_stack) = expected[i];
-        if !parser.stack().is_equal_to(expected_stack) {
-            panic!("Parser stack is not equal to {:?}", expected_stack);
-        }
-        assert_eq!(&evt, expected_evt);
-        i += 1;
-    }
-}
-#[test]
-fn test_streaming_parser() {
-    assert_stream_equal(
-        r#"{ "foo":"bar", "array" : [0, 1, 2, 3, 4, 5], "idents":[null,true,false]}"#,
-        vec![
-            (ObjectStart, vec![]),
-            (StringValue("bar".to_string()), vec![StackElement::Key("foo")]),
-            (ArrayStart, vec![StackElement::Key("array")]),
-            (U64Value(0), vec![StackElement::Key("array"), StackElement::Index(0)]),
-            (U64Value(1), vec![StackElement::Key("array"), StackElement::Index(1)]),
-            (U64Value(2), vec![StackElement::Key("array"), StackElement::Index(2)]),
-            (U64Value(3), vec![StackElement::Key("array"), StackElement::Index(3)]),
-            (U64Value(4), vec![StackElement::Key("array"), StackElement::Index(4)]),
-            (U64Value(5), vec![StackElement::Key("array"), StackElement::Index(5)]),
-            (ArrayEnd, vec![StackElement::Key("array")]),
-            (ArrayStart, vec![StackElement::Key("idents")]),
-            (NullValue, vec![StackElement::Key("idents"), StackElement::Index(0)]),
-            (BooleanValue(true), vec![StackElement::Key("idents"), StackElement::Index(1)]),
-            (BooleanValue(false), vec![StackElement::Key("idents"), StackElement::Index(2)]),
-            (ArrayEnd, vec![StackElement::Key("idents")]),
-            (ObjectEnd, vec![]),
-        ],
-    );
-}
-fn last_event(src: &str) -> JsonEvent {
-    let mut parser = Parser::new(src.chars());
-    let mut evt = NullValue;
-    loop {
-        evt = match parser.next() {
-            Some(e) => e,
-            None => return evt,
-        }
-    }
-}
-
-#[test]
-fn test_read_object_streaming() {
-    assert_eq!(last_event("{ "), Error(SyntaxError(EOFWhileParsingObject, 1, 3)));
-    assert_eq!(last_event("{1"), Error(SyntaxError(KeyMustBeAString, 1, 2)));
-    assert_eq!(last_event("{ \"a\""), Error(SyntaxError(EOFWhileParsingObject, 1, 6)));
-    assert_eq!(last_event("{\"a\""), Error(SyntaxError(EOFWhileParsingObject, 1, 5)));
-    assert_eq!(last_event("{\"a\" "), Error(SyntaxError(EOFWhileParsingObject, 1, 6)));
-
-    assert_eq!(last_event("{\"a\" 1"), Error(SyntaxError(ExpectedColon, 1, 6)));
-    assert_eq!(last_event("{\"a\":"), Error(SyntaxError(EOFWhileParsingValue, 1, 6)));
-    assert_eq!(last_event("{\"a\":1"), Error(SyntaxError(EOFWhileParsingObject, 1, 7)));
-    assert_eq!(last_event("{\"a\":1 1"), Error(SyntaxError(InvalidSyntax, 1, 8)));
-    assert_eq!(last_event("{\"a\":1,"), Error(SyntaxError(EOFWhileParsingObject, 1, 8)));
-    assert_eq!(last_event("{\"a\":1,}"), Error(SyntaxError(TrailingComma, 1, 8)));
-
-    assert_stream_equal("{}", vec![(ObjectStart, vec![]), (ObjectEnd, vec![])]);
-    assert_stream_equal(
-        "{\"a\": 3}",
-        vec![
-            (ObjectStart, vec![]),
-            (U64Value(3), vec![StackElement::Key("a")]),
-            (ObjectEnd, vec![]),
-        ],
-    );
-    assert_stream_equal(
-        "{ \"a\": null, \"b\" : true }",
-        vec![
-            (ObjectStart, vec![]),
-            (NullValue, vec![StackElement::Key("a")]),
-            (BooleanValue(true), vec![StackElement::Key("b")]),
-            (ObjectEnd, vec![]),
-        ],
-    );
-    assert_stream_equal(
-        "{\"a\" : 1.0 ,\"b\": [ true ]}",
-        vec![
-            (ObjectStart, vec![]),
-            (F64Value(1.0), vec![StackElement::Key("a")]),
-            (ArrayStart, vec![StackElement::Key("b")]),
-            (BooleanValue(true), vec![StackElement::Key("b"), StackElement::Index(0)]),
-            (ArrayEnd, vec![StackElement::Key("b")]),
-            (ObjectEnd, vec![]),
-        ],
-    );
-    assert_stream_equal(
-        r#"{
-            "a": 1.0,
-            "b": [
-                true,
-                "foo\nbar",
-                { "c": {"d": null} }
-            ]
-        }"#,
-        vec![
-            (ObjectStart, vec![]),
-            (F64Value(1.0), vec![StackElement::Key("a")]),
-            (ArrayStart, vec![StackElement::Key("b")]),
-            (BooleanValue(true), vec![StackElement::Key("b"), StackElement::Index(0)]),
-            (
-                StringValue("foo\nbar".to_string()),
-                vec![StackElement::Key("b"), StackElement::Index(1)],
-            ),
-            (ObjectStart, vec![StackElement::Key("b"), StackElement::Index(2)]),
-            (
-                ObjectStart,
-                vec![StackElement::Key("b"), StackElement::Index(2), StackElement::Key("c")],
-            ),
-            (
-                NullValue,
-                vec![
-                    StackElement::Key("b"),
-                    StackElement::Index(2),
-                    StackElement::Key("c"),
-                    StackElement::Key("d"),
-                ],
-            ),
-            (
-                ObjectEnd,
-                vec![StackElement::Key("b"), StackElement::Index(2), StackElement::Key("c")],
-            ),
-            (ObjectEnd, vec![StackElement::Key("b"), StackElement::Index(2)]),
-            (ArrayEnd, vec![StackElement::Key("b")]),
-            (ObjectEnd, vec![]),
-        ],
-    );
-}
-#[test]
-fn test_read_array_streaming() {
-    assert_stream_equal("[]", vec![(ArrayStart, vec![]), (ArrayEnd, vec![])]);
-    assert_stream_equal("[ ]", vec![(ArrayStart, vec![]), (ArrayEnd, vec![])]);
-    assert_stream_equal(
-        "[true]",
-        vec![
-            (ArrayStart, vec![]),
-            (BooleanValue(true), vec![StackElement::Index(0)]),
-            (ArrayEnd, vec![]),
-        ],
-    );
-    assert_stream_equal(
-        "[ false ]",
-        vec![
-            (ArrayStart, vec![]),
-            (BooleanValue(false), vec![StackElement::Index(0)]),
-            (ArrayEnd, vec![]),
-        ],
-    );
-    assert_stream_equal(
-        "[null]",
-        vec![(ArrayStart, vec![]), (NullValue, vec![StackElement::Index(0)]), (ArrayEnd, vec![])],
-    );
-    assert_stream_equal(
-        "[3, 1]",
-        vec![
-            (ArrayStart, vec![]),
-            (U64Value(3), vec![StackElement::Index(0)]),
-            (U64Value(1), vec![StackElement::Index(1)]),
-            (ArrayEnd, vec![]),
-        ],
-    );
-    assert_stream_equal(
-        "\n[3, 2]\n",
-        vec![
-            (ArrayStart, vec![]),
-            (U64Value(3), vec![StackElement::Index(0)]),
-            (U64Value(2), vec![StackElement::Index(1)]),
-            (ArrayEnd, vec![]),
-        ],
-    );
-    assert_stream_equal(
-        "[2, [4, 1]]",
-        vec![
-            (ArrayStart, vec![]),
-            (U64Value(2), vec![StackElement::Index(0)]),
-            (ArrayStart, vec![StackElement::Index(1)]),
-            (U64Value(4), vec![StackElement::Index(1), StackElement::Index(0)]),
-            (U64Value(1), vec![StackElement::Index(1), StackElement::Index(1)]),
-            (ArrayEnd, vec![StackElement::Index(1)]),
-            (ArrayEnd, vec![]),
-        ],
-    );
-
-    assert_eq!(last_event("["), Error(SyntaxError(EOFWhileParsingValue, 1, 2)));
-
-    assert_eq!(from_str("["), Err(SyntaxError(EOFWhileParsingValue, 1, 2)));
-    assert_eq!(from_str("[1"), Err(SyntaxError(EOFWhileParsingArray, 1, 3)));
-    assert_eq!(from_str("[1,"), Err(SyntaxError(EOFWhileParsingValue, 1, 4)));
-    assert_eq!(from_str("[1,]"), Err(SyntaxError(InvalidSyntax, 1, 4)));
-    assert_eq!(from_str("[6 7]"), Err(SyntaxError(InvalidSyntax, 1, 4)));
-}
-#[test]
-fn test_trailing_characters_streaming() {
-    assert_eq!(last_event("nulla"), Error(SyntaxError(TrailingCharacters, 1, 5)));
-    assert_eq!(last_event("truea"), Error(SyntaxError(TrailingCharacters, 1, 5)));
-    assert_eq!(last_event("falsea"), Error(SyntaxError(TrailingCharacters, 1, 6)));
-    assert_eq!(last_event("1a"), Error(SyntaxError(TrailingCharacters, 1, 2)));
-    assert_eq!(last_event("[]a"), Error(SyntaxError(TrailingCharacters, 1, 3)));
-    assert_eq!(last_event("{}a"), Error(SyntaxError(TrailingCharacters, 1, 3)));
-}
-#[test]
-fn test_read_identifiers_streaming() {
-    assert_eq!(Parser::new("null".chars()).next(), Some(NullValue));
-    assert_eq!(Parser::new("true".chars()).next(), Some(BooleanValue(true)));
-    assert_eq!(Parser::new("false".chars()).next(), Some(BooleanValue(false)));
-
-    assert_eq!(last_event("n"), Error(SyntaxError(InvalidSyntax, 1, 2)));
-    assert_eq!(last_event("nul"), Error(SyntaxError(InvalidSyntax, 1, 4)));
-    assert_eq!(last_event("t"), Error(SyntaxError(InvalidSyntax, 1, 2)));
-    assert_eq!(last_event("truz"), Error(SyntaxError(InvalidSyntax, 1, 4)));
-    assert_eq!(last_event("f"), Error(SyntaxError(InvalidSyntax, 1, 2)));
-    assert_eq!(last_event("faz"), Error(SyntaxError(InvalidSyntax, 1, 3)));
-}
-
-#[test]
-fn test_to_json() {
-    use json::ToJson;
-    use std::collections::{BTreeMap, HashMap};
-
-    let array2 = Array(vec![U64(1), U64(2)]);
-    let array3 = Array(vec![U64(1), U64(2), U64(3)]);
-    let object = {
-        let mut tree_map = BTreeMap::new();
-        tree_map.insert("a".to_string(), U64(1));
-        tree_map.insert("b".to_string(), U64(2));
-        Object(tree_map)
-    };
-
-    assert_eq!(array2.to_json(), array2);
-    assert_eq!(object.to_json(), object);
-    assert_eq!(3_isize.to_json(), I64(3));
-    assert_eq!(4_i8.to_json(), I64(4));
-    assert_eq!(5_i16.to_json(), I64(5));
-    assert_eq!(6_i32.to_json(), I64(6));
-    assert_eq!(7_i64.to_json(), I64(7));
-    assert_eq!(8_usize.to_json(), U64(8));
-    assert_eq!(9_u8.to_json(), U64(9));
-    assert_eq!(10_u16.to_json(), U64(10));
-    assert_eq!(11_u32.to_json(), U64(11));
-    assert_eq!(12_u64.to_json(), U64(12));
-    assert_eq!(13.0_f32.to_json(), F64(13.0_f64));
-    assert_eq!(14.0_f64.to_json(), F64(14.0_f64));
-    assert_eq!(().to_json(), Null);
-    assert_eq!(f32::INFINITY.to_json(), Null);
-    assert_eq!(f64::NAN.to_json(), Null);
-    assert_eq!(true.to_json(), Boolean(true));
-    assert_eq!(false.to_json(), Boolean(false));
-    assert_eq!("abc".to_json(), String("abc".to_string()));
-    assert_eq!("abc".to_string().to_json(), String("abc".to_string()));
-    assert_eq!((1_usize, 2_usize).to_json(), array2);
-    assert_eq!((1_usize, 2_usize, 3_usize).to_json(), array3);
-    assert_eq!([1_usize, 2_usize].to_json(), array2);
-    assert_eq!((&[1_usize, 2_usize, 3_usize]).to_json(), array3);
-    assert_eq!((vec![1_usize, 2_usize]).to_json(), array2);
-    assert_eq!(vec![1_usize, 2_usize, 3_usize].to_json(), array3);
-    let mut tree_map = BTreeMap::new();
-    tree_map.insert("a".to_string(), 1 as usize);
-    tree_map.insert("b".to_string(), 2);
-    assert_eq!(tree_map.to_json(), object);
-    let mut hash_map = HashMap::new();
-    hash_map.insert("a".to_string(), 1 as usize);
-    hash_map.insert("b".to_string(), 2);
-    assert_eq!(hash_map.to_json(), object);
-    assert_eq!(Some(15).to_json(), I64(15));
-    assert_eq!(Some(15 as usize).to_json(), U64(15));
-    assert_eq!(None::<isize>.to_json(), Null);
-}
-
-#[test]
-fn test_encode_hashmap_with_arbitrary_key() {
-    use std::collections::HashMap;
-    #[derive(PartialEq, Eq, Hash, Encodable)]
-    struct ArbitraryType(usize);
-    let mut hm: HashMap<ArbitraryType, bool> = HashMap::new();
-    hm.insert(ArbitraryType(1), true);
-    let mut mem_buf = string::String::new();
-    let mut encoder = Encoder::new(&mut mem_buf);
-    let result = hm.encode(&mut encoder);
-    match result.unwrap_err() {
-        EncoderError::BadHashmapKey => (),
-        _ => panic!("expected bad hash map key"),
-    }
-}
diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs
index 997f361737b..5190cd44936 100644
--- a/compiler/rustc_session/src/config.rs
+++ b/compiler/rustc_session/src/config.rs
@@ -741,7 +741,6 @@ impl Default for Options {
             incremental: None,
             debugging_opts: Default::default(),
             prints: Vec::new(),
-            borrowck_mode: BorrowckMode::Migrate,
             cg: Default::default(),
             error_format: ErrorOutputType::default(),
             externs: Externs(BTreeMap::new()),
@@ -2084,14 +2083,6 @@ fn parse_libs(matches: &getopts::Matches, error_format: ErrorOutputType) -> Vec<
         .collect()
 }
 
-fn parse_borrowck_mode(dopts: &DebuggingOptions, error_format: ErrorOutputType) -> BorrowckMode {
-    match dopts.borrowck.as_ref() {
-        "migrate" => BorrowckMode::Migrate,
-        "mir" => BorrowckMode::Mir,
-        m => early_error(error_format, &format!("unknown borrowck mode `{m}`")),
-    }
-}
-
 pub fn parse_externs(
     matches: &getopts::Matches,
     debugging_opts: &DebuggingOptions,
@@ -2429,8 +2420,6 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
 
     let test = matches.opt_present("test");
 
-    let borrowck_mode = parse_borrowck_mode(&debugging_opts, error_format);
-
     if !cg.remark.is_empty() && debuginfo == DebugInfo::None {
         early_warn(error_format, "-C remark requires \"-C debuginfo=n\" to show source locations");
     }
@@ -2506,7 +2495,6 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
         incremental,
         debugging_opts,
         prints,
-        borrowck_mode,
         cg,
         error_format,
         externs,
diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs
index 66198dff2ae..181acc224fa 100644
--- a/compiler/rustc_session/src/options.rs
+++ b/compiler/rustc_session/src/options.rs
@@ -178,9 +178,6 @@ top_level_options!(
 
         debugging_opts: DebuggingOptions [SUBSTRUCT],
         prints: Vec<PrintRequest> [UNTRACKED],
-        /// Determines which borrow checker(s) to run. This is the parsed, sanitized
-        /// version of `debugging_opts.borrowck`, which is just a plain string.
-        borrowck_mode: BorrowckMode [UNTRACKED],
         cg: CodegenOptions [SUBSTRUCT],
         externs: Externs [UNTRACKED],
         crate_name: Option<String> [TRACKED],
@@ -1207,15 +1204,9 @@ options! {
     assert_incr_state: Option<String> = (None, parse_opt_string, [UNTRACKED],
         "assert that the incremental cache is in given state: \
          either `loaded` or `not-loaded`."),
-    ast_json: bool = (false, parse_bool, [UNTRACKED],
-        "print the AST as JSON and halt (default: no)"),
-    ast_json_noexpand: bool = (false, parse_bool, [UNTRACKED],
-        "print the pre-expansion AST as JSON and halt (default: no)"),
     binary_dep_depinfo: bool = (false, parse_bool, [TRACKED],
         "include artifacts (sysroot, crate dependencies) used during compilation in dep-info \
         (default: no)"),
-    borrowck: String = ("migrate".to_string(), parse_string, [UNTRACKED],
-        "select which borrowck is used (`mir` or `migrate`) (default: `migrate`)"),
     branch_protection: Option<BranchProtection> = (None, parse_branch_protection, [TRACKED],
         "set options for branch target identification and pointer authentication on AArch64"),
     cf_protection: CFProtection = (CFProtection::None, parse_cfprotection, [TRACKED],
diff --git a/compiler/rustc_span/src/def_id.rs b/compiler/rustc_span/src/def_id.rs
index 3976c062221..2bd0880a7c4 100644
--- a/compiler/rustc_span/src/def_id.rs
+++ b/compiler/rustc_span/src/def_id.rs
@@ -307,11 +307,8 @@ impl DefId {
 
 impl<E: Encoder> Encodable<E> for DefId {
     default fn encode(&self, s: &mut E) -> Result<(), E::Error> {
-        s.emit_struct(false, |s| {
-            s.emit_struct_field("krate", true, |s| self.krate.encode(s))?;
-
-            s.emit_struct_field("index", false, |s| self.index.encode(s))
-        })
+        self.krate.encode(s)?;
+        self.index.encode(s)
     }
 }
 
diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs
index 6805d212f0b..ae0228d6ea0 100644
--- a/compiler/rustc_span/src/lib.rs
+++ b/compiler/rustc_span/src/lib.rs
@@ -18,7 +18,6 @@
 #![feature(let_else)]
 #![feature(if_let_guard)]
 #![feature(negative_impls)]
-#![feature(nll)]
 #![feature(min_specialization)]
 #![feature(rustc_attrs)]
 #![allow(rustc::potential_query_instability)]
@@ -196,24 +195,23 @@ impl Hash for RealFileName {
 // an added assert statement
 impl<S: Encoder> Encodable<S> for RealFileName {
     fn encode(&self, encoder: &mut S) -> Result<(), S::Error> {
-        encoder.emit_enum(|encoder| match *self {
-            RealFileName::LocalPath(ref local_path) => {
-                encoder.emit_enum_variant("LocalPath", 0, 1, |encoder| {
-                    encoder.emit_enum_variant_arg(true, |encoder| local_path.encode(encoder))?;
-                    Ok(())
+        match *self {
+            RealFileName::LocalPath(ref local_path) => encoder.emit_enum_variant(0, |encoder| {
+                Ok({
+                    local_path.encode(encoder)?;
                 })
-            }
+            }),
 
             RealFileName::Remapped { ref local_path, ref virtual_name } => encoder
-                .emit_enum_variant("Remapped", 1, 2, |encoder| {
+                .emit_enum_variant(1, |encoder| {
                     // For privacy and build reproducibility, we must not embed host-dependant path in artifacts
                     // if they have been remapped by --remap-path-prefix
                     assert!(local_path.is_none());
-                    encoder.emit_enum_variant_arg(true, |encoder| local_path.encode(encoder))?;
-                    encoder.emit_enum_variant_arg(false, |encoder| virtual_name.encode(encoder))?;
+                    local_path.encode(encoder)?;
+                    virtual_name.encode(encoder)?;
                     Ok(())
                 }),
-        })
+        }
     }
 }
 
@@ -950,10 +948,8 @@ impl Default for Span {
 impl<E: Encoder> Encodable<E> for Span {
     default fn encode(&self, s: &mut E) -> Result<(), E::Error> {
         let span = self.data();
-        s.emit_struct(false, |s| {
-            s.emit_struct_field("lo", true, |s| span.lo.encode(s))?;
-            s.emit_struct_field("hi", false, |s| span.hi.encode(s))
-        })
+        span.lo.encode(s)?;
+        span.hi.encode(s)
     }
 }
 impl<D: Decoder> Decodable<D> for Span {
@@ -1302,79 +1298,77 @@ pub struct SourceFile {
 
 impl<S: Encoder> Encodable<S> for SourceFile {
     fn encode(&self, s: &mut S) -> Result<(), S::Error> {
-        s.emit_struct(false, |s| {
-            s.emit_struct_field("name", true, |s| self.name.encode(s))?;
-            s.emit_struct_field("src_hash", false, |s| self.src_hash.encode(s))?;
-            s.emit_struct_field("start_pos", false, |s| self.start_pos.encode(s))?;
-            s.emit_struct_field("end_pos", false, |s| self.end_pos.encode(s))?;
-            s.emit_struct_field("lines", false, |s| {
-                // We are always in `Lines` form by the time we reach here.
-                assert!(self.lines.borrow().is_lines());
-                self.lines(|lines| {
-                    // Store the length.
-                    s.emit_u32(lines.len() as u32)?;
-
-                    // Compute and store the difference list.
-                    if lines.len() != 0 {
-                        let max_line_length = if lines.len() == 1 {
-                            0
-                        } else {
-                            lines
-                                .array_windows()
-                                .map(|&[fst, snd]| snd - fst)
-                                .map(|bp| bp.to_usize())
-                                .max()
-                                .unwrap()
-                        };
-
-                        let bytes_per_diff: usize = match max_line_length {
-                            0..=0xFF => 1,
-                            0x100..=0xFFFF => 2,
-                            _ => 4,
-                        };
-
-                        // Encode the number of bytes used per diff.
-                        s.emit_u8(bytes_per_diff as u8)?;
-
-                        // Encode the first element.
-                        lines[0].encode(s)?;
-
-                        // Encode the difference list.
-                        let diff_iter = lines.array_windows().map(|&[fst, snd]| snd - fst);
-                        let num_diffs = lines.len() - 1;
-                        let mut raw_diffs;
-                        match bytes_per_diff {
-                            1 => {
-                                raw_diffs = Vec::with_capacity(num_diffs);
-                                for diff in diff_iter {
-                                    raw_diffs.push(diff.0 as u8);
-                                }
-                            }
-                            2 => {
-                                raw_diffs = Vec::with_capacity(bytes_per_diff * num_diffs);
-                                for diff in diff_iter {
-                                    raw_diffs.extend_from_slice(&(diff.0 as u16).to_le_bytes());
-                                }
-                            }
-                            4 => {
-                                raw_diffs = Vec::with_capacity(bytes_per_diff * num_diffs);
-                                for diff in diff_iter {
-                                    raw_diffs.extend_from_slice(&(diff.0 as u32).to_le_bytes());
-                                }
-                            }
-                            _ => unreachable!(),
+        self.name.encode(s)?;
+        self.src_hash.encode(s)?;
+        self.start_pos.encode(s)?;
+        self.end_pos.encode(s)?;
+
+        // We are always in `Lines` form by the time we reach here.
+        assert!(self.lines.borrow().is_lines());
+        self.lines(|lines| {
+            // Store the length.
+            s.emit_u32(lines.len() as u32)?;
+
+            // Compute and store the difference list.
+            if lines.len() != 0 {
+                let max_line_length = if lines.len() == 1 {
+                    0
+                } else {
+                    lines
+                        .array_windows()
+                        .map(|&[fst, snd]| snd - fst)
+                        .map(|bp| bp.to_usize())
+                        .max()
+                        .unwrap()
+                };
+
+                let bytes_per_diff: usize = match max_line_length {
+                    0..=0xFF => 1,
+                    0x100..=0xFFFF => 2,
+                    _ => 4,
+                };
+
+                // Encode the number of bytes used per diff.
+                s.emit_u8(bytes_per_diff as u8)?;
+
+                // Encode the first element.
+                lines[0].encode(s)?;
+
+                // Encode the difference list.
+                let diff_iter = lines.array_windows().map(|&[fst, snd]| snd - fst);
+                let num_diffs = lines.len() - 1;
+                let mut raw_diffs;
+                match bytes_per_diff {
+                    1 => {
+                        raw_diffs = Vec::with_capacity(num_diffs);
+                        for diff in diff_iter {
+                            raw_diffs.push(diff.0 as u8);
                         }
-                        s.emit_raw_bytes(&raw_diffs)?;
                     }
-                    Ok(())
-                })
-            })?;
-            s.emit_struct_field("multibyte_chars", false, |s| self.multibyte_chars.encode(s))?;
-            s.emit_struct_field("non_narrow_chars", false, |s| self.non_narrow_chars.encode(s))?;
-            s.emit_struct_field("name_hash", false, |s| self.name_hash.encode(s))?;
-            s.emit_struct_field("normalized_pos", false, |s| self.normalized_pos.encode(s))?;
-            s.emit_struct_field("cnum", false, |s| self.cnum.encode(s))
-        })
+                    2 => {
+                        raw_diffs = Vec::with_capacity(bytes_per_diff * num_diffs);
+                        for diff in diff_iter {
+                            raw_diffs.extend_from_slice(&(diff.0 as u16).to_le_bytes());
+                        }
+                    }
+                    4 => {
+                        raw_diffs = Vec::with_capacity(bytes_per_diff * num_diffs);
+                        for diff in diff_iter {
+                            raw_diffs.extend_from_slice(&(diff.0 as u32).to_le_bytes());
+                        }
+                    }
+                    _ => unreachable!(),
+                }
+                s.emit_raw_bytes(&raw_diffs)?;
+            }
+            Ok(())
+        })?;
+
+        self.multibyte_chars.encode(s)?;
+        self.non_narrow_chars.encode(s)?;
+        self.name_hash.encode(s)?;
+        self.normalized_pos.encode(s)?;
+        self.cnum.encode(s)
     }
 }
 
diff --git a/compiler/rustc_symbol_mangling/src/lib.rs b/compiler/rustc_symbol_mangling/src/lib.rs
index ee0994c9ad6..46f70bb1674 100644
--- a/compiler/rustc_symbol_mangling/src/lib.rs
+++ b/compiler/rustc_symbol_mangling/src/lib.rs
@@ -89,7 +89,6 @@
 
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
 #![feature(never_type)]
-#![feature(nll)]
 #![recursion_limit = "256"]
 #![allow(rustc::potential_query_instability)]
 
diff --git a/compiler/rustc_target/Cargo.toml b/compiler/rustc_target/Cargo.toml
index 925813e6bb4..162376af45f 100644
--- a/compiler/rustc_target/Cargo.toml
+++ b/compiler/rustc_target/Cargo.toml
@@ -6,6 +6,7 @@ edition = "2021"
 [dependencies]
 bitflags = "1.2.1"
 tracing = "0.1"
+serde_json = "1.0.59"
 rustc_data_structures = { path = "../rustc_data_structures" }
 rustc_macros = { path = "../rustc_macros" }
 rustc_serialize = { path = "../rustc_serialize" }
diff --git a/compiler/rustc_target/src/abi/mod.rs b/compiler/rustc_target/src/abi/mod.rs
index a771369c807..d1eafd6ac5f 100644
--- a/compiler/rustc_target/src/abi/mod.rs
+++ b/compiler/rustc_target/src/abi/mod.rs
@@ -1,6 +1,7 @@
 pub use Integer::*;
 pub use Primitive::*;
 
+use crate::json::{Json, ToJson};
 use crate::spec::Target;
 
 use std::convert::{TryFrom, TryInto};
@@ -13,7 +14,6 @@ use std::str::FromStr;
 use rustc_data_structures::intern::Interned;
 use rustc_index::vec::{Idx, IndexVec};
 use rustc_macros::HashStable_Generic;
-use rustc_serialize::json::{Json, ToJson};
 
 pub mod call;
 
@@ -166,7 +166,8 @@ impl TargetDataLayout {
             ));
         }
 
-        if dl.pointer_size.bits() != target.pointer_width.into() {
+        let target_pointer_width: u64 = target.pointer_width.into();
+        if dl.pointer_size.bits() != target_pointer_width {
             return Err(format!(
                 "inconsistent target specification: \"data-layout\" claims \
                  pointers are {}-bit, while \"target-pointer-width\" is `{}`",
@@ -574,7 +575,7 @@ impl Align {
 }
 
 /// A pair of alignments, ABI-mandated and preferred.
-#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, Encodable, Decodable)]
+#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
 #[derive(HashStable_Generic)]
 pub struct AbiAndPrefAlign {
     pub abi: Align,
@@ -746,6 +747,11 @@ impl Primitive {
     pub fn is_int(self) -> bool {
         matches!(self, Int(..))
     }
+
+    #[inline]
+    pub fn is_ptr(self) -> bool {
+        matches!(self, Pointer)
+    }
 }
 
 /// Inclusive wrap-around range of valid values, that is, if
diff --git a/compiler/rustc_target/src/json.rs b/compiler/rustc_target/src/json.rs
new file mode 100644
index 00000000000..b5d92635212
--- /dev/null
+++ b/compiler/rustc_target/src/json.rs
@@ -0,0 +1,91 @@
+use std::borrow::Cow;
+use std::collections::BTreeMap;
+
+pub use serde_json::Value as Json;
+use serde_json::{Map, Number};
+
+pub trait ToJson {
+    fn to_json(&self) -> Json;
+}
+
+impl ToJson for Json {
+    fn to_json(&self) -> Json {
+        self.clone()
+    }
+}
+
+macro_rules! to_json_impl_num {
+    ($($t:ty), +) => (
+        $(impl ToJson for $t {
+            fn to_json(&self) -> Json {
+                Json::Number(Number::from(*self))
+            }
+        })+
+    )
+}
+
+to_json_impl_num! { isize, i8, i16, i32, i64, usize, u8, u16, u32, u64 }
+
+impl ToJson for bool {
+    fn to_json(&self) -> Json {
+        Json::Bool(*self)
+    }
+}
+
+impl ToJson for str {
+    fn to_json(&self) -> Json {
+        Json::String(self.to_owned())
+    }
+}
+
+impl ToJson for String {
+    fn to_json(&self) -> Json {
+        Json::String(self.to_owned())
+    }
+}
+
+impl<'a> ToJson for Cow<'a, str> {
+    fn to_json(&self) -> Json {
+        Json::String(self.to_string())
+    }
+}
+
+impl<A: ToJson> ToJson for [A] {
+    fn to_json(&self) -> Json {
+        Json::Array(self.iter().map(|elt| elt.to_json()).collect())
+    }
+}
+
+impl<A: ToJson> ToJson for Vec<A> {
+    fn to_json(&self) -> Json {
+        Json::Array(self.iter().map(|elt| elt.to_json()).collect())
+    }
+}
+
+impl<'a, A: ToJson> ToJson for Cow<'a, [A]>
+where
+    [A]: ToOwned,
+{
+    fn to_json(&self) -> Json {
+        Json::Array(self.iter().map(|elt| elt.to_json()).collect())
+    }
+}
+
+impl<T: ToString, A: ToJson> ToJson for BTreeMap<T, A> {
+    fn to_json(&self) -> Json {
+        let mut d = Map::new();
+        for (key, value) in self {
+            d.insert(key.to_string(), value.to_json());
+        }
+        Json::Object(d)
+    }
+}
+
+impl<A: ToJson> ToJson for Option<A> {
+    fn to_json(&self) -> Json {
+        match *self {
+            None => Json::Null,
+            Some(ref value) => value.to_json(),
+        }
+    }
+}
diff --git a/compiler/rustc_target/src/lib.rs b/compiler/rustc_target/src/lib.rs
index 4dc6af15001..a8ddcc9bfac 100644
--- a/compiler/rustc_target/src/lib.rs
+++ b/compiler/rustc_target/src/lib.rs
@@ -13,7 +13,6 @@
 #![feature(let_else)]
 #![feature(min_specialization)]
 #![feature(never_type)]
-#![feature(nll)]
 #![feature(rustc_attrs)]
 #![feature(step_trait)]
 
@@ -28,6 +27,7 @@ extern crate tracing;
 
 pub mod abi;
 pub mod asm;
+pub mod json;
 pub mod spec;
 
 #[cfg(test)]
diff --git a/compiler/rustc_target/src/spec/crt_objects.rs b/compiler/rustc_target/src/spec/crt_objects.rs
index 51f392a64b1..52ac3622eca 100644
--- a/compiler/rustc_target/src/spec/crt_objects.rs
+++ b/compiler/rustc_target/src/spec/crt_objects.rs
@@ -40,8 +40,8 @@
 //! but not gcc's. As a result rustc cannot link with C++ static libraries (#36710)
 //! when linking in self-contained mode.
 
+use crate::json::{Json, ToJson};
 use crate::spec::LinkOutputKind;
-use rustc_serialize::json::{Json, ToJson};
 use std::borrow::Cow;
 use std::collections::BTreeMap;
 use std::str::FromStr;
diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
index 6dd245b047c..0f5db8982e8 100644
--- a/compiler/rustc_target/src/spec/mod.rs
+++ b/compiler/rustc_target/src/spec/mod.rs
@@ -35,11 +35,12 @@
 //! to the list specified by the target, rather than replace.
 
 use crate::abi::Endian;
+use crate::json::{Json, ToJson};
 use crate::spec::abi::{lookup as lookup_abi, Abi};
 use crate::spec::crt_objects::{CrtObjects, CrtObjectsFallback};
 use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
-use rustc_serialize::json::{Json, ToJson};
 use rustc_span::symbol::{sym, Symbol};
+use serde_json::Value;
 use std::borrow::Cow;
 use std::collections::BTreeMap;
 use std::convert::TryFrom;
@@ -211,7 +212,7 @@ impl ToJson for PanicStrategy {
     }
 }
 
-#[derive(Clone, Copy, Debug, PartialEq, Hash, Encodable, Decodable)]
+#[derive(Clone, Copy, Debug, PartialEq, Hash)]
 pub enum RelroLevel {
     Full,
     Partial,
@@ -255,7 +256,7 @@ impl ToJson for RelroLevel {
     }
 }
 
-#[derive(Clone, Copy, Debug, PartialEq, Hash, Encodable, Decodable)]
+#[derive(Clone, Copy, Debug, PartialEq, Hash)]
 pub enum MergeFunctions {
     Disabled,
     Trampolines,
@@ -548,7 +549,7 @@ impl StackProbeType {
         let object = json.as_object().ok_or_else(|| "expected a JSON object")?;
         let kind = object
             .get("kind")
-            .and_then(|o| o.as_string())
+            .and_then(|o| o.as_str())
             .ok_or_else(|| "expected `kind` to be a string")?;
         match kind {
             "none" => Ok(StackProbeType::None),
@@ -592,11 +593,11 @@ impl ToJson for StackProbeType {
             StackProbeType::Call => {
                 [(String::from("kind"), "call".to_json())].into_iter().collect()
             }
-            StackProbeType::InlineOrCall { min_llvm_version_for_inline } => [
+            StackProbeType::InlineOrCall { min_llvm_version_for_inline: (maj, min, patch) } => [
                 (String::from("kind"), "inline-or-call".to_json()),
                 (
                     String::from("min-llvm-version-for-inline"),
-                    min_llvm_version_for_inline.to_json(),
+                    Json::Array(vec![maj.to_json(), min.to_json(), patch.to_json()]),
                 ),
             ]
             .into_iter()
@@ -983,6 +984,7 @@ supported_targets! {
     ("riscv32imc-unknown-none-elf", riscv32imc_unknown_none_elf),
     ("riscv32imc-esp-espidf", riscv32imc_esp_espidf),
     ("riscv32imac-unknown-none-elf", riscv32imac_unknown_none_elf),
+    ("riscv32imac-unknown-xous-elf", riscv32imac_unknown_xous_elf),
     ("riscv32gc-unknown-linux-gnu", riscv32gc_unknown_linux_gnu),
     ("riscv32gc-unknown-linux-musl", riscv32gc_unknown_linux_musl),
     ("riscv64imac-unknown-none-elf", riscv64imac_unknown_none_elf),
@@ -1682,7 +1684,7 @@ impl Target {
     }
 
     /// Loads a target descriptor from a JSON object.
-    pub fn from_json(mut obj: Json) -> Result<(Target, TargetWarnings), String> {
+    pub fn from_json(obj: Json) -> Result<(Target, TargetWarnings), String> {
         // While ugly, this code must remain this way to retain
         // compatibility with existing JSON fields and the internal
         // expected naming of the Target and TargetOptions structs.
@@ -1690,9 +1692,14 @@ impl Target {
         // are round-tripped through this code to catch cases where
         // the JSON parser is not updated to match the structs.
 
+        let mut obj = match obj {
+            Value::Object(obj) => obj,
+            _ => return Err("Expected JSON object for target")?,
+        };
+
         let mut get_req_field = |name: &str| {
-            obj.remove_key(name)
-                .and_then(|j| Json::as_string(&j).map(str::to_string))
+            obj.remove(name)
+                .and_then(|j| j.as_str().map(str::to_string))
                 .ok_or_else(|| format!("Field {} in target specification is required", name))
         };
 
@@ -1711,31 +1718,31 @@ impl Target {
         macro_rules! key {
             ($key_name:ident) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                if let Some(s) = obj.remove_key(&name).and_then(|j| Json::as_string(&j).map(str::to_string).map(Cow::from)) {
+                if let Some(s) = obj.remove(&name).and_then(|s| s.as_str().map(str::to_string).map(Cow::from)) {
                     base.$key_name = s;
                 }
             } );
             ($key_name:ident = $json_name:expr) => ( {
                 let name = $json_name;
-                if let Some(s) = obj.remove_key(&name).and_then(|j| Json::as_string(&j).map(str::to_string).map(Cow::from)) {
+                if let Some(s) = obj.remove(name).and_then(|s| s.as_str().map(str::to_string).map(Cow::from)) {
                     base.$key_name = s;
                 }
             } );
             ($key_name:ident, bool) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                if let Some(s) = obj.remove_key(&name).and_then(|j| Json::as_boolean(&j)) {
+                if let Some(s) = obj.remove(&name).and_then(|b| b.as_bool()) {
                     base.$key_name = s;
                 }
             } );
             ($key_name:ident, u64) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                if let Some(s) = obj.remove_key(&name).and_then(|j| Json::as_u64(&j)) {
+                if let Some(s) = obj.remove(&name).and_then(|j| Json::as_u64(&j)) {
                     base.$key_name = s;
                 }
             } );
             ($key_name:ident, Option<u32>) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                if let Some(s) = obj.remove_key(&name).and_then(|j| Json::as_u64(&j)) {
+                if let Some(s) = obj.remove(&name).and_then(|b| b.as_u64()) {
                     if s < 1 || s > 5 {
                         return Err("Not a valid DWARF version number".into());
                     }
@@ -1744,13 +1751,13 @@ impl Target {
             } );
             ($key_name:ident, Option<u64>) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                if let Some(s) = obj.remove_key(&name).and_then(|j| Json::as_u64(&j)) {
+                if let Some(s) = obj.remove(&name).and_then(|b| b.as_u64()) {
                     base.$key_name = Some(s);
                 }
             } );
             ($key_name:ident, MergeFunctions) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                obj.remove_key(&name[..]).and_then(|o| o.as_string().and_then(|s| {
+                obj.remove(&name).and_then(|o| o.as_str().and_then(|s| {
                     match s.parse::<MergeFunctions>() {
                         Ok(mergefunc) => base.$key_name = mergefunc,
                         _ => return Some(Err(format!("'{}' is not a valid value for \
@@ -1763,7 +1770,7 @@ impl Target {
             } );
             ($key_name:ident, RelocModel) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                obj.remove_key(&name[..]).and_then(|o| o.as_string().and_then(|s| {
+                obj.remove(&name).and_then(|o| o.as_str().and_then(|s| {
                     match s.parse::<RelocModel>() {
                         Ok(relocation_model) => base.$key_name = relocation_model,
                         _ => return Some(Err(format!("'{}' is not a valid relocation model. \
@@ -1775,7 +1782,7 @@ impl Target {
             } );
             ($key_name:ident, CodeModel) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                obj.remove_key(&name[..]).and_then(|o| o.as_string().and_then(|s| {
+                obj.remove(&name).and_then(|o| o.as_str().and_then(|s| {
                     match s.parse::<CodeModel>() {
                         Ok(code_model) => base.$key_name = Some(code_model),
                         _ => return Some(Err(format!("'{}' is not a valid code model. \
@@ -1787,7 +1794,7 @@ impl Target {
             } );
             ($key_name:ident, TlsModel) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                obj.remove_key(&name[..]).and_then(|o| o.as_string().and_then(|s| {
+                obj.remove(&name).and_then(|o| o.as_str().and_then(|s| {
                     match s.parse::<TlsModel>() {
                         Ok(tls_model) => base.$key_name = tls_model,
                         _ => return Some(Err(format!("'{}' is not a valid TLS model. \
@@ -1799,7 +1806,7 @@ impl Target {
             } );
             ($key_name:ident, PanicStrategy) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                obj.remove_key(&name[..]).and_then(|o| o.as_string().and_then(|s| {
+                obj.remove(&name).and_then(|o| o.as_str().and_then(|s| {
                     match s {
                         "unwind" => base.$key_name = PanicStrategy::Unwind,
                         "abort" => base.$key_name = PanicStrategy::Abort,
@@ -1812,7 +1819,7 @@ impl Target {
             } );
             ($key_name:ident, RelroLevel) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                obj.remove_key(&name[..]).and_then(|o| o.as_string().and_then(|s| {
+                obj.remove(&name).and_then(|o| o.as_str().and_then(|s| {
                     match s.parse::<RelroLevel>() {
                         Ok(level) => base.$key_name = level,
                         _ => return Some(Err(format!("'{}' is not a valid value for \
@@ -1824,7 +1831,7 @@ impl Target {
             } );
             ($key_name:ident, SplitDebuginfo) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                obj.remove_key(&name[..]).and_then(|o| o.as_string().and_then(|s| {
+                obj.remove(&name).and_then(|o| o.as_str().and_then(|s| {
                     match s.parse::<SplitDebuginfo>() {
                         Ok(level) => base.$key_name = level,
                         _ => return Some(Err(format!("'{}' is not a valid value for \
@@ -1836,10 +1843,10 @@ impl Target {
             } );
             ($key_name:ident, list) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                if let Some(j) = obj.remove_key(&name){
-                    if let Some(v) = Json::as_array(&j) {
+                if let Some(j) = obj.remove(&name) {
+                    if let Some(v) = j.as_array() {
                         base.$key_name = v.iter()
-                            .map(|a| a.as_string().unwrap().to_string().into())
+                            .map(|a| a.as_str().unwrap().to_string().into())
                             .collect();
                     } else {
                         incorrect_type.push(name)
@@ -1848,10 +1855,10 @@ impl Target {
             } );
             ($key_name:ident, opt_list) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                if let Some(j) = obj.remove_key(&name) {
-                    if let Some(v) = Json::as_array(&j) {
+                if let Some(j) = obj.remove(&name) {
+                    if let Some(v) = j.as_array() {
                         base.$key_name = Some(v.iter()
-                            .map(|a| a.as_string().unwrap().to_string().into())
+                            .map(|a| a.as_str().unwrap().to_string().into())
                             .collect());
                     } else {
                         incorrect_type.push(name)
@@ -1860,15 +1867,15 @@ impl Target {
             } );
             ($key_name:ident, optional) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                if let Some(o) = obj.remove_key(&name[..]) {
+                if let Some(o) = obj.remove(&name) {
                     base.$key_name = o
-                        .as_string()
+                        .as_str()
                         .map(|s| s.to_string().into());
                 }
             } );
             ($key_name:ident, LldFlavor) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                obj.remove_key(&name[..]).and_then(|o| o.as_string().and_then(|s| {
+                obj.remove(&name).and_then(|o| o.as_str().and_then(|s| {
                     if let Some(flavor) = LldFlavor::from_str(&s) {
                         base.$key_name = flavor;
                     } else {
@@ -1882,7 +1889,7 @@ impl Target {
             } );
             ($key_name:ident, LinkerFlavor) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                obj.remove_key(&name[..]).and_then(|o| o.as_string().and_then(|s| {
+                obj.remove(&name).and_then(|o| o.as_str().and_then(|s| {
                     match LinkerFlavor::from_str(s) {
                         Some(linker_flavor) => base.$key_name = linker_flavor,
                         _ => return Some(Err(format!("'{}' is not a valid value for linker-flavor. \
@@ -1893,7 +1900,7 @@ impl Target {
             } );
             ($key_name:ident, StackProbeType) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                obj.remove_key(&name[..]).and_then(|o| match StackProbeType::from_json(&o) {
+                obj.remove(&name).and_then(|o| match StackProbeType::from_json(&o) {
                     Ok(v) => {
                         base.$key_name = v;
                         Some(Ok(()))
@@ -1905,10 +1912,10 @@ impl Target {
             } );
             ($key_name:ident, SanitizerSet) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                if let Some(o) = obj.remove_key(&name[..]) {
+                if let Some(o) = obj.remove(&name) {
                     if let Some(a) = o.as_array() {
                         for s in a {
-                            base.$key_name |= match s.as_string() {
+                            base.$key_name |= match s.as_str() {
                                 Some("address") => SanitizerSet::ADDRESS,
                                 Some("cfi") => SanitizerSet::CFI,
                                 Some("leak") => SanitizerSet::LEAK,
@@ -1929,7 +1936,7 @@ impl Target {
 
             ($key_name:ident, crt_objects_fallback) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                obj.remove_key(&name[..]).and_then(|o| o.as_string().and_then(|s| {
+                obj.remove(&name).and_then(|o| o.as_str().and_then(|s| {
                     match s.parse::<CrtObjectsFallback>() {
                         Ok(fallback) => base.$key_name = Some(fallback),
                         _ => return Some(Err(format!("'{}' is not a valid CRT objects fallback. \
@@ -1940,7 +1947,7 @@ impl Target {
             } );
             ($key_name:ident, link_objects) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                if let Some(val) = obj.remove_key(&name[..]) {
+                if let Some(val) = obj.remove(&name) {
                     let obj = val.as_object().ok_or_else(|| format!("{}: expected a \
                         JSON object with fields per CRT object kind.", name))?;
                     let mut args = CrtObjects::new();
@@ -1955,7 +1962,7 @@ impl Target {
                             format!("{}.{}: expected a JSON array", name, k)
                         )?.iter().enumerate()
                             .map(|(i,s)| {
-                                let s = s.as_string().ok_or_else(||
+                                let s = s.as_str().ok_or_else(||
                                     format!("{}.{}[{}]: expected a JSON string", name, k, i))?;
                                 Ok(s.to_string().into())
                             })
@@ -1968,7 +1975,7 @@ impl Target {
             } );
             ($key_name:ident, link_args) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                if let Some(val) = obj.remove_key(&name[..]) {
+                if let Some(val) = obj.remove(&name) {
                     let obj = val.as_object().ok_or_else(|| format!("{}: expected a \
                         JSON object with fields per linker-flavor.", name))?;
                     let mut args = LinkArgs::new();
@@ -1982,7 +1989,7 @@ impl Target {
                             format!("{}.{}: expected a JSON array", name, k)
                         )?.iter().enumerate()
                             .map(|(i,s)| {
-                                let s = s.as_string().ok_or_else(||
+                                let s = s.as_str().ok_or_else(||
                                     format!("{}.{}[{}]: expected a JSON string", name, k, i))?;
                                 Ok(s.to_string().into())
                             })
@@ -1995,10 +2002,10 @@ impl Target {
             } );
             ($key_name:ident, env) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                if let Some(o) = obj.remove_key(&name[..]) {
+                if let Some(o) = obj.remove(&name) {
                     if let Some(a) = o.as_array() {
                         for o in a {
-                            if let Some(s) = o.as_string() {
+                            if let Some(s) = o.as_str() {
                                 let p = s.split('=').collect::<Vec<_>>();
                                 if p.len() == 2 {
                                     let k = p[0].to_string();
@@ -2014,7 +2021,7 @@ impl Target {
             } );
             ($key_name:ident, Option<Abi>) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
-                obj.remove_key(&name[..]).and_then(|o| o.as_string().and_then(|s| {
+                obj.remove(&name).and_then(|o| o.as_str().and_then(|s| {
                     match lookup_abi(s) {
                         Some(abi) => base.$key_name = Some(abi),
                         _ => return Some(Err(format!("'{}' is not a valid value for abi", s))),
@@ -2023,28 +2030,28 @@ impl Target {
                 })).unwrap_or(Ok(()))
             } );
             ($key_name:ident, TargetFamilies) => ( {
-                if let Some(value) = obj.remove_key("target-family") {
-                    if let Some(v) = Json::as_array(&value) {
+                if let Some(value) = obj.remove("target-family") {
+                    if let Some(v) = value.as_array() {
                         base.$key_name = v.iter()
-                            .map(|a| a.as_string().unwrap().to_string().into())
+                            .map(|a| a.as_str().unwrap().to_string().into())
                             .collect();
-                    } else if let Some(v) = Json::as_string(&value) {
+                    } else if let Some(v) = value.as_str() {
                         base.$key_name = vec![v.to_string().into()].into();
                     }
                 }
             } );
         }
 
-        if let Some(j) = obj.remove_key("target-endian") {
-            if let Some(s) = Json::as_string(&j) {
+        if let Some(j) = obj.remove("target-endian") {
+            if let Some(s) = j.as_str() {
                 base.endian = s.parse()?;
             } else {
                 incorrect_type.push("target-endian".into())
             }
         }
 
-        if let Some(fp) = obj.remove_key("frame-pointer") {
-            if let Some(s) = Json::as_string(&fp) {
+        if let Some(fp) = obj.remove("frame-pointer") {
+            if let Some(s) = fp.as_str() {
                 base.frame_pointer = s
                     .parse()
                     .map_err(|()| format!("'{}' is not a valid value for frame-pointer", s))?;
@@ -2156,8 +2163,8 @@ impl Target {
             // This can cause unfortunate ICEs later down the line.
             return Err("may not set is_builtin for targets not built-in".into());
         }
-        // Each field should have been read using `Json::remove_key` so any keys remaining are unused.
-        let remaining_keys = obj.as_object().ok_or("Expected JSON object for target")?.keys();
+        // Each field should have been read using `Json::remove` so any keys remaining are unused.
+        let remaining_keys = obj.keys();
         Ok((
             base,
             TargetWarnings { unused_fields: remaining_keys.cloned().collect(), incorrect_type },
@@ -2189,13 +2196,12 @@ impl Target {
         target_triple: &TargetTriple,
         sysroot: &Path,
     ) -> Result<(Target, TargetWarnings), String> {
-        use rustc_serialize::json;
         use std::env;
         use std::fs;
 
         fn load_file(path: &Path) -> Result<(Target, TargetWarnings), String> {
             let contents = fs::read_to_string(path).map_err(|e| e.to_string())?;
-            let obj = json::from_str(&contents).map_err(|e| e.to_string())?;
+            let obj = serde_json::from_str(&contents).map_err(|e| e.to_string())?;
             Target::from_json(obj)
         }
 
@@ -2248,7 +2254,7 @@ impl Target {
 
 impl ToJson for Target {
     fn to_json(&self) -> Json {
-        let mut d = BTreeMap::new();
+        let mut d = serde_json::Map::new();
         let default: TargetOptions = Default::default();
 
         macro_rules! target_val {
diff --git a/compiler/rustc_target/src/spec/riscv32imac_unknown_xous_elf.rs b/compiler/rustc_target/src/spec/riscv32imac_unknown_xous_elf.rs
new file mode 100644
index 00000000000..b46ca159370
--- /dev/null
+++ b/compiler/rustc_target/src/spec/riscv32imac_unknown_xous_elf.rs
@@ -0,0 +1,24 @@
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel};
+use crate::spec::{Target, TargetOptions};
+
+pub fn target() -> Target {
+    Target {
+        data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
+        llvm_target: "riscv32".into(),
+        pointer_width: 32,
+        arch: "riscv32".into(),
+
+        options: TargetOptions {
+            os: "xous".into(),
+            linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
+            linker: Some("rust-lld".into()),
+            cpu: "generic-rv32".into(),
+            max_atomic_width: Some(32),
+            features: "+m,+a,+c".into(),
+            executables: true,
+            panic_strategy: PanicStrategy::Abort,
+            relocation_model: RelocModel::Static,
+            ..Default::default()
+        },
+    }
+}
diff --git a/compiler/rustc_target/src/tests.rs b/compiler/rustc_target/src/tests.rs
index 3a737b3355a..76375170db6 100644
--- a/compiler/rustc_target/src/tests.rs
+++ b/compiler/rustc_target/src/tests.rs
@@ -1,10 +1,8 @@
 use crate::spec::Target;
-use rustc_serialize::json::Json;
-use std::str::FromStr;
 
 #[test]
 fn report_unused_fields() {
-    let json = Json::from_str(
+    let json = serde_json::from_str(
         r#"
     {
         "arch": "powerpc64",
@@ -23,7 +21,7 @@ fn report_unused_fields() {
 
 #[test]
 fn report_incorrect_json_type() {
-    let json = Json::from_str(
+    let json = serde_json::from_str(
         r#"
     {
         "arch": "powerpc64",
@@ -42,7 +40,7 @@ fn report_incorrect_json_type() {
 
 #[test]
 fn no_warnings_for_valid_target() {
-    let json = Json::from_str(
+    let json = serde_json::from_str(
         r#"
     {
         "arch": "powerpc64",
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
index d0f20022bfb..185f500808f 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
@@ -5,7 +5,7 @@ use super::{
 
 use crate::autoderef::Autoderef;
 use crate::infer::InferCtxt;
-use crate::traits::normalize_projection_type;
+use crate::traits::normalize_to;
 
 use rustc_data_structures::fx::FxHashSet;
 use rustc_data_structures::stack::ensure_sufficient_stack;
@@ -146,11 +146,13 @@ impl<'tcx, 'a> GeneratorData<'tcx, 'a> {
     /// that are live across the yield of this generator
     fn get_generator_interior_types(
         &self,
-    ) -> ty::Binder<'tcx, &Vec<GeneratorInteriorTypeCause<'tcx>>> {
+    ) -> ty::Binder<'tcx, &[GeneratorInteriorTypeCause<'tcx>]> {
         match self {
-            GeneratorData::Local(typeck_result) => typeck_result.generator_interior_types.as_ref(),
+            GeneratorData::Local(typeck_result) => {
+                typeck_result.generator_interior_types.as_deref()
+            }
             GeneratorData::Foreign(generator_diagnostic_data) => {
-                generator_diagnostic_data.generator_interior_types.as_ref()
+                generator_diagnostic_data.generator_interior_types.as_deref()
             }
         }
     }
@@ -2704,55 +2706,43 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
                 let future_trait = self.tcx.require_lang_item(LangItem::Future, None);
 
                 let self_ty = self.resolve_vars_if_possible(trait_pred.self_ty());
-
-                // Do not check on infer_types to avoid panic in evaluate_obligation.
-                if self_ty.has_infer_types() {
-                    return;
-                }
-                let self_ty = self.tcx.erase_regions(self_ty);
-
                 let impls_future = self.type_implements_trait(
                     future_trait,
-                    self_ty.skip_binder(),
+                    self.tcx.erase_late_bound_regions(self_ty),
                     ty::List::empty(),
                     obligation.param_env,
                 );
+                if !impls_future.must_apply_modulo_regions() {
+                    return;
+                }
 
                 let item_def_id = self.tcx.associated_item_def_ids(future_trait)[0];
                 // `<T as Future>::Output`
-                let projection_ty = ty::ProjectionTy {
-                    // `T`
-                    substs: self.tcx.mk_substs_trait(
-                        trait_pred.self_ty().skip_binder(),
-                        &self.fresh_substs_for_item(span, item_def_id)[1..],
-                    ),
-                    // `Future::Output`
-                    item_def_id,
-                };
-
-                let mut selcx = SelectionContext::new(self);
-
-                let mut obligations = vec![];
-                let normalized_ty = normalize_projection_type(
-                    &mut selcx,
+                let projection_ty = trait_pred.map_bound(|trait_pred| {
+                    self.tcx.mk_projection(
+                        item_def_id,
+                        // Future::Output has no substs
+                        self.tcx.mk_substs_trait(trait_pred.self_ty(), &[]),
+                    )
+                });
+                let projection_ty = normalize_to(
+                    &mut SelectionContext::new(self),
                     obligation.param_env,
-                    projection_ty,
                     obligation.cause.clone(),
-                    0,
-                    &mut obligations,
+                    projection_ty,
+                    &mut vec![],
                 );
 
                 debug!(
                     "suggest_await_before_try: normalized_projection_type {:?}",
-                    self.resolve_vars_if_possible(normalized_ty)
+                    self.resolve_vars_if_possible(projection_ty)
                 );
                 let try_obligation = self.mk_trait_obligation_with_new_self_ty(
                     obligation.param_env,
-                    trait_pred.map_bound(|trait_pred| (trait_pred, normalized_ty.ty().unwrap())),
+                    trait_pred.map_bound(|trait_pred| (trait_pred, projection_ty.skip_binder())),
                 );
                 debug!("suggest_await_before_try: try_trait_obligation {:?}", try_obligation);
                 if self.predicate_may_hold(&try_obligation)
-                    && impls_future.must_apply_modulo_regions()
                     && let Ok(snippet) = self.tcx.sess.source_map().span_to_snippet(span)
                     && snippet.ends_with('?')
                 {
diff --git a/compiler/rustc_trait_selection/src/traits/misc.rs b/compiler/rustc_trait_selection/src/traits/misc.rs
index b83b0bf1ca5..f04f527ccb7 100644
--- a/compiler/rustc_trait_selection/src/traits/misc.rs
+++ b/compiler/rustc_trait_selection/src/traits/misc.rs
@@ -20,7 +20,7 @@ pub fn can_type_implement_copy<'tcx>(
     tcx: TyCtxt<'tcx>,
     param_env: ty::ParamEnv<'tcx>,
     self_type: Ty<'tcx>,
-    cause: ObligationCause<'tcx>,
+    parent_cause: ObligationCause<'tcx>,
 ) -> Result<(), CopyImplementationError<'tcx>> {
     // FIXME: (@jroesch) float this code up
     tcx.infer_ctxt().enter(|infcx| {
@@ -59,7 +59,7 @@ pub fn can_type_implement_copy<'tcx>(
                     .ty(tcx, traits::InternalSubsts::identity_for_item(tcx, adt.did()))
                     .has_param_types_or_consts()
                 {
-                    cause.clone()
+                    parent_cause.clone()
                 } else {
                     ObligationCause::dummy_with_span(span)
                 };
diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs
index 641b915f373..17e0fae9853 100644
--- a/compiler/rustc_trait_selection/src/traits/project.rs
+++ b/compiler/rustc_trait_selection/src/traits/project.rs
@@ -773,7 +773,7 @@ pub struct PlaceholderReplacer<'me, 'tcx> {
     mapped_regions: BTreeMap<ty::PlaceholderRegion, ty::BoundRegion>,
     mapped_types: BTreeMap<ty::PlaceholderType, ty::BoundTy>,
     mapped_consts: BTreeMap<ty::PlaceholderConst<'tcx>, ty::BoundVar>,
-    universe_indices: &'me Vec<Option<ty::UniverseIndex>>,
+    universe_indices: &'me [Option<ty::UniverseIndex>],
     current_index: ty::DebruijnIndex,
 }
 
@@ -783,7 +783,7 @@ impl<'me, 'tcx> PlaceholderReplacer<'me, 'tcx> {
         mapped_regions: BTreeMap<ty::PlaceholderRegion, ty::BoundRegion>,
         mapped_types: BTreeMap<ty::PlaceholderType, ty::BoundTy>,
         mapped_consts: BTreeMap<ty::PlaceholderConst<'tcx>, ty::BoundVar>,
-        universe_indices: &'me Vec<Option<ty::UniverseIndex>>,
+        universe_indices: &'me [Option<ty::UniverseIndex>],
         value: T,
     ) -> T {
         let mut replacer = PlaceholderReplacer {
diff --git a/compiler/rustc_traits/src/lib.rs b/compiler/rustc_traits/src/lib.rs
index 6489bd2202d..2bea164c051 100644
--- a/compiler/rustc_traits/src/lib.rs
+++ b/compiler/rustc_traits/src/lib.rs
@@ -2,7 +2,6 @@
 //! the guts are broken up into modules; see the comments in those modules.
 
 #![feature(let_else)]
-#![feature(nll)]
 #![recursion_limit = "256"]
 
 #[macro_use]
diff --git a/compiler/rustc_ty_utils/src/lib.rs b/compiler/rustc_ty_utils/src/lib.rs
index 702a9513b44..484967bbef8 100644
--- a/compiler/rustc_ty_utils/src/lib.rs
+++ b/compiler/rustc_ty_utils/src/lib.rs
@@ -7,7 +7,6 @@
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
 #![feature(control_flow_enum)]
 #![feature(let_else)]
-#![feature(nll)]
 #![recursion_limit = "256"]
 
 #[macro_use]
diff --git a/compiler/rustc_type_ir/src/sty.rs b/compiler/rustc_type_ir/src/sty.rs
index 650c3519b56..22b5b475b2c 100644
--- a/compiler/rustc_type_ir/src/sty.rs
+++ b/compiler/rustc_type_ir/src/sty.rs
@@ -716,118 +716,116 @@ where
     I::AllocId: Encodable<E>,
 {
     fn encode(&self, e: &mut E) -> Result<(), <E as rustc_serialize::Encoder>::Error> {
-        rustc_serialize::Encoder::emit_enum(e, |e| {
-            let disc = discriminant(self);
-            match self {
-                Bool => e.emit_enum_variant("Bool", disc, 0, |_| Ok(())),
-                Char => e.emit_enum_variant("Char", disc, 0, |_| Ok(())),
-                Int(i) => e.emit_enum_variant("Int", disc, 1, |e| {
-                    e.emit_enum_variant_arg(true, |e| i.encode(e))?;
-                    Ok(())
-                }),
-                Uint(u) => e.emit_enum_variant("Uint", disc, 1, |e| {
-                    e.emit_enum_variant_arg(true, |e| u.encode(e))?;
-                    Ok(())
-                }),
-                Float(f) => e.emit_enum_variant("Float", disc, 1, |e| {
-                    e.emit_enum_variant_arg(true, |e| f.encode(e))?;
-                    Ok(())
-                }),
-                Adt(adt, substs) => e.emit_enum_variant("Adt", disc, 2, |e| {
-                    e.emit_enum_variant_arg(true, |e| adt.encode(e))?;
-                    e.emit_enum_variant_arg(false, |e| substs.encode(e))?;
-                    Ok(())
-                }),
-                Foreign(def_id) => e.emit_enum_variant("Foreign", disc, 1, |e| {
-                    e.emit_enum_variant_arg(true, |e| def_id.encode(e))?;
-                    Ok(())
-                }),
-                Str => e.emit_enum_variant("Str", disc, 0, |_| Ok(())),
-                Array(t, c) => e.emit_enum_variant("Array", disc, 2, |e| {
-                    e.emit_enum_variant_arg(true, |e| t.encode(e))?;
-                    e.emit_enum_variant_arg(false, |e| c.encode(e))?;
-                    Ok(())
-                }),
-                Slice(t) => e.emit_enum_variant("Slice", disc, 1, |e| {
-                    e.emit_enum_variant_arg(true, |e| t.encode(e))?;
-                    Ok(())
-                }),
-                RawPtr(tam) => e.emit_enum_variant("RawPtr", disc, 1, |e| {
-                    e.emit_enum_variant_arg(true, |e| tam.encode(e))?;
-                    Ok(())
-                }),
-                Ref(r, t, m) => e.emit_enum_variant("Ref", disc, 3, |e| {
-                    e.emit_enum_variant_arg(true, |e| r.encode(e))?;
-                    e.emit_enum_variant_arg(false, |e| t.encode(e))?;
-                    e.emit_enum_variant_arg(false, |e| m.encode(e))?;
-                    Ok(())
-                }),
-                FnDef(def_id, substs) => e.emit_enum_variant("FnDef", disc, 2, |e| {
-                    e.emit_enum_variant_arg(true, |e| def_id.encode(e))?;
-                    e.emit_enum_variant_arg(false, |e| substs.encode(e))?;
-                    Ok(())
-                }),
-                FnPtr(polyfnsig) => e.emit_enum_variant("FnPtr", disc, 1, |e| {
-                    e.emit_enum_variant_arg(true, |e| polyfnsig.encode(e))?;
-                    Ok(())
-                }),
-                Dynamic(l, r) => e.emit_enum_variant("Dynamic", disc, 2, |e| {
-                    e.emit_enum_variant_arg(true, |e| l.encode(e))?;
-                    e.emit_enum_variant_arg(false, |e| r.encode(e))?;
-                    Ok(())
-                }),
-                Closure(def_id, substs) => e.emit_enum_variant("Closure", disc, 2, |e| {
-                    e.emit_enum_variant_arg(true, |e| def_id.encode(e))?;
-                    e.emit_enum_variant_arg(false, |e| substs.encode(e))?;
-                    Ok(())
-                }),
-                Generator(def_id, substs, m) => e.emit_enum_variant("Generator", disc, 3, |e| {
-                    e.emit_enum_variant_arg(true, |e| def_id.encode(e))?;
-                    e.emit_enum_variant_arg(false, |e| substs.encode(e))?;
-                    e.emit_enum_variant_arg(false, |e| m.encode(e))?;
-                    Ok(())
-                }),
-                GeneratorWitness(b) => e.emit_enum_variant("GeneratorWitness", disc, 1, |e| {
-                    e.emit_enum_variant_arg(true, |e| b.encode(e))?;
-                    Ok(())
-                }),
-                Never => e.emit_enum_variant("Never", disc, 0, |_| Ok(())),
-                Tuple(substs) => e.emit_enum_variant("Tuple", disc, 1, |e| {
-                    e.emit_enum_variant_arg(true, |e| substs.encode(e))?;
-                    Ok(())
-                }),
-                Projection(p) => e.emit_enum_variant("Projection", disc, 1, |e| {
-                    e.emit_enum_variant_arg(true, |e| p.encode(e))?;
-                    Ok(())
-                }),
-                Opaque(def_id, substs) => e.emit_enum_variant("Opaque", disc, 2, |e| {
-                    e.emit_enum_variant_arg(true, |e| def_id.encode(e))?;
-                    e.emit_enum_variant_arg(false, |e| substs.encode(e))?;
-                    Ok(())
-                }),
-                Param(p) => e.emit_enum_variant("Param", disc, 1, |e| {
-                    e.emit_enum_variant_arg(true, |e| p.encode(e))?;
-                    Ok(())
-                }),
-                Bound(d, b) => e.emit_enum_variant("Bound", disc, 2, |e| {
-                    e.emit_enum_variant_arg(true, |e| d.encode(e))?;
-                    e.emit_enum_variant_arg(false, |e| b.encode(e))?;
-                    Ok(())
-                }),
-                Placeholder(p) => e.emit_enum_variant("Placeholder", disc, 1, |e| {
-                    e.emit_enum_variant_arg(true, |e| p.encode(e))?;
-                    Ok(())
-                }),
-                Infer(i) => e.emit_enum_variant("Infer", disc, 1, |e| {
-                    e.emit_enum_variant_arg(true, |e| i.encode(e))?;
-                    Ok(())
-                }),
-                Error(d) => e.emit_enum_variant("Error", disc, 1, |e| {
-                    e.emit_enum_variant_arg(true, |e| d.encode(e))?;
-                    Ok(())
-                }),
-            }
-        })
+        let disc = discriminant(self);
+        match self {
+            Bool => e.emit_enum_variant(disc, |_| Ok(())),
+            Char => e.emit_enum_variant(disc, |_| Ok(())),
+            Int(i) => e.emit_enum_variant(disc, |e| {
+                i.encode(e)?;
+                Ok(())
+            }),
+            Uint(u) => e.emit_enum_variant(disc, |e| {
+                u.encode(e)?;
+                Ok(())
+            }),
+            Float(f) => e.emit_enum_variant(disc, |e| {
+                f.encode(e)?;
+                Ok(())
+            }),
+            Adt(adt, substs) => e.emit_enum_variant(disc, |e| {
+                adt.encode(e)?;
+                substs.encode(e)?;
+                Ok(())
+            }),
+            Foreign(def_id) => e.emit_enum_variant(disc, |e| {
+                def_id.encode(e)?;
+                Ok(())
+            }),
+            Str => e.emit_enum_variant(disc, |_| Ok(())),
+            Array(t, c) => e.emit_enum_variant(disc, |e| {
+                t.encode(e)?;
+                c.encode(e)?;
+                Ok(())
+            }),
+            Slice(t) => e.emit_enum_variant(disc, |e| {
+                t.encode(e)?;
+                Ok(())
+            }),
+            RawPtr(tam) => e.emit_enum_variant(disc, |e| {
+                tam.encode(e)?;
+                Ok(())
+            }),
+            Ref(r, t, m) => e.emit_enum_variant(disc, |e| {
+                r.encode(e)?;
+                t.encode(e)?;
+                m.encode(e)?;
+                Ok(())
+            }),
+            FnDef(def_id, substs) => e.emit_enum_variant(disc, |e| {
+                def_id.encode(e)?;
+                substs.encode(e)?;
+                Ok(())
+            }),
+            FnPtr(polyfnsig) => e.emit_enum_variant(disc, |e| {
+                polyfnsig.encode(e)?;
+                Ok(())
+            }),
+            Dynamic(l, r) => e.emit_enum_variant(disc, |e| {
+                l.encode(e)?;
+                r.encode(e)?;
+                Ok(())
+            }),
+            Closure(def_id, substs) => e.emit_enum_variant(disc, |e| {
+                def_id.encode(e)?;
+                substs.encode(e)?;
+                Ok(())
+            }),
+            Generator(def_id, substs, m) => e.emit_enum_variant(disc, |e| {
+                def_id.encode(e)?;
+                substs.encode(e)?;
+                m.encode(e)?;
+                Ok(())
+            }),
+            GeneratorWitness(b) => e.emit_enum_variant(disc, |e| {
+                b.encode(e)?;
+                Ok(())
+            }),
+            Never => e.emit_enum_variant(disc, |_| Ok(())),
+            Tuple(substs) => e.emit_enum_variant(disc, |e| {
+                substs.encode(e)?;
+                Ok(())
+            }),
+            Projection(p) => e.emit_enum_variant(disc, |e| {
+                p.encode(e)?;
+                Ok(())
+            }),
+            Opaque(def_id, substs) => e.emit_enum_variant(disc, |e| {
+                def_id.encode(e)?;
+                substs.encode(e)?;
+                Ok(())
+            }),
+            Param(p) => e.emit_enum_variant(disc, |e| {
+                p.encode(e)?;
+                Ok(())
+            }),
+            Bound(d, b) => e.emit_enum_variant(disc, |e| {
+                d.encode(e)?;
+                b.encode(e)?;
+                Ok(())
+            }),
+            Placeholder(p) => e.emit_enum_variant(disc, |e| {
+                p.encode(e)?;
+                Ok(())
+            }),
+            Infer(i) => e.emit_enum_variant(disc, |e| {
+                i.encode(e)?;
+                Ok(())
+            }),
+            Error(d) => e.emit_enum_variant(disc, |e| {
+                d.encode(e)?;
+                Ok(())
+            }),
+        }
     }
 }
 
diff --git a/compiler/rustc_typeck/src/astconv/mod.rs b/compiler/rustc_typeck/src/astconv/mod.rs
index 96d083bb94f..bcff2ae5129 100644
--- a/compiler/rustc_typeck/src/astconv/mod.rs
+++ b/compiler/rustc_typeck/src/astconv/mod.rs
@@ -16,7 +16,7 @@ use crate::require_c_abi_if_c_variadic;
 use rustc_ast::TraitObjectSyntax;
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
 use rustc_errors::{
-    struct_span_err, Applicability, DiagnosticBuilder, ErrorGuaranteed, FatalError,
+    struct_span_err, Applicability, DiagnosticBuilder, ErrorGuaranteed, FatalError, MultiSpan,
 };
 use rustc_hir as hir;
 use rustc_hir::def::{CtorOf, DefKind, Namespace, Res};
@@ -30,7 +30,7 @@ use rustc_middle::ty::{self, Const, DefIdTree, EarlyBinder, Ty, TyCtxt, TypeFold
 use rustc_session::lint::builtin::{AMBIGUOUS_ASSOCIATED_ITEMS, BARE_TRAIT_OBJECTS};
 use rustc_span::edition::Edition;
 use rustc_span::lev_distance::find_best_match_for_name;
-use rustc_span::symbol::{Ident, Symbol};
+use rustc_span::symbol::{kw, Ident, Symbol};
 use rustc_span::{Span, DUMMY_SP};
 use rustc_target::spec::abi;
 use rustc_trait_selection::traits;
@@ -653,7 +653,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
             span, item_def_id, item_segment
         );
         if tcx.generics_of(item_def_id).params.is_empty() {
-            self.prohibit_generics(slice::from_ref(item_segment));
+            self.prohibit_generics(slice::from_ref(item_segment).iter(), |_| {});
 
             parent_substs
         } else {
@@ -681,7 +681,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
         trait_ref: &hir::TraitRef<'_>,
         self_ty: Ty<'tcx>,
     ) -> ty::TraitRef<'tcx> {
-        self.prohibit_generics(trait_ref.path.segments.split_last().unwrap().1);
+        self.prohibit_generics(trait_ref.path.segments.split_last().unwrap().1.iter(), |_| {});
 
         self.ast_path_to_mono_trait_ref(
             trait_ref.path.span,
@@ -784,7 +784,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
         let args = trait_segment.args();
         let infer_args = trait_segment.infer_args;
 
-        self.prohibit_generics(trait_ref.path.segments.split_last().unwrap().1);
+        self.prohibit_generics(trait_ref.path.segments.split_last().unwrap().1.iter(), |_| {});
         self.complain_about_internal_fn_trait(span, trait_def_id, trait_segment, false);
 
         self.instantiate_poly_trait_ref_inner(
@@ -1776,12 +1776,17 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
         hir_ref_id: hir::HirId,
         span: Span,
         qself_ty: Ty<'tcx>,
-        qself_res: Res,
+        qself: &hir::Ty<'_>,
         assoc_segment: &hir::PathSegment<'_>,
         permit_variants: bool,
     ) -> Result<(Ty<'tcx>, DefKind, DefId), ErrorGuaranteed> {
         let tcx = self.tcx();
         let assoc_ident = assoc_segment.ident;
+        let qself_res = if let hir::TyKind::Path(hir::QPath::Resolved(_, ref path)) = qself.kind {
+            path.res
+        } else {
+            Res::Err
+        };
 
         debug!("associated_path_to_ty: {:?}::{}", qself_ty, assoc_ident);
 
@@ -1796,7 +1801,87 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
                 if let Some(variant_def) = variant_def {
                     if permit_variants {
                         tcx.check_stability(variant_def.def_id, Some(hir_ref_id), span, None);
-                        self.prohibit_generics(slice::from_ref(assoc_segment));
+                        self.prohibit_generics(slice::from_ref(assoc_segment).iter(), |err| {
+                            err.note("enum variants can't have type parameters");
+                            let type_name = tcx.item_name(adt_def.did());
+                            let msg = format!(
+                                "you might have meant to specity type parameters on enum \
+                                 `{type_name}`"
+                            );
+                            let Some(args) = assoc_segment.args else { return; };
+                            // Get the span of the generics args *including* the leading `::`.
+                            let args_span = assoc_segment.ident.span.shrink_to_hi().to(args.span_ext);
+                            if tcx.generics_of(adt_def.did()).count() == 0 {
+                                // FIXME(estebank): we could also verify that the arguments being
+                                // work for the `enum`, instead of just looking if it takes *any*.
+                                err.span_suggestion_verbose(
+                                    args_span,
+                                    &format!("{type_name} doesn't have generic parameters"),
+                                    String::new(),
+                                    Applicability::MachineApplicable,
+                                );
+                                return;
+                            }
+                            let Ok(snippet) = tcx.sess.source_map().span_to_snippet(args_span) else {
+                                err.note(&msg);
+                                return;
+                            };
+                            let (qself_sugg_span, is_self) = if let hir::TyKind::Path(
+                                hir::QPath::Resolved(_, ref path)
+                            ) = qself.kind {
+                                // If the path segment already has type params, we want to overwrite
+                                // them.
+                                match &path.segments[..] {
+                                    // `segment` is the previous to last element on the path,
+                                    // which would normally be the `enum` itself, while the last
+                                    // `_` `PathSegment` corresponds to the variant.
+                                    [.., hir::PathSegment {
+                                        ident,
+                                        args,
+                                        res: Some(Res::Def(DefKind::Enum, _)),
+                                        ..
+                                    }, _] => (
+                                        // We need to include the `::` in `Type::Variant::<Args>`
+                                        // to point the span to `::<Args>`, not just `<Args>`.
+                                        ident.span.shrink_to_hi().to(args.map_or(
+                                            ident.span.shrink_to_hi(),
+                                            |a| a.span_ext)),
+                                        false,
+                                    ),
+                                    [segment] => (
+                                        // We need to include the `::` in `Type::Variant::<Args>`
+                                        // to point the span to `::<Args>`, not just `<Args>`.
+                                        segment.ident.span.shrink_to_hi().to(segment.args.map_or(
+                                            segment.ident.span.shrink_to_hi(),
+                                            |a| a.span_ext)),
+                                        kw::SelfUpper == segment.ident.name,
+                                    ),
+                                    _ => {
+                                        err.note(&msg);
+                                        return;
+                                    }
+                                }
+                            } else {
+                                err.note(&msg);
+                                return;
+                            };
+                            let suggestion = vec![
+                                if is_self {
+                                    // Account for people writing `Self::Variant::<Args>`, where
+                                    // `Self` is the enum, and suggest replacing `Self` with the
+                                    // appropriate type: `Type::<Args>::Variant`.
+                                    (qself.span, format!("{type_name}{snippet}"))
+                                } else {
+                                    (qself_sugg_span, snippet)
+                                },
+                                (args_span, String::new()),
+                            ];
+                            err.multipart_suggestion_verbose(
+                                &msg,
+                                suggestion,
+                                Applicability::MaybeIncorrect,
+                            );
+                        });
                         return Ok((qself_ty, DefKind::Variant, variant_def.def_id));
                     } else {
                         variant_resolution = Some(variant_def.def_id);
@@ -2017,69 +2102,112 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
         self.normalize_ty(span, tcx.mk_projection(item_def_id, item_substs))
     }
 
-    pub fn prohibit_generics<'a, T: IntoIterator<Item = &'a hir::PathSegment<'a>>>(
+    pub fn prohibit_generics<'a>(
         &self,
-        segments: T,
+        segments: impl Iterator<Item = &'a hir::PathSegment<'a>> + Clone,
+        extend: impl Fn(&mut DiagnosticBuilder<'tcx, ErrorGuaranteed>),
     ) -> bool {
-        let mut has_err = false;
-        for segment in segments {
-            let (mut err_for_lt, mut err_for_ty, mut err_for_ct) = (false, false, false);
-            for arg in segment.args().args {
-                let (span, kind) = match arg {
-                    hir::GenericArg::Lifetime(lt) => {
-                        if err_for_lt {
-                            continue;
-                        }
-                        err_for_lt = true;
-                        has_err = true;
-                        (lt.span, "lifetime")
-                    }
-                    hir::GenericArg::Type(ty) => {
-                        if err_for_ty {
-                            continue;
-                        }
-                        err_for_ty = true;
-                        has_err = true;
-                        (ty.span, "type")
-                    }
-                    hir::GenericArg::Const(ct) => {
-                        if err_for_ct {
-                            continue;
-                        }
-                        err_for_ct = true;
-                        has_err = true;
-                        (ct.span, "const")
-                    }
-                    hir::GenericArg::Infer(inf) => {
-                        if err_for_ty {
-                            continue;
-                        }
-                        has_err = true;
-                        err_for_ty = true;
-                        (inf.span, "generic")
+        let args = segments.clone().flat_map(|segment| segment.args().args);
+        let types_and_spans: Vec<_> = segments
+            .clone()
+            .flat_map(|segment| {
+                segment.res.and_then(|res| {
+                    if segment.args().args.is_empty() {
+                        None
+                    } else {
+                        Some((
+                            match res {
+                                Res::PrimTy(ty) => format!("{} `{}`", res.descr(), ty.name()),
+                                Res::Def(_, def_id)
+                                if let Some(name) = self.tcx().opt_item_name(def_id) => {
+                                    format!("{} `{name}`", res.descr())
+                                }
+                                Res::Err => "this type".to_string(),
+                                _ => res.descr().to_string(),
+                            },
+                            segment.ident.span,
+                        ))
                     }
-                };
-                let mut err = struct_span_err!(
-                    self.tcx().sess,
-                    span,
-                    E0109,
-                    "{} arguments are not allowed for this type",
-                    kind,
-                );
-                err.span_label(span, format!("{} argument not allowed", kind));
-                err.emit();
-                if err_for_lt && err_for_ty && err_for_ct {
-                    break;
-                }
+                })
+            })
+            .collect();
+        let this_type = match &types_and_spans[..] {
+            [.., _, (last, _)] => format!(
+                "{} and {last}",
+                types_and_spans[..types_and_spans.len() - 1]
+                    .iter()
+                    .map(|(x, _)| x.as_str())
+                    .intersperse(&", ")
+                    .collect::<String>()
+            ),
+            [(only, _)] => only.to_string(),
+            [] => "this type".to_string(),
+        };
+
+        let (lt, ty, ct, inf) =
+            args.clone().fold((false, false, false, false), |(lt, ty, ct, inf), arg| match arg {
+                hir::GenericArg::Lifetime(_) => (true, ty, ct, inf),
+                hir::GenericArg::Type(_) => (lt, true, ct, inf),
+                hir::GenericArg::Const(_) => (lt, ty, true, inf),
+                hir::GenericArg::Infer(_) => (lt, ty, ct, true),
+            });
+        let mut emitted = false;
+        if lt || ty || ct || inf {
+            let arg_spans: Vec<Span> = args.map(|arg| arg.span()).collect();
+
+            let mut kinds = Vec::with_capacity(4);
+            if lt {
+                kinds.push("lifetime");
+            }
+            if ty {
+                kinds.push("type");
+            }
+            if ct {
+                kinds.push("const");
             }
+            if inf {
+                kinds.push("generic");
+            }
+            let (kind, s) = match kinds[..] {
+                [.., _, last] => (
+                    format!(
+                        "{} and {last}",
+                        kinds[..kinds.len() - 1]
+                            .iter()
+                            .map(|&x| x)
+                            .intersperse(", ")
+                            .collect::<String>()
+                    ),
+                    "s",
+                ),
+                [only] => (format!("{only}"), ""),
+                [] => unreachable!(),
+            };
+            let last_span = *arg_spans.last().unwrap();
+            let span: MultiSpan = arg_spans.into();
+            let mut err = struct_span_err!(
+                self.tcx().sess,
+                span,
+                E0109,
+                "{kind} arguments are not allowed on {this_type}",
+            );
+            err.span_label(last_span, format!("{kind} argument{s} not allowed"));
+            for (_, span) in types_and_spans {
+                err.span_label(span, "not allowed on this");
+            }
+            extend(&mut err);
+            err.emit();
+            emitted = true;
+        }
 
+        for segment in segments {
             // Only emit the first error to avoid overloading the user with error messages.
             if let [binding, ..] = segment.args().bindings {
-                has_err = true;
                 Self::prohibit_assoc_ty_binding(self.tcx(), binding.span);
+                return true;
             }
         }
-        has_err
+        emitted
     }
 
     // FIXME(eddyb, varkor) handle type paths here too, not just value ones.
@@ -2229,7 +2357,9 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
                 // Check for desugared `impl Trait`.
                 assert!(ty::is_impl_trait_defn(tcx, did).is_none());
                 let item_segment = path.segments.split_last().unwrap();
-                self.prohibit_generics(item_segment.1);
+                self.prohibit_generics(item_segment.1.iter(), |err| {
+                    err.note("`impl Trait` types can't have type parameters");
+                });
                 let substs = self.ast_path_substs_for_ty(span, did, item_segment.0);
                 self.normalize_ty(span, tcx.mk_opaque(did, substs))
             }
@@ -2242,7 +2372,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
                 did,
             ) => {
                 assert_eq!(opt_self_ty, None);
-                self.prohibit_generics(path.segments.split_last().unwrap().1);
+                self.prohibit_generics(path.segments.split_last().unwrap().1.iter(), |_| {});
                 self.ast_path_to_ty(span, did, path.segments.last().unwrap())
             }
             Res::Def(kind @ DefKind::Variant, def_id) if permit_variants => {
@@ -2254,18 +2384,26 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
                     self.def_ids_for_value_path_segments(path.segments, None, kind, def_id);
                 let generic_segs: FxHashSet<_> =
                     path_segs.iter().map(|PathSeg(_, index)| index).collect();
-                self.prohibit_generics(path.segments.iter().enumerate().filter_map(
-                    |(index, seg)| {
+                self.prohibit_generics(
+                    path.segments.iter().enumerate().filter_map(|(index, seg)| {
                         if !generic_segs.contains(&index) { Some(seg) } else { None }
+                    }),
+                    |err| {
+                        err.note("enum variants can't have type parameters");
                     },
-                ));
+                );
 
                 let PathSeg(def_id, index) = path_segs.last().unwrap();
                 self.ast_path_to_ty(span, *def_id, &path.segments[*index])
             }
             Res::Def(DefKind::TyParam, def_id) => {
                 assert_eq!(opt_self_ty, None);
-                self.prohibit_generics(path.segments);
+                self.prohibit_generics(path.segments.iter(), |err| {
+                    if let Some(span) = tcx.def_ident_span(def_id) {
+                        let name = tcx.item_name(def_id);
+                        err.span_note(span, &format!("type parameter `{name}` defined here"));
+                    }
+                });
 
                 let def_id = def_id.expect_local();
                 let item_def_id = tcx.hir().ty_param_owner(def_id);
@@ -2276,15 +2414,81 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
             Res::SelfTy { trait_: Some(_), alias_to: None } => {
                 // `Self` in trait or type alias.
                 assert_eq!(opt_self_ty, None);
-                self.prohibit_generics(path.segments);
+                self.prohibit_generics(path.segments.iter(), |err| {
+                    if let [hir::PathSegment { args: Some(args), ident, .. }] = &path.segments[..] {
+                        err.span_suggestion_verbose(
+                            ident.span.shrink_to_hi().to(args.span_ext),
+                            "the `Self` type doesn't accept type parameters",
+                            String::new(),
+                            Applicability::MaybeIncorrect,
+                        );
+                    }
+                });
                 tcx.types.self_param
             }
             Res::SelfTy { trait_: _, alias_to: Some((def_id, forbid_generic)) } => {
                 // `Self` in impl (we know the concrete type).
                 assert_eq!(opt_self_ty, None);
-                self.prohibit_generics(path.segments);
                 // Try to evaluate any array length constants.
                 let ty = tcx.at(span).type_of(def_id);
+                let span_of_impl = tcx.span_of_impl(def_id);
+                self.prohibit_generics(path.segments.iter(), |err| {
+                    let def_id = match *ty.kind() {
+                        ty::Adt(self_def, _) => self_def.did(),
+                        _ => return,
+                    };
+
+                    let type_name = tcx.item_name(def_id);
+                    let span_of_ty = tcx.def_ident_span(def_id);
+                    let generics = tcx.generics_of(def_id).count();
+
+                    let msg = format!("`Self` is of type `{ty}`");
+                    if let (Ok(i_sp), Some(t_sp)) = (span_of_impl, span_of_ty) {
+                        let i_sp = tcx.sess.source_map().guess_head_span(i_sp);
+                        let mut span: MultiSpan = vec![t_sp].into();
+                        span.push_span_label(
+                            i_sp,
+                            &format!("`Self` is on type `{type_name}` in this `impl`"),
+                        );
+                        let mut postfix = "";
+                        if generics == 0 {
+                            postfix = ", which doesn't have generic parameters";
+                        }
+                        span.push_span_label(
+                            t_sp,
+                            &format!("`Self` corresponds to this type{postfix}"),
+                        );
+                        err.span_note(span, &msg);
+                    } else {
+                        err.note(&msg);
+                    }
+                    for segment in path.segments {
+                        if let Some(args) = segment.args && segment.ident.name == kw::SelfUpper {
+                            if generics == 0 {
+                                // FIXME(estebank): we could also verify that the arguments being
+                                // work for the `enum`, instead of just looking if it takes *any*.
+                                err.span_suggestion_verbose(
+                                    segment.ident.span.shrink_to_hi().to(args.span_ext),
+                                    "the `Self` type doesn't accept type parameters",
+                                    String::new(),
+                                    Applicability::MachineApplicable,
+                                );
+                                return;
+                            } else {
+                                err.span_suggestion_verbose(
+                                    segment.ident.span,
+                                    format!(
+                                        "the `Self` type doesn't accept type parameters, use the \
+                                        concrete type's name `{type_name}` instead if you want to \
+                                        specify its type parameters"
+                                    ),
+                                    type_name.to_string(),
+                                    Applicability::MaybeIncorrect,
+                                );
+                            }
+                        }
+                    }
+                });
                 // HACK(min_const_generics): Forbid generic `Self` types
                 // here as we can't easily do that during nameres.
                 //
@@ -2324,7 +2528,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
             }
             Res::Def(DefKind::AssocTy, def_id) => {
                 debug_assert!(path.segments.len() >= 2);
-                self.prohibit_generics(&path.segments[..path.segments.len() - 2]);
+                self.prohibit_generics(path.segments[..path.segments.len() - 2].iter(), |_| {});
                 self.qpath_to_ty(
                     span,
                     opt_self_ty,
@@ -2335,7 +2539,19 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
             }
             Res::PrimTy(prim_ty) => {
                 assert_eq!(opt_self_ty, None);
-                self.prohibit_generics(path.segments);
+                self.prohibit_generics(path.segments.iter(), |err| {
+                    let name = prim_ty.name_str();
+                    for segment in path.segments {
+                        if let Some(args) = segment.args {
+                            err.span_suggestion_verbose(
+                                segment.ident.span.shrink_to_hi().to(args.span_ext),
+                                &format!("primitive type `{name}` doesn't have generic parameters"),
+                                String::new(),
+                                Applicability::MaybeIncorrect,
+                            );
+                        }
+                    }
+                });
                 match prim_ty {
                     hir::PrimTy::Bool => tcx.types.bool,
                     hir::PrimTy::Char => tcx.types.char,
@@ -2426,13 +2642,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
             hir::TyKind::Path(hir::QPath::TypeRelative(ref qself, ref segment)) => {
                 debug!(?qself, ?segment);
                 let ty = self.ast_ty_to_ty_inner(qself, false, true);
-
-                let res = if let hir::TyKind::Path(hir::QPath::Resolved(_, path)) = qself.kind {
-                    path.res
-                } else {
-                    Res::Err
-                };
-                self.associated_path_to_ty(ast_ty.hir_id, ast_ty.span, ty, res, segment, false)
+                self.associated_path_to_ty(ast_ty.hir_id, ast_ty.span, ty, qself, segment, false)
                     .map(|(ty, _, _)| ty)
                     .unwrap_or_else(|_| tcx.ty_error())
             }
diff --git a/compiler/rustc_typeck/src/check/expr.rs b/compiler/rustc_typeck/src/check/expr.rs
index ea81f1ef90c..e3e0063c4ec 100644
--- a/compiler/rustc_typeck/src/check/expr.rs
+++ b/compiler/rustc_typeck/src/check/expr.rs
@@ -2448,7 +2448,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         &self,
         span: Span,
         base_t: Ty<'tcx>,
-    ) -> Option<(&Vec<ty::FieldDef>, SubstsRef<'tcx>)> {
+    ) -> Option<(&[ty::FieldDef], SubstsRef<'tcx>)> {
         debug!("get_field_candidates(span: {:?}, base_t: {:?}", span, base_t);
 
         for (base_t, _) in self.autoderef(span, base_t) {
diff --git a/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs b/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs
index ac2dc6522ad..c28c041e78d 100644
--- a/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs
+++ b/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs
@@ -1228,6 +1228,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                     None
                 }
             }),
+            |_| {},
         );
 
         if let Res::Local(hid) = res {
diff --git a/compiler/rustc_typeck/src/check/fn_ctxt/checks.rs b/compiler/rustc_typeck/src/check/fn_ctxt/checks.rs
index 34cc02f180b..83afbfa54b1 100644
--- a/compiler/rustc_typeck/src/check/fn_ctxt/checks.rs
+++ b/compiler/rustc_typeck/src/check/fn_ctxt/checks.rs
@@ -1564,13 +1564,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             QPath::TypeRelative(ref qself, ref segment) => {
                 let ty = self.to_ty(qself);
 
-                let res = if let hir::TyKind::Path(QPath::Resolved(_, ref path)) = qself.kind {
-                    path.res
-                } else {
-                    Res::Err
-                };
                 let result = <dyn AstConv<'_>>::associated_path_to_ty(
-                    self, hir_id, path_span, ty, res, segment, true,
+                    self, hir_id, path_span, ty, qself, segment, true,
                 );
                 let ty = result.map(|(ty, _, _)| ty).unwrap_or_else(|_| self.tcx().ty_error());
                 let result = result.map(|(_, kind, def_id)| (kind, def_id));
diff --git a/compiler/rustc_typeck/src/check/generator_interior/drop_ranges/cfg_build.rs b/compiler/rustc_typeck/src/check/generator_interior/drop_ranges/cfg_build.rs
index 417778cc57d..58b63804b4a 100644
--- a/compiler/rustc_typeck/src/check/generator_interior/drop_ranges/cfg_build.rs
+++ b/compiler/rustc_typeck/src/check/generator_interior/drop_ranges/cfg_build.rs
@@ -249,6 +249,7 @@ impl<'a, 'tcx> DropRangeVisitor<'a, 'tcx> {
                 | hir::Node::Stmt(..)
                 | hir::Node::PathSegment(..)
                 | hir::Node::Ty(..)
+                | hir::Node::TypeBinding(..)
                 | hir::Node::TraitRef(..)
                 | hir::Node::Binding(..)
                 | hir::Node::Pat(..)
diff --git a/compiler/rustc_typeck/src/check/regionck.rs b/compiler/rustc_typeck/src/check/regionck.rs
index 01a76ce5586..e4be4603558 100644
--- a/compiler/rustc_typeck/src/check/regionck.rs
+++ b/compiler/rustc_typeck/src/check/regionck.rs
@@ -165,7 +165,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             rcx.visit_body(body);
             rcx.visit_region_obligations(id);
         }
-        rcx.resolve_regions_and_report_errors(RegionckMode::for_item_body(self.tcx));
+        rcx.resolve_regions_and_report_errors(RegionckMode::Erase);
     }
 
     /// Region checking during the WF phase for items. `wf_tys` are the
@@ -208,7 +208,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             rcx.visit_fn_body(fn_id, body, self.tcx.hir().span(fn_id));
         }
 
-        rcx.resolve_regions_and_report_errors(RegionckMode::for_item_body(self.tcx));
+        rcx.resolve_regions_and_report_errors(RegionckMode::Erase);
     }
 }
 
diff --git a/compiler/rustc_typeck/src/check/upvar.rs b/compiler/rustc_typeck/src/check/upvar.rs
index f57d5761051..8074ff368cc 100644
--- a/compiler/rustc_typeck/src/check/upvar.rs
+++ b/compiler/rustc_typeck/src/check/upvar.rs
@@ -2039,7 +2039,7 @@ fn should_do_rust_2021_incompatible_closure_captures_analysis(
 /// - s2: Comma separated names of the variables being migrated.
 fn migration_suggestion_for_2229(
     tcx: TyCtxt<'_>,
-    need_migrations: &Vec<NeededMigration>,
+    need_migrations: &[NeededMigration],
 ) -> (String, String) {
     let need_migrations_variables = need_migrations
         .iter()
diff --git a/compiler/rustc_typeck/src/check_unused.rs b/compiler/rustc_typeck/src/check_unused.rs
index 00f0d1e6f02..f28184c74d3 100644
--- a/compiler/rustc_typeck/src/check_unused.rs
+++ b/compiler/rustc_typeck/src/check_unused.rs
@@ -16,48 +16,32 @@ pub fn check_crate(tcx: TyCtxt<'_>) {
         used_trait_imports.extend(imports.iter());
     }
 
-    for id in tcx.hir().items() {
-        if matches!(tcx.def_kind(id.def_id), DefKind::Use) {
-            if tcx.visibility(id.def_id).is_public() {
-                continue;
-            }
-            let item = tcx.hir().item(id);
-            if item.span.is_dummy() {
-                continue;
-            }
-            if let hir::ItemKind::Use(path, _) = item.kind {
-                check_import(tcx, &mut used_trait_imports, item.item_id(), path.span);
-            }
+    for &id in tcx.maybe_unused_trait_imports(()) {
+        debug_assert_eq!(tcx.def_kind(id), DefKind::Use);
+        if tcx.visibility(id).is_public() {
+            continue;
+        }
+        if used_trait_imports.contains(&id) {
+            continue;
         }
+        let item = tcx.hir().expect_item(id);
+        if item.span.is_dummy() {
+            continue;
+        }
+        let hir::ItemKind::Use(path, _) = item.kind else { unreachable!() };
+        tcx.struct_span_lint_hir(lint::builtin::UNUSED_IMPORTS, item.hir_id(), path.span, |lint| {
+            let msg = if let Ok(snippet) = tcx.sess.source_map().span_to_snippet(path.span) {
+                format!("unused import: `{}`", snippet)
+            } else {
+                "unused import".to_owned()
+            };
+            lint.build(&msg).emit();
+        });
     }
 
     unused_crates_lint(tcx);
 }
 
-fn check_import<'tcx>(
-    tcx: TyCtxt<'tcx>,
-    used_trait_imports: &mut FxHashSet<LocalDefId>,
-    item_id: hir::ItemId,
-    span: Span,
-) {
-    if !tcx.maybe_unused_trait_import(item_id.def_id) {
-        return;
-    }
-
-    if used_trait_imports.contains(&item_id.def_id) {
-        return;
-    }
-
-    tcx.struct_span_lint_hir(lint::builtin::UNUSED_IMPORTS, item_id.hir_id(), span, |lint| {
-        let msg = if let Ok(snippet) = tcx.sess.source_map().span_to_snippet(span) {
-            format!("unused import: `{}`", snippet)
-        } else {
-            "unused import".to_owned()
-        };
-        lint.build(&msg).emit();
-    });
-}
-
 fn unused_crates_lint(tcx: TyCtxt<'_>) {
     let lint = lint::builtin::UNUSED_EXTERN_CRATES;
 
diff --git a/compiler/rustc_typeck/src/coherence/builtin.rs b/compiler/rustc_typeck/src/coherence/builtin.rs
index c809b8bdd73..9f4e6a46d73 100644
--- a/compiler/rustc_typeck/src/coherence/builtin.rs
+++ b/compiler/rustc_typeck/src/coherence/builtin.rs
@@ -107,6 +107,10 @@ fn visit_implementation_of_copy(tcx: TyCtxt<'_>, impl_did: LocalDefId) {
 
             for (field, ty) in fields {
                 let field_span = tcx.def_span(field.did);
+                let field_ty_span = match tcx.hir().get_if_local(field.did) {
+                    Some(hir::Node::Field(field_def)) => field_def.ty.span,
+                    _ => field_span,
+                };
                 err.span_label(field_span, "this field does not implement `Copy`");
                 // Spin up a new FulfillmentContext, so we can get the _precise_ reason
                 // why this field does not implement Copy. This is useful because sometimes
@@ -119,7 +123,7 @@ fn visit_implementation_of_copy(tcx: TyCtxt<'_>, impl_did: LocalDefId) {
                         param_env,
                         ty,
                         tcx.lang_items().copy_trait().unwrap(),
-                        traits::ObligationCause::dummy_with_span(field_span),
+                        traits::ObligationCause::dummy_with_span(field_ty_span),
                     );
                     for error in fulfill_cx.select_all_or_error(&infcx) {
                         let error_predicate = error.obligation.predicate;
diff --git a/compiler/rustc_typeck/src/collect.rs b/compiler/rustc_typeck/src/collect.rs
index 4322440d685..838980e08aa 100644
--- a/compiler/rustc_typeck/src/collect.rs
+++ b/compiler/rustc_typeck/src/collect.rs
@@ -1364,7 +1364,6 @@ fn has_late_bound_regions<'tcx>(tcx: TyCtxt<'tcx>, node: Node<'tcx>) -> Option<S
 
     fn has_late_bound_regions<'tcx>(
         tcx: TyCtxt<'tcx>,
-        def_id: LocalDefId,
         generics: &'tcx hir::Generics<'tcx>,
         decl: &'tcx hir::FnDecl<'tcx>,
     ) -> Option<Span> {
@@ -1373,14 +1372,9 @@ fn has_late_bound_regions<'tcx>(tcx: TyCtxt<'tcx>, node: Node<'tcx>) -> Option<S
             outer_index: ty::INNERMOST,
             has_late_bound_regions: None,
         };
-        let late_bound_map = tcx.is_late_bound_map(def_id);
-        let is_late_bound = |id| {
-            let id = tcx.hir().local_def_id(id);
-            late_bound_map.map_or(false, |(_, set)| set.contains(&id))
-        };
         for param in generics.params {
             if let GenericParamKind::Lifetime { .. } = param.kind {
-                if is_late_bound(param.hir_id) {
+                if tcx.is_late_bound(param.hir_id) {
                     return Some(param.span);
                 }
             }
@@ -1392,25 +1386,25 @@ fn has_late_bound_regions<'tcx>(tcx: TyCtxt<'tcx>, node: Node<'tcx>) -> Option<S
     match node {
         Node::TraitItem(item) => match item.kind {
             hir::TraitItemKind::Fn(ref sig, _) => {
-                has_late_bound_regions(tcx, item.def_id, &item.generics, sig.decl)
+                has_late_bound_regions(tcx, &item.generics, sig.decl)
             }
             _ => None,
         },
         Node::ImplItem(item) => match item.kind {
             hir::ImplItemKind::Fn(ref sig, _) => {
-                has_late_bound_regions(tcx, item.def_id, &item.generics, sig.decl)
+                has_late_bound_regions(tcx, &item.generics, sig.decl)
             }
             _ => None,
         },
         Node::ForeignItem(item) => match item.kind {
             hir::ForeignItemKind::Fn(fn_decl, _, ref generics) => {
-                has_late_bound_regions(tcx, item.def_id, generics, fn_decl)
+                has_late_bound_regions(tcx, generics, fn_decl)
             }
             _ => None,
         },
         Node::Item(item) => match item.kind {
             hir::ItemKind::Fn(ref sig, .., ref generics, _) => {
-                has_late_bound_regions(tcx, item.def_id, generics, sig.decl)
+                has_late_bound_regions(tcx, generics, sig.decl)
             }
             _ => None,
         },
@@ -1594,41 +1588,20 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics {
         _ => None,
     };
 
-    let mut opt_self = None;
-    let mut allow_defaults = false;
-
     let no_generics = hir::Generics::empty();
-    let ast_generics = match node {
-        Node::TraitItem(item) => &item.generics,
-
-        Node::ImplItem(item) => &item.generics,
-
+    let ast_generics = node.generics().unwrap_or(&no_generics);
+    let (opt_self, allow_defaults) = match node {
         Node::Item(item) => {
             match item.kind {
-                ItemKind::Fn(.., ref generics, _)
-                | ItemKind::Impl(hir::Impl { ref generics, .. }) => generics,
-
-                ItemKind::TyAlias(_, ref generics)
-                | ItemKind::Enum(_, ref generics)
-                | ItemKind::Struct(_, ref generics)
-                | ItemKind::OpaqueTy(hir::OpaqueTy { ref generics, .. })
-                | ItemKind::Union(_, ref generics) => {
-                    allow_defaults = true;
-                    generics
-                }
-
-                ItemKind::Trait(_, _, ref generics, ..)
-                | ItemKind::TraitAlias(ref generics, ..) => {
+                ItemKind::Trait(..) | ItemKind::TraitAlias(..) => {
                     // Add in the self type parameter.
                     //
                     // Something of a hack: use the node id for the trait, also as
                     // the node id for the Self type parameter.
-                    let param_id = item.def_id;
-
-                    opt_self = Some(ty::GenericParamDef {
+                    let opt_self = Some(ty::GenericParamDef {
                         index: 0,
                         name: kw::SelfUpper,
-                        def_id: param_id.to_def_id(),
+                        def_id,
                         pure_wrt_drop: false,
                         kind: ty::GenericParamDefKind::Type {
                             has_default: false,
@@ -1637,21 +1610,17 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics {
                         },
                     });
 
-                    allow_defaults = true;
-                    generics
+                    (opt_self, true)
                 }
-
-                _ => &no_generics,
+                ItemKind::TyAlias(..)
+                | ItemKind::Enum(..)
+                | ItemKind::Struct(..)
+                | ItemKind::OpaqueTy(..)
+                | ItemKind::Union(..) => (None, true),
+                _ => (None, false),
             }
         }
-
-        Node::ForeignItem(item) => match item.kind {
-            ForeignItemKind::Static(..) => &no_generics,
-            ForeignItemKind::Fn(_, _, ref generics) => generics,
-            ForeignItemKind::Type => &no_generics,
-        },
-
-        _ => &no_generics,
+        _ => (None, false),
     };
 
     let has_self = opt_self.is_some();
@@ -1671,7 +1640,7 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics {
         params.push(opt_self);
     }
 
-    let early_lifetimes = early_bound_lifetimes_from_generics(tcx, hir_id.owner, ast_generics);
+    let early_lifetimes = early_bound_lifetimes_from_generics(tcx, ast_generics);
     params.extend(early_lifetimes.enumerate().map(|(i, param)| ty::GenericParamDef {
         name: param.name.ident().name,
         index: own_start + i as u32,
@@ -2054,23 +2023,10 @@ fn impl_polarity(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ImplPolarity {
 /// `resolve_lifetime::early_bound_lifetimes`.
 fn early_bound_lifetimes_from_generics<'a, 'tcx: 'a>(
     tcx: TyCtxt<'tcx>,
-    def_id: LocalDefId,
     generics: &'a hir::Generics<'a>,
 ) -> impl Iterator<Item = &'a hir::GenericParam<'a>> + Captures<'tcx> {
-    let late_bound_map = if generics.params.is_empty() {
-        // This function may be called on `def_id == CRATE_DEF_ID`,
-        // which makes `is_late_bound_map` ICE.  Don't even try if there
-        // is no generic parameter.
-        None
-    } else {
-        tcx.is_late_bound_map(def_id)
-    };
-    let is_late_bound = move |hir_id| {
-        let id = tcx.hir().local_def_id(hir_id);
-        late_bound_map.map_or(false, |(_, set)| set.contains(&id))
-    };
     generics.params.iter().filter(move |param| match param.kind {
-        GenericParamKind::Lifetime { .. } => !is_late_bound(param.hir_id),
+        GenericParamKind::Lifetime { .. } => !tcx.is_late_bound(param.hir_id),
         _ => false,
     })
 }
@@ -2255,7 +2211,7 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericP
     // have to be careful to only iterate over early-bound regions.
     let mut index = parent_count
         + has_own_self as u32
-        + early_bound_lifetimes_from_generics(tcx, hir_id.owner, ast_generics).count() as u32;
+        + early_bound_lifetimes_from_generics(tcx, ast_generics).count() as u32;
 
     // Collect the predicates that were written inline by the user on each
     // type parameter (e.g., `<T: Foo>`).
diff --git a/compiler/rustc_typeck/src/collect/type_of.rs b/compiler/rustc_typeck/src/collect/type_of.rs
index 7e3fefe4502..2433401b7f0 100644
--- a/compiler/rustc_typeck/src/collect/type_of.rs
+++ b/compiler/rustc_typeck/src/collect/type_of.rs
@@ -450,21 +450,10 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
                     .discr_type()
                     .to_ty(tcx),
 
-                Node::TraitRef(trait_ref @ &TraitRef {
-                  path, ..
-                }) if let Some((binding, seg)) =
-                  path
-                      .segments
-                      .iter()
-                      .find_map(|seg| {
-                          seg.args?.bindings
-                              .iter()
-                              .find_map(|binding| if binding.opt_const()?.hir_id == hir_id {
-                                Some((binding, seg))
-                              } else {
-                                None
-                              })
-                      }) =>
+                Node::TypeBinding(binding @ &TypeBinding { hir_id: binding_id, ..  })
+                    if let Node::TraitRef(trait_ref) = tcx.hir().get(
+                        tcx.hir().get_parent_node(binding_id)
+                    ) =>
                 {
                   let Some(trait_def_id) = trait_ref.trait_def_id() else {
                     return tcx.ty_error_with_message(DUMMY_SP, "Could not find trait");
diff --git a/compiler/rustc_typeck/src/lib.rs b/compiler/rustc_typeck/src/lib.rs
index 454c71d4971..2fc9705527b 100644
--- a/compiler/rustc_typeck/src/lib.rs
+++ b/compiler/rustc_typeck/src/lib.rs
@@ -69,7 +69,6 @@ This API is completely unstable and subject to change.
 #![feature(let_else)]
 #![feature(min_specialization)]
 #![feature(never_type)]
-#![feature(nll)]
 #![feature(once_cell)]
 #![feature(slice_partition_dedup)]
 #![feature(try_blocks)]
diff --git a/compiler/rustc_typeck/src/structured_errors/wrong_number_of_generic_args.rs b/compiler/rustc_typeck/src/structured_errors/wrong_number_of_generic_args.rs
index f1dc3cbbac4..c440e93fe0a 100644
--- a/compiler/rustc_typeck/src/structured_errors/wrong_number_of_generic_args.rs
+++ b/compiler/rustc_typeck/src/structured_errors/wrong_number_of_generic_args.rs
@@ -5,7 +5,6 @@ use rustc_errors::{
 };
 use rustc_hir as hir;
 use rustc_middle::hir::map::fn_sig;
-use rustc_middle::middle::resolve_lifetime::LifetimeScopeForPath;
 use rustc_middle::ty::{self as ty, AssocItems, AssocKind, TyCtxt};
 use rustc_session::Session;
 use rustc_span::def_id::DefId;
@@ -291,7 +290,69 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
     }
 
     // Creates lifetime name suggestions from the lifetime parameter names
-    fn get_lifetime_args_suggestions_from_param_names(&self, num_params_to_take: usize) -> String {
+    fn get_lifetime_args_suggestions_from_param_names(
+        &self,
+        path_hir_id: Option<hir::HirId>,
+        num_params_to_take: usize,
+    ) -> String {
+        debug!(?path_hir_id);
+
+        if let Some(path_hir_id) = path_hir_id {
+            let mut ret = Vec::new();
+            for (id, node) in self.tcx.hir().parent_iter(path_hir_id) {
+                debug!(?id);
+                let params = if let Some(generics) = node.generics() {
+                    generics.params
+                } else if let hir::Node::Ty(ty) = node
+                    && let hir::TyKind::BareFn(bare_fn) = ty.kind
+                {
+                    bare_fn.generic_params
+                } else {
+                    &[]
+                };
+                ret.extend(params.iter().filter_map(|p| {
+                    let hir::GenericParamKind::Lifetime { kind: hir::LifetimeParamKind::Explicit }
+                        = p.kind
+                    else { return None };
+                    let hir::ParamName::Plain(name) = p.name else { return None };
+                    Some(name.to_string())
+                }));
+                // Suggest `'static` when in const/static item-like.
+                if let hir::Node::Item(hir::Item {
+                    kind: hir::ItemKind::Static { .. } | hir::ItemKind::Const { .. },
+                    ..
+                })
+                | hir::Node::TraitItem(hir::TraitItem {
+                    kind: hir::TraitItemKind::Const { .. },
+                    ..
+                })
+                | hir::Node::ImplItem(hir::ImplItem {
+                    kind: hir::ImplItemKind::Const { .. },
+                    ..
+                })
+                | hir::Node::ForeignItem(hir::ForeignItem {
+                    kind: hir::ForeignItemKind::Static { .. },
+                    ..
+                })
+                | hir::Node::AnonConst(..) = node
+                {
+                    ret.extend(
+                        std::iter::repeat("'static".to_owned())
+                            .take(num_params_to_take.saturating_sub(ret.len())),
+                    );
+                }
+                if ret.len() >= num_params_to_take {
+                    return ret[..num_params_to_take].join(", ");
+                }
+                // We cannot refer to lifetimes defined in an outer function.
+                if let hir::Node::Item(_) = node {
+                    break;
+                }
+            }
+        }
+
+        // We could not gather enough lifetime parameters in the scope.
+        // We use the parameter names from the target type's definition instead.
         self.gen_params
             .params
             .iter()
@@ -501,42 +562,10 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
         let num_params_to_take = num_missing_args;
         let msg = format!("add missing {} argument{}", self.kind(), pluralize!(num_missing_args));
 
-        // we first try to get lifetime name suggestions from scope or elision information. If none is
-        // available we use the parameter definitions
-        let suggested_args = if let Some(hir_id) = self.path_segment.hir_id {
-            if let Some(lifetimes_in_scope) = self.tcx.lifetime_scope(hir_id) {
-                match lifetimes_in_scope {
-                    LifetimeScopeForPath::NonElided(param_names) => {
-                        debug!("NonElided(param_names: {:?})", param_names);
-
-                        if param_names.len() >= num_params_to_take {
-                            // use lifetime parameters in scope for suggestions
-                            param_names
-                                .iter()
-                                .take(num_params_to_take)
-                                .map(|p| p.as_str())
-                                .collect::<Vec<_>>()
-                                .join(", ")
-                        } else {
-                            // Not enough lifetime arguments in scope -> create suggestions from
-                            // lifetime parameter names in definition. An error for the incorrect
-                            // lifetime scope will be output later.
-                            self.get_lifetime_args_suggestions_from_param_names(num_params_to_take)
-                        }
-                    }
-                    LifetimeScopeForPath::Elided => {
-                        debug!("Elided");
-                        // use suggestions of the form `<'_, '_>` in case lifetime can be elided
-                        ["'_"].repeat(num_params_to_take).join(",")
-                    }
-                }
-            } else {
-                self.get_lifetime_args_suggestions_from_param_names(num_params_to_take)
-            }
-        } else {
-            self.get_lifetime_args_suggestions_from_param_names(num_params_to_take)
-        };
-
+        let suggested_args = self.get_lifetime_args_suggestions_from_param_names(
+            self.path_segment.hir_id,
+            num_params_to_take,
+        );
         debug!("suggested_args: {:?}", &suggested_args);
 
         match self.angle_brackets {
diff --git a/config.toml.example b/config.toml.example
index a810e8c0e12..b3284050f05 100644
--- a/config.toml.example
+++ b/config.toml.example
@@ -324,6 +324,12 @@ changelog-seen = 2
 # a Nix toolchain on non-NixOS distributions.
 #patch-binaries-for-nix = false
 
+# Collect information and statistics about the current build and writes it to
+# disk. Enabling this or not has no impact on the resulting build output. The
+# schema of the file generated by the build metrics feature is unstable, and
+# this is not intended to be used during local development.
+#metrics = false
+
 # =============================================================================
 # General install configuration options
 # =============================================================================
diff --git a/library/alloc/src/boxed/thin.rs b/library/alloc/src/boxed/thin.rs
index 390030fa2b2..807c035fdbd 100644
--- a/library/alloc/src/boxed/thin.rs
+++ b/library/alloc/src/boxed/thin.rs
@@ -138,7 +138,11 @@ impl<T: ?Sized> ThinBox<T> {
     }
 }
 
-/// A pointer to type-erased data, guaranteed to have a header `H` before the pointed-to location.
+/// A pointer to type-erased data, guaranteed to either be:
+/// 1. `NonNull::dangling()`, in the case where both the pointee (`T`) and
+///    metadata (`H`) are ZSTs.
+/// 2. A pointer to a valid `T` that has a header `H` directly before the
+///    pointed-to location.
 struct WithHeader<H>(NonNull<u8>, PhantomData<H>);
 
 impl<H> WithHeader<H> {
@@ -156,16 +160,27 @@ impl<H> WithHeader<H> {
         };
 
         unsafe {
-            let ptr = alloc::alloc(layout);
-
-            if ptr.is_null() {
-                alloc::handle_alloc_error(layout);
-            }
-            //  Safety:
-            //  -   The size is at least `aligned_header_size`.
-            let ptr = ptr.add(value_offset) as *mut _;
-
-            let ptr = NonNull::new_unchecked(ptr);
+            // Note: It's UB to pass a layout with a zero size to `alloc::alloc`, so
+            // we use `layout.dangling()` for this case, which should have a valid
+            // alignment for both `T` and `H`.
+            let ptr = if layout.size() == 0 {
+                // Some paranoia checking, mostly so that the ThinBox tests are
+                // more able to catch issues.
+                debug_assert!(
+                    value_offset == 0 && mem::size_of::<T>() == 0 && mem::size_of::<H>() == 0
+                );
+                layout.dangling()
+            } else {
+                let ptr = alloc::alloc(layout);
+                if ptr.is_null() {
+                    alloc::handle_alloc_error(layout);
+                }
+                // Safety:
+                // - The size is at least `aligned_header_size`.
+                let ptr = ptr.add(value_offset) as *mut _;
+
+                NonNull::new_unchecked(ptr)
+            };
 
             let result = WithHeader(ptr, PhantomData);
             ptr::write(result.header(), header);
@@ -175,18 +190,28 @@ impl<H> WithHeader<H> {
         }
     }
 
-    //  Safety:
-    //  -   Assumes that `value` can be dereferenced.
+    // Safety:
+    // - Assumes that either `value` can be dereferenced, or is the
+    //   `NonNull::dangling()` we use when both `T` and `H` are ZSTs.
     unsafe fn drop<T: ?Sized>(&self, value: *mut T) {
         unsafe {
+            let value_layout = Layout::for_value_raw(value);
             // SAFETY: Layout must have been computable if we're in drop
-            let (layout, value_offset) =
-                Self::alloc_layout(Layout::for_value_raw(value)).unwrap_unchecked();
+            let (layout, value_offset) = Self::alloc_layout(value_layout).unwrap_unchecked();
 
-            ptr::drop_in_place::<T>(value);
             // We only drop the value because the Pointee trait requires that the metadata is copy
-            // aka trivially droppable
-            alloc::dealloc(self.0.as_ptr().sub(value_offset), layout);
+            // aka trivially droppable.
+            ptr::drop_in_place::<T>(value);
+
+            // Note: Don't deallocate if the layout size is zero, because the pointer
+            // didn't come from the allocator.
+            if layout.size() != 0 {
+                alloc::dealloc(self.0.as_ptr().sub(value_offset), layout);
+            } else {
+                debug_assert!(
+                    value_offset == 0 && mem::size_of::<H>() == 0 && value_layout.size() == 0
+                );
+            }
         }
     }
 
@@ -198,7 +223,9 @@ impl<H> WithHeader<H> {
         //    needed to align the header. Subtracting the header size from the aligned data pointer
         //    will always result in an aligned header pointer, it just may not point to the
         //    beginning of the allocation.
-        unsafe { self.0.as_ptr().sub(Self::header_size()) as *mut H }
+        let hp = unsafe { self.0.as_ptr().sub(Self::header_size()) as *mut H };
+        debug_assert!(hp.is_aligned());
+        hp
     }
 
     fn value(&self) -> *mut u8 {
diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs
index 710a3985266..baa1106a0dd 100644
--- a/library/alloc/src/lib.rs
+++ b/library/alloc/src/lib.rs
@@ -166,9 +166,9 @@
 #![feature(min_specialization)]
 #![feature(negative_impls)]
 #![feature(never_type)]
-#![feature(nll)] // Not necessary, but here to test the `nll` feature.
 #![feature(rustc_allow_const_fn_unstable)]
 #![feature(rustc_attrs)]
+#![feature(pointer_is_aligned)]
 #![feature(slice_internals)]
 #![feature(staged_api)]
 #![feature(stmt_expr_attributes)]
diff --git a/library/alloc/tests/lib.rs b/library/alloc/tests/lib.rs
index 601a87aa4ac..ffc7944ec7e 100644
--- a/library/alloc/tests/lib.rs
+++ b/library/alloc/tests/lib.rs
@@ -42,6 +42,9 @@
 #![feature(panic_update_hook)]
 #![feature(slice_flatten)]
 #![feature(thin_box)]
+#![feature(bench_black_box)]
+#![feature(strict_provenance)]
+#![feature(once_cell)]
 
 use std::collections::hash_map::DefaultHasher;
 use std::hash::{Hash, Hasher};
diff --git a/library/alloc/tests/thin_box.rs b/library/alloc/tests/thin_box.rs
index 51d2e9324bf..70d1db8b457 100644
--- a/library/alloc/tests/thin_box.rs
+++ b/library/alloc/tests/thin_box.rs
@@ -1,3 +1,4 @@
+use core::fmt::Debug;
 use core::mem::size_of;
 use std::boxed::ThinBox;
 
@@ -24,3 +25,231 @@ fn want_thin() {
     assert!(is_thin::<[i32]>());
     assert!(is_thin::<i32>());
 }
+
+#[track_caller]
+fn verify_aligned<T>(ptr: *const T) {
+    // Use `black_box` to attempt to obscure the fact that we're calling this
+    // function on pointers that come from box/references, which the compiler
+    // would otherwise realize is impossible (because it would mean we've
+    // already executed UB).
+    //
+    // That is, we'd *like* it to be possible for the asserts in this function
+    // to detect brokenness in the ThinBox impl.
+    //
+    // It would probably be better if we instead had these as debug_asserts
+    // inside `ThinBox`, prior to the point where we do the UB. Anyway, in
+    // practice these checks are mostly just smoke-detectors for an extremely
+    // broken `ThinBox` impl, since it's an extremely subtle piece of code.
+    let ptr = core::hint::black_box(ptr);
+    let align = core::mem::align_of::<T>();
+    assert!(
+        (ptr.addr() & (align - 1)) == 0 && !ptr.is_null(),
+        "misaligned ThinBox data; valid pointers to `{}` should be aligned to {align}: {ptr:p}",
+        core::any::type_name::<T>(),
+    );
+}
+
+#[track_caller]
+fn check_thin_sized<T: Debug + PartialEq + Clone>(make: impl FnOnce() -> T) {
+    let value = make();
+    let boxed = ThinBox::new(value.clone());
+    let val = &*boxed;
+    verify_aligned(val as *const T);
+    assert_eq!(val, &value);
+}
+
+#[track_caller]
+fn check_thin_dyn<T: Debug + PartialEq + Clone>(make: impl FnOnce() -> T) {
+    let value = make();
+    let wanted_debug = format!("{value:?}");
+    let boxed: ThinBox<dyn Debug> = ThinBox::new_unsize(value.clone());
+    let val = &*boxed;
+    // wide reference -> wide pointer -> thin pointer
+    verify_aligned(val as *const dyn Debug as *const T);
+    let got_debug = format!("{val:?}");
+    assert_eq!(wanted_debug, got_debug);
+}
+
+macro_rules! define_test {
+    (
+        @test_name: $testname:ident;
+
+        $(#[$m:meta])*
+        struct $Type:ident($inner:ty);
+
+        $($test_stmts:tt)*
+    ) => {
+        #[test]
+        fn $testname() {
+            use core::sync::atomic::{AtomicIsize, Ordering};
+            // Define the type, and implement new/clone/drop in such a way that
+            // the number of live instances will be counted.
+            $(#[$m])*
+            #[derive(Debug, PartialEq)]
+            struct $Type {
+                _priv: $inner,
+            }
+
+            impl Clone for $Type {
+                fn clone(&self) -> Self {
+                    verify_aligned(self);
+                    Self::new(self._priv.clone())
+                }
+            }
+
+            impl Drop for $Type {
+                fn drop(&mut self) {
+                    verify_aligned(self);
+                    Self::modify_live(-1);
+                }
+            }
+
+            impl $Type {
+                fn new(i: $inner) -> Self {
+                    Self::modify_live(1);
+                    Self { _priv: i }
+                }
+
+                fn modify_live(n: isize) -> isize {
+                    static COUNTER: AtomicIsize = AtomicIsize::new(0);
+                    COUNTER.fetch_add(n, Ordering::Relaxed) + n
+                }
+
+                fn live_objects() -> isize {
+                    Self::modify_live(0)
+                }
+            }
+            // Run the test statements
+            let _: () = { $($test_stmts)* };
+            // Check that we didn't leak anything, or call drop too many times.
+            assert_eq!(
+                $Type::live_objects(), 0,
+                "Wrong number of drops of {}, `initializations - drops` should be 0.",
+                stringify!($Type),
+            );
+        }
+    };
+}
+
+define_test! {
+    @test_name: align1zst;
+    struct Align1Zst(());
+
+    check_thin_sized(|| Align1Zst::new(()));
+    check_thin_dyn(|| Align1Zst::new(()));
+}
+
+define_test! {
+    @test_name: align1small;
+    struct Align1Small(u8);
+
+    check_thin_sized(|| Align1Small::new(50));
+    check_thin_dyn(|| Align1Small::new(50));
+}
+
+define_test! {
+    @test_name: align1_size_not_pow2;
+    struct Align64NotPow2Size([u8; 79]);
+
+    check_thin_sized(|| Align64NotPow2Size::new([100; 79]));
+    check_thin_dyn(|| Align64NotPow2Size::new([100; 79]));
+}
+
+define_test! {
+    @test_name: align1big;
+    struct Align1Big([u8; 256]);
+
+    check_thin_sized(|| Align1Big::new([5u8; 256]));
+    check_thin_dyn(|| Align1Big::new([5u8; 256]));
+}
+
+// Note: `#[repr(align(2))]` is worth testing because
+// - can have pointers which are misaligned, unlike align(1)
+// - is still expected to have an alignment less than the alignment of a vtable.
+define_test! {
+    @test_name: align2zst;
+    #[repr(align(2))]
+    struct Align2Zst(());
+
+    check_thin_sized(|| Align2Zst::new(()));
+    check_thin_dyn(|| Align2Zst::new(()));
+}
+
+define_test! {
+    @test_name: align2small;
+    #[repr(align(2))]
+    struct Align2Small(u8);
+
+    check_thin_sized(|| Align2Small::new(60));
+    check_thin_dyn(|| Align2Small::new(60));
+}
+
+define_test! {
+    @test_name: align2full;
+    #[repr(align(2))]
+    struct Align2Full([u8; 2]);
+    check_thin_sized(|| Align2Full::new([3u8; 2]));
+    check_thin_dyn(|| Align2Full::new([3u8; 2]));
+}
+
+define_test! {
+    @test_name: align2_size_not_pow2;
+    #[repr(align(2))]
+    struct Align2NotPower2Size([u8; 6]);
+
+    check_thin_sized(|| Align2NotPower2Size::new([3; 6]));
+    check_thin_dyn(|| Align2NotPower2Size::new([3; 6]));
+}
+
+define_test! {
+    @test_name: align2big;
+    #[repr(align(2))]
+    struct Align2Big([u8; 256]);
+
+    check_thin_sized(|| Align2Big::new([5u8; 256]));
+    check_thin_dyn(|| Align2Big::new([5u8; 256]));
+}
+
+define_test! {
+    @test_name: align64zst;
+    #[repr(align(64))]
+    struct Align64Zst(());
+
+    check_thin_sized(|| Align64Zst::new(()));
+    check_thin_dyn(|| Align64Zst::new(()));
+}
+
+define_test! {
+    @test_name: align64small;
+    #[repr(align(64))]
+    struct Align64Small(u8);
+
+    check_thin_sized(|| Align64Small::new(50));
+    check_thin_dyn(|| Align64Small::new(50));
+}
+
+define_test! {
+    @test_name: align64med;
+    #[repr(align(64))]
+    struct Align64Med([u8; 64]);
+    check_thin_sized(|| Align64Med::new([10; 64]));
+    check_thin_dyn(|| Align64Med::new([10; 64]));
+}
+
+define_test! {
+    @test_name: align64_size_not_pow2;
+    #[repr(align(64))]
+    struct Align64NotPow2Size([u8; 192]);
+
+    check_thin_sized(|| Align64NotPow2Size::new([10; 192]));
+    check_thin_dyn(|| Align64NotPow2Size::new([10; 192]));
+}
+
+define_test! {
+    @test_name: align64big;
+    #[repr(align(64))]
+    struct Align64Big([u8; 256]);
+
+    check_thin_sized(|| Align64Big::new([10; 256]));
+    check_thin_dyn(|| Align64Big::new([10; 256]));
+}
diff --git a/library/core/src/ptr/const_ptr.rs b/library/core/src/ptr/const_ptr.rs
index f26fdc74ce1..490d7594bb8 100644
--- a/library/core/src/ptr/const_ptr.rs
+++ b/library/core/src/ptr/const_ptr.rs
@@ -180,7 +180,9 @@ impl<T: ?Sized> *const T {
         T: Sized,
     {
         // FIXME(strict_provenance_magic): I am magic and should be a compiler intrinsic.
-        self as usize
+        // SAFETY: Pointer-to-integer transmutes are valid (if you are okay with losing the
+        // provenance).
+        unsafe { mem::transmute(self) }
     }
 
     /// Gets the "address" portion of the pointer, and 'exposes' the "provenance" part for future
diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs
index 5b04ae7b07e..a3b4e5886ef 100644
--- a/library/core/src/ptr/mod.rs
+++ b/library/core/src/ptr/mod.rs
@@ -532,7 +532,7 @@ pub const fn null<T>() -> *const T {
 #[rustc_diagnostic_item = "ptr_null"]
 #[cfg(not(bootstrap))]
 pub const fn null<T: ?Sized + Thin>() -> *const T {
-    from_raw_parts(0 as *const (), ())
+    from_raw_parts(invalid(0), ())
 }
 
 /// Creates a null mutable raw pointer.
@@ -709,7 +709,7 @@ where
 #[rustc_diagnostic_item = "ptr_null_mut"]
 #[cfg(not(bootstrap))]
 pub const fn null_mut<T: ?Sized + Thin>() -> *mut T {
-    from_raw_parts_mut(0 as *mut (), ())
+    from_raw_parts_mut(invalid_mut(0), ())
 }
 
 /// Forms a raw slice from a pointer and a length.
diff --git a/library/core/src/ptr/mut_ptr.rs b/library/core/src/ptr/mut_ptr.rs
index 1fbf592c232..5846c855e8f 100644
--- a/library/core/src/ptr/mut_ptr.rs
+++ b/library/core/src/ptr/mut_ptr.rs
@@ -184,7 +184,9 @@ impl<T: ?Sized> *mut T {
         T: Sized,
     {
         // FIXME(strict_provenance_magic): I am magic and should be a compiler intrinsic.
-        self as usize
+        // SAFETY: Pointer-to-integer transmutes are valid (if you are okay with losing the
+        // provenance).
+        unsafe { mem::transmute(self) }
     }
 
     /// Gets the "address" portion of the pointer, and 'exposes' the "provenance" part for future
diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs
index 7e9d7d27101..9505ec31609 100644
--- a/library/core/tests/lib.rs
+++ b/library/core/tests/lib.rs
@@ -84,6 +84,7 @@
 #![feature(const_option)]
 #![feature(const_option_ext)]
 #![feature(const_result)]
+#![feature(const_intrinsic_copy)]
 #![feature(integer_atomics)]
 #![feature(int_roundings)]
 #![feature(slice_group_by)]
diff --git a/library/core/tests/ptr.rs b/library/core/tests/ptr.rs
index c5242ad04de..40b2b49bdbd 100644
--- a/library/core/tests/ptr.rs
+++ b/library/core/tests/ptr.rs
@@ -1,4 +1,5 @@
 use core::cell::RefCell;
+use core::mem::{self, MaybeUninit};
 use core::num::NonZeroUsize;
 use core::ptr;
 use core::ptr::*;
@@ -781,3 +782,42 @@ fn nonnull_tagged_pointer_with_provenance() {
         }
     }
 }
+
+#[test]
+fn test_const_copy() {
+    const {
+        let ptr1 = &1;
+        let mut ptr2 = &666;
+
+        // Copy ptr1 to ptr2, bytewise.
+        unsafe {
+            ptr::copy(
+                &ptr1 as *const _ as *const MaybeUninit<u8>,
+                &mut ptr2 as *mut _ as *mut MaybeUninit<u8>,
+                mem::size_of::<&i32>(),
+            );
+        }
+
+        // Make sure they still work.
+        assert!(*ptr1 == 1);
+        assert!(*ptr2 == 1);
+    };
+
+    const {
+        let ptr1 = &1;
+        let mut ptr2 = &666;
+
+        // Copy ptr1 to ptr2, bytewise.
+        unsafe {
+            ptr::copy_nonoverlapping(
+                &ptr1 as *const _ as *const MaybeUninit<u8>,
+                &mut ptr2 as *mut _ as *mut MaybeUninit<u8>,
+                mem::size_of::<&i32>(),
+            );
+        }
+
+        // Make sure they still work.
+        assert!(*ptr1 == 1);
+        assert!(*ptr2 == 1);
+    };
+}
diff --git a/library/panic_abort/src/lib.rs b/library/panic_abort/src/lib.rs
index 0a1aa7bb3c8..6a01b4a2e28 100644
--- a/library/panic_abort/src/lib.rs
+++ b/library/panic_abort/src/lib.rs
@@ -9,7 +9,6 @@
 #![panic_runtime]
 #![allow(unused_features)]
 #![feature(core_intrinsics)]
-#![feature(nll)]
 #![feature(panic_runtime)]
 #![feature(std_internals)]
 #![feature(staged_api)]
diff --git a/library/panic_unwind/src/lib.rs b/library/panic_unwind/src/lib.rs
index 4ae5f8ae446..f9acb42c46b 100644
--- a/library/panic_unwind/src/lib.rs
+++ b/library/panic_unwind/src/lib.rs
@@ -16,7 +16,6 @@
 #![doc(issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/")]
 #![feature(core_intrinsics)]
 #![feature(lang_items)]
-#![feature(nll)]
 #![feature(panic_unwind)]
 #![feature(staged_api)]
 #![feature(std_internals)]
diff --git a/library/proc_macro/src/bridge/buffer.rs b/library/proc_macro/src/bridge/buffer.rs
index fb05a02dc45..48030f8d82d 100644
--- a/library/proc_macro/src/bridge/buffer.rs
+++ b/library/proc_macro/src/bridge/buffer.rs
@@ -18,6 +18,7 @@ unsafe impl Sync for Buffer {}
 unsafe impl Send for Buffer {}
 
 impl Default for Buffer {
+    #[inline]
     fn default() -> Self {
         Self::from(vec![])
     }
@@ -25,26 +26,31 @@ impl Default for Buffer {
 
 impl Deref for Buffer {
     type Target = [u8];
+    #[inline]
     fn deref(&self) -> &[u8] {
         unsafe { slice::from_raw_parts(self.data as *const u8, self.len) }
     }
 }
 
 impl DerefMut for Buffer {
+    #[inline]
     fn deref_mut(&mut self) -> &mut [u8] {
         unsafe { slice::from_raw_parts_mut(self.data, self.len) }
     }
 }
 
 impl Buffer {
+    #[inline]
     pub(super) fn new() -> Self {
         Self::default()
     }
 
+    #[inline]
     pub(super) fn clear(&mut self) {
         self.len = 0;
     }
 
+    #[inline]
     pub(super) fn take(&mut self) -> Self {
         mem::take(self)
     }
@@ -53,6 +59,7 @@ impl Buffer {
     // because in the case of small arrays, codegen can be more efficient
     // (avoiding a memmove call). With extend_from_slice, LLVM at least
     // currently is not able to make that optimization.
+    #[inline]
     pub(super) fn extend_from_array<const N: usize>(&mut self, xs: &[u8; N]) {
         if xs.len() > (self.capacity - self.len) {
             let b = self.take();
@@ -64,6 +71,7 @@ impl Buffer {
         }
     }
 
+    #[inline]
     pub(super) fn extend_from_slice(&mut self, xs: &[u8]) {
         if xs.len() > (self.capacity - self.len) {
             let b = self.take();
@@ -75,6 +83,7 @@ impl Buffer {
         }
     }
 
+    #[inline]
     pub(super) fn push(&mut self, v: u8) {
         // The code here is taken from Vec::push, and we know that reserve()
         // will panic if we're exceeding isize::MAX bytes and so there's no need
@@ -91,22 +100,26 @@ impl Buffer {
 }
 
 impl Write for Buffer {
+    #[inline]
     fn write(&mut self, xs: &[u8]) -> io::Result<usize> {
         self.extend_from_slice(xs);
         Ok(xs.len())
     }
 
+    #[inline]
     fn write_all(&mut self, xs: &[u8]) -> io::Result<()> {
         self.extend_from_slice(xs);
         Ok(())
     }
 
+    #[inline]
     fn flush(&mut self) -> io::Result<()> {
         Ok(())
     }
 }
 
 impl Drop for Buffer {
+    #[inline]
     fn drop(&mut self) {
         let b = self.take();
         (b.drop)(b);
diff --git a/library/proc_macro/src/lib.rs b/library/proc_macro/src/lib.rs
index f1c5eaad868..30ad3d23880 100644
--- a/library/proc_macro/src/lib.rs
+++ b/library/proc_macro/src/lib.rs
@@ -21,7 +21,6 @@
 // Please avoid unstable features where possible to minimize the amount of changes necessary
 // to make it compile with rust-analyzer on stable.
 #![feature(rustc_allow_const_fn_unstable)]
-#![feature(nll)]
 #![feature(staged_api)]
 #![feature(allow_internal_unstable)]
 #![feature(decl_macro)]
diff --git a/library/profiler_builtins/src/lib.rs b/library/profiler_builtins/src/lib.rs
index bb1f2785deb..0c83bcee06f 100644
--- a/library/profiler_builtins/src/lib.rs
+++ b/library/profiler_builtins/src/lib.rs
@@ -7,5 +7,4 @@
     issue = "none"
 )]
 #![allow(unused_features)]
-#![feature(nll)]
 #![feature(staged_api)]
diff --git a/library/std/src/collections/hash/set.rs b/library/std/src/collections/hash/set.rs
index 19428fe9a23..fa498a987d6 100644
--- a/library/std/src/collections/hash/set.rs
+++ b/library/std/src/collections/hash/set.rs
@@ -588,6 +588,12 @@ where
     /// Visits the values representing the intersection,
     /// i.e., the values that are both in `self` and `other`.
     ///
+    /// When an equal element is present in `self` and `other`
+    /// then the resulting `Intersection` may yield references to
+    /// one or the other. This can be relevant if `T` contains fields which
+    /// are not compared by its `Eq` implementation, and may hold different
+    /// value between the two equal copies of `T` in the two sets.
+    ///
     /// # Examples
     ///
     /// ```
diff --git a/library/std/src/keyword_docs.rs b/library/std/src/keyword_docs.rs
index 6dcd55cc937..52a02e998b4 100644
--- a/library/std/src/keyword_docs.rs
+++ b/library/std/src/keyword_docs.rs
@@ -2167,7 +2167,7 @@ mod use_keyword {}
 /// is missing: the `'b` lifetime is not known to live at least as long as `'a`
 /// which means this function cannot ensure it always returns a valid reference:
 ///
-/// ```rust,compile_fail,E0623
+/// ```rust,compile_fail
 /// fn select<'a, 'b>(s1: &'a str, s2: &'b str, second: bool) -> &'a str
 /// {
 ///     if second { s2 } else { s1 }
diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs
index 71ea5f1a1f0..b1c68ec43bc 100644
--- a/library/std/src/lib.rs
+++ b/library/std/src/lib.rs
@@ -248,7 +248,7 @@
 #![feature(needs_panic_runtime)]
 #![feature(negative_impls)]
 #![feature(never_type)]
-#![feature(nll)]
+#![cfg_attr(bootstrap, feature(nll))]
 #![feature(platform_intrinsics)]
 #![feature(prelude_import)]
 #![feature(rustc_attrs)]
diff --git a/library/std/src/sys/hermit/condvar.rs b/library/std/src/sys/hermit/condvar.rs
index f6083530005..46f45b19771 100644
--- a/library/std/src/sys/hermit/condvar.rs
+++ b/library/std/src/sys/hermit/condvar.rs
@@ -70,9 +70,13 @@ impl Condvar {
         mutex.lock();
         res == 0
     }
+}
 
-    pub unsafe fn destroy(&self) {
-        let _ = abi::sem_destroy(self.sem1);
-        let _ = abi::sem_destroy(self.sem2);
+impl Drop for Condvar {
+    fn drop(&mut self) {
+        unsafe {
+            let _ = abi::sem_destroy(self.sem1);
+            let _ = abi::sem_destroy(self.sem2);
+        }
     }
 }
diff --git a/library/std/src/sys/hermit/mutex.rs b/library/std/src/sys/hermit/mutex.rs
index 97b4c49896f..ef44bf411fb 100644
--- a/library/std/src/sys/hermit/mutex.rs
+++ b/library/std/src/sys/hermit/mutex.rs
@@ -215,7 +215,4 @@ impl Mutex {
         }
         guard.locked
     }
-
-    #[inline]
-    pub unsafe fn destroy(&self) {}
 }
diff --git a/library/std/src/sys/hermit/rwlock.rs b/library/std/src/sys/hermit/rwlock.rs
index 690bb155e1a..d43fa08a171 100644
--- a/library/std/src/sys/hermit/rwlock.rs
+++ b/library/std/src/sys/hermit/rwlock.rs
@@ -84,12 +84,6 @@ impl RwLock {
         // FIXME: should only wake up one of these some of the time
         self.cond.notify_all();
     }
-
-    #[inline]
-    pub unsafe fn destroy(&self) {
-        self.lock.destroy();
-        self.cond.destroy();
-    }
 }
 
 impl State {
diff --git a/library/std/src/sys/itron/condvar.rs b/library/std/src/sys/itron/condvar.rs
index ed26c528027..008cd8fb1e3 100644
--- a/library/std/src/sys/itron/condvar.rs
+++ b/library/std/src/sys/itron/condvar.rs
@@ -117,8 +117,6 @@ impl Condvar {
         unsafe { mutex.lock() };
         success
     }
-
-    pub unsafe fn destroy(&self) {}
 }
 
 mod waiter_queue {
diff --git a/library/std/src/sys/itron/mutex.rs b/library/std/src/sys/itron/mutex.rs
index 5ee231882bb..2ba8454ff92 100644
--- a/library/std/src/sys/itron/mutex.rs
+++ b/library/std/src/sys/itron/mutex.rs
@@ -64,8 +64,10 @@ impl Mutex {
             }
         }
     }
+}
 
-    pub unsafe fn destroy(&self) {
+impl Drop for Mutex {
+    fn drop(&mut self) {
         if let Some(mtx) = self.mtx.get().map(|x| x.0) {
             expect_success_aborting(unsafe { abi::del_mtx(mtx) }, &"del_mtx");
         }
diff --git a/library/std/src/sys/sgx/condvar.rs b/library/std/src/sys/sgx/condvar.rs
index c9736880b08..36534e0eff3 100644
--- a/library/std/src/sys/sgx/condvar.rs
+++ b/library/std/src/sys/sgx/condvar.rs
@@ -1,4 +1,5 @@
 use crate::sys::locks::Mutex;
+use crate::sys_common::lazy_box::{LazyBox, LazyInit};
 use crate::time::Duration;
 
 use super::waitqueue::{SpinMutex, WaitQueue, WaitVariable};
@@ -7,7 +8,13 @@ pub struct Condvar {
     inner: SpinMutex<WaitVariable<()>>,
 }
 
-pub type MovableCondvar = Box<Condvar>;
+pub(crate) type MovableCondvar = LazyBox<Condvar>;
+
+impl LazyInit for Condvar {
+    fn init() -> Box<Self> {
+        Box::new(Self::new())
+    }
+}
 
 impl Condvar {
     pub const fn new() -> Condvar {
@@ -15,9 +22,6 @@ impl Condvar {
     }
 
     #[inline]
-    pub unsafe fn init(&mut self) {}
-
-    #[inline]
     pub unsafe fn notify_one(&self) {
         let _ = WaitQueue::notify_one(self.inner.lock());
     }
@@ -38,7 +42,4 @@ impl Condvar {
         unsafe { mutex.lock() };
         success
     }
-
-    #[inline]
-    pub unsafe fn destroy(&self) {}
 }
diff --git a/library/std/src/sys/sgx/mutex.rs b/library/std/src/sys/sgx/mutex.rs
index 98a390c4c2b..513cd77fd2a 100644
--- a/library/std/src/sys/sgx/mutex.rs
+++ b/library/std/src/sys/sgx/mutex.rs
@@ -1,11 +1,18 @@
 use super::waitqueue::{try_lock_or_false, SpinMutex, WaitQueue, WaitVariable};
+use crate::sys_common::lazy_box::{LazyBox, LazyInit};
 
 pub struct Mutex {
     inner: SpinMutex<WaitVariable<bool>>,
 }
 
 // not movable: see UnsafeList implementation
-pub type MovableMutex = Box<Mutex>;
+pub(crate) type MovableMutex = LazyBox<Mutex>;
+
+impl LazyInit for Mutex {
+    fn init() -> Box<Self> {
+        Box::new(Self::new())
+    }
+}
 
 // Implementation according to “Operating Systems: Three Easy Pieces”, chapter 28
 impl Mutex {
@@ -52,7 +59,4 @@ impl Mutex {
             true
         }
     }
-
-    #[inline]
-    pub unsafe fn destroy(&self) {}
 }
diff --git a/library/std/src/sys/sgx/rwlock.rs b/library/std/src/sys/sgx/rwlock.rs
index 47be4c006ec..a97fb9ab026 100644
--- a/library/std/src/sys/sgx/rwlock.rs
+++ b/library/std/src/sys/sgx/rwlock.rs
@@ -2,6 +2,7 @@
 mod tests;
 
 use crate::num::NonZeroUsize;
+use crate::sys_common::lazy_box::{LazyBox, LazyInit};
 
 use super::waitqueue::{
     try_lock_or_false, NotifiedTcs, SpinMutex, SpinMutexGuard, WaitQueue, WaitVariable,
@@ -13,7 +14,13 @@ pub struct RwLock {
     writer: SpinMutex<WaitVariable<bool>>,
 }
 
-pub type MovableRwLock = Box<RwLock>;
+pub(crate) type MovableRwLock = LazyBox<RwLock>;
+
+impl LazyInit for RwLock {
+    fn init() -> Box<Self> {
+        Box::new(Self::new())
+    }
+}
 
 // Check at compile time that RwLock size matches C definition (see test_c_rwlock_initializer below)
 //
@@ -168,9 +175,6 @@ impl RwLock {
             unsafe { self.__read_unlock(rguard, wguard) };
         }
     }
-
-    #[inline]
-    pub unsafe fn destroy(&self) {}
 }
 
 // The following functions are needed by libunwind. These symbols are named
diff --git a/library/std/src/sys/solid/rwlock.rs b/library/std/src/sys/solid/rwlock.rs
index df16cc680ad..433abc895f5 100644
--- a/library/std/src/sys/solid/rwlock.rs
+++ b/library/std/src/sys/solid/rwlock.rs
@@ -82,9 +82,11 @@ impl RwLock {
         let rwl = self.raw();
         expect_success_aborting(unsafe { abi::rwl_unl_rwl(rwl) }, &"rwl_unl_rwl");
     }
+}
 
+impl Drop for RwLock {
     #[inline]
-    pub unsafe fn destroy(&self) {
+    fn drop(&mut self) {
         if let Some(rwl) = self.rwl.get().map(|x| x.0) {
             expect_success_aborting(unsafe { abi::rwl_del_rwl(rwl) }, &"rwl_del_rwl");
         }
diff --git a/library/std/src/sys/unix/locks/futex.rs b/library/std/src/sys/unix/locks/futex.rs
index 7a63af1ad7c..a9a1a32c5af 100644
--- a/library/std/src/sys/unix/locks/futex.rs
+++ b/library/std/src/sys/unix/locks/futex.rs
@@ -25,9 +25,6 @@ impl Mutex {
     pub unsafe fn init(&mut self) {}
 
     #[inline]
-    pub unsafe fn destroy(&self) {}
-
-    #[inline]
     pub unsafe fn try_lock(&self) -> bool {
         self.futex.compare_exchange(0, 1, Acquire, Relaxed).is_ok()
     }
@@ -118,12 +115,6 @@ impl Condvar {
         Self { futex: AtomicU32::new(0) }
     }
 
-    #[inline]
-    pub unsafe fn init(&mut self) {}
-
-    #[inline]
-    pub unsafe fn destroy(&self) {}
-
     // All the memory orderings here are `Relaxed`,
     // because synchronization is done by unlocking and locking the mutex.
 
diff --git a/library/std/src/sys/unix/locks/futex_rwlock.rs b/library/std/src/sys/unix/locks/futex_rwlock.rs
index 5ff1aba7974..1f902f50587 100644
--- a/library/std/src/sys/unix/locks/futex_rwlock.rs
+++ b/library/std/src/sys/unix/locks/futex_rwlock.rs
@@ -64,9 +64,6 @@ impl RwLock {
     }
 
     #[inline]
-    pub unsafe fn destroy(&self) {}
-
-    #[inline]
     pub unsafe fn try_read(&self) -> bool {
         self.state
             .fetch_update(Acquire, Relaxed, |s| is_read_lockable(s).then(|| s + READ_LOCKED))
diff --git a/library/std/src/sys/unix/locks/mod.rs b/library/std/src/sys/unix/locks/mod.rs
index 04c5c489fc9..03400efa3c9 100644
--- a/library/std/src/sys/unix/locks/mod.rs
+++ b/library/std/src/sys/unix/locks/mod.rs
@@ -9,14 +9,14 @@ cfg_if::cfg_if! {
     ))] {
         mod futex;
         mod futex_rwlock;
-        pub use futex::{Mutex, MovableMutex, Condvar, MovableCondvar};
-        pub use futex_rwlock::{RwLock, MovableRwLock};
+        pub(crate) use futex::{Mutex, MovableMutex, MovableCondvar};
+        pub(crate) use futex_rwlock::{RwLock, MovableRwLock};
     } else {
         mod pthread_mutex;
         mod pthread_rwlock;
         mod pthread_condvar;
-        pub use pthread_mutex::{Mutex, MovableMutex};
-        pub use pthread_rwlock::{RwLock, MovableRwLock};
-        pub use pthread_condvar::{Condvar, MovableCondvar};
+        pub(crate) use pthread_mutex::{Mutex, MovableMutex};
+        pub(crate) use pthread_rwlock::{RwLock, MovableRwLock};
+        pub(crate) use pthread_condvar::MovableCondvar;
     }
 }
diff --git a/library/std/src/sys/unix/locks/pthread_condvar.rs b/library/std/src/sys/unix/locks/pthread_condvar.rs
index 099aa68706f..61c28d696bc 100644
--- a/library/std/src/sys/unix/locks/pthread_condvar.rs
+++ b/library/std/src/sys/unix/locks/pthread_condvar.rs
@@ -1,12 +1,13 @@
 use crate::cell::UnsafeCell;
 use crate::sys::locks::{pthread_mutex, Mutex};
+use crate::sys_common::lazy_box::{LazyBox, LazyInit};
 use crate::time::Duration;
 
 pub struct Condvar {
     inner: UnsafeCell<libc::pthread_cond_t>,
 }
 
-pub type MovableCondvar = Box<Condvar>;
+pub(crate) type MovableCondvar = LazyBox<Condvar>;
 
 unsafe impl Send for Condvar {}
 unsafe impl Sync for Condvar {}
@@ -18,6 +19,14 @@ fn saturating_cast_to_time_t(value: u64) -> libc::time_t {
     if value > <libc::time_t>::MAX as u64 { <libc::time_t>::MAX } else { value as libc::time_t }
 }
 
+impl LazyInit for Condvar {
+    fn init() -> Box<Self> {
+        let mut condvar = Box::new(Self::new());
+        unsafe { condvar.init() };
+        condvar
+    }
+}
+
 impl Condvar {
     pub const fn new() -> Condvar {
         // Might be moved and address is changing it is better to avoid
@@ -32,14 +41,14 @@ impl Condvar {
         target_os = "android",
         target_os = "redox"
     ))]
-    pub unsafe fn init(&mut self) {}
+    unsafe fn init(&mut self) {}
 
     // NOTE: ESP-IDF's PTHREAD_COND_INITIALIZER support is not released yet
     // So on that platform, init() should always be called
     // Moreover, that platform does not have pthread_condattr_setclock support,
     // hence that initialization should be skipped as well
     #[cfg(target_os = "espidf")]
-    pub unsafe fn init(&mut self) {
+    unsafe fn init(&mut self) {
         let r = libc::pthread_cond_init(self.inner.get(), crate::ptr::null());
         assert_eq!(r, 0);
     }
@@ -52,7 +61,7 @@ impl Condvar {
         target_os = "redox",
         target_os = "espidf"
     )))]
-    pub unsafe fn init(&mut self) {
+    unsafe fn init(&mut self) {
         use crate::mem::MaybeUninit;
         let mut attr = MaybeUninit::<libc::pthread_condattr_t>::uninit();
         let r = libc::pthread_condattr_init(attr.as_mut_ptr());
@@ -179,14 +188,14 @@ impl Condvar {
 
     #[inline]
     #[cfg(not(target_os = "dragonfly"))]
-    pub unsafe fn destroy(&self) {
+    unsafe fn destroy(&mut self) {
         let r = libc::pthread_cond_destroy(self.inner.get());
         debug_assert_eq!(r, 0);
     }
 
     #[inline]
     #[cfg(target_os = "dragonfly")]
-    pub unsafe fn destroy(&self) {
+    unsafe fn destroy(&mut self) {
         let r = libc::pthread_cond_destroy(self.inner.get());
         // On DragonFly pthread_cond_destroy() returns EINVAL if called on
         // a condvar that was just initialized with
@@ -195,3 +204,10 @@ impl Condvar {
         debug_assert!(r == 0 || r == libc::EINVAL);
     }
 }
+
+impl Drop for Condvar {
+    #[inline]
+    fn drop(&mut self) {
+        unsafe { self.destroy() };
+    }
+}
diff --git a/library/std/src/sys/unix/locks/pthread_mutex.rs b/library/std/src/sys/unix/locks/pthread_mutex.rs
index 76840ce74dd..916e898d890 100644
--- a/library/std/src/sys/unix/locks/pthread_mutex.rs
+++ b/library/std/src/sys/unix/locks/pthread_mutex.rs
@@ -1,12 +1,13 @@
 use crate::cell::UnsafeCell;
 use crate::mem::MaybeUninit;
 use crate::sys::cvt_nz;
+use crate::sys_common::lazy_box::{LazyBox, LazyInit};
 
 pub struct Mutex {
     inner: UnsafeCell<libc::pthread_mutex_t>,
 }
 
-pub type MovableMutex = Box<Mutex>;
+pub(crate) type MovableMutex = LazyBox<Mutex>;
 
 #[inline]
 pub unsafe fn raw(m: &Mutex) -> *mut libc::pthread_mutex_t {
@@ -16,6 +17,14 @@ pub unsafe fn raw(m: &Mutex) -> *mut libc::pthread_mutex_t {
 unsafe impl Send for Mutex {}
 unsafe impl Sync for Mutex {}
 
+impl LazyInit for Mutex {
+    fn init() -> Box<Self> {
+        let mut mutex = Box::new(Self::new());
+        unsafe { mutex.init() };
+        mutex
+    }
+}
+
 impl Mutex {
     pub const fn new() -> Mutex {
         // Might be moved to a different address, so it is better to avoid
@@ -73,13 +82,13 @@ impl Mutex {
     }
     #[inline]
     #[cfg(not(target_os = "dragonfly"))]
-    pub unsafe fn destroy(&self) {
+    unsafe fn destroy(&mut self) {
         let r = libc::pthread_mutex_destroy(self.inner.get());
         debug_assert_eq!(r, 0);
     }
     #[inline]
     #[cfg(target_os = "dragonfly")]
-    pub unsafe fn destroy(&self) {
+    unsafe fn destroy(&mut self) {
         let r = libc::pthread_mutex_destroy(self.inner.get());
         // On DragonFly pthread_mutex_destroy() returns EINVAL if called on a
         // mutex that was just initialized with libc::PTHREAD_MUTEX_INITIALIZER.
@@ -89,6 +98,13 @@ impl Mutex {
     }
 }
 
+impl Drop for Mutex {
+    #[inline]
+    fn drop(&mut self) {
+        unsafe { self.destroy() };
+    }
+}
+
 pub(super) struct PthreadMutexAttr<'a>(pub &'a mut MaybeUninit<libc::pthread_mutexattr_t>);
 
 impl Drop for PthreadMutexAttr<'_> {
diff --git a/library/std/src/sys/unix/locks/pthread_rwlock.rs b/library/std/src/sys/unix/locks/pthread_rwlock.rs
index 11a0c0457cd..75e5759c787 100644
--- a/library/std/src/sys/unix/locks/pthread_rwlock.rs
+++ b/library/std/src/sys/unix/locks/pthread_rwlock.rs
@@ -1,5 +1,6 @@
 use crate::cell::UnsafeCell;
 use crate::sync::atomic::{AtomicUsize, Ordering};
+use crate::sys_common::lazy_box::{LazyBox, LazyInit};
 
 pub struct RwLock {
     inner: UnsafeCell<libc::pthread_rwlock_t>,
@@ -7,11 +8,17 @@ pub struct RwLock {
     num_readers: AtomicUsize,
 }
 
-pub type MovableRwLock = Box<RwLock>;
+pub(crate) type MovableRwLock = LazyBox<RwLock>;
 
 unsafe impl Send for RwLock {}
 unsafe impl Sync for RwLock {}
 
+impl LazyInit for RwLock {
+    fn init() -> Box<Self> {
+        Box::new(Self::new())
+    }
+}
+
 impl RwLock {
     pub const fn new() -> RwLock {
         RwLock {
@@ -128,7 +135,7 @@ impl RwLock {
         self.raw_unlock();
     }
     #[inline]
-    pub unsafe fn destroy(&self) {
+    unsafe fn destroy(&mut self) {
         let r = libc::pthread_rwlock_destroy(self.inner.get());
         // On DragonFly pthread_rwlock_destroy() returns EINVAL if called on a
         // rwlock that was just initialized with
@@ -141,3 +148,10 @@ impl RwLock {
         }
     }
 }
+
+impl Drop for RwLock {
+    #[inline]
+    fn drop(&mut self) {
+        unsafe { self.destroy() };
+    }
+}
diff --git a/library/std/src/sys/unix/mod.rs b/library/std/src/sys/unix/mod.rs
index 8e909aab7f0..1505878e18c 100644
--- a/library/std/src/sys/unix/mod.rs
+++ b/library/std/src/sys/unix/mod.rs
@@ -1,5 +1,6 @@
 #![allow(missing_docs, nonstandard_style)]
 
+use crate::ffi::CStr;
 use crate::io::ErrorKind;
 
 pub use self::rand::hashmap_random_keys;
@@ -66,6 +67,15 @@ pub unsafe fn init(argc: isize, argv: *const *const u8) {
     stack_overflow::init();
     args::init(argc, argv);
 
+    // Normally, `thread::spawn` will call `Thread::set_name` but since this thread
+    // already exists, we have to call it ourselves. We only do this on macos
+    // because some unix-like operating systems such as Linux share process-id and
+    // thread-id for the main thread and so renaming the main thread will rename the
+    // process and we only want to enable this on platforms we've tested.
+    if cfg!(target_os = "macos") {
+        thread::Thread::set_name(&CStr::from_bytes_with_nul_unchecked(b"main\0"));
+    }
+
     unsafe fn sanitize_standard_fds() {
         #[cfg(not(miri))]
         // The standard fds are always available in Miri.
diff --git a/library/std/src/sys/unix/process/process_unix.rs b/library/std/src/sys/unix/process/process_unix.rs
index 23bb6d6c15f..ef29aa3c890 100644
--- a/library/std/src/sys/unix/process/process_unix.rs
+++ b/library/std/src/sys/unix/process/process_unix.rs
@@ -695,18 +695,94 @@ impl From<c_int> for ExitStatus {
     }
 }
 
+/// Convert a signal number to a readable, searchable name.
+///
+/// This string should be displayed right after the signal number.
+/// If a signal is unrecognized, it returns the empty string, so that
+/// you just get the number like "0". If it is recognized, you'll get
+/// something like "9 (SIGKILL)".
+fn signal_string(signal: i32) -> &'static str {
+    match signal {
+        libc::SIGHUP => " (SIGHUP)",
+        libc::SIGINT => " (SIGINT)",
+        libc::SIGQUIT => " (SIGQUIT)",
+        libc::SIGILL => " (SIGILL)",
+        libc::SIGTRAP => " (SIGTRAP)",
+        libc::SIGABRT => " (SIGABRT)",
+        libc::SIGBUS => " (SIGBUS)",
+        libc::SIGFPE => " (SIGFPE)",
+        libc::SIGKILL => " (SIGKILL)",
+        libc::SIGUSR1 => " (SIGUSR1)",
+        libc::SIGSEGV => " (SIGSEGV)",
+        libc::SIGUSR2 => " (SIGUSR2)",
+        libc::SIGPIPE => " (SIGPIPE)",
+        libc::SIGALRM => " (SIGALRM)",
+        libc::SIGTERM => " (SIGTERM)",
+        libc::SIGCHLD => " (SIGCHLD)",
+        libc::SIGCONT => " (SIGCONT)",
+        libc::SIGSTOP => " (SIGSTOP)",
+        libc::SIGTSTP => " (SIGTSTP)",
+        libc::SIGTTIN => " (SIGTTIN)",
+        libc::SIGTTOU => " (SIGTTOU)",
+        libc::SIGURG => " (SIGURG)",
+        libc::SIGXCPU => " (SIGXCPU)",
+        libc::SIGXFSZ => " (SIGXFSZ)",
+        libc::SIGVTALRM => " (SIGVTALRM)",
+        libc::SIGPROF => " (SIGPROF)",
+        libc::SIGWINCH => " (SIGWINCH)",
+        libc::SIGIO => " (SIGIO)",
+        libc::SIGSYS => " (SIGSYS)",
+        // For information on Linux signals, run `man 7 signal`
+        #[cfg(all(
+            target_os = "linux",
+            any(
+                target_arch = "x86_64",
+                target_arch = "x86",
+                target_arch = "arm",
+                target_arch = "aarch64"
+            )
+        ))]
+        libc::SIGSTKFLT => " (SIGSTKFLT)",
+        #[cfg(target_os = "linux")]
+        libc::SIGPWR => " (SIGPWR)",
+        #[cfg(any(
+            target_os = "macos",
+            target_os = "ios",
+            target_os = "tvos",
+            target_os = "freebsd",
+            target_os = "netbsd",
+            target_os = "openbsd",
+            target_os = "dragonfly"
+        ))]
+        libc::SIGEMT => " (SIGEMT)",
+        #[cfg(any(
+            target_os = "macos",
+            target_os = "ios",
+            target_os = "tvos",
+            target_os = "freebsd",
+            target_os = "netbsd",
+            target_os = "openbsd",
+            target_os = "dragonfly"
+        ))]
+        libc::SIGINFO => " (SIGINFO)",
+        _ => "",
+    }
+}
+
 impl fmt::Display for ExitStatus {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         if let Some(code) = self.code() {
             write!(f, "exit status: {code}")
         } else if let Some(signal) = self.signal() {
+            let signal_string = signal_string(signal);
             if self.core_dumped() {
-                write!(f, "signal: {signal} (core dumped)")
+                write!(f, "signal: {signal}{signal_string} (core dumped)")
             } else {
-                write!(f, "signal: {signal}")
+                write!(f, "signal: {signal}{signal_string}")
             }
         } else if let Some(signal) = self.stopped_signal() {
-            write!(f, "stopped (not terminated) by signal: {signal}")
+            let signal_string = signal_string(signal);
+            write!(f, "stopped (not terminated) by signal: {signal}{signal_string}")
         } else if self.continued() {
             write!(f, "continued (WIFCONTINUED)")
         } else {
diff --git a/library/std/src/sys/unix/process/process_unix/tests.rs b/library/std/src/sys/unix/process/process_unix/tests.rs
index 560c62155d9..e0e2d478fad 100644
--- a/library/std/src/sys/unix/process/process_unix/tests.rs
+++ b/library/std/src/sys/unix/process/process_unix/tests.rs
@@ -14,8 +14,8 @@ fn exitstatus_display_tests() {
 
     let t = |v, s| assert_eq!(s, format!("{}", <ExitStatus as ExitStatusExt>::from_raw(v)));
 
-    t(0x0000f, "signal: 15");
-    t(0x0008b, "signal: 11 (core dumped)");
+    t(0x0000f, "signal: 15 (SIGTERM)");
+    t(0x0008b, "signal: 11 (SIGSEGV) (core dumped)");
     t(0x00000, "exit status: 0");
     t(0x0ff00, "exit status: 255");
 
@@ -24,7 +24,7 @@ fn exitstatus_display_tests() {
     // The purpose of this test is to test our string formatting, not our understanding of the wait
     // status magic numbers.  So restrict these to Linux.
     if cfg!(target_os = "linux") {
-        t(0x0137f, "stopped (not terminated) by signal: 19");
+        t(0x0137f, "stopped (not terminated) by signal: 19 (SIGSTOP)");
         t(0x0ffff, "continued (WIFCONTINUED)");
     }
 
diff --git a/library/std/src/sys/unsupported/locks/condvar.rs b/library/std/src/sys/unsupported/locks/condvar.rs
index 8dbe03bad9b..f27bf2b26bd 100644
--- a/library/std/src/sys/unsupported/locks/condvar.rs
+++ b/library/std/src/sys/unsupported/locks/condvar.rs
@@ -11,9 +11,6 @@ impl Condvar {
     }
 
     #[inline]
-    pub unsafe fn init(&mut self) {}
-
-    #[inline]
     pub unsafe fn notify_one(&self) {}
 
     #[inline]
@@ -26,7 +23,4 @@ impl Condvar {
     pub unsafe fn wait_timeout(&self, _mutex: &Mutex, _dur: Duration) -> bool {
         panic!("condvar wait not supported");
     }
-
-    #[inline]
-    pub unsafe fn destroy(&self) {}
 }
diff --git a/library/std/src/sys/unsupported/locks/mutex.rs b/library/std/src/sys/unsupported/locks/mutex.rs
index cad991aae5e..56bad71b189 100644
--- a/library/std/src/sys/unsupported/locks/mutex.rs
+++ b/library/std/src/sys/unsupported/locks/mutex.rs
@@ -32,7 +32,4 @@ impl Mutex {
     pub unsafe fn try_lock(&self) -> bool {
         self.locked.replace(true) == false
     }
-
-    #[inline]
-    pub unsafe fn destroy(&self) {}
 }
diff --git a/library/std/src/sys/unsupported/locks/rwlock.rs b/library/std/src/sys/unsupported/locks/rwlock.rs
index 14fd351314c..bf6e2d3d080 100644
--- a/library/std/src/sys/unsupported/locks/rwlock.rs
+++ b/library/std/src/sys/unsupported/locks/rwlock.rs
@@ -62,7 +62,4 @@ impl RwLock {
     pub unsafe fn write_unlock(&self) {
         assert_eq!(self.mode.replace(0), -1);
     }
-
-    #[inline]
-    pub unsafe fn destroy(&self) {}
 }
diff --git a/library/std/src/sys/wasm/mod.rs b/library/std/src/sys/wasm/mod.rs
index 9992e44b0e7..55b5ad314da 100644
--- a/library/std/src/sys/wasm/mod.rs
+++ b/library/std/src/sys/wasm/mod.rs
@@ -54,8 +54,8 @@ cfg_if::cfg_if! {
             #![allow(unsafe_op_in_unsafe_fn)]
             mod futex;
             mod futex_rwlock;
-            pub use futex::{Mutex, MovableMutex, Condvar, MovableCondvar};
-            pub use futex_rwlock::{RwLock, MovableRwLock};
+            pub(crate) use futex::{Mutex, MovableMutex, Condvar, MovableCondvar};
+            pub(crate) use futex_rwlock::{RwLock, MovableRwLock};
         }
         #[path = "atomics/futex.rs"]
         pub mod futex;
diff --git a/library/std/src/sys/windows/locks/condvar.rs b/library/std/src/sys/windows/locks/condvar.rs
index dfd8cfdceee..59e2c1be0f0 100644
--- a/library/std/src/sys/windows/locks/condvar.rs
+++ b/library/std/src/sys/windows/locks/condvar.rs
@@ -19,9 +19,6 @@ impl Condvar {
     }
 
     #[inline]
-    pub unsafe fn init(&mut self) {}
-
-    #[inline]
     pub unsafe fn wait(&self, mutex: &Mutex) {
         let r = c::SleepConditionVariableSRW(self.inner.get(), mutex::raw(mutex), c::INFINITE, 0);
         debug_assert!(r != 0);
@@ -51,8 +48,4 @@ impl Condvar {
     pub unsafe fn notify_all(&self) {
         c::WakeAllConditionVariable(self.inner.get())
     }
-
-    pub unsafe fn destroy(&self) {
-        // ...
-    }
 }
diff --git a/library/std/src/sys/windows/locks/mutex.rs b/library/std/src/sys/windows/locks/mutex.rs
index 9fa280b8b76..08f55844a0e 100644
--- a/library/std/src/sys/windows/locks/mutex.rs
+++ b/library/std/src/sys/windows/locks/mutex.rs
@@ -53,9 +53,4 @@ impl Mutex {
     pub unsafe fn unlock(&self) {
         c::ReleaseSRWLockExclusive(raw(self));
     }
-
-    #[inline]
-    pub unsafe fn destroy(&self) {
-        // SRWLock does not need to be destroyed.
-    }
 }
diff --git a/library/std/src/sys/windows/locks/rwlock.rs b/library/std/src/sys/windows/locks/rwlock.rs
index 12906652e0b..a32df85e2f6 100644
--- a/library/std/src/sys/windows/locks/rwlock.rs
+++ b/library/std/src/sys/windows/locks/rwlock.rs
@@ -38,9 +38,4 @@ impl RwLock {
     pub unsafe fn write_unlock(&self) {
         c::ReleaseSRWLockExclusive(self.inner.get())
     }
-
-    #[inline]
-    pub unsafe fn destroy(&self) {
-        // ...
-    }
 }
diff --git a/library/std/src/sys/windows/mod.rs b/library/std/src/sys/windows/mod.rs
index 4e9d408291d..b3f6d2d0aae 100644
--- a/library/std/src/sys/windows/mod.rs
+++ b/library/std/src/sys/windows/mod.rs
@@ -1,6 +1,6 @@
 #![allow(missing_docs, nonstandard_style)]
 
-use crate::ffi::{OsStr, OsString};
+use crate::ffi::{CStr, OsStr, OsString};
 use crate::io::ErrorKind;
 use crate::os::windows::ffi::{OsStrExt, OsStringExt};
 use crate::path::PathBuf;
@@ -49,6 +49,10 @@ cfg_if::cfg_if! {
 // NOTE: this is not guaranteed to run, for example when Rust code is called externally.
 pub unsafe fn init(_argc: isize, _argv: *const *const u8) {
     stack_overflow::init();
+
+    // Normally, `thread::spawn` will call `Thread::set_name` but since this thread already
+    // exists, we have to call it ourselves.
+    thread::Thread::set_name(&CStr::from_bytes_with_nul_unchecked(b"main\0"));
 }
 
 // SAFETY: must be called only once during runtime cleanup.
diff --git a/library/std/src/sys_common/condvar.rs b/library/std/src/sys_common/condvar.rs
index 67d4b126209..1def0518e0a 100644
--- a/library/std/src/sys_common/condvar.rs
+++ b/library/std/src/sys_common/condvar.rs
@@ -15,9 +15,7 @@ pub struct Condvar {
 impl Condvar {
     /// Creates a new condition variable for use.
     pub fn new() -> Self {
-        let mut c = imp::MovableCondvar::from(imp::Condvar::new());
-        unsafe { c.init() };
-        Self { inner: c, check: CondvarCheck::new() }
+        Self { inner: imp::MovableCondvar::new(), check: CondvarCheck::new() }
     }
 
     /// Signals one waiter on this condition variable to wake up.
@@ -55,9 +53,3 @@ impl Condvar {
         self.inner.wait_timeout(mutex.raw(), dur)
     }
 }
-
-impl Drop for Condvar {
-    fn drop(&mut self) {
-        unsafe { self.inner.destroy() };
-    }
-}
diff --git a/library/std/src/sys_common/condvar/check.rs b/library/std/src/sys_common/condvar/check.rs
index d0d0d596518..ce8f3670487 100644
--- a/library/std/src/sys_common/condvar/check.rs
+++ b/library/std/src/sys_common/condvar/check.rs
@@ -1,6 +1,7 @@
 use crate::ptr;
 use crate::sync::atomic::{AtomicPtr, Ordering};
 use crate::sys::locks as imp;
+use crate::sys_common::lazy_box::{LazyBox, LazyInit};
 use crate::sys_common::mutex::MovableMutex;
 
 pub trait CondvarCheck {
@@ -9,7 +10,7 @@ pub trait CondvarCheck {
 
 /// For boxed mutexes, a `Condvar` will check it's only ever used with the same
 /// mutex, based on its (stable) address.
-impl CondvarCheck for Box<imp::Mutex> {
+impl<T: LazyInit> CondvarCheck for LazyBox<T> {
     type Check = SameMutexCheck;
 }
 
diff --git a/library/std/src/sys_common/lazy_box.rs b/library/std/src/sys_common/lazy_box.rs
new file mode 100644
index 00000000000..647c13d2437
--- /dev/null
+++ b/library/std/src/sys_common/lazy_box.rs
@@ -0,0 +1,77 @@
+#![allow(dead_code)] // Only used on some platforms.
+
+// This is used to wrap pthread {Mutex, Condvar, RwLock} in.
+
+use crate::marker::PhantomData;
+use crate::ops::{Deref, DerefMut};
+use crate::ptr::null_mut;
+use crate::sync::atomic::{
+    AtomicPtr,
+    Ordering::{AcqRel, Acquire},
+};
+
+pub(crate) struct LazyBox<T: LazyInit> {
+    ptr: AtomicPtr<T>,
+    _phantom: PhantomData<T>,
+}
+
+pub(crate) trait LazyInit {
+    /// This is called before the box is allocated, to provide the value to
+    /// move into the new box.
+    ///
+    /// It might be called more than once per LazyBox, as multiple threads
+    /// might race to initialize it concurrently, each constructing and initializing
+    /// their own box. (All but one of them will be destroyed right after.)
+    fn init() -> Box<Self>;
+}
+
+impl<T: LazyInit> LazyBox<T> {
+    #[inline]
+    pub const fn new() -> Self {
+        Self { ptr: AtomicPtr::new(null_mut()), _phantom: PhantomData }
+    }
+
+    #[inline]
+    fn get_pointer(&self) -> *mut T {
+        let ptr = self.ptr.load(Acquire);
+        if ptr.is_null() { self.initialize() } else { ptr }
+    }
+
+    #[cold]
+    fn initialize(&self) -> *mut T {
+        let new_ptr = Box::into_raw(T::init());
+        match self.ptr.compare_exchange(null_mut(), new_ptr, AcqRel, Acquire) {
+            Ok(_) => new_ptr,
+            Err(ptr) => {
+                // Lost the race to another thread.
+                // Drop the box we created, and use the one from the other thread instead.
+                drop(unsafe { Box::from_raw(new_ptr) });
+                ptr
+            }
+        }
+    }
+}
+
+impl<T: LazyInit> Deref for LazyBox<T> {
+    type Target = T;
+    #[inline]
+    fn deref(&self) -> &T {
+        unsafe { &*self.get_pointer() }
+    }
+}
+
+impl<T: LazyInit> DerefMut for LazyBox<T> {
+    #[inline]
+    fn deref_mut(&mut self) -> &mut T {
+        unsafe { &mut *self.get_pointer() }
+    }
+}
+
+impl<T: LazyInit> Drop for LazyBox<T> {
+    fn drop(&mut self) {
+        let ptr = *self.ptr.get_mut();
+        if !ptr.is_null() {
+            drop(unsafe { Box::from_raw(ptr) });
+        }
+    }
+}
diff --git a/library/std/src/sys_common/mod.rs b/library/std/src/sys_common/mod.rs
index 804727fbc54..80f56bf7522 100644
--- a/library/std/src/sys_common/mod.rs
+++ b/library/std/src/sys_common/mod.rs
@@ -24,6 +24,7 @@ pub mod backtrace;
 pub mod condvar;
 pub mod fs;
 pub mod io;
+pub mod lazy_box;
 pub mod memchr;
 pub mod mutex;
 pub mod process;
diff --git a/library/std/src/sys_common/mutex.rs b/library/std/src/sys_common/mutex.rs
index 12a09c98605..36ea888d8de 100644
--- a/library/std/src/sys_common/mutex.rs
+++ b/library/std/src/sys_common/mutex.rs
@@ -61,9 +61,7 @@ unsafe impl Sync for MovableMutex {}
 impl MovableMutex {
     /// Creates a new mutex.
     pub fn new() -> Self {
-        let mut mutex = imp::MovableMutex::from(imp::Mutex::new());
-        unsafe { mutex.init() };
-        Self(mutex)
+        Self(imp::MovableMutex::new())
     }
 
     pub(super) fn raw(&self) -> &imp::Mutex {
@@ -92,9 +90,3 @@ impl MovableMutex {
         self.0.unlock()
     }
 }
-
-impl Drop for MovableMutex {
-    fn drop(&mut self) {
-        unsafe { self.0.destroy() };
-    }
-}
diff --git a/library/std/src/sys_common/remutex.rs b/library/std/src/sys_common/remutex.rs
index 8f252308de7..8921af311d4 100644
--- a/library/std/src/sys_common/remutex.rs
+++ b/library/std/src/sys_common/remutex.rs
@@ -168,13 +168,6 @@ impl<T> ReentrantMutex<T> {
     }
 }
 
-impl<T> Drop for ReentrantMutex<T> {
-    fn drop(&mut self) {
-        // Safety: We're the unique owner of this mutex and not going to use it afterwards.
-        unsafe { self.mutex.destroy() }
-    }
-}
-
 impl<T> Deref for ReentrantMutexGuard<'_, T> {
     type Target = T;
 
diff --git a/library/std/src/sys_common/rwlock.rs b/library/std/src/sys_common/rwlock.rs
index 12e7a72a344..abc9fd561f1 100644
--- a/library/std/src/sys_common/rwlock.rs
+++ b/library/std/src/sys_common/rwlock.rs
@@ -74,7 +74,7 @@ pub struct MovableRwLock(imp::MovableRwLock);
 impl MovableRwLock {
     /// Creates a new reader-writer lock for use.
     pub fn new() -> Self {
-        Self(imp::MovableRwLock::from(imp::RwLock::new()))
+        Self(imp::MovableRwLock::new())
     }
 
     /// Acquires shared access to the underlying lock, blocking the current
@@ -126,9 +126,3 @@ impl MovableRwLock {
         self.0.write_unlock()
     }
 }
-
-impl Drop for MovableRwLock {
-    fn drop(&mut self) {
-        unsafe { self.0.destroy() };
-    }
-}
diff --git a/library/test/src/lib.rs b/library/test/src/lib.rs
index 0c748da1a59..3b7193adcc7 100644
--- a/library/test/src/lib.rs
+++ b/library/test/src/lib.rs
@@ -15,7 +15,6 @@
 
 #![unstable(feature = "test", issue = "50297")]
 #![doc(test(attr(deny(warnings))))]
-#![feature(nll)]
 #![feature(bench_black_box)]
 #![feature(internal_output_capture)]
 #![feature(staged_api)]
diff --git a/library/unwind/src/lib.rs b/library/unwind/src/lib.rs
index c92a7d310f3..15254bc755b 100644
--- a/library/unwind/src/lib.rs
+++ b/library/unwind/src/lib.rs
@@ -2,7 +2,6 @@
 #![unstable(feature = "panic_unwind", issue = "32837")]
 #![feature(link_cfg)]
 #![feature(native_link_modifiers_bundle)]
-#![feature(nll)]
 #![feature(staged_api)]
 #![feature(c_unwind)]
 #![feature(cfg_target_abi)]
diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml
index dea8d998bde..5027a45e0ad 100644
--- a/src/bootstrap/Cargo.toml
+++ b/src/bootstrap/Cargo.toml
@@ -49,6 +49,9 @@ opener = "0.5"
 once_cell = "1.7.2"
 xz2 = "0.1"
 
+# Dependencies needed by the build-metrics feature
+sysinfo = { version = "0.24.1", optional = true }
+
 [target.'cfg(windows)'.dependencies.winapi]
 version = "0.3"
 features = [
@@ -64,3 +67,6 @@ features = [
 
 [dev-dependencies]
 pretty_assertions = "0.7"
+
+[features]
+build-metrics = ["sysinfo"]
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index a997c4f63ab..d81874bfe7e 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -837,6 +837,9 @@ class RustBuild(object):
             args.append("--locked")
         if self.use_vendored_sources:
             args.append("--frozen")
+        if self.get_toml("metrics", "build"):
+            args.append("--features")
+            args.append("build-metrics")
         run(args, env=env, verbose=self.verbose)
 
     def build_triple(self):
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 17c2d1c79ec..da13374cee7 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -1364,29 +1364,26 @@ impl<'a> Builder<'a> {
         // get some support for setting `--check-cfg` within build script, it's the least invasive
         // hack that still let's us have cfg checking for the vast majority of the codebase.
         if stage != 0 {
-            // Enable cfg checking of cargo features for everything but std.
+            // Enable cfg checking of cargo features for everything but std and also enable cfg
+            // checking of names and values.
             //
             // Note: `std`, `alloc` and `core` imports some dependencies by #[path] (like
-            // backtrace, core_simd, std_float, ...), those dependencies have their own features
-            // but cargo isn't involved in the #[path] and so cannot pass the complete list of
-            // features, so for that reason we don't enable checking of features for std.
+            // backtrace, core_simd, std_float, ...), those dependencies have their own
+            // features but cargo isn't involved in the #[path] process and so cannot pass the
+            // complete list of features, so for that reason we don't enable checking of
+            // features for std crates.
+            cargo.arg(if mode != Mode::Std {
+                "-Zcheck-cfg=names,values,features"
+            } else {
+                "-Zcheck-cfg=names,values"
+            });
+
+            // Add extra cfg not defined in/by rustc
             //
-            // FIXME: Re-enable this after the beta bump as apperently rustc-perf doesn't use the
-            // beta cargo. See https://github.com/rust-lang/rust/pull/96984#issuecomment-1126678773
-            // #[cfg(not(bootstrap))]
-            // if mode != Mode::Std {
-            //     cargo.arg("-Zcheck-cfg-features"); // -Zcheck-cfg=features after bump
-            // }
-
-            // Enable cfg checking of well known names/values
-            rustflags
-                .arg("-Zunstable-options")
-                // Enable checking of well known names
-                .arg("--check-cfg=names()")
-                // Enable checking of well known values
-                .arg("--check-cfg=values()");
-
-            // Add extra cfg not defined in rustc
+            // Note: Altrough it would seems that "-Zunstable-options" to `rustflags` is useless as
+            // cargo would implicitly add it, it was discover that sometimes bootstrap only use
+            // `rustflags` without `cargo` making it required.
+            rustflags.arg("-Zunstable-options");
             for (restricted_mode, name, values) in EXTRA_CHECK_CFGS {
                 if *restricted_mode == None || *restricted_mode == Some(mode) {
                     // Creating a string of the values by concatenating each value:
@@ -2013,6 +2010,9 @@ impl<'a> Builder<'a> {
             stack.push(Box::new(step.clone()));
         }
 
+        #[cfg(feature = "build-metrics")]
+        self.metrics.enter_step(&step);
+
         let (out, dur) = {
             let start = Instant::now();
             let zero = Duration::new(0, 0);
@@ -2036,6 +2036,9 @@ impl<'a> Builder<'a> {
             );
         }
 
+        #[cfg(feature = "build-metrics")]
+        self.metrics.exit_step();
+
         {
             let mut stack = self.stack.borrow_mut();
             let cur_step = stack.pop().expect("step stack empty");
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
index 8e94fc7c4be..6cb0bd518e2 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
@@ -550,6 +550,7 @@ define_config! {
         dist_stage: Option<u32> = "dist-stage",
         bench_stage: Option<u32> = "bench-stage",
         patch_binaries_for_nix: Option<bool> = "patch-binaries-for-nix",
+        metrics: Option<bool> = "metrics",
     }
 }
 
diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs
index 9827a6c590b..f692ff72d4e 100644
--- a/src/bootstrap/flags.rs
+++ b/src/bootstrap/flags.rs
@@ -452,7 +452,7 @@ Arguments:
         ./x.py test library/std --test-args hash_map
         ./x.py test library/std --stage 0 --no-doc
         ./x.py test src/test/ui --bless
-        ./x.py test src/test/ui --compare-mode nll
+        ./x.py test src/test/ui --compare-mode chalk
 
     Note that `test src/test/* --stage N` does NOT depend on `build compiler/rustc --stage N`;
     just like `build library/std --stage N` it tests the compiler produced by the previous
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 0f0cf0762ab..fab6168bf38 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -150,6 +150,9 @@ mod tool;
 mod toolstate;
 pub mod util;
 
+#[cfg(feature = "build-metrics")]
+mod metrics;
+
 #[cfg(windows)]
 mod job;
 
@@ -312,6 +315,9 @@ pub struct Build {
     prerelease_version: Cell<Option<u32>>,
     tool_artifacts:
         RefCell<HashMap<TargetSelection, HashMap<String, (&'static str, PathBuf, Vec<String>)>>>,
+
+    #[cfg(feature = "build-metrics")]
+    metrics: metrics::BuildMetrics,
 }
 
 #[derive(Debug)]
@@ -501,6 +507,9 @@ impl Build {
             delayed_failures: RefCell::new(Vec::new()),
             prerelease_version: Cell::new(None),
             tool_artifacts: Default::default(),
+
+            #[cfg(feature = "build-metrics")]
+            metrics: metrics::BuildMetrics::init(),
         };
 
         build.verbose("finding compilers");
@@ -695,6 +704,9 @@ impl Build {
             }
             process::exit(1);
         }
+
+        #[cfg(feature = "build-metrics")]
+        self.metrics.persist(self);
     }
 
     /// Clear out `dir` if `input` is newer.
diff --git a/src/bootstrap/metrics.rs b/src/bootstrap/metrics.rs
new file mode 100644
index 00000000000..451febddc88
--- /dev/null
+++ b/src/bootstrap/metrics.rs
@@ -0,0 +1,208 @@
+//! This module is responsible for collecting metrics profiling information for the current build
+//! and dumping it to disk as JSON, to aid investigations on build and CI performance.
+//!
+//! As this module requires additional dependencies not present during local builds, it's cfg'd
+//! away whenever the `build.metrics` config option is not set to `true`.
+
+use crate::builder::Step;
+use crate::util::t;
+use crate::Build;
+use serde::{Deserialize, Serialize};
+use std::cell::RefCell;
+use std::fs::File;
+use std::io::BufWriter;
+use std::time::{Duration, Instant};
+use sysinfo::{CpuExt, System, SystemExt};
+
+pub(crate) struct BuildMetrics {
+    state: RefCell<MetricsState>,
+}
+
+impl BuildMetrics {
+    pub(crate) fn init() -> Self {
+        let state = RefCell::new(MetricsState {
+            finished_steps: Vec::new(),
+            running_steps: Vec::new(),
+
+            system_info: System::new(),
+            timer_start: None,
+            invocation_timer_start: Instant::now(),
+        });
+
+        BuildMetrics { state }
+    }
+
+    pub(crate) fn enter_step<S: Step>(&self, step: &S) {
+        let mut state = self.state.borrow_mut();
+
+        // Consider all the stats gathered so far as the parent's.
+        if !state.running_steps.is_empty() {
+            self.collect_stats(&mut *state);
+        }
+
+        state.system_info.refresh_cpu();
+        state.timer_start = Some(Instant::now());
+
+        state.running_steps.push(StepMetrics {
+            type_: std::any::type_name::<S>().into(),
+            debug_repr: format!("{step:?}"),
+
+            cpu_usage_time_sec: 0.0,
+            duration_excluding_children_sec: Duration::ZERO,
+
+            children: Vec::new(),
+        });
+    }
+
+    pub(crate) fn exit_step(&self) {
+        let mut state = self.state.borrow_mut();
+
+        self.collect_stats(&mut *state);
+
+        let step = state.running_steps.pop().unwrap();
+        if state.running_steps.is_empty() {
+            state.finished_steps.push(step);
+            state.timer_start = None;
+        } else {
+            state.running_steps.last_mut().unwrap().children.push(step);
+
+            // Start collecting again for the parent step.
+            state.system_info.refresh_cpu();
+            state.timer_start = Some(Instant::now());
+        }
+    }
+
+    fn collect_stats(&self, state: &mut MetricsState) {
+        let step = state.running_steps.last_mut().unwrap();
+
+        let elapsed = state.timer_start.unwrap().elapsed();
+        step.duration_excluding_children_sec += elapsed;
+
+        state.system_info.refresh_cpu();
+        let cpu = state.system_info.cpus().iter().map(|p| p.cpu_usage()).sum::<f32>();
+        step.cpu_usage_time_sec += cpu as f64 / 100.0 * elapsed.as_secs_f64();
+    }
+
+    pub(crate) fn persist(&self, build: &Build) {
+        let mut state = self.state.borrow_mut();
+        assert!(state.running_steps.is_empty(), "steps are still executing");
+
+        let dest = build.out.join("metrics.json");
+
+        let mut system = System::new();
+        system.refresh_cpu();
+        system.refresh_memory();
+
+        let system_stats = JsonInvocationSystemStats {
+            cpu_threads_count: system.cpus().len(),
+            cpu_model: system.cpus()[0].brand().into(),
+
+            memory_total_bytes: system.total_memory() * 1024,
+        };
+        let steps = std::mem::take(&mut state.finished_steps);
+
+        // Some of our CI builds consist of multiple independent CI invocations. Ensure all the
+        // previous invocations are still present in the resulting file.
+        let mut invocations = match std::fs::read(&dest) {
+            Ok(contents) => t!(serde_json::from_slice::<JsonRoot>(&contents)).invocations,
+            Err(err) => {
+                if err.kind() != std::io::ErrorKind::NotFound {
+                    panic!("failed to open existing metrics file at {}: {err}", dest.display());
+                }
+                Vec::new()
+            }
+        };
+        invocations.push(JsonInvocation {
+            duration_including_children_sec: state.invocation_timer_start.elapsed().as_secs_f64(),
+            children: steps.into_iter().map(|step| self.prepare_json_step(step)).collect(),
+        });
+
+        let json = JsonRoot { system_stats, invocations };
+
+        t!(std::fs::create_dir_all(dest.parent().unwrap()));
+        let mut file = BufWriter::new(t!(File::create(&dest)));
+        t!(serde_json::to_writer(&mut file, &json));
+    }
+
+    fn prepare_json_step(&self, step: StepMetrics) -> JsonNode {
+        JsonNode::RustbuildStep {
+            type_: step.type_,
+            debug_repr: step.debug_repr,
+
+            duration_excluding_children_sec: step.duration_excluding_children_sec.as_secs_f64(),
+            system_stats: JsonStepSystemStats {
+                cpu_utilization_percent: step.cpu_usage_time_sec * 100.0
+                    / step.duration_excluding_children_sec.as_secs_f64(),
+            },
+
+            children: step
+                .children
+                .into_iter()
+                .map(|child| self.prepare_json_step(child))
+                .collect(),
+        }
+    }
+}
+
+struct MetricsState {
+    finished_steps: Vec<StepMetrics>,
+    running_steps: Vec<StepMetrics>,
+
+    system_info: System,
+    timer_start: Option<Instant>,
+    invocation_timer_start: Instant,
+}
+
+struct StepMetrics {
+    type_: String,
+    debug_repr: String,
+
+    cpu_usage_time_sec: f64,
+    duration_excluding_children_sec: Duration,
+
+    children: Vec<StepMetrics>,
+}
+
+#[derive(Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+struct JsonRoot {
+    system_stats: JsonInvocationSystemStats,
+    invocations: Vec<JsonInvocation>,
+}
+
+#[derive(Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+struct JsonInvocation {
+    duration_including_children_sec: f64,
+    children: Vec<JsonNode>,
+}
+
+#[derive(Serialize, Deserialize)]
+#[serde(tag = "kind", rename_all = "snake_case")]
+enum JsonNode {
+    RustbuildStep {
+        #[serde(rename = "type")]
+        type_: String,
+        debug_repr: String,
+
+        duration_excluding_children_sec: f64,
+        system_stats: JsonStepSystemStats,
+
+        children: Vec<JsonNode>,
+    },
+}
+
+#[derive(Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+struct JsonInvocationSystemStats {
+    cpu_threads_count: usize,
+    cpu_model: String,
+
+    memory_total_bytes: u64,
+}
+
+#[derive(Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+struct JsonStepSystemStats {
+    cpu_utilization_percent: f64,
+}
diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs
index a41079333b1..79f2338b7ab 100644
--- a/src/bootstrap/native.rs
+++ b/src/bootstrap/native.rs
@@ -300,6 +300,9 @@ impl Step for Llvm {
 
         if builder.config.llvm_profile_generate {
             cfg.define("LLVM_BUILD_INSTRUMENTED", "IR");
+            if let Ok(llvm_profile_dir) = std::env::var("LLVM_PROFILE_DIR") {
+                cfg.define("LLVM_PROFILE_DATA_DIR", llvm_profile_dir);
+            }
             cfg.define("LLVM_BUILD_RUNTIME", "No");
         }
         if let Some(path) = builder.config.llvm_profile_use.as_ref() {
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index b71bf62fe45..8a236ec5130 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -1167,12 +1167,7 @@ macro_rules! test_definitions {
     };
 }
 
-default_test_with_compare_mode!(Ui {
-    path: "src/test/ui",
-    mode: "ui",
-    suite: "ui",
-    compare_mode: "nll"
-});
+default_test!(Ui { path: "src/test/ui", mode: "ui", suite: "ui" });
 
 default_test!(RunPassValgrind {
     path: "src/test/run-pass-valgrind",
diff --git a/src/ci/azure-pipelines/auto.yml b/src/ci/azure-pipelines/auto.yml
deleted file mode 100644
index 37c2e9bc35a..00000000000
--- a/src/ci/azure-pipelines/auto.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-#####################################
-##    READ BEFORE CHANGING THIS    ##
-#####################################
-
-# We're in the process of evaluating GitHub Actions as a possible replacement
-# for Azure Pipelines, and at the moment the configuration is duplicated
-# between the two CI providers. Be sure to also change the configuration in
-# src/ci/github-actions when changing this file.
-
-#####################################
-
-#
-# Azure Pipelines "auto" branch build for Rust on macOS
-#
-
-pr: none
-trigger:
-  - auto
-
-jobs:
-- job: Dummy
-  timeoutInMinutes: 600
-  pool:
-    vmImage: ubuntu-16.04
-  steps:
-  - bash: echo "We're running this job since bors is still gating on Azure"
diff --git a/src/ci/azure-pipelines/try.yml b/src/ci/azure-pipelines/try.yml
deleted file mode 100644
index 62bb6f47334..00000000000
--- a/src/ci/azure-pipelines/try.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-#####################################
-##    READ BEFORE CHANGING THIS    ##
-#####################################
-
-# We're in the process of evaluating GitHub Actions as a possible replacement
-# for Azure Pipelines, and at the moment the configuration is duplicated
-# between the two CI providers. Be sure to also change the configuration in
-# src/ci/github-actions when changing this file.
-
-#####################################
-
-pr: none
-trigger:
-- try
-
-jobs:
-- job: Dummy
-  timeoutInMinutes: 600
-  pool:
-    vmImage: ubuntu-16.04
-  steps:
-  - bash: echo "We're running this job since bors is still gating on Azure"
diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml
index 173ee170c9f..57832ac2b95 100644
--- a/src/ci/github-actions/ci.yml
+++ b/src/ci/github-actions/ci.yml
@@ -161,10 +161,6 @@ x--expand-yaml-anchors--remove:
         run: src/ci/scripts/install-wix.sh
         <<: *step
 
-      - name: ensure the build happens on a partition with enough space
-        run: src/ci/scripts/symlink-build-dir.sh
-        <<: *step
-
       - name: disable git crlf conversion
         run: src/ci/scripts/disable-git-crlf-conversion.sh
         <<: *step
diff --git a/src/ci/init_repo.sh b/src/ci/init_repo.sh
index 93af8c26111..ec45d9e8bc6 100755
--- a/src/ci/init_repo.sh
+++ b/src/ci/init_repo.sh
@@ -1,9 +1,5 @@
 #!/usr/bin/env bash
 
-# FIXME(61301): we need to debug spurious failures with this on Windows on
-# Azure, so let's print more information in the logs.
-set -x
-
 set -o errexit
 set -o pipefail
 set -o nounset
diff --git a/src/ci/pgo.sh b/src/ci/pgo.sh
index 9b727947f6a..9de970c9c2a 100755
--- a/src/ci/pgo.sh
+++ b/src/ci/pgo.sh
@@ -39,12 +39,19 @@ gather_profiles () {
 
 rm -rf /tmp/rustc-pgo
 
+# This path has to be absolute
+LLVM_PROFILE_DIRECTORY_ROOT=/tmp/llvm-pgo
+
 # We collect LLVM profiling information and rustc profiling information in
 # separate phases. This increases build time -- though not by a huge amount --
 # but prevents any problems from arising due to different profiling runtimes
 # being simultaneously linked in.
-
-python3 ../x.py build --target=$PGO_HOST --host=$PGO_HOST \
+# LLVM IR PGO does not respect LLVM_PROFILE_FILE, so we have to set the profiling file
+# path through our custom environment variable. We include the PID in the directory path
+# to avoid updates to profile files being lost because of race conditions.
+LLVM_PROFILE_DIR=${LLVM_PROFILE_DIRECTORY_ROOT}/prof-%p python3 ../x.py build \
+    --target=$PGO_HOST \
+    --host=$PGO_HOST \
     --stage 2 library/std \
     --llvm-profile-generate
 
@@ -64,11 +71,18 @@ RUSTC_BOOTSTRAP=1 \
 gather_profiles "Debug,Opt" "Full" \
 "syn-1.0.89,cargo-0.60.0,serde-1.0.136,ripgrep-13.0.0,regex-1.5.5,clap-3.1.6,hyper-0.14.18"
 
+LLVM_PROFILE_MERGED_FILE=/tmp/llvm-pgo.profdata
+
 # Merge the profile data we gathered for LLVM
 # Note that this uses the profdata from the clang we used to build LLVM,
 # which likely has a different version than our in-tree clang.
-/rustroot/bin/llvm-profdata \
-    merge -o /tmp/llvm-pgo.profdata ./build/$PGO_HOST/llvm/build/profiles
+/rustroot/bin/llvm-profdata merge -o ${LLVM_PROFILE_MERGED_FILE} ${LLVM_PROFILE_DIRECTORY_ROOT}
+
+echo "LLVM PGO statistics"
+du -sh ${LLVM_PROFILE_MERGED_FILE}
+du -sh ${LLVM_PROFILE_DIRECTORY_ROOT}
+echo "Profile file count"
+find ${LLVM_PROFILE_DIRECTORY_ROOT} -type f | wc -l
 
 # Rustbuild currently doesn't support rebuilding LLVM when PGO options
 # change (or any other llvm-related options); so just clear out the relevant
@@ -77,9 +91,12 @@ rm -r ./build/$PGO_HOST/llvm ./build/$PGO_HOST/lld
 
 # Okay, LLVM profiling is done, switch to rustc PGO.
 
+# The path has to be absolute
+RUSTC_PROFILE_DIRECTORY_ROOT=/tmp/rustc-pgo
+
 python3 ../x.py build --target=$PGO_HOST --host=$PGO_HOST \
     --stage 2 library/std \
-    --rust-profile-generate=/tmp/rustc-pgo
+    --rust-profile-generate=${RUSTC_PROFILE_DIRECTORY_ROOT}
 
 # Here we're profiling the `rustc` frontend, so we also include `Check`.
 # The benchmark set includes various stress tests that put the frontend under pressure.
@@ -87,12 +104,21 @@ python3 ../x.py build --target=$PGO_HOST --host=$PGO_HOST \
 # rustc invocation ends. Empirically, this can result in some profiling data being lost.
 # That's why we override the profile path to include the PID. This will produce many more profiling
 # files, but the resulting profile will produce a slightly faster rustc binary.
-LLVM_PROFILE_FILE=/tmp/rustc-pgo/default_%m_%p.profraw gather_profiles "Check,Debug,Opt" "All" \
-"externs,ctfe-stress-5,cargo-0.60.0,token-stream-stress,match-stress,tuple-stress,diesel-1.4.8,bitmaps-3.1.0"
+LLVM_PROFILE_FILE=${RUSTC_PROFILE_DIRECTORY_ROOT}/default_%m_%p.profraw gather_profiles \
+  "Check,Debug,Opt" "All" \
+  "externs,ctfe-stress-5,cargo-0.60.0,token-stream-stress,match-stress,tuple-stress,diesel-1.4.8,bitmaps-3.1.0"
+
+RUSTC_PROFILE_MERGED_FILE=/tmp/rustc-pgo.profdata
 
 # Merge the profile data we gathered
 ./build/$PGO_HOST/llvm/bin/llvm-profdata \
-    merge -o /tmp/rustc-pgo.profdata /tmp/rustc-pgo
+    merge -o ${RUSTC_PROFILE_MERGED_FILE} ${RUSTC_PROFILE_DIRECTORY_ROOT}
+
+echo "Rustc PGO statistics"
+du -sh ${RUSTC_PROFILE_MERGED_FILE}
+du -sh ${RUSTC_PROFILE_DIRECTORY_ROOT}
+echo "Profile file count"
+find ${RUSTC_PROFILE_DIRECTORY_ROOT} -type f | wc -l
 
 # Rustbuild currently doesn't support rebuilding LLVM when PGO options
 # change (or any other llvm-related options); so just clear out the relevant
@@ -102,5 +128,5 @@ rm -r ./build/$PGO_HOST/llvm ./build/$PGO_HOST/lld
 # This produces the actual final set of artifacts, using both the LLVM and rustc
 # collected profiling data.
 $@ \
-    --rust-profile-use=/tmp/rustc-pgo.profdata \
-    --llvm-profile-use=/tmp/llvm-pgo.profdata
+    --rust-profile-use=${RUSTC_PROFILE_MERGED_FILE} \
+    --llvm-profile-use=${LLVM_PROFILE_MERGED_FILE}
diff --git a/src/ci/run.sh b/src/ci/run.sh
index 5f843a13bcd..b0314047c07 100755
--- a/src/ci/run.sh
+++ b/src/ci/run.sh
@@ -45,6 +45,7 @@ fi
 
 if ! isCI || isCiBranch auto || isCiBranch beta || isCiBranch try; then
     RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.print-step-timings --enable-verbose-tests"
+    RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.metrics"
 fi
 
 RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-sccache"
diff --git a/src/ci/scripts/clean-disk.sh b/src/ci/scripts/clean-disk.sh
deleted file mode 100755
index c50de37c492..00000000000
--- a/src/ci/scripts/clean-disk.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-# This script deletes some of the Azure-provided artifacts. We don't use these,
-# and disk space is at a premium on our builders.
-
-set -euo pipefail
-IFS=$'\n\t'
-
-source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
-
-# All the Linux builds happen inside Docker.
-if isLinux; then
-    # 6.7GB
-    sudo rm -rf /opt/ghc
-    # 16GB
-    sudo rm -rf /usr/share/dotnet
-fi
diff --git a/src/ci/scripts/disable-git-crlf-conversion.sh b/src/ci/scripts/disable-git-crlf-conversion.sh
index 836145fbb8e..6de080a9fde 100755
--- a/src/ci/scripts/disable-git-crlf-conversion.sh
+++ b/src/ci/scripts/disable-git-crlf-conversion.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 # Disable automatic line ending conversion, which is enabled by default on
-# Azure's Windows image. Having the conversion enabled caused regressions both
+# GitHub's Windows image. Having the conversion enabled caused regressions both
 # in our test suite (it broke miri tests) and in the ecosystem, since we
 # started shipping install scripts with CRLF endings instead of the old LF.
 #
diff --git a/src/ci/scripts/setup-environment.sh b/src/ci/scripts/setup-environment.sh
index 411ef6f9b28..0bc35f93283 100755
--- a/src/ci/scripts/setup-environment.sh
+++ b/src/ci/scripts/setup-environment.sh
@@ -8,21 +8,6 @@ IFS=$'\n\t'
 
 source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
 
-# Since matrix variables are readonly in Azure Pipelines, we take
-# INITIAL_RUST_CONFIGURE_ARGS and establish RUST_CONFIGURE_ARGS
-# which downstream steps can alter
-if isAzurePipelines; then
-    # macOS ships with Bash 3.16, so we cannot use [[ -v FOO ]],
-    # which was introduced in Bash 4.2
-    if [[ -z "${INITIAL_RUST_CONFIGURE_ARGS+x}" ]]; then
-        INITIAL_RUST_CONFIG=""
-        echo "No initial Rust configure args set"
-    else
-        INITIAL_RUST_CONFIG="${INITIAL_RUST_CONFIGURE_ARGS}"
-        ciCommandSetEnv RUST_CONFIGURE_ARGS "${INITIAL_RUST_CONFIG}"
-    fi
-fi
-
 # Load extra environment variables
 vars="${EXTRA_VARIABLES-}"
 echo "${vars}" | jq '' >/dev/null  # Validate JSON and exit on errors
diff --git a/src/ci/scripts/symlink-build-dir.sh b/src/ci/scripts/symlink-build-dir.sh
deleted file mode 100755
index 23849f7047c..00000000000
--- a/src/ci/scripts/symlink-build-dir.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-# We've had multiple issues with the default disk running out of disk space
-# during builds, and it looks like other disks mounted in the VMs have more
-# space available. This script synlinks the build directory to those other
-# disks, in the CI providers and OSes affected by this.
-
-set -euo pipefail
-IFS=$'\n\t'
-
-source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
-
-if isWindows && isAzurePipelines; then
-    cmd //c "mkdir c:\\MORE_SPACE"
-    cmd //c "mklink /J build c:\\MORE_SPACE"
-fi
diff --git a/src/ci/scripts/upload-artifacts.sh b/src/ci/scripts/upload-artifacts.sh
index cea9b770f2a..ffa1859fc22 100755
--- a/src/ci/scripts/upload-artifacts.sh
+++ b/src/ci/scripts/upload-artifacts.sh
@@ -10,12 +10,14 @@ source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
 
 upload_dir="$(mktemp -d)"
 
+build_dir=build
+if isLinux; then
+    build_dir=obj/build
+fi
+
 # Release tarballs produced by a dist builder.
 if [[ "${DEPLOY-0}" -eq "1" ]] || [[ "${DEPLOY_ALT-0}" -eq "1" ]]; then
-    dist_dir=build/dist
-    if isLinux; then
-        dist_dir=obj/build/dist
-    fi
+    dist_dir="${build_dir}/dist"
     rm -rf "${dist_dir}/doc"
     cp -r "${dist_dir}"/* "${upload_dir}"
 fi
@@ -23,6 +25,9 @@ fi
 # CPU usage statistics.
 cp cpu-usage.csv "${upload_dir}/cpu-${CI_JOB_NAME}.csv"
 
+# Build metrics generated by x.py.
+cp "${build_dir}/metrics.json" "${upload_dir}/metrics-${CI_JOB_NAME}.json"
+
 # Toolstate data.
 if [[ -n "${DEPLOY_TOOLSTATES_JSON+x}" ]]; then
     cp /tmp/toolstate/toolstates.json "${upload_dir}/${DEPLOY_TOOLSTATES_JSON}"
diff --git a/src/ci/shared.sh b/src/ci/shared.sh
index 1f218bc8346..8a88c56194c 100644
--- a/src/ci/shared.sh
+++ b/src/ci/shared.sh
@@ -28,11 +28,7 @@ function retry {
 }
 
 function isCI {
-    [[ "${CI-false}" = "true" ]] || isAzurePipelines || isGitHubActions
-}
-
-function isAzurePipelines {
-    [[ "${TF_BUILD-False}" = "True" ]]
+    [[ "${CI-false}" = "true" ]] || isGitHubActions
 }
 
 function isGitHubActions {
@@ -63,9 +59,7 @@ function isCiBranch {
     fi
     name="$1"
 
-    if isAzurePipelines; then
-        [[ "${BUILD_SOURCEBRANCHNAME}" = "${name}" ]]
-    elif isGitHubActions; then
+    if isGitHubActions; then
         [[ "${GITHUB_REF}" = "refs/heads/${name}" ]]
     else
         echo "isCiBranch only works inside CI!"
@@ -74,10 +68,7 @@ function isCiBranch {
 }
 
 function ciBaseBranch {
-    if isAzurePipelines; then
-        echo "unsupported on Azure Pipelines"
-        exit 1
-    elif isGitHubActions; then
+    if isGitHubActions; then
         echo "${GITHUB_BASE_REF#refs/heads/}"
     else
         echo "ciBaseBranch only works inside CI!"
@@ -86,9 +77,7 @@ function ciBaseBranch {
 }
 
 function ciCommit {
-    if isAzurePipelines; then
-        echo "${BUILD_SOURCEVERSION}"
-    elif isGitHubActions; then
+    if isGitHubActions; then
         echo "${GITHUB_SHA}"
     else
         echo "ciCommit only works inside CI!"
@@ -97,9 +86,7 @@ function ciCommit {
 }
 
 function ciCheckoutPath {
-    if isAzurePipelines; then
-        echo "${BUILD_SOURCESDIRECTORY}"
-    elif isGitHubActions; then
+    if isGitHubActions; then
         echo "${GITHUB_WORKSPACE}"
     else
         echo "ciCheckoutPath only works inside CI!"
@@ -114,9 +101,7 @@ function ciCommandAddPath {
     fi
     path="$1"
 
-    if isAzurePipelines; then
-        echo "##vso[task.prependpath]${path}"
-    elif isGitHubActions; then
+    if isGitHubActions; then
         echo "${path}" >> "${GITHUB_PATH}"
     else
         echo "ciCommandAddPath only works inside CI!"
@@ -132,9 +117,7 @@ function ciCommandSetEnv {
     name="$1"
     value="$2"
 
-    if isAzurePipelines; then
-        echo "##vso[task.setvariable variable=${name}]${value}"
-    elif isGitHubActions; then
+    if isGitHubActions; then
         echo "${name}=${value}" >> "${GITHUB_ENV}"
     else
         echo "ciCommandSetEnv only works inside CI!"
diff --git a/src/doc/rustc/src/SUMMARY.md b/src/doc/rustc/src/SUMMARY.md
index 7b2c35c0593..8e2d44c1812 100644
--- a/src/doc/rustc/src/SUMMARY.md
+++ b/src/doc/rustc/src/SUMMARY.md
@@ -22,6 +22,7 @@
     - [m68k-unknown-linux-gnu](platform-support/m68k-unknown-linux-gnu.md)
     - [mips64-openwrt-linux-musl](platform-support/mips64-openwrt-linux-musl.md)
     - [nvptx64-nvidia-cuda](platform-support/nvptx64-nvidia-cuda.md)
+    - [riscv32imac-unknown-xous-elf](platform-support/riscv32imac-unknown-xous-elf.md)
     - [*-pc-windows-gnullvm](platform-support/pc-windows-gnullvm.md)
     - [*-unknown-openbsd](platform-support/openbsd.md)
     - [wasm64-unknown-unknown](platform-support/wasm64-unknown-unknown.md)
diff --git a/src/doc/rustc/src/platform-support.md b/src/doc/rustc/src/platform-support.md
index ab98651a1ec..4ac09711b0a 100644
--- a/src/doc/rustc/src/platform-support.md
+++ b/src/doc/rustc/src/platform-support.md
@@ -275,6 +275,7 @@ target | std | host | notes
 `riscv32gc-unknown-linux-gnu` |   |   | RISC-V Linux (kernel 5.4, glibc 2.33)
 `riscv32gc-unknown-linux-musl` |   |   | RISC-V Linux (kernel 5.4, musl + RISCV32 support patches)
 `riscv32im-unknown-none-elf` | * |  | Bare RISC-V (RV32IM ISA)
+[`riscv32imac-unknown-xous-elf`](platform-support/riscv32imac-unknown-xous-elf.md) | ? |  | RISC-V Xous (RV32IMAC ISA)
 `riscv32imc-esp-espidf` | ✓ |  | RISC-V ESP-IDF
 `riscv64gc-unknown-freebsd` |   |   | RISC-V FreeBSD
 `riscv64gc-unknown-linux-musl` |   |   | RISC-V Linux (kernel 4.20, musl 1.2.0)
diff --git a/src/doc/rustc/src/platform-support/riscv32imac-unknown-xous-elf.md b/src/doc/rustc/src/platform-support/riscv32imac-unknown-xous-elf.md
new file mode 100644
index 00000000000..f024cd25bf7
--- /dev/null
+++ b/src/doc/rustc/src/platform-support/riscv32imac-unknown-xous-elf.md
@@ -0,0 +1,50 @@
+# riscv32imac-unknown-xous-elf
+
+**Tier: 3**
+
+Xous microkernel, message-based operating system that powers devices such as Precursor and Betrusted. The operating system is written entirely in Rust, so no additional software is required to compile programs for Xous.
+
+## Target maintainers
+
+- [@xobs](https://github.com/xobs)
+
+## Requirements
+
+
+Building the target itself requires a RISC-V compiler that is supported by `cc-rs`. For example, you can use the prebuilt [xPack](https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/latest) toolchain.
+
+Cross-compiling programs does not require any additional software beyond the toolchain. Prebuilt versions of the toolchain are available [from Betrusted](https://github.com/betrusted-io/rust/releases).
+
+## Building the target
+
+The target can be built by enabling it for a `rustc` build.
+
+```toml
+[build]
+target = ["riscv32imac-unknown-xous-elf"]
+```
+
+Make sure your C compiler is included in `$PATH`, then add it to the `config.toml`:
+
+```toml
+[target.riscv32imac-unknown-xous-elf]
+cc = "riscv-none-elf-gcc"
+ar = "riscv-none-elf-ar"
+```
+
+## Building Rust programs
+
+Rust does not yet ship pre-compiled artifacts for this target. To compile for
+this target, you will need to do one of the following:
+
+* Build Rust with the target enabled (see "Building the target" above)
+* Build your own copy of `core` by using `build-std` or similar
+* Download a prebuilt toolchain [from Betrusted](https://github.com/betrusted-io/rust/releases)
+
+## Cross-compilation
+
+This target can be cross-compiled from any host.
+
+## Testing
+
+Currently there is no support to run the rustc test suite for this target.
diff --git a/src/etc/htmldocck.py b/src/etc/htmldocck.py
index 5eb70ab13db..f762e389005 100644
--- a/src/etc/htmldocck.py
+++ b/src/etc/htmldocck.py
@@ -94,6 +94,10 @@ There are a number of supported commands:
   in the specified file. The number of occurrences must match the given
   count.
 
+* `@count PATH XPATH TEXT COUNT` checks for the occurrence of the given XPath
+  with the given text in the specified file. The number of occurrences must
+  match the given count.
+
 * `@snapshot NAME PATH XPATH` creates a snapshot test named NAME.
   A snapshot test captures a subtree of the DOM, at the location
   determined by the XPath, and compares it to a pre-recorded value
@@ -382,9 +386,10 @@ def check_tree_attr(tree, path, attr, pat, regexp):
     return ret
 
 
-def check_tree_text(tree, path, pat, regexp):
+# Returns the number of occurences matching the regex (`regexp`) and the text (`pat`).
+def check_tree_text(tree, path, pat, regexp, stop_at_first):
     path = normalize_xpath(path)
-    ret = False
+    match_count = 0
     try:
         for e in tree.findall(path):
             try:
@@ -392,13 +397,14 @@ def check_tree_text(tree, path, pat, regexp):
             except KeyError:
                 continue
             else:
-                ret = check_string(value, pat, regexp)
-                if ret:
-                    break
+                if check_string(value, pat, regexp):
+                    match_count += 1
+                    if stop_at_first:
+                        break
     except Exception:
         print('Failed to get path "{}"'.format(path))
         raise
-    return ret
+    return match_count
 
 
 def get_tree_count(tree, path):
@@ -518,6 +524,19 @@ def print_err(lineno, context, err, message=None):
         stderr("\t{}".format(context))
 
 
+def get_nb_matching_elements(cache, c, regexp, stop_at_first):
+    tree = cache.get_tree(c.args[0])
+    pat, sep, attr = c.args[1].partition('/@')
+    if sep:  # attribute
+        tree = cache.get_tree(c.args[0])
+        return check_tree_attr(tree, pat, attr, c.args[2], False)
+    else:  # normalized text
+        pat = c.args[1]
+        if pat.endswith('/text()'):
+            pat = pat[:-7]
+        return check_tree_text(cache.get_tree(c.args[0]), pat, c.args[2], regexp, stop_at_first)
+
+
 ERR_COUNT = 0
 
 
@@ -538,16 +557,7 @@ def check_command(c, cache):
                 ret = check_string(cache.get_file(c.args[0]), c.args[1], regexp)
             elif len(c.args) == 3:  # @has/matches <path> <pat> <match> = XML tree test
                 cerr = "`XPATH PATTERN` did not match"
-                tree = cache.get_tree(c.args[0])
-                pat, sep, attr = c.args[1].partition('/@')
-                if sep:  # attribute
-                    tree = cache.get_tree(c.args[0])
-                    ret = check_tree_attr(tree, pat, attr, c.args[2], regexp)
-                else:  # normalized text
-                    pat = c.args[1]
-                    if pat.endswith('/text()'):
-                        pat = pat[:-7]
-                    ret = check_tree_text(cache.get_tree(c.args[0]), pat, c.args[2], regexp)
+                ret = get_nb_matching_elements(cache, c, regexp, True) != 0
             else:
                 raise InvalidCheck('Invalid number of @{} arguments'.format(c.cmd))
 
@@ -557,6 +567,11 @@ def check_command(c, cache):
                 found = get_tree_count(cache.get_tree(c.args[0]), c.args[1])
                 cerr = "Expected {} occurrences but found {}".format(expected, found)
                 ret = expected == found
+            elif len(c.args) == 4:  # @count <path> <pat> <text> <count> = count test
+                expected = int(c.args[3])
+                found = get_nb_matching_elements(cache, c, False, False)
+                cerr = "Expected {} occurrences but found {}".format(expected, found)
+                ret = found == expected
             else:
                 raise InvalidCheck('Invalid number of @{} arguments'.format(c.cmd))
 
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs
index c725cf93be2..f3070fb35f1 100644
--- a/src/librustdoc/clean/mod.rs
+++ b/src/librustdoc/clean/mod.rs
@@ -475,24 +475,14 @@ fn clean_generic_param<'tcx>(
     generics: Option<&hir::Generics<'tcx>>,
     param: &hir::GenericParam<'tcx>,
 ) -> GenericParamDef {
+    let did = cx.tcx.hir().local_def_id(param.hir_id);
     let (name, kind) = match param.kind {
         hir::GenericParamKind::Lifetime { .. } => {
             let outlives = if let Some(generics) = generics {
                 generics
-                    .predicates
-                    .iter()
-                    .flat_map(|pred| {
-                        match pred {
-                            hir::WherePredicate::RegionPredicate(rp)
-                                if rp.lifetime.name == hir::LifetimeName::Param(param.name)
-                                    && !rp.in_where_clause =>
-                            {
-                                rp.bounds
-                            }
-                            _ => &[],
-                        }
-                        .iter()
-                    })
+                    .outlives_for_param(did)
+                    .filter(|bp| !bp.in_where_clause)
+                    .flat_map(|bp| bp.bounds)
                     .map(|bound| match bound {
                         hir::GenericBound::Outlives(lt) => lt.clean(cx),
                         _ => panic!(),
@@ -504,7 +494,6 @@ fn clean_generic_param<'tcx>(
             (param.name.ident().name, GenericParamDefKind::Lifetime { outlives })
         }
         hir::GenericParamKind::Type { ref default, synthetic } => {
-            let did = cx.tcx.hir().local_def_id(param.hir_id);
             let bounds = if let Some(generics) = generics {
                 generics
                     .bounds_for_param(did)
@@ -528,7 +517,7 @@ fn clean_generic_param<'tcx>(
         hir::GenericParamKind::Const { ty, default } => (
             param.name.ident().name,
             GenericParamDefKind::Const {
-                did: cx.tcx.hir().local_def_id(param.hir_id).to_def_id(),
+                did: did.to_def_id(),
                 ty: Box::new(ty.clean(cx)),
                 default: default.map(|ct| {
                     let def_id = cx.tcx.hir().local_def_id(ct.hir_id);
@@ -1459,7 +1448,7 @@ impl<'tcx> Clean<'tcx, Type> for hir::Ty<'tcx> {
                 // Turning `fn f(&'_ self)` into `fn f(&self)` isn't the worst thing in the world, though;
                 // there's no case where it could cause the function to fail to compile.
                 let elided =
-                    l.is_elided() || matches!(l.name, LifetimeName::Param(ParamName::Fresh(_)));
+                    l.is_elided() || matches!(l.name, LifetimeName::Param(_, ParamName::Fresh));
                 let lifetime = if elided { None } else { Some(l.clean(cx)) };
                 BorrowedRef { lifetime, mutability: m.mutbl, type_: box m.ty.clean(cx) }
             }
diff --git a/src/librustdoc/formats/mod.rs b/src/librustdoc/formats/mod.rs
index 9f26ccc74d1..b236bd7be4f 100644
--- a/src/librustdoc/formats/mod.rs
+++ b/src/librustdoc/formats/mod.rs
@@ -7,7 +7,7 @@ use rustc_hir::def_id::DefId;
 pub(crate) use renderer::{run_format, FormatRenderer};
 
 use crate::clean::{self, ItemId};
-use cache::Cache;
+use crate::html::render::Context;
 
 /// Specifies whether rendering directly implemented trait items or ones from a certain Deref
 /// impl.
@@ -65,7 +65,8 @@ impl Impl {
     // Returns true if this is an implementation on a "local" type, meaning:
     // the type is in the current crate, or the type and the trait are both
     // re-exported by the current crate.
-    pub(crate) fn is_on_local_type(&self, cache: &Cache) -> bool {
+    pub(crate) fn is_on_local_type(&self, cx: &Context<'_>) -> bool {
+        let cache = cx.cache();
         let for_type = &self.inner_impl().for_;
         if let Some(for_type_did) = for_type.def_id(cache) {
             // The "for" type is local if it's in the paths for the current crate.
@@ -80,6 +81,18 @@ impl Impl {
                 if for_type_did.krate == trait_did.krate {
                     return true;
                 }
+                // Hack: many traits and types in std are re-exported from
+                // core or alloc. In general, rustdoc is capable of recognizing
+                // these implementations as being on local types. However, in at
+                // least one case (https://github.com/rust-lang/rust/issues/97610),
+                // rustdoc gets confused and labels an implementation as being on
+                // a foreign type. To make sure that confusion doesn't pass on to
+                // the reader, consider all implementations in std, core, and alloc
+                // to be on local types.
+                let crate_name = cx.tcx().crate_name(trait_did.krate);
+                if matches!(crate_name.as_str(), "std" | "core" | "alloc") {
+                    return true;
+                }
             }
             return false;
         };
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index 0b801a20995..cb887d16906 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -1600,6 +1600,13 @@ fn render_impl(
         }
 
         if let Some(ref dox) = i.impl_item.collapsed_doc_value() {
+            if trait_.is_none() && i.inner_impl().items.is_empty() {
+                w.write_str(
+                    "<div class=\"item-info\">\
+                    <div class=\"stab empty-impl\">This impl block contains no items.</div>
+                </div>",
+                );
+            }
             write!(
                 w,
                 "<div class=\"docblock\">{}</div>",
@@ -2281,11 +2288,10 @@ fn sidebar_trait(cx: &Context<'_>, buf: &mut Buffer, it: &clean::Item, t: &clean
         |sym| format!("<a href=\"#{1}.{0}\">{0}</a>", sym, ItemType::Method),
     );
 
-    let cache = cx.cache();
-    if let Some(implementors) = cache.implementors.get(&it.item_id.expect_def_id()) {
+    if let Some(implementors) = cx.cache().implementors.get(&it.item_id.expect_def_id()) {
         let mut res = implementors
             .iter()
-            .filter(|i| !i.is_on_local_type(cache))
+            .filter(|i| !i.is_on_local_type(cx))
             .filter_map(|i| extract_for_impl_name(&i.impl_item, cx))
             .collect::<Vec<_>>();
 
diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs
index 8683e6dfcd9..d115185562c 100644
--- a/src/librustdoc/html/render/print_item.rs
+++ b/src/librustdoc/html/render/print_item.rs
@@ -823,7 +823,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
         }
 
         let (local, foreign) =
-            implementors.iter().partition::<Vec<_>, _>(|i| i.is_on_local_type(cache));
+            implementors.iter().partition::<Vec<_>, _>(|i| i.is_on_local_type(cx));
 
         let (mut synthetic, mut concrete): (Vec<&&Impl>, Vec<&&Impl>) =
             local.iter().partition(|i| i.inner_impl().kind.is_auto());
diff --git a/src/librustdoc/html/static/.eslintrc.js b/src/librustdoc/html/static/.eslintrc.js
index f66ecbf78af..9088e06e508 100644
--- a/src/librustdoc/html/static/.eslintrc.js
+++ b/src/librustdoc/html/static/.eslintrc.js
@@ -70,5 +70,19 @@ module.exports = {
         "no-dupe-keys": "error",
         "no-duplicate-case": "error",
         "no-ex-assign": "error",
+        "no-fallthrough": "error",
+        "no-invalid-regexp": "error",
+        "no-import-assign": "error",
+        "no-self-compare": "error",
+        "no-template-curly-in-string": "error",
+        "block-scoped-var": "error",
+        "guard-for-in": "error",
+        "no-alert": "error",
+        "no-confusing-arrow": "error",
+        "no-div-regex": "error",
+        "no-floating-decimal": "error",
+        "no-implicit-globals": "error",
+        "no-implied-eval": "error",
+        "no-label-var": "error",
     }
 };
diff --git a/src/librustdoc/html/static/css/themes/ayu.css b/src/librustdoc/html/static/css/themes/ayu.css
index 7303cecc0d6..8e0521d9ad6 100644
--- a/src/librustdoc/html/static/css/themes/ayu.css
+++ b/src/librustdoc/html/static/css/themes/ayu.css
@@ -281,9 +281,13 @@ details.undocumented > summary::before {
 	color: #000;
 }
 
+/* Created this empty rule to satisfy the theme checks. */
+.stab.empty-impl {}
+
 .stab.unstable,
 .stab.deprecated,
-.stab.portability {
+.stab.portability,
+.stab.empty-impl {
 	color: #c5c5c5;
 	background: #314559 !important;
 	border-style: none !important;
diff --git a/src/librustdoc/html/static/css/themes/dark.css b/src/librustdoc/html/static/css/themes/dark.css
index 34a4f446b56..071ad006ed3 100644
--- a/src/librustdoc/html/static/css/themes/dark.css
+++ b/src/librustdoc/html/static/css/themes/dark.css
@@ -266,6 +266,7 @@ details.undocumented > summary::before {
 	color: #ddd;
 }
 
+.stab.empty-impl { background: #FFF5D6; border-color: #FFC600; color: #2f2f2f; }
 .stab.unstable { background: #FFF5D6; border-color: #FFC600; color: #2f2f2f; }
 .stab.deprecated { background: #ffc4c4; border-color: #db7b7b; color: #2f2f2f; }
 .stab.portability { background: #F3DFFF; border-color: #b07bdb; color: #2f2f2f; }
diff --git a/src/librustdoc/html/static/css/themes/light.css b/src/librustdoc/html/static/css/themes/light.css
index aa6ad2f5473..5c3789bf463 100644
--- a/src/librustdoc/html/static/css/themes/light.css
+++ b/src/librustdoc/html/static/css/themes/light.css
@@ -255,6 +255,7 @@ details.undocumented > summary::before {
 	color: #000;
 }
 
+.stab.empty-impl { background: #FFF5D6; border-color: #FFC600; }
 .stab.unstable { background: #FFF5D6; border-color: #FFC600; }
 .stab.deprecated { background: #ffc4c4; border-color: #db7b7b; }
 .stab.portability { background: #F3DFFF; border-color: #b07bdb; }
diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js
index 548aeedd033..414bca850e3 100644
--- a/src/librustdoc/html/static/js/main.js
+++ b/src/librustdoc/html/static/js/main.js
@@ -882,7 +882,7 @@ function loadCss(cssFileName) {
             ["-", "Collapse all sections"],
         ].map(x => "<dt>" +
             x[0].split(" ")
-                .map((y, index) => (index & 1) === 0 ? "<kbd>" + y + "</kbd>" : " " + y + " ")
+                .map((y, index) => ((index & 1) === 0 ? "<kbd>" + y + "</kbd>" : " " + y + " "))
                 .join("") + "</dt><dd>" + x[1] + "</dd>").join("");
         const div_shortcuts = document.createElement("div");
         addClass(div_shortcuts, "shortcuts");
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs
index 8b3edfd2135..ea842a85070 100644
--- a/src/librustdoc/lib.rs
+++ b/src/librustdoc/lib.rs
@@ -11,7 +11,7 @@
 #![feature(drain_filter)]
 #![feature(let_chains)]
 #![feature(let_else)]
-#![feature(nll)]
+#![cfg_attr(bootstrap, feature(nll))]
 #![feature(test)]
 #![feature(never_type)]
 #![feature(once_cell)]
diff --git a/src/librustdoc/passes/stripper.rs b/src/librustdoc/passes/stripper.rs
index d5db919dc4b..0fd124e6154 100644
--- a/src/librustdoc/passes/stripper.rs
+++ b/src/librustdoc/passes/stripper.rs
@@ -124,8 +124,9 @@ pub(crate) struct ImplStripper<'a> {
 impl<'a> DocFolder for ImplStripper<'a> {
     fn fold_item(&mut self, i: Item) -> Option<Item> {
         if let clean::ImplItem(ref imp) = *i.kind {
-            // emptied none trait impls can be stripped
-            if imp.trait_.is_none() && imp.items.is_empty() {
+            // Impl blocks can be skipped if they are: empty; not a trait impl; and have no
+            // documentation.
+            if imp.trait_.is_none() && imp.items.is_empty() && i.doc_value().is_none() {
                 return None;
             }
             if let Some(did) = imp.for_.def_id(self.cache) {
diff --git a/src/llvm-project b/src/llvm-project
-Subproject 47848665966fc7393cb6f898077994f6dec2b59
+Subproject c9e2e89ed3aa5a3be77143aa0c86906b4138374
diff --git a/src/test/debuginfo/thread-names.rs b/src/test/debuginfo/thread-names.rs
new file mode 100644
index 00000000000..7a35a518946
--- /dev/null
+++ b/src/test/debuginfo/thread-names.rs
@@ -0,0 +1,51 @@
+// compile-flags:-g
+// We can't set the main thread name on Linux because it renames the process (#97191)
+// ignore-linux
+// ignore-android
+// ignore-dragonfly
+// ignore-emscripten
+// ignore-freebsd
+// ignore-haiku
+// ignore-ios
+// ignore-netbsd
+// ignore-openbsd
+// ignore-solaris
+// ignore-sgx
+// ignore-windows-gnu
+
+// === GDB TESTS ==================================================================================
+//
+// gdb-command:run
+//
+// gdb-command:info threads
+// gdb-check:  1    Thread [...] [...] "main" [...]
+// gdb-check:* 2    Thread [...] [...] "my new thread" [...]
+
+// === LLDB TESTS =================================================================================
+//
+// lldb-command:run
+//
+// lldb-command:thread info 1
+// lldb-check:thread #1:[...]name = 'main'[...]
+// lldb-command:thread info 2
+// lldb-check:thread #2:[...]name = 'my new thread'[...]
+
+// === CDB TESTS ==================================================================================
+//
+// cdb-command:g
+//
+// cdb-command:~
+// cdb-check:   0  Id: [...] Suspend: 1 Teb: [...] Unfrozen "main"
+// cdb-check:.  [...]  Id: [...] Suspend: 1 Teb: [...] Unfrozen "my new thread"
+
+use std::thread;
+
+fn main() {
+    let handle = thread::Builder::new().name("my new thread".into()).spawn(|| {
+        zzz(); // #break
+    }).unwrap();
+
+    handle.join().unwrap();
+}
+
+fn zzz() {}
diff --git a/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir b/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir
index e49b9898dfa..0d0204e126a 100644
--- a/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir
+++ b/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir
@@ -1,113 +1,113 @@
 // MIR for `full_tested_match` after PromoteTemps
 
 fn full_tested_match() -> () {
-    let mut _0: ();                      // return place in scope 0 at $DIR/match_false_edges.rs:14:28: 14:28
-    let mut _1: (i32, i32);              // in scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
-    let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
-    let mut _3: isize;                   // in scope 0 at $DIR/match_false_edges.rs:16:9: 16:16
-    let mut _4: &std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
-    let _5: i32;                         // in scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
-    let _6: &i32;                        // in scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
-    let mut _7: bool;                    // in scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
-    let mut _8: i32;                     // in scope 0 at $DIR/match_false_edges.rs:16:35: 16:36
-    let _9: i32;                         // in scope 0 at $DIR/match_false_edges.rs:17:14: 17:15
-    let mut _10: i32;                    // in scope 0 at $DIR/match_false_edges.rs:17:24: 17:25
-    let mut _11: &std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
+    let mut _0: ();                      // return place in scope 0 at $DIR/match_false_edges.rs:12:28: 12:28
+    let mut _1: (i32, i32);              // in scope 0 at $DIR/match_false_edges.rs:13:13: 17:6
+    let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:13:19: 13:27
+    let mut _3: isize;                   // in scope 0 at $DIR/match_false_edges.rs:14:9: 14:16
+    let mut _4: &std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:13:19: 13:27
+    let _5: i32;                         // in scope 0 at $DIR/match_false_edges.rs:14:14: 14:15
+    let _6: &i32;                        // in scope 0 at $DIR/match_false_edges.rs:14:14: 14:15
+    let mut _7: bool;                    // in scope 0 at $DIR/match_false_edges.rs:14:20: 14:27
+    let mut _8: i32;                     // in scope 0 at $DIR/match_false_edges.rs:14:35: 14:36
+    let _9: i32;                         // in scope 0 at $DIR/match_false_edges.rs:15:14: 15:15
+    let mut _10: i32;                    // in scope 0 at $DIR/match_false_edges.rs:15:24: 15:25
+    let mut _11: &std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:14:14: 14:15
     scope 1 {
     }
     scope 2 {
-        debug x => _5;                   // in scope 2 at $DIR/match_false_edges.rs:16:14: 16:15
-        debug x => _6;                   // in scope 2 at $DIR/match_false_edges.rs:16:14: 16:15
+        debug x => _5;                   // in scope 2 at $DIR/match_false_edges.rs:14:14: 14:15
+        debug x => _6;                   // in scope 2 at $DIR/match_false_edges.rs:14:14: 14:15
     }
     scope 3 {
-        debug y => _9;                   // in scope 3 at $DIR/match_false_edges.rs:17:14: 17:15
+        debug y => _9;                   // in scope 3 at $DIR/match_false_edges.rs:15:14: 15:15
     }
 
     bb0: {
-        StorageLive(_1);                 // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
-        StorageLive(_2);                 // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
-        _2 = Option::<i32>::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
-        FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
-        _3 = discriminant(_2);           // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
-        switchInt(move _3) -> [0_isize: bb1, 1_isize: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:15:13: 15:27
+        StorageLive(_1);                 // scope 0 at $DIR/match_false_edges.rs:13:13: 17:6
+        StorageLive(_2);                 // scope 0 at $DIR/match_false_edges.rs:13:19: 13:27
+        _2 = Option::<i32>::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:13:19: 13:27
+        FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:13:19: 13:27
+        _3 = discriminant(_2);           // scope 0 at $DIR/match_false_edges.rs:13:19: 13:27
+        switchInt(move _3) -> [0_isize: bb1, 1_isize: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:13:13: 13:27
     }
 
     bb1: {
-        _1 = (const 3_i32, const 3_i32); // scope 0 at $DIR/match_false_edges.rs:18:17: 18:23
-        goto -> bb10;                    // scope 0 at $DIR/match_false_edges.rs:18:17: 18:23
+        _1 = (const 3_i32, const 3_i32); // scope 0 at $DIR/match_false_edges.rs:16:17: 16:23
+        goto -> bb10;                    // scope 0 at $DIR/match_false_edges.rs:16:17: 16:23
     }
 
     bb2: {
-        falseEdge -> [real: bb5, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:16:9: 16:16
+        falseEdge -> [real: bb5, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:14:9: 14:16
     }
 
     bb3: {
-        falseEdge -> [real: bb9, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:17:9: 17:16
+        falseEdge -> [real: bb9, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:15:9: 15:16
     }
 
     bb4: {
-        unreachable;                     // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
+        unreachable;                     // scope 0 at $DIR/match_false_edges.rs:13:19: 13:27
     }
 
     bb5: {
-        StorageLive(_6);                 // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
-        _11 = const full_tested_match::promoted[0]; // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
+        StorageLive(_6);                 // scope 0 at $DIR/match_false_edges.rs:14:14: 14:15
+        _11 = const full_tested_match::promoted[0]; // scope 0 at $DIR/match_false_edges.rs:14:14: 14:15
                                          // mir::Constant
-                                         // + span: $DIR/match_false_edges.rs:16:14: 16:15
+                                         // + span: $DIR/match_false_edges.rs:14:14: 14:15
                                          // + literal: Const { ty: &Option<i32>, val: Unevaluated(full_tested_match, [], Some(promoted[0])) }
-        _6 = &(((*_11) as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
-        _4 = &shallow _2;                // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
-        StorageLive(_7);                 // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
-        _7 = guard() -> [return: bb6, unwind: bb11]; // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
+        _6 = &(((*_11) as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:14:14: 14:15
+        _4 = &shallow _2;                // scope 0 at $DIR/match_false_edges.rs:13:19: 13:27
+        StorageLive(_7);                 // scope 0 at $DIR/match_false_edges.rs:14:20: 14:27
+        _7 = guard() -> [return: bb6, unwind: bb11]; // scope 0 at $DIR/match_false_edges.rs:14:20: 14:27
                                          // mir::Constant
-                                         // + span: $DIR/match_false_edges.rs:16:20: 16:25
+                                         // + span: $DIR/match_false_edges.rs:14:20: 14:25
                                          // + literal: Const { ty: fn() -> bool {guard}, val: Value(Scalar(<ZST>)) }
     }
 
     bb6: {
-        switchInt(move _7) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
+        switchInt(move _7) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:14:20: 14:27
     }
 
     bb7: {
-        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:16:26: 16:27
-        FakeRead(ForMatchGuard, _4);     // scope 0 at $DIR/match_false_edges.rs:16:26: 16:27
-        FakeRead(ForGuardBinding, _6);   // scope 0 at $DIR/match_false_edges.rs:16:26: 16:27
-        StorageLive(_5);                 // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
-        _5 = ((_2 as Some).0: i32);      // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
-        StorageLive(_8);                 // scope 2 at $DIR/match_false_edges.rs:16:35: 16:36
-        _8 = _5;                         // scope 2 at $DIR/match_false_edges.rs:16:35: 16:36
-        _1 = (const 1_i32, move _8);     // scope 2 at $DIR/match_false_edges.rs:16:31: 16:37
-        StorageDead(_8);                 // scope 2 at $DIR/match_false_edges.rs:16:36: 16:37
-        StorageDead(_5);                 // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37
-        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37
-        goto -> bb10;                    // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37
+        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:14:26: 14:27
+        FakeRead(ForMatchGuard, _4);     // scope 0 at $DIR/match_false_edges.rs:14:26: 14:27
+        FakeRead(ForGuardBinding, _6);   // scope 0 at $DIR/match_false_edges.rs:14:26: 14:27
+        StorageLive(_5);                 // scope 0 at $DIR/match_false_edges.rs:14:14: 14:15
+        _5 = ((_2 as Some).0: i32);      // scope 0 at $DIR/match_false_edges.rs:14:14: 14:15
+        StorageLive(_8);                 // scope 2 at $DIR/match_false_edges.rs:14:35: 14:36
+        _8 = _5;                         // scope 2 at $DIR/match_false_edges.rs:14:35: 14:36
+        _1 = (const 1_i32, move _8);     // scope 2 at $DIR/match_false_edges.rs:14:31: 14:37
+        StorageDead(_8);                 // scope 2 at $DIR/match_false_edges.rs:14:36: 14:37
+        StorageDead(_5);                 // scope 0 at $DIR/match_false_edges.rs:14:36: 14:37
+        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:14:36: 14:37
+        goto -> bb10;                    // scope 0 at $DIR/match_false_edges.rs:14:36: 14:37
     }
 
     bb8: {
-        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:16:26: 16:27
-        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37
-        goto -> bb3;                     // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
+        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:14:26: 14:27
+        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:14:36: 14:37
+        goto -> bb3;                     // scope 0 at $DIR/match_false_edges.rs:14:20: 14:27
     }
 
     bb9: {
-        StorageLive(_9);                 // scope 0 at $DIR/match_false_edges.rs:17:14: 17:15
-        _9 = ((_2 as Some).0: i32);      // scope 0 at $DIR/match_false_edges.rs:17:14: 17:15
-        StorageLive(_10);                // scope 3 at $DIR/match_false_edges.rs:17:24: 17:25
-        _10 = _9;                        // scope 3 at $DIR/match_false_edges.rs:17:24: 17:25
-        _1 = (const 2_i32, move _10);    // scope 3 at $DIR/match_false_edges.rs:17:20: 17:26
-        StorageDead(_10);                // scope 3 at $DIR/match_false_edges.rs:17:25: 17:26
-        StorageDead(_9);                 // scope 0 at $DIR/match_false_edges.rs:17:25: 17:26
-        goto -> bb10;                    // scope 0 at $DIR/match_false_edges.rs:17:25: 17:26
+        StorageLive(_9);                 // scope 0 at $DIR/match_false_edges.rs:15:14: 15:15
+        _9 = ((_2 as Some).0: i32);      // scope 0 at $DIR/match_false_edges.rs:15:14: 15:15
+        StorageLive(_10);                // scope 3 at $DIR/match_false_edges.rs:15:24: 15:25
+        _10 = _9;                        // scope 3 at $DIR/match_false_edges.rs:15:24: 15:25
+        _1 = (const 2_i32, move _10);    // scope 3 at $DIR/match_false_edges.rs:15:20: 15:26
+        StorageDead(_10);                // scope 3 at $DIR/match_false_edges.rs:15:25: 15:26
+        StorageDead(_9);                 // scope 0 at $DIR/match_false_edges.rs:15:25: 15:26
+        goto -> bb10;                    // scope 0 at $DIR/match_false_edges.rs:15:25: 15:26
     }
 
     bb10: {
-        StorageDead(_2);                 // scope 0 at $DIR/match_false_edges.rs:19:6: 19:7
-        StorageDead(_1);                 // scope 0 at $DIR/match_false_edges.rs:19:6: 19:7
-        _0 = const ();                   // scope 0 at $DIR/match_false_edges.rs:14:28: 20:2
-        return;                          // scope 0 at $DIR/match_false_edges.rs:20:2: 20:2
+        StorageDead(_2);                 // scope 0 at $DIR/match_false_edges.rs:17:6: 17:7
+        StorageDead(_1);                 // scope 0 at $DIR/match_false_edges.rs:17:6: 17:7
+        _0 = const ();                   // scope 0 at $DIR/match_false_edges.rs:12:28: 18:2
+        return;                          // scope 0 at $DIR/match_false_edges.rs:18:2: 18:2
     }
 
     bb11 (cleanup): {
-        resume;                          // scope 0 at $DIR/match_false_edges.rs:14:1: 20:2
+        resume;                          // scope 0 at $DIR/match_false_edges.rs:12:1: 18:2
     }
 }
diff --git a/src/test/mir-opt/match_false_edges.full_tested_match2.PromoteTemps.before.mir b/src/test/mir-opt/match_false_edges.full_tested_match2.PromoteTemps.before.mir
index 0953eba1658..270cc85ce03 100644
--- a/src/test/mir-opt/match_false_edges.full_tested_match2.PromoteTemps.before.mir
+++ b/src/test/mir-opt/match_false_edges.full_tested_match2.PromoteTemps.before.mir
@@ -1,108 +1,108 @@
 // MIR for `full_tested_match2` before PromoteTemps
 
 fn full_tested_match2() -> () {
-    let mut _0: ();                      // return place in scope 0 at $DIR/match_false_edges.rs:25:29: 25:29
-    let mut _1: (i32, i32);              // in scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
-    let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
-    let mut _3: isize;                   // in scope 0 at $DIR/match_false_edges.rs:27:9: 27:16
-    let mut _4: &std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
-    let _5: i32;                         // in scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
-    let _6: &i32;                        // in scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
-    let mut _7: bool;                    // in scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
-    let mut _8: i32;                     // in scope 0 at $DIR/match_false_edges.rs:27:35: 27:36
-    let _9: i32;                         // in scope 0 at $DIR/match_false_edges.rs:29:14: 29:15
-    let mut _10: i32;                    // in scope 0 at $DIR/match_false_edges.rs:29:24: 29:25
+    let mut _0: ();                      // return place in scope 0 at $DIR/match_false_edges.rs:23:29: 23:29
+    let mut _1: (i32, i32);              // in scope 0 at $DIR/match_false_edges.rs:24:13: 28:6
+    let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:24:19: 24:27
+    let mut _3: isize;                   // in scope 0 at $DIR/match_false_edges.rs:25:9: 25:16
+    let mut _4: &std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:24:19: 24:27
+    let _5: i32;                         // in scope 0 at $DIR/match_false_edges.rs:25:14: 25:15
+    let _6: &i32;                        // in scope 0 at $DIR/match_false_edges.rs:25:14: 25:15
+    let mut _7: bool;                    // in scope 0 at $DIR/match_false_edges.rs:25:20: 25:27
+    let mut _8: i32;                     // in scope 0 at $DIR/match_false_edges.rs:25:35: 25:36
+    let _9: i32;                         // in scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
+    let mut _10: i32;                    // in scope 0 at $DIR/match_false_edges.rs:27:24: 27:25
     scope 1 {
     }
     scope 2 {
-        debug x => _5;                   // in scope 2 at $DIR/match_false_edges.rs:27:14: 27:15
-        debug x => _6;                   // in scope 2 at $DIR/match_false_edges.rs:27:14: 27:15
+        debug x => _5;                   // in scope 2 at $DIR/match_false_edges.rs:25:14: 25:15
+        debug x => _6;                   // in scope 2 at $DIR/match_false_edges.rs:25:14: 25:15
     }
     scope 3 {
-        debug y => _9;                   // in scope 3 at $DIR/match_false_edges.rs:29:14: 29:15
+        debug y => _9;                   // in scope 3 at $DIR/match_false_edges.rs:27:14: 27:15
     }
 
     bb0: {
-        StorageLive(_1);                 // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
-        StorageLive(_2);                 // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
-        _2 = Option::<i32>::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
-        FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
-        _3 = discriminant(_2);           // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
-        switchInt(move _3) -> [0_isize: bb1, 1_isize: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:26:13: 26:27
+        StorageLive(_1);                 // scope 0 at $DIR/match_false_edges.rs:24:13: 28:6
+        StorageLive(_2);                 // scope 0 at $DIR/match_false_edges.rs:24:19: 24:27
+        _2 = Option::<i32>::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:24:19: 24:27
+        FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:24:19: 24:27
+        _3 = discriminant(_2);           // scope 0 at $DIR/match_false_edges.rs:24:19: 24:27
+        switchInt(move _3) -> [0_isize: bb1, 1_isize: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:24:13: 24:27
     }
 
     bb1: {
-        falseEdge -> [real: bb9, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:28:9: 28:13
+        falseEdge -> [real: bb9, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:26:9: 26:13
     }
 
     bb2: {
-        falseEdge -> [real: bb5, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16
+        falseEdge -> [real: bb5, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:25:9: 25:16
     }
 
     bb3: {
-        StorageLive(_9);                 // scope 0 at $DIR/match_false_edges.rs:29:14: 29:15
-        _9 = ((_2 as Some).0: i32);      // scope 0 at $DIR/match_false_edges.rs:29:14: 29:15
-        StorageLive(_10);                // scope 3 at $DIR/match_false_edges.rs:29:24: 29:25
-        _10 = _9;                        // scope 3 at $DIR/match_false_edges.rs:29:24: 29:25
-        _1 = (const 2_i32, move _10);    // scope 3 at $DIR/match_false_edges.rs:29:20: 29:26
-        StorageDead(_10);                // scope 3 at $DIR/match_false_edges.rs:29:25: 29:26
-        StorageDead(_9);                 // scope 0 at $DIR/match_false_edges.rs:29:25: 29:26
-        goto -> bb10;                    // scope 0 at $DIR/match_false_edges.rs:29:25: 29:26
+        StorageLive(_9);                 // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
+        _9 = ((_2 as Some).0: i32);      // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
+        StorageLive(_10);                // scope 3 at $DIR/match_false_edges.rs:27:24: 27:25
+        _10 = _9;                        // scope 3 at $DIR/match_false_edges.rs:27:24: 27:25
+        _1 = (const 2_i32, move _10);    // scope 3 at $DIR/match_false_edges.rs:27:20: 27:26
+        StorageDead(_10);                // scope 3 at $DIR/match_false_edges.rs:27:25: 27:26
+        StorageDead(_9);                 // scope 0 at $DIR/match_false_edges.rs:27:25: 27:26
+        goto -> bb10;                    // scope 0 at $DIR/match_false_edges.rs:27:25: 27:26
     }
 
     bb4: {
-        unreachable;                     // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
+        unreachable;                     // scope 0 at $DIR/match_false_edges.rs:24:19: 24:27
     }
 
     bb5: {
-        StorageLive(_6);                 // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
-        _6 = &((_2 as Some).0: i32);     // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
-        _4 = &shallow _2;                // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
-        StorageLive(_7);                 // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
-        _7 = guard() -> [return: bb6, unwind: bb11]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
+        StorageLive(_6);                 // scope 0 at $DIR/match_false_edges.rs:25:14: 25:15
+        _6 = &((_2 as Some).0: i32);     // scope 0 at $DIR/match_false_edges.rs:25:14: 25:15
+        _4 = &shallow _2;                // scope 0 at $DIR/match_false_edges.rs:24:19: 24:27
+        StorageLive(_7);                 // scope 0 at $DIR/match_false_edges.rs:25:20: 25:27
+        _7 = guard() -> [return: bb6, unwind: bb11]; // scope 0 at $DIR/match_false_edges.rs:25:20: 25:27
                                          // mir::Constant
-                                         // + span: $DIR/match_false_edges.rs:27:20: 27:25
+                                         // + span: $DIR/match_false_edges.rs:25:20: 25:25
                                          // + literal: Const { ty: fn() -> bool {guard}, val: Value(Scalar(<ZST>)) }
     }
 
     bb6: {
-        switchInt(move _7) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
+        switchInt(move _7) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:25:20: 25:27
     }
 
     bb7: {
-        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:27:26: 27:27
-        FakeRead(ForMatchGuard, _4);     // scope 0 at $DIR/match_false_edges.rs:27:26: 27:27
-        FakeRead(ForGuardBinding, _6);   // scope 0 at $DIR/match_false_edges.rs:27:26: 27:27
-        StorageLive(_5);                 // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
-        _5 = ((_2 as Some).0: i32);      // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
-        StorageLive(_8);                 // scope 2 at $DIR/match_false_edges.rs:27:35: 27:36
-        _8 = _5;                         // scope 2 at $DIR/match_false_edges.rs:27:35: 27:36
-        _1 = (const 1_i32, move _8);     // scope 2 at $DIR/match_false_edges.rs:27:31: 27:37
-        StorageDead(_8);                 // scope 2 at $DIR/match_false_edges.rs:27:36: 27:37
-        StorageDead(_5);                 // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37
-        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37
-        goto -> bb10;                    // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37
+        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:25:26: 25:27
+        FakeRead(ForMatchGuard, _4);     // scope 0 at $DIR/match_false_edges.rs:25:26: 25:27
+        FakeRead(ForGuardBinding, _6);   // scope 0 at $DIR/match_false_edges.rs:25:26: 25:27
+        StorageLive(_5);                 // scope 0 at $DIR/match_false_edges.rs:25:14: 25:15
+        _5 = ((_2 as Some).0: i32);      // scope 0 at $DIR/match_false_edges.rs:25:14: 25:15
+        StorageLive(_8);                 // scope 2 at $DIR/match_false_edges.rs:25:35: 25:36
+        _8 = _5;                         // scope 2 at $DIR/match_false_edges.rs:25:35: 25:36
+        _1 = (const 1_i32, move _8);     // scope 2 at $DIR/match_false_edges.rs:25:31: 25:37
+        StorageDead(_8);                 // scope 2 at $DIR/match_false_edges.rs:25:36: 25:37
+        StorageDead(_5);                 // scope 0 at $DIR/match_false_edges.rs:25:36: 25:37
+        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:25:36: 25:37
+        goto -> bb10;                    // scope 0 at $DIR/match_false_edges.rs:25:36: 25:37
     }
 
     bb8: {
-        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:27:26: 27:27
-        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37
-        falseEdge -> [real: bb3, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
+        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:25:26: 25:27
+        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:25:36: 25:37
+        falseEdge -> [real: bb3, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:25:20: 25:27
     }
 
     bb9: {
-        _1 = (const 3_i32, const 3_i32); // scope 0 at $DIR/match_false_edges.rs:28:17: 28:23
-        goto -> bb10;                    // scope 0 at $DIR/match_false_edges.rs:28:17: 28:23
+        _1 = (const 3_i32, const 3_i32); // scope 0 at $DIR/match_false_edges.rs:26:17: 26:23
+        goto -> bb10;                    // scope 0 at $DIR/match_false_edges.rs:26:17: 26:23
     }
 
     bb10: {
-        StorageDead(_2);                 // scope 0 at $DIR/match_false_edges.rs:30:6: 30:7
-        StorageDead(_1);                 // scope 0 at $DIR/match_false_edges.rs:30:6: 30:7
-        _0 = const ();                   // scope 0 at $DIR/match_false_edges.rs:25:29: 31:2
-        return;                          // scope 0 at $DIR/match_false_edges.rs:31:2: 31:2
+        StorageDead(_2);                 // scope 0 at $DIR/match_false_edges.rs:28:6: 28:7
+        StorageDead(_1);                 // scope 0 at $DIR/match_false_edges.rs:28:6: 28:7
+        _0 = const ();                   // scope 0 at $DIR/match_false_edges.rs:23:29: 29:2
+        return;                          // scope 0 at $DIR/match_false_edges.rs:29:2: 29:2
     }
 
     bb11 (cleanup): {
-        resume;                          // scope 0 at $DIR/match_false_edges.rs:25:1: 31:2
+        resume;                          // scope 0 at $DIR/match_false_edges.rs:23:1: 29:2
     }
 }
diff --git a/src/test/mir-opt/match_false_edges.main.PromoteTemps.before.mir b/src/test/mir-opt/match_false_edges.main.PromoteTemps.before.mir
index a07e257f549..2f76e0137bd 100644
--- a/src/test/mir-opt/match_false_edges.main.PromoteTemps.before.mir
+++ b/src/test/mir-opt/match_false_edges.main.PromoteTemps.before.mir
@@ -1,153 +1,153 @@
 // MIR for `main` before PromoteTemps
 
 fn main() -> () {
-    let mut _0: ();                      // return place in scope 0 at $DIR/match_false_edges.rs:34:11: 34:11
-    let mut _1: i32;                     // in scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
-    let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
-    let mut _3: isize;                   // in scope 0 at $DIR/match_false_edges.rs:38:9: 38:16
-    let mut _4: isize;                   // in scope 0 at $DIR/match_false_edges.rs:36:9: 36:17
-    let mut _5: &std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
-    let _6: i32;                         // in scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
-    let _7: &i32;                        // in scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
-    let mut _8: bool;                    // in scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
-    let _9: std::option::Option<i32>;    // in scope 0 at $DIR/match_false_edges.rs:37:9: 37:11
-    let _10: i32;                        // in scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
-    let _11: &i32;                       // in scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
-    let mut _12: bool;                   // in scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
-    let mut _13: i32;                    // in scope 0 at $DIR/match_false_edges.rs:38:27: 38:28
-    let _14: std::option::Option<i32>;   // in scope 0 at $DIR/match_false_edges.rs:39:9: 39:11
+    let mut _0: ();                      // return place in scope 0 at $DIR/match_false_edges.rs:32:11: 32:11
+    let mut _1: i32;                     // in scope 0 at $DIR/match_false_edges.rs:33:13: 38:6
+    let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:33:19: 33:26
+    let mut _3: isize;                   // in scope 0 at $DIR/match_false_edges.rs:36:9: 36:16
+    let mut _4: isize;                   // in scope 0 at $DIR/match_false_edges.rs:34:9: 34:17
+    let mut _5: &std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:33:19: 33:26
+    let _6: i32;                         // in scope 0 at $DIR/match_false_edges.rs:34:14: 34:16
+    let _7: &i32;                        // in scope 0 at $DIR/match_false_edges.rs:34:14: 34:16
+    let mut _8: bool;                    // in scope 0 at $DIR/match_false_edges.rs:34:21: 34:28
+    let _9: std::option::Option<i32>;    // in scope 0 at $DIR/match_false_edges.rs:35:9: 35:11
+    let _10: i32;                        // in scope 0 at $DIR/match_false_edges.rs:36:14: 36:15
+    let _11: &i32;                       // in scope 0 at $DIR/match_false_edges.rs:36:14: 36:15
+    let mut _12: bool;                   // in scope 0 at $DIR/match_false_edges.rs:36:20: 36:29
+    let mut _13: i32;                    // in scope 0 at $DIR/match_false_edges.rs:36:27: 36:28
+    let _14: std::option::Option<i32>;   // in scope 0 at $DIR/match_false_edges.rs:37:9: 37:11
     scope 1 {
     }
     scope 2 {
-        debug _w => _6;                  // in scope 2 at $DIR/match_false_edges.rs:36:14: 36:16
-        debug _w => _7;                  // in scope 2 at $DIR/match_false_edges.rs:36:14: 36:16
+        debug _w => _6;                  // in scope 2 at $DIR/match_false_edges.rs:34:14: 34:16
+        debug _w => _7;                  // in scope 2 at $DIR/match_false_edges.rs:34:14: 34:16
     }
     scope 3 {
-        debug _x => _9;                  // in scope 3 at $DIR/match_false_edges.rs:37:9: 37:11
+        debug _x => _9;                  // in scope 3 at $DIR/match_false_edges.rs:35:9: 35:11
     }
     scope 4 {
-        debug y => _10;                  // in scope 4 at $DIR/match_false_edges.rs:38:14: 38:15
-        debug y => _11;                  // in scope 4 at $DIR/match_false_edges.rs:38:14: 38:15
+        debug y => _10;                  // in scope 4 at $DIR/match_false_edges.rs:36:14: 36:15
+        debug y => _11;                  // in scope 4 at $DIR/match_false_edges.rs:36:14: 36:15
     }
     scope 5 {
-        debug _z => _14;                 // in scope 5 at $DIR/match_false_edges.rs:39:9: 39:11
+        debug _z => _14;                 // in scope 5 at $DIR/match_false_edges.rs:37:9: 37:11
     }
 
     bb0: {
-        StorageLive(_1);                 // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
-        StorageLive(_2);                 // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
-        _2 = Option::<i32>::Some(const 1_i32); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
-        FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
-        _4 = discriminant(_2);           // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
-        switchInt(move _4) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/match_false_edges.rs:35:13: 35:26
+        StorageLive(_1);                 // scope 0 at $DIR/match_false_edges.rs:33:13: 38:6
+        StorageLive(_2);                 // scope 0 at $DIR/match_false_edges.rs:33:19: 33:26
+        _2 = Option::<i32>::Some(const 1_i32); // scope 0 at $DIR/match_false_edges.rs:33:19: 33:26
+        FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:33:19: 33:26
+        _4 = discriminant(_2);           // scope 0 at $DIR/match_false_edges.rs:33:19: 33:26
+        switchInt(move _4) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/match_false_edges.rs:33:13: 33:26
     }
 
     bb1: {
-        falseEdge -> [real: bb9, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11
+        falseEdge -> [real: bb9, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:35:9: 35:11
     }
 
     bb2: {
-        falseEdge -> [real: bb5, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:36:9: 36:17
+        falseEdge -> [real: bb5, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:34:9: 34:17
     }
 
     bb3: {
-        StorageLive(_14);                // scope 0 at $DIR/match_false_edges.rs:39:9: 39:11
-        _14 = _2;                        // scope 0 at $DIR/match_false_edges.rs:39:9: 39:11
-        _1 = const 4_i32;                // scope 5 at $DIR/match_false_edges.rs:39:15: 39:16
-        StorageDead(_14);                // scope 0 at $DIR/match_false_edges.rs:39:15: 39:16
-        goto -> bb14;                    // scope 0 at $DIR/match_false_edges.rs:39:15: 39:16
+        StorageLive(_14);                // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11
+        _14 = _2;                        // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11
+        _1 = const 4_i32;                // scope 5 at $DIR/match_false_edges.rs:37:15: 37:16
+        StorageDead(_14);                // scope 0 at $DIR/match_false_edges.rs:37:15: 37:16
+        goto -> bb14;                    // scope 0 at $DIR/match_false_edges.rs:37:15: 37:16
     }
 
     bb4: {
-        falseEdge -> [real: bb10, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:38:9: 38:16
+        falseEdge -> [real: bb10, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:36:9: 36:16
     }
 
     bb5: {
-        StorageLive(_7);                 // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
-        _7 = &((_2 as Some).0: i32);     // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
-        _5 = &shallow _2;                // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
-        StorageLive(_8);                 // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
-        _8 = guard() -> [return: bb6, unwind: bb15]; // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
+        StorageLive(_7);                 // scope 0 at $DIR/match_false_edges.rs:34:14: 34:16
+        _7 = &((_2 as Some).0: i32);     // scope 0 at $DIR/match_false_edges.rs:34:14: 34:16
+        _5 = &shallow _2;                // scope 0 at $DIR/match_false_edges.rs:33:19: 33:26
+        StorageLive(_8);                 // scope 0 at $DIR/match_false_edges.rs:34:21: 34:28
+        _8 = guard() -> [return: bb6, unwind: bb15]; // scope 0 at $DIR/match_false_edges.rs:34:21: 34:28
                                          // mir::Constant
-                                         // + span: $DIR/match_false_edges.rs:36:21: 36:26
+                                         // + span: $DIR/match_false_edges.rs:34:21: 34:26
                                          // + literal: Const { ty: fn() -> bool {guard}, val: Value(Scalar(<ZST>)) }
     }
 
     bb6: {
-        switchInt(move _8) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
+        switchInt(move _8) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:34:21: 34:28
     }
 
     bb7: {
-        StorageDead(_8);                 // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28
-        FakeRead(ForMatchGuard, _5);     // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28
-        FakeRead(ForGuardBinding, _7);   // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28
-        StorageLive(_6);                 // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
-        _6 = ((_2 as Some).0: i32);      // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
-        _1 = const 1_i32;                // scope 2 at $DIR/match_false_edges.rs:36:32: 36:33
-        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33
-        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33
-        goto -> bb14;                    // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33
+        StorageDead(_8);                 // scope 0 at $DIR/match_false_edges.rs:34:27: 34:28
+        FakeRead(ForMatchGuard, _5);     // scope 0 at $DIR/match_false_edges.rs:34:27: 34:28
+        FakeRead(ForGuardBinding, _7);   // scope 0 at $DIR/match_false_edges.rs:34:27: 34:28
+        StorageLive(_6);                 // scope 0 at $DIR/match_false_edges.rs:34:14: 34:16
+        _6 = ((_2 as Some).0: i32);      // scope 0 at $DIR/match_false_edges.rs:34:14: 34:16
+        _1 = const 1_i32;                // scope 2 at $DIR/match_false_edges.rs:34:32: 34:33
+        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:34:32: 34:33
+        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:34:32: 34:33
+        goto -> bb14;                    // scope 0 at $DIR/match_false_edges.rs:34:32: 34:33
     }
 
     bb8: {
-        StorageDead(_8);                 // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28
-        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33
-        falseEdge -> [real: bb1, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
+        StorageDead(_8);                 // scope 0 at $DIR/match_false_edges.rs:34:27: 34:28
+        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:34:32: 34:33
+        falseEdge -> [real: bb1, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:34:21: 34:28
     }
 
     bb9: {
-        StorageLive(_9);                 // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11
-        _9 = _2;                         // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11
-        _1 = const 2_i32;                // scope 3 at $DIR/match_false_edges.rs:37:15: 37:16
-        StorageDead(_9);                 // scope 0 at $DIR/match_false_edges.rs:37:15: 37:16
-        goto -> bb14;                    // scope 0 at $DIR/match_false_edges.rs:37:15: 37:16
+        StorageLive(_9);                 // scope 0 at $DIR/match_false_edges.rs:35:9: 35:11
+        _9 = _2;                         // scope 0 at $DIR/match_false_edges.rs:35:9: 35:11
+        _1 = const 2_i32;                // scope 3 at $DIR/match_false_edges.rs:35:15: 35:16
+        StorageDead(_9);                 // scope 0 at $DIR/match_false_edges.rs:35:15: 35:16
+        goto -> bb14;                    // scope 0 at $DIR/match_false_edges.rs:35:15: 35:16
     }
 
     bb10: {
-        StorageLive(_11);                // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
-        _11 = &((_2 as Some).0: i32);    // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
-        _5 = &shallow _2;                // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
-        StorageLive(_12);                // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
-        StorageLive(_13);                // scope 0 at $DIR/match_false_edges.rs:38:27: 38:28
-        _13 = (*_11);                    // scope 0 at $DIR/match_false_edges.rs:38:27: 38:28
-        _12 = guard2(move _13) -> [return: bb11, unwind: bb15]; // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
+        StorageLive(_11);                // scope 0 at $DIR/match_false_edges.rs:36:14: 36:15
+        _11 = &((_2 as Some).0: i32);    // scope 0 at $DIR/match_false_edges.rs:36:14: 36:15
+        _5 = &shallow _2;                // scope 0 at $DIR/match_false_edges.rs:33:19: 33:26
+        StorageLive(_12);                // scope 0 at $DIR/match_false_edges.rs:36:20: 36:29
+        StorageLive(_13);                // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28
+        _13 = (*_11);                    // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28
+        _12 = guard2(move _13) -> [return: bb11, unwind: bb15]; // scope 0 at $DIR/match_false_edges.rs:36:20: 36:29
                                          // mir::Constant
-                                         // + span: $DIR/match_false_edges.rs:38:20: 38:26
+                                         // + span: $DIR/match_false_edges.rs:36:20: 36:26
                                          // + literal: Const { ty: fn(i32) -> bool {guard2}, val: Value(Scalar(<ZST>)) }
     }
 
     bb11: {
-        switchInt(move _12) -> [false: bb13, otherwise: bb12]; // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
+        switchInt(move _12) -> [false: bb13, otherwise: bb12]; // scope 0 at $DIR/match_false_edges.rs:36:20: 36:29
     }
 
     bb12: {
-        StorageDead(_13);                // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29
-        StorageDead(_12);                // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29
-        FakeRead(ForMatchGuard, _5);     // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29
-        FakeRead(ForGuardBinding, _11);  // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29
-        StorageLive(_10);                // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
-        _10 = ((_2 as Some).0: i32);     // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
-        _1 = const 3_i32;                // scope 4 at $DIR/match_false_edges.rs:38:33: 38:34
-        StorageDead(_10);                // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34
-        StorageDead(_11);                // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34
-        goto -> bb14;                    // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34
+        StorageDead(_13);                // scope 0 at $DIR/match_false_edges.rs:36:28: 36:29
+        StorageDead(_12);                // scope 0 at $DIR/match_false_edges.rs:36:28: 36:29
+        FakeRead(ForMatchGuard, _5);     // scope 0 at $DIR/match_false_edges.rs:36:28: 36:29
+        FakeRead(ForGuardBinding, _11);  // scope 0 at $DIR/match_false_edges.rs:36:28: 36:29
+        StorageLive(_10);                // scope 0 at $DIR/match_false_edges.rs:36:14: 36:15
+        _10 = ((_2 as Some).0: i32);     // scope 0 at $DIR/match_false_edges.rs:36:14: 36:15
+        _1 = const 3_i32;                // scope 4 at $DIR/match_false_edges.rs:36:33: 36:34
+        StorageDead(_10);                // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
+        StorageDead(_11);                // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
+        goto -> bb14;                    // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
     }
 
     bb13: {
-        StorageDead(_13);                // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29
-        StorageDead(_12);                // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29
-        StorageDead(_11);                // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34
-        falseEdge -> [real: bb3, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
+        StorageDead(_13);                // scope 0 at $DIR/match_false_edges.rs:36:28: 36:29
+        StorageDead(_12);                // scope 0 at $DIR/match_false_edges.rs:36:28: 36:29
+        StorageDead(_11);                // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
+        falseEdge -> [real: bb3, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:36:20: 36:29
     }
 
     bb14: {
-        StorageDead(_2);                 // scope 0 at $DIR/match_false_edges.rs:40:6: 40:7
-        StorageDead(_1);                 // scope 0 at $DIR/match_false_edges.rs:40:6: 40:7
-        _0 = const ();                   // scope 0 at $DIR/match_false_edges.rs:34:11: 41:2
-        return;                          // scope 0 at $DIR/match_false_edges.rs:41:2: 41:2
+        StorageDead(_2);                 // scope 0 at $DIR/match_false_edges.rs:38:6: 38:7
+        StorageDead(_1);                 // scope 0 at $DIR/match_false_edges.rs:38:6: 38:7
+        _0 = const ();                   // scope 0 at $DIR/match_false_edges.rs:32:11: 39:2
+        return;                          // scope 0 at $DIR/match_false_edges.rs:39:2: 39:2
     }
 
     bb15 (cleanup): {
-        resume;                          // scope 0 at $DIR/match_false_edges.rs:34:1: 41:2
+        resume;                          // scope 0 at $DIR/match_false_edges.rs:32:1: 39:2
     }
 }
diff --git a/src/test/mir-opt/match_false_edges.rs b/src/test/mir-opt/match_false_edges.rs
index 42dea9c7082..3603253dafc 100644
--- a/src/test/mir-opt/match_false_edges.rs
+++ b/src/test/mir-opt/match_false_edges.rs
@@ -1,5 +1,3 @@
-// compile-flags: -Z borrowck=mir
-
 fn guard() -> bool {
     false
 }
diff --git a/src/test/mir-opt/nll/named-lifetimes-basic.rs b/src/test/mir-opt/nll/named-lifetimes-basic.rs
index 73bd6d64e86..843716033ca 100644
--- a/src/test/mir-opt/nll/named-lifetimes-basic.rs
+++ b/src/test/mir-opt/nll/named-lifetimes-basic.rs
@@ -3,8 +3,8 @@
 // suitable variables and that we setup the outlives relationship
 // between R0 and R1 properly.
 
-// compile-flags:-Zborrowck=mir -Zverbose
-//                              ^^^^^^^^^ force compiler to dump more region information
+// compile-flags: -Zverbose
+//                ^^^^^^^^^ force compiler to dump more region information
 
 #![allow(warnings)]
 
diff --git a/src/test/mir-opt/nll/region-subtyping-basic.rs b/src/test/mir-opt/nll/region-subtyping-basic.rs
index 224a495c788..64332f302e8 100644
--- a/src/test/mir-opt/nll/region-subtyping-basic.rs
+++ b/src/test/mir-opt/nll/region-subtyping-basic.rs
@@ -2,8 +2,8 @@
 // in the type of `p` includes the points after `&v[0]` up to (but not
 // including) the call to `use_x`. The `else` branch is not included.
 
-// compile-flags:-Zborrowck=mir -Zverbose
-//                              ^^^^^^^^^ force compiler to dump more region information
+// compile-flags:-Zverbose
+//               ^^^^^^^^^ force compiler to dump more region information
 
 #![allow(warnings)]
 
diff --git a/src/test/run-make-fulldeps/rustdoc-error-lines/input.rs b/src/test/run-make-fulldeps/rustdoc-error-lines/input.rs
index 2d29fa89110..b4db182e85f 100644
--- a/src/test/run-make-fulldeps/rustdoc-error-lines/input.rs
+++ b/src/test/run-make-fulldeps/rustdoc-error-lines/input.rs
@@ -3,7 +3,7 @@
 // random #![feature] to ensure that crate attrs
 // do not offset things
 /// ```rust
-/// #![feature(nll)]
+/// #![feature(bool_to_option)]
 /// let x: char = 1;
 /// ```
 pub fn foo() {
@@ -13,7 +13,7 @@ pub fn foo() {
 /// Add some text around the test...
 ///
 /// ```rust
-/// #![feature(nll)]
+/// #![feature(bool_to_option)]
 /// let x: char = 1;
 /// ```
 ///
@@ -22,7 +22,7 @@ pub fn foo() {
 /// Let's also add a second test in the same doc comment.
 ///
 /// ```rust
-/// #![feature(nll)]
+/// #![feature(bool_to_option)]
 /// let x: char = 1;
 /// ```
 pub fn bar() {}
diff --git a/src/test/rustdoc/empty-impl-block.rs b/src/test/rustdoc/empty-impl-block.rs
new file mode 100644
index 00000000000..6a2a254f63a
--- /dev/null
+++ b/src/test/rustdoc/empty-impl-block.rs
@@ -0,0 +1,20 @@
+#![crate_name = "foo"]
+
+// @has 'foo/struct.Foo.html'
+pub struct Foo;
+
+// @has - '//*[@class="docblock"]' 'Hello empty impl block!'
+// @has - '//*[@class="item-info"]' 'This impl block contains no items.'
+/// Hello empty impl block!
+impl Foo {}
+// We ensure that this empty impl block without doc isn't rendered.
+// @count - '//*[@class="impl has-srclink"]' 'impl Foo' 1
+impl Foo {}
+
+// Just to ensure that empty trait impl blocks are rendered.
+pub struct Another;
+pub trait Bar {}
+
+// @has 'foo/struct.Another.html'
+// @has - '//h3[@class="code-header in-band"]' 'impl Bar for Another'
+impl Bar for Another {}
diff --git a/src/test/ui-fulldeps/extern-mod-syntax.rs b/src/test/ui-fulldeps/extern-mod-syntax.rs
index a90ab7ac438..230194c5377 100644
--- a/src/test/ui-fulldeps/extern-mod-syntax.rs
+++ b/src/test/ui-fulldeps/extern-mod-syntax.rs
@@ -3,8 +3,8 @@
 #![allow(unused_imports)]
 #![feature(rustc_private)]
 
-extern crate rustc_serialize;
-use rustc_serialize::json::Object;
+extern crate libc;
+use libc::c_void;
 
 pub fn main() {
     println!("Hello world!");
diff --git a/src/test/ui-fulldeps/issue-11881.rs b/src/test/ui-fulldeps/issue-11881.rs
index 6d64aeeda7e..9641470a68b 100644
--- a/src/test/ui-fulldeps/issue-11881.rs
+++ b/src/test/ui-fulldeps/issue-11881.rs
@@ -3,42 +3,80 @@
 #![allow(unused_must_use)]
 #![allow(dead_code)]
 #![allow(unused_imports)]
-#![feature(rustc_private)]
-
-extern crate rustc_macros;
-extern crate rustc_serialize;
 
 use std::fmt;
 use std::io::prelude::*;
 use std::io::Cursor;
 use std::slice;
+use std::marker::PhantomData;
+
+trait Encoder {
+    type Error;
+}
+
+trait Encodable<S: Encoder> {
+    fn encode(&self, s: &mut S) -> Result<(), S::Error>;
+}
+
+struct JsonEncoder<'a>(PhantomData<&'a mut ()>);
+
+impl Encoder for JsonEncoder<'_> {
+    type Error = ();
+}
+
+struct AsJson<'a, T> {
+    inner: &'a T,
+}
+
+impl<'a, T: for<'r> Encodable<JsonEncoder<'r>>> fmt::Display for AsJson<'a, T> {
+    /// Encodes a json value into a string
+    fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        Ok(())
+    }
+}
+
+fn as_json<T>(t: &T) -> AsJson<'_, T> {
+    AsJson { inner: t }
+}
+
+struct OpaqueEncoder(Vec<u8>);
+
+impl Encoder for OpaqueEncoder {
+    type Error = ();
+}
 
-use rustc_macros::Encodable;
-use rustc_serialize::json;
-use rustc_serialize::opaque;
-use rustc_serialize::{Encodable, Encoder};
 
-#[derive(Encodable)]
 struct Foo {
     baz: bool,
 }
 
-#[derive(Encodable)]
+impl<S: Encoder> Encodable<S> for Foo {
+    fn encode(&self, _s: &mut S) -> Result<(), S::Error> {
+        Ok(())
+    }
+}
+
 struct Bar {
     froboz: usize,
 }
 
+impl<S: Encoder> Encodable<S> for Bar {
+    fn encode(&self, _s: &mut S) -> Result<(), S::Error> {
+        Ok(())
+    }
+}
+
 enum WireProtocol {
     JSON,
     Opaque,
     // ...
 }
 
-fn encode_json<T: for<'a> Encodable<json::Encoder<'a>>>(val: &T, wr: &mut Cursor<Vec<u8>>) {
-    write!(wr, "{}", json::as_json(val));
+fn encode_json<T: for<'a> Encodable<JsonEncoder<'a>>>(val: &T, wr: &mut Cursor<Vec<u8>>) {
+    write!(wr, "{}", as_json(val));
 }
-fn encode_opaque<T: Encodable<opaque::Encoder>>(val: &T, wr: Vec<u8>) {
-    let mut encoder = opaque::Encoder::new(wr);
+fn encode_opaque<T: Encodable<OpaqueEncoder>>(val: &T, wr: Vec<u8>) {
+    let mut encoder = OpaqueEncoder(wr);
     val.encode(&mut encoder);
 }
 
diff --git a/src/test/ui-fulldeps/issue-15924.rs b/src/test/ui-fulldeps/issue-15924.rs
index 5adc2c482f5..d8b3914d0d4 100644
--- a/src/test/ui-fulldeps/issue-15924.rs
+++ b/src/test/ui-fulldeps/issue-15924.rs
@@ -3,21 +3,48 @@
 #![allow(unused_imports)]
 #![allow(unused_must_use)]
 // pretty-expanded FIXME #23616
-#![feature(rustc_private)]
 
-extern crate rustc_serialize;
-
-use rustc_serialize::json;
-use rustc_serialize::{Encodable, Encoder};
 use std::fmt;
+use std::marker::PhantomData;
+
+trait Encoder {
+    type Error;
+}
+
+trait Encodable<S: Encoder> {
+    fn encode(&self, s: &mut S) -> Result<(), S::Error>;
+}
+
+impl<S: Encoder> Encodable<S> for i32 {
+    fn encode(&self, _s: &mut S) -> Result<(), S::Error> {
+        Ok(())
+    }
+}
+
+struct JsonEncoder<'a>(PhantomData<&'a mut ()>);
+
+impl Encoder for JsonEncoder<'_> {
+    type Error = ();
+}
+
+fn encode_json<T: for<'r> Encodable<JsonEncoder<'r>>>(
+    object: &T,
+) -> Result<String, ()> {
+    let s = String::new();
+    {
+        let mut encoder = JsonEncoder(PhantomData);
+        object.encode(&mut encoder)?;
+    }
+    Ok(s)
+}
 
-struct Foo<T: for<'a> Encodable<json::Encoder<'a>>> {
+struct Foo<T: for<'a> Encodable<JsonEncoder<'a>>> {
     v: T,
 }
 
-impl<T: for<'a> Encodable<json::Encoder<'a>>> Drop for Foo<T> {
+impl<T: for<'a> Encodable<JsonEncoder<'a>>> Drop for Foo<T> {
     fn drop(&mut self) {
-        json::encode(&self.v);
+        encode_json(&self.v);
     }
 }
 
diff --git a/src/test/ui-fulldeps/issue-2804.rs b/src/test/ui-fulldeps/issue-2804.rs
index 3d5922d155f..571028c5e40 100644
--- a/src/test/ui-fulldeps/issue-2804.rs
+++ b/src/test/ui-fulldeps/issue-2804.rs
@@ -2,27 +2,38 @@
 
 #![allow(non_camel_case_types)]
 #![allow(dead_code)]
-#![feature(rustc_private)]
 
-extern crate rustc_serialize;
-
-use std::collections::HashMap;
-use rustc_serialize::json::{self, Json};
+use std::collections::{BTreeMap, HashMap};
 use std::option;
 
+#[derive(Clone, Debug)]
+enum Json {
+    I64(i64),
+    U64(u64),
+    F64(f64),
+    String(String),
+    Boolean(bool),
+    Array(Array),
+    Object(Object),
+    Null,
+}
+
+type Array = Vec<Json>;
+type Object = BTreeMap<String, Json>;
+
 enum object {
     bool_value(bool),
     int_value(i64),
 }
 
-fn lookup(table: json::Object, key: String, default: String) -> String
+fn lookup(table: Object, key: String, default: String) -> String
 {
     match table.get(&key) {
         option::Option::Some(&Json::String(ref s)) => {
             s.to_string()
         }
         option::Option::Some(value) => {
-            println!("{} was expected to be a string but is a {}", key, value);
+            println!("{} was expected to be a string but is a {:?}", key, value);
             default
         }
         option::Option::None => {
@@ -31,7 +42,7 @@ fn lookup(table: json::Object, key: String, default: String) -> String
     }
 }
 
-fn add_interface(_store: isize, managed_ip: String, data: json::Json) -> (String, object)
+fn add_interface(_store: isize, managed_ip: String, data: Json) -> (String, object)
 {
     match &data {
         &Json::Object(ref interface) => {
@@ -43,13 +54,13 @@ fn add_interface(_store: isize, managed_ip: String, data: json::Json) -> (String
             (label, object::bool_value(false))
         }
         _ => {
-            println!("Expected dict for {} interfaces, found {}", managed_ip, data);
+            println!("Expected dict for {} interfaces, found {:?}", managed_ip, data);
             ("gnos:missing-interface".to_string(), object::bool_value(true))
         }
     }
 }
 
-fn add_interfaces(store: isize, managed_ip: String, device: HashMap<String, json::Json>)
+fn add_interfaces(store: isize, managed_ip: String, device: HashMap<String, Json>)
 -> Vec<(String, object)> {
     match device["interfaces"] {
         Json::Array(ref interfaces) =>
@@ -60,7 +71,7 @@ fn add_interfaces(store: isize, managed_ip: String, device: HashMap<String, json
         }
         _ =>
         {
-            println!("Expected list for {} interfaces, found {}", managed_ip,
+            println!("Expected list for {} interfaces, found {:?}", managed_ip,
                      device["interfaces"]);
             Vec::new()
         }
diff --git a/src/test/ui/associated-type-bounds/implied-region-constraints.base.stderr b/src/test/ui/associated-type-bounds/implied-region-constraints.base.stderr
deleted file mode 100644
index b4437069cd7..00000000000
--- a/src/test/ui/associated-type-bounds/implied-region-constraints.base.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/implied-region-constraints.rs:21:64
-   |
-LL | fn _bad_st<'a, 'b, T>(x: St<'a, 'b, T>)
-   |                          ------------- this type is declared with multiple lifetimes...
-...
-LL |     let _failure_proves_not_implied_outlives_region_b: &'b T = &x.f0;
-   |                                                                ^^^^^ ...but data with one lifetime flows into the other here
-
-error[E0623]: lifetime mismatch
-  --> $DIR/implied-region-constraints.rs:43:72
-   |
-LL | fn _bad_en7<'a, 'b, T>(x: En7<'a, 'b, T>)
-   |                           -------------- this type is declared with multiple lifetimes...
-...
-LL |             let _failure_proves_not_implied_outlives_region_b: &'b T = &x;
-   |                                                                        ^^ ...but data with one lifetime flows into the other here
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/associated-type-bounds/implied-region-constraints.rs b/src/test/ui/associated-type-bounds/implied-region-constraints.rs
index a41c7643430..38219da61b4 100644
--- a/src/test/ui/associated-type-bounds/implied-region-constraints.rs
+++ b/src/test/ui/associated-type-bounds/implied-region-constraints.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 #![feature(associated_type_bounds)]
 
 trait Tr1 { type As1; }
@@ -19,8 +15,7 @@ where
 {
     // This should fail because `T: 'b` is not implied from `WF(St<'a, 'b, T>)`.
     let _failure_proves_not_implied_outlives_region_b: &'b T = &x.f0;
-    //[base]~^ ERROR lifetime mismatch [E0623]
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 enum En7<'a, 'b, T> // `<T::As1 as Tr2>::As2: 'a` is implied.
@@ -41,8 +36,7 @@ where
         En7::V0(x) => {
             // Also fails for the same reason as above:
             let _failure_proves_not_implied_outlives_region_b: &'b T = &x;
-            //[base]~^ ERROR lifetime mismatch [E0623]
-            //[nll]~^^ ERROR lifetime may not live long enough
+            //~^ ERROR lifetime may not live long enough
         },
         En7::V1(_) => {},
     }
diff --git a/src/test/ui/associated-type-bounds/implied-region-constraints.nll.stderr b/src/test/ui/associated-type-bounds/implied-region-constraints.stderr
index bf9fecf06a4..cddce8777ea 100644
--- a/src/test/ui/associated-type-bounds/implied-region-constraints.nll.stderr
+++ b/src/test/ui/associated-type-bounds/implied-region-constraints.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/implied-region-constraints.rs:21:56
+  --> $DIR/implied-region-constraints.rs:17:56
    |
 LL | fn _bad_st<'a, 'b, T>(x: St<'a, 'b, T>)
    |            --  -- lifetime `'b` defined here
@@ -12,7 +12,7 @@ LL |     let _failure_proves_not_implied_outlives_region_b: &'b T = &x.f0;
    = help: consider adding the following bound: `'a: 'b`
 
 error: lifetime may not live long enough
-  --> $DIR/implied-region-constraints.rs:43:64
+  --> $DIR/implied-region-constraints.rs:38:64
    |
 LL | fn _bad_en7<'a, 'b, T>(x: En7<'a, 'b, T>)
    |             --  -- lifetime `'b` defined here
diff --git a/src/test/ui/associated-types/associated-types-eq-hr.base.stderr b/src/test/ui/associated-types/associated-types-eq-hr.base.stderr
deleted file mode 100644
index 4313078064c..00000000000
--- a/src/test/ui/associated-types/associated-types-eq-hr.base.stderr
+++ /dev/null
@@ -1,92 +0,0 @@
-error[E0271]: type mismatch resolving `for<'x> <UintStruct as TheTrait<&'x isize>>::A == &'x isize`
-  --> $DIR/associated-types-eq-hr.rs:91:5
-   |
-LL |     foo::<UintStruct>();
-   |     ^^^^^^^^^^^^^^^^^ type mismatch resolving `for<'x> <UintStruct as TheTrait<&'x isize>>::A == &'x isize`
-   |
-note: expected this to be `&isize`
-  --> $DIR/associated-types-eq-hr.rs:30:14
-   |
-LL |     type A = &'a usize;
-   |              ^^^^^^^^^
-   = note: expected reference `&isize`
-              found reference `&usize`
-note: required by a bound in `foo`
-  --> $DIR/associated-types-eq-hr.rs:49:36
-   |
-LL | fn foo<T>()
-   |    --- required by a bound in this
-LL | where
-LL |     T: for<'x> TheTrait<&'x isize, A = &'x isize>,
-   |                                    ^^^^^^^^^^^^^ required by this bound in `foo`
-
-error[E0271]: type mismatch resolving `for<'x> <IntStruct as TheTrait<&'x isize>>::A == &'x usize`
-  --> $DIR/associated-types-eq-hr.rs:95:5
-   |
-LL |     bar::<IntStruct>();
-   |     ^^^^^^^^^^^^^^^^ type mismatch resolving `for<'x> <IntStruct as TheTrait<&'x isize>>::A == &'x usize`
-   |
-note: expected this to be `&usize`
-  --> $DIR/associated-types-eq-hr.rs:18:14
-   |
-LL |     type A = &'a isize;
-   |              ^^^^^^^^^
-   = note: expected reference `&usize`
-              found reference `&isize`
-note: required by a bound in `bar`
-  --> $DIR/associated-types-eq-hr.rs:56:36
-   |
-LL | fn bar<T>()
-   |    --- required by a bound in this
-LL | where
-LL |     T: for<'x> TheTrait<&'x isize, A = &'x usize>,
-   |                                    ^^^^^^^^^^^^^ required by this bound in `bar`
-
-error: implementation of `TheTrait` is not general enough
-  --> $DIR/associated-types-eq-hr.rs:100:5
-   |
-LL |     tuple_one::<Tuple>();
-   |     ^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
-   |
-   = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
-   = note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
-
-error: implementation of `TheTrait` is not general enough
-  --> $DIR/associated-types-eq-hr.rs:100:5
-   |
-LL |     tuple_one::<Tuple>();
-   |     ^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
-   |
-   = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
-   = note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
-
-error: implementation of `TheTrait` is not general enough
-  --> $DIR/associated-types-eq-hr.rs:106:5
-   |
-LL |     tuple_two::<Tuple>();
-   |     ^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
-   |
-   = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
-   = note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
-
-error: implementation of `TheTrait` is not general enough
-  --> $DIR/associated-types-eq-hr.rs:106:5
-   |
-LL |     tuple_two::<Tuple>();
-   |     ^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
-   |
-   = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
-   = note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
-
-error: implementation of `TheTrait` is not general enough
-  --> $DIR/associated-types-eq-hr.rs:116:5
-   |
-LL |     tuple_four::<Tuple>();
-   |     ^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
-   |
-   = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
-   = note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
-
-error: aborting due to 7 previous errors
-
-For more information about this error, try `rustc --explain E0271`.
diff --git a/src/test/ui/associated-types/associated-types-eq-hr.rs b/src/test/ui/associated-types/associated-types-eq-hr.rs
index deb3fd059f8..dc653f7f2e9 100644
--- a/src/test/ui/associated-types/associated-types-eq-hr.rs
+++ b/src/test/ui/associated-types/associated-types-eq-hr.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 // Check testing of equality constraints in a higher-ranked context.
 
 pub trait TheTrait<T> {
@@ -98,14 +94,10 @@ pub fn call_bar() {
 
 pub fn call_tuple_one() {
     tuple_one::<Tuple>();
-    //[base]~^ ERROR implementation of `TheTrait` is not general enough
-    //[base]~| ERROR implementation of `TheTrait` is not general enough
 }
 
 pub fn call_tuple_two() {
     tuple_two::<Tuple>();
-    //[base]~^ ERROR implementation of `TheTrait` is not general enough
-    //[base]~| ERROR implementation of `TheTrait` is not general enough
 }
 
 pub fn call_tuple_three() {
@@ -114,7 +106,6 @@ pub fn call_tuple_three() {
 
 pub fn call_tuple_four() {
     tuple_four::<Tuple>();
-    //[base]~^ ERROR implementation of `TheTrait` is not general enough
 }
 
 fn main() {}
diff --git a/src/test/ui/associated-types/associated-types-eq-hr.nll.stderr b/src/test/ui/associated-types/associated-types-eq-hr.stderr
index 8d128821656..b306ae273e8 100644
--- a/src/test/ui/associated-types/associated-types-eq-hr.nll.stderr
+++ b/src/test/ui/associated-types/associated-types-eq-hr.stderr
@@ -1,18 +1,18 @@
 error[E0271]: type mismatch resolving `for<'x> <UintStruct as TheTrait<&'x isize>>::A == &'x isize`
-  --> $DIR/associated-types-eq-hr.rs:91:5
+  --> $DIR/associated-types-eq-hr.rs:87:5
    |
 LL |     foo::<UintStruct>();
    |     ^^^^^^^^^^^^^^^^^ type mismatch resolving `for<'x> <UintStruct as TheTrait<&'x isize>>::A == &'x isize`
    |
 note: expected this to be `&isize`
-  --> $DIR/associated-types-eq-hr.rs:30:14
+  --> $DIR/associated-types-eq-hr.rs:26:14
    |
 LL |     type A = &'a usize;
    |              ^^^^^^^^^
    = note: expected reference `&isize`
               found reference `&usize`
 note: required by a bound in `foo`
-  --> $DIR/associated-types-eq-hr.rs:49:36
+  --> $DIR/associated-types-eq-hr.rs:45:36
    |
 LL | fn foo<T>()
    |    --- required by a bound in this
@@ -21,20 +21,20 @@ LL |     T: for<'x> TheTrait<&'x isize, A = &'x isize>,
    |                                    ^^^^^^^^^^^^^ required by this bound in `foo`
 
 error[E0271]: type mismatch resolving `for<'x> <IntStruct as TheTrait<&'x isize>>::A == &'x usize`
-  --> $DIR/associated-types-eq-hr.rs:95:5
+  --> $DIR/associated-types-eq-hr.rs:91:5
    |
 LL |     bar::<IntStruct>();
    |     ^^^^^^^^^^^^^^^^ type mismatch resolving `for<'x> <IntStruct as TheTrait<&'x isize>>::A == &'x usize`
    |
 note: expected this to be `&usize`
-  --> $DIR/associated-types-eq-hr.rs:18:14
+  --> $DIR/associated-types-eq-hr.rs:14:14
    |
 LL |     type A = &'a isize;
    |              ^^^^^^^^^
    = note: expected reference `&usize`
               found reference `&isize`
 note: required by a bound in `bar`
-  --> $DIR/associated-types-eq-hr.rs:56:36
+  --> $DIR/associated-types-eq-hr.rs:52:36
    |
 LL | fn bar<T>()
    |    --- required by a bound in this
diff --git a/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.base.stderr b/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.base.stderr
deleted file mode 100644
index fe238344263..00000000000
--- a/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.base.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/associated-types-project-from-hrtb-in-fn-body.rs:26:40
-   |
-LL |     x: <I as Foo<&'a isize>>::A,
-   |                  --------- these two types are declared with different lifetimes...
-LL |     y: <I as Foo<&'b isize>>::A,
-   |                  ---------
-...
-LL |     let z: I::A = if cond { x } else { y };
-   |                                        ^ ...but data from `x` flows into `y` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.rs b/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.rs
index 7ad12f2a1f3..069bf560044 100644
--- a/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.rs
+++ b/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 // Check projection of an associated type out of a higher-ranked
 // trait-bound in the context of a function body.
 
@@ -24,9 +20,8 @@ fn bar<'a, 'b, I : for<'x> Foo<&'x isize>>(
 {
     // x and y here have two distinct lifetimes:
     let z: I::A = if cond { x } else { y };
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
-    //[nll]~| ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
+    //~| ERROR lifetime may not live long enough
 }
 
 pub fn main() {}
diff --git a/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.nll.stderr b/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.stderr
index ae6ccb8af55..e12d42e5ed0 100644
--- a/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.nll.stderr
+++ b/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/associated-types-project-from-hrtb-in-fn-body.rs:26:29
+  --> $DIR/associated-types-project-from-hrtb-in-fn-body.rs:22:29
    |
 LL | fn bar<'a, 'b, I : for<'x> Foo<&'x isize>>(
    |        --  -- lifetime `'b` defined here
@@ -12,7 +12,7 @@ LL |     let z: I::A = if cond { x } else { y };
    = help: consider adding the following bound: `'a: 'b`
 
 error: lifetime may not live long enough
-  --> $DIR/associated-types-project-from-hrtb-in-fn-body.rs:26:40
+  --> $DIR/associated-types-project-from-hrtb-in-fn-body.rs:22:40
    |
 LL | fn bar<'a, 'b, I : for<'x> Foo<&'x isize>>(
    |        --  -- lifetime `'b` defined here
diff --git a/src/test/ui/associated-types/associated-types-subtyping-1.base.stderr b/src/test/ui/associated-types/associated-types-subtyping-1.base.stderr
deleted file mode 100644
index 35b3a83ee43..00000000000
--- a/src/test/ui/associated-types/associated-types-subtyping-1.base.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/associated-types-subtyping-1.rs:31:38
-   |
-LL | fn method2<'a,'b,T>(x: &'a T, y: &'b T)
-   |                        -----     ----- these two types are declared with different lifetimes...
-...
-LL |     let _c: <T as Trait<'b>>::Type = a;
-   |                                      ^ ...but data from `y` flows into `x` here
-
-error[E0623]: lifetime mismatch
-  --> $DIR/associated-types-subtyping-1.rs:41:38
-   |
-LL | fn method3<'a,'b,T>(x: &'a T, y: &'b T)
-   |                        -----     ----- these two types are declared with different lifetimes...
-...
-LL |     let _c: <T as Trait<'a>>::Type = b;
-   |                                      ^ ...but data from `y` flows into `x` here
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/associated-types/associated-types-subtyping-1.rs b/src/test/ui/associated-types/associated-types-subtyping-1.rs
index 5b75e023b85..c4758f255b3 100644
--- a/src/test/ui/associated-types/associated-types-subtyping-1.rs
+++ b/src/test/ui/associated-types/associated-types-subtyping-1.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 #![allow(unused_variables)]
 
 fn make_any<T>() -> T {  loop {} }
@@ -26,10 +22,9 @@ fn method2<'a,'b,T>(x: &'a T, y: &'b T)
 {
     // Note that &'static T <: &'a T.
     let a: <T as Trait<'a>>::Type = make_any();
-    //[nll]~^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
     let b: <T as Trait<'b>>::Type = make_any();
     let _c: <T as Trait<'b>>::Type = a;
-    //[base]~^ ERROR E0623
 }
 
 fn method3<'a,'b,T>(x: &'a T, y: &'b T)
@@ -39,8 +34,7 @@ fn method3<'a,'b,T>(x: &'a T, y: &'b T)
     let a: <T as Trait<'a>>::Type = make_any();
     let b: <T as Trait<'b>>::Type = make_any();
     let _c: <T as Trait<'a>>::Type = b;
-    //[base]~^ ERROR E0623
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn method4<'a,'b,T>(x: &'a T, y: &'b T)
diff --git a/src/test/ui/associated-types/associated-types-subtyping-1.nll.stderr b/src/test/ui/associated-types/associated-types-subtyping-1.stderr
index 44f918e12ba..414bc048ab5 100644
--- a/src/test/ui/associated-types/associated-types-subtyping-1.nll.stderr
+++ b/src/test/ui/associated-types/associated-types-subtyping-1.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/associated-types-subtyping-1.rs:28:12
+  --> $DIR/associated-types-subtyping-1.rs:24:12
    |
 LL | fn method2<'a,'b,T>(x: &'a T, y: &'b T)
    |            -- -- lifetime `'b` defined here
@@ -12,7 +12,7 @@ LL |     let a: <T as Trait<'a>>::Type = make_any();
    = help: consider adding the following bound: `'b: 'a`
 
 error: lifetime may not live long enough
-  --> $DIR/associated-types-subtyping-1.rs:41:13
+  --> $DIR/associated-types-subtyping-1.rs:36:13
    |
 LL | fn method3<'a,'b,T>(x: &'a T, y: &'b T)
    |            -- -- lifetime `'b` defined here
diff --git a/src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.krisskross.stderr b/src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.krisskross.stderr
deleted file mode 100644
index ed5518b628f..00000000000
--- a/src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.krisskross.stderr
+++ /dev/null
@@ -1,25 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/project-fn-ret-contravariant-nll.rs:51:5
-   |
-LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
-   |                        -------                 ------------------
-   |                        |
-   |                        this parameter and the return type are declared with different lifetimes...
-...
-LL |    (a, b)
-   |     ^ ...but data from `y` is returned here
-
-error[E0623]: lifetime mismatch
-  --> $DIR/project-fn-ret-contravariant-nll.rs:51:8
-   |
-LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
-   |                                    -------     ------------------
-   |                                    |
-   |                                    this parameter and the return type are declared with different lifetimes...
-...
-LL |    (a, b)
-   |        ^ ...but data from `x` is returned here
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.rs b/src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.rs
deleted file mode 100644
index c3ac9949c21..00000000000
--- a/src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.rs
+++ /dev/null
@@ -1,55 +0,0 @@
-#![feature(unboxed_closures)]
-
-// Test for projection cache. We should be able to project distinct
-// lifetimes from `foo` as we reinstantiate it multiple times, but not
-// if we do it just once. In this variant, the region `'a` is used in
-// an contravariant position, which affects the results.
-
-// revisions: ok oneuse transmute krisskross
-//[ok] check-pass
-//[oneuse] check-pass
-
-// ignore-compare-mode-nll
-// FIXME(nll): When stabilizing, this test should replace `project-fn-ret-contravariant.rs`
-// The two would normally be just revisions, but this test uses revisions heavily, so splitting into
-// a separate test is just easier.
-
-#![allow(dead_code, unused_variables)]
-
-fn foo<'a>() -> &'a u32 { loop { } }
-
-fn bar<T>(t: T, x: T::Output) -> T::Output
-    where T: FnOnce<()>
-{
-    t()
-}
-
-#[cfg(ok)] // two instantiations: OK
-fn baz<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
-    let a = bar(foo, x);
-    let b = bar(foo, y);
-    (a, b)
-}
-
-#[cfg(oneuse)] // one instantiation: OK (surprisingly)
-fn baz<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
-    let f /* : fn() -> &'static u32 */ = foo; // <-- inferred type annotated
-    let a = bar(f, x); // this is considered ok because fn args are contravariant...
-    let b = bar(f, y); // ...and hence we infer T to distinct values in each call.
-    (a, b)
-}
-
-#[cfg(transmute)] // one instantiations: BAD
-fn baz<'a,'b>(x: &'a u32) -> &'static u32 {
-   bar(foo, x) //[transmute]~ ERROR E0759
-}
-
-#[cfg(krisskross)] // two instantiations, mixing and matching: BAD
-fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
-   let a = bar(foo, y);
-   let b = bar(foo, x);
-   (a, b) //[krisskross]~ ERROR lifetime mismatch [E0623]
-   //[krisskross]~^ ERROR lifetime mismatch [E0623]
-}
-
-fn main() { }
diff --git a/src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.transmute.stderr b/src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.transmute.stderr
deleted file mode 100644
index ca57142ecee..00000000000
--- a/src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.transmute.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/project-fn-ret-contravariant-nll.rs:44:8
-   |
-LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 {
-   |                  ------- this data with lifetime `'a`...
-LL |    bar(foo, x)
-   |        ^^^  - ...is used and required to live as long as `'static` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0759`.
diff --git a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.stderr b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.stderr
index 52824b3922e..2ecee1341ab 100644
--- a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.stderr
+++ b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.stderr
@@ -1,25 +1,30 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/project-fn-ret-contravariant.rs:52:5
+error: lifetime may not live long enough
+  --> $DIR/project-fn-ret-contravariant.rs:46:4
    |
 LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
-   |                        -------                 ------------------
-   |                        |
-   |                        this parameter and the return type are declared with different lifetimes...
+   |              -- -- lifetime `'b` defined here
+   |              |
+   |              lifetime `'a` defined here
 ...
 LL |    (a, b)
-   |     ^ ...but data from `y` is returned here
+   |    ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
+   |
+   = help: consider adding the following bound: `'a: 'b`
 
-error[E0623]: lifetime mismatch
-  --> $DIR/project-fn-ret-contravariant.rs:52:8
+error: lifetime may not live long enough
+  --> $DIR/project-fn-ret-contravariant.rs:46:4
    |
 LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
-   |                                    -------     ------------------
-   |                                    |
-   |                                    this parameter and the return type are declared with different lifetimes...
+   |              -- -- lifetime `'b` defined here
+   |              |
+   |              lifetime `'a` defined here
 ...
 LL |    (a, b)
-   |        ^ ...but data from `x` is returned here
+   |    ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
+   |
+   = help: consider adding the following bound: `'b: 'a`
+
+help: `'a` and `'b` must be the same: replace one with the other
 
 error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.rs b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.rs
index 7bd245d1c34..f1ea6627aab 100644
--- a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.rs
+++ b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.rs
@@ -9,12 +9,6 @@
 //[ok] check-pass
 //[oneuse] check-pass
 
-// ignore-compare-mode-nll
-// FIXME(nll): When stabilizing, this test should be replaced with
-// `project-fn-ret-contravariant-nll.rs` The two would normally be just
-// revisions, but this test uses revisions heavily, so splitting into
-// a separate test is just easier.
-
 #![allow(dead_code, unused_variables)]
 
 fn foo<'a>() -> &'a u32 { loop { } }
@@ -42,15 +36,15 @@ fn baz<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
 
 #[cfg(transmute)] // one instantiations: BAD
 fn baz<'a,'b>(x: &'a u32) -> &'static u32 {
-   bar(foo, x) //[transmute]~ ERROR E0759
+   bar(foo, x) //[transmute]~ ERROR lifetime may not live long enough
 }
 
 #[cfg(krisskross)] // two instantiations, mixing and matching: BAD
 fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
    let a = bar(foo, y);
    let b = bar(foo, x);
-   (a, b) //[krisskross]~ ERROR lifetime mismatch [E0623]
-   //[krisskross]~^ ERROR lifetime mismatch [E0623]
+   (a, b) //[krisskross]~ ERROR lifetime may not live long enough
+   //[krisskross]~^ ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.stderr b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.stderr
index 3d7f36ca32b..6d8ab2c3fdc 100644
--- a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.stderr
+++ b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.stderr
@@ -1,11 +1,10 @@
-error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/project-fn-ret-contravariant.rs:45:8
+error: lifetime may not live long enough
+  --> $DIR/project-fn-ret-contravariant.rs:39:4
    |
 LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 {
-   |                  ------- this data with lifetime `'a`...
+   |        -- lifetime `'a` defined here
 LL |    bar(foo, x)
-   |        ^^^  - ...is used and required to live as long as `'static` here
+   |    ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0759`.
diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.krisskross.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.krisskross.stderr
deleted file mode 100644
index 09119ea2bb5..00000000000
--- a/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.krisskross.stderr
+++ /dev/null
@@ -1,36 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/project-fn-ret-invariant-nll.rs:64:5
-   |
-LL | fn transmute<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
-   |              --  -- lifetime `'b` defined here
-   |              |
-   |              lifetime `'a` defined here
-...
-LL |     (a, b)
-   |     ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
-   |
-   = help: consider adding the following bound: `'a: 'b`
-   = note: requirement occurs because of the type `Type<'_>`, which makes the generic argument `'_` invariant
-   = note: the struct `Type<'a>` is invariant over the parameter `'a`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: lifetime may not live long enough
-  --> $DIR/project-fn-ret-invariant-nll.rs:64:5
-   |
-LL | fn transmute<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
-   |              --  -- lifetime `'b` defined here
-   |              |
-   |              lifetime `'a` defined here
-...
-LL |     (a, b)
-   |     ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
-   |
-   = help: consider adding the following bound: `'b: 'a`
-   = note: requirement occurs because of the type `Type<'_>`, which makes the generic argument `'_` invariant
-   = note: the struct `Type<'a>` is invariant over the parameter `'a`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-help: `'a` and `'b` must be the same: replace one with the other
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.oneuse.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.oneuse.stderr
deleted file mode 100644
index 266f3b99f9f..00000000000
--- a/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.oneuse.stderr
+++ /dev/null
@@ -1,36 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/project-fn-ret-invariant-nll.rs:46:13
-   |
-LL | fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
-   |        --  -- lifetime `'b` defined here
-   |        |
-   |        lifetime `'a` defined here
-LL |     let f = foo; // <-- No consistent type can be inferred for `f` here.
-LL |     let a = bar(f, x);
-   |             ^^^^^^^^^ argument requires that `'a` must outlive `'b`
-   |
-   = help: consider adding the following bound: `'a: 'b`
-   = note: requirement occurs because of the type `Type<'_>`, which makes the generic argument `'_` invariant
-   = note: the struct `Type<'a>` is invariant over the parameter `'a`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: lifetime may not live long enough
-  --> $DIR/project-fn-ret-invariant-nll.rs:46:13
-   |
-LL | fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
-   |        --  -- lifetime `'b` defined here
-   |        |
-   |        lifetime `'a` defined here
-LL |     let f = foo; // <-- No consistent type can be inferred for `f` here.
-LL |     let a = bar(f, x);
-   |             ^^^^^^^^^ argument requires that `'b` must outlive `'a`
-   |
-   = help: consider adding the following bound: `'b: 'a`
-   = note: requirement occurs because of a function pointer to `foo`
-   = note: the function `foo` is invariant over the parameter `'a`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-help: `'a` and `'b` must be the same: replace one with the other
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.rs b/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.rs
deleted file mode 100644
index 15bf38dabc0..00000000000
--- a/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.rs
+++ /dev/null
@@ -1,69 +0,0 @@
-#![feature(unboxed_closures)]
-// Test for projection cache. We should be able to project distinct
-// lifetimes from `foo` as we reinstantiate it multiple times, but not
-// if we do it just once. In this variant, the region `'a` is used in
-// an invariant position, which affects the results.
-
-// revisions: ok oneuse transmute krisskross
-//[ok] check-pass
-
-// compile-flags: -Z borrowck=mir
-// ignore-compare-mode-nll
-// FIXME(nll): When stabilizing, this test should replace with `project-fn-ret-invariant.rs`
-// The two would normally be just revisions, but this test uses revisions heavily, so splitting into
-// a separate test is just easier.
-
-#![allow(dead_code, unused_variables)]
-
-use std::marker::PhantomData;
-
-struct Type<'a> {
-    // Invariant
-    data: PhantomData<fn(&'a u32) -> &'a u32>,
-}
-
-fn foo<'a>() -> Type<'a> {
-    loop {}
-}
-
-fn bar<T>(t: T, x: T::Output) -> T::Output
-where
-    T: FnOnce<()>,
-{
-    t()
-}
-
-#[cfg(ok)] // two instantiations: OK
-fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
-    let a = bar(foo, x);
-    let b = bar(foo, y);
-    (a, b)
-}
-
-#[cfg(oneuse)] // one instantiation: BAD
-fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
-    let f = foo; // <-- No consistent type can be inferred for `f` here.
-    let a = bar(f, x); //[oneuse]~ ERROR lifetime may not live long enough
-    //[oneuse]~^ ERROR lifetime may not live long enough
-    let b = bar(f, y);
-    (a, b)
-}
-
-#[cfg(transmute)] // one instantiations: BAD
-fn baz<'a, 'b>(x: Type<'a>) -> Type<'static> {
-    // Cannot instantiate `foo` with any lifetime other than `'a`,
-    // since it is provided as input.
-
-    bar(foo, x) //[transmute]~ ERROR lifetime may not live long enough
-}
-
-#[cfg(krisskross)] // two instantiations, mixing and matching: BAD
-fn transmute<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
-    let a = bar(foo, y);
-    let b = bar(foo, x);
-    (a, b)
-    //[krisskross]~^ ERROR lifetime may not live long enough
-    //[krisskross]~| ERROR lifetime may not live long enough
-}
-
-fn main() {}
diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.transmute.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.transmute.stderr
deleted file mode 100644
index 56f08152999..00000000000
--- a/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.transmute.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/project-fn-ret-invariant-nll.rs:57:5
-   |
-LL | fn baz<'a, 'b>(x: Type<'a>) -> Type<'static> {
-   |        -- lifetime `'a` defined here
-...
-LL |     bar(foo, x)
-   |     ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
-   |
-   = note: requirement occurs because of the type `Type<'_>`, which makes the generic argument `'_` invariant
-   = note: the struct `Type<'a>` is invariant over the parameter `'a`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.stderr
index fd1152dd80c..ada12c7ee91 100644
--- a/src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.stderr
+++ b/src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.stderr
@@ -1,24 +1,36 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/project-fn-ret-invariant.rs:60:22
+error: lifetime may not live long enough
+  --> $DIR/project-fn-ret-invariant.rs:59:5
    |
 LL | fn transmute<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
-   |                                      --------     --------------------
-   |                                      |
-   |                                      this parameter and the return type are declared with different lifetimes...
-LL |     let a = bar(foo, y);
-   |                      ^ ...but data from `x` is returned here
+   |              --  -- lifetime `'b` defined here
+   |              |
+   |              lifetime `'a` defined here
+...
+LL |     (a, b)
+   |     ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
+   |
+   = help: consider adding the following bound: `'a: 'b`
+   = note: requirement occurs because of the type `Type<'_>`, which makes the generic argument `'_` invariant
+   = note: the struct `Type<'a>` is invariant over the parameter `'a`
+   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
-error[E0623]: lifetime mismatch
-  --> $DIR/project-fn-ret-invariant.rs:62:9
+error: lifetime may not live long enough
+  --> $DIR/project-fn-ret-invariant.rs:59:5
    |
 LL | fn transmute<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
-   |                                      --------     --------------------
-   |                                      |
-   |                                      this parameter and the return type are declared with different lifetimes...
+   |              --  -- lifetime `'b` defined here
+   |              |
+   |              lifetime `'a` defined here
 ...
 LL |     (a, b)
-   |         ^ ...but data from `x` is returned here
+   |     ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
+   |
+   = help: consider adding the following bound: `'b: 'a`
+   = note: requirement occurs because of the type `Type<'_>`, which makes the generic argument `'_` invariant
+   = note: the struct `Type<'a>` is invariant over the parameter `'a`
+   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
+
+help: `'a` and `'b` must be the same: replace one with the other
 
 error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.stderr
index 1b10c6b990a..cc156016212 100644
--- a/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.stderr
+++ b/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.stderr
@@ -1,14 +1,36 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/project-fn-ret-invariant.rs:46:20
+error: lifetime may not live long enough
+  --> $DIR/project-fn-ret-invariant.rs:40:13
    |
 LL | fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
-   |                                --------     --------------------
-   |                                |
-   |                                this parameter and the return type are declared with different lifetimes...
-...
-LL |     let b = bar(f, y);
-   |                    ^ ...but data from `x` is returned here
+   |        --  -- lifetime `'b` defined here
+   |        |
+   |        lifetime `'a` defined here
+LL |     let f = foo; // <-- No consistent type can be inferred for `f` here.
+LL |     let a = bar(f, x);
+   |             ^^^^^^^^^ argument requires that `'a` must outlive `'b`
+   |
+   = help: consider adding the following bound: `'a: 'b`
+   = note: requirement occurs because of the type `Type<'_>`, which makes the generic argument `'_` invariant
+   = note: the struct `Type<'a>` is invariant over the parameter `'a`
+   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
+
+error: lifetime may not live long enough
+  --> $DIR/project-fn-ret-invariant.rs:40:13
+   |
+LL | fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
+   |        --  -- lifetime `'b` defined here
+   |        |
+   |        lifetime `'a` defined here
+LL |     let f = foo; // <-- No consistent type can be inferred for `f` here.
+LL |     let a = bar(f, x);
+   |             ^^^^^^^^^ argument requires that `'b` must outlive `'a`
+   |
+   = help: consider adding the following bound: `'b: 'a`
+   = note: requirement occurs because of a function pointer to `foo`
+   = note: the function `foo` is invariant over the parameter `'a`
+   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
+
+help: `'a` and `'b` must be the same: replace one with the other
 
-error: aborting due to previous error
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant.rs b/src/test/ui/associated-types/cache/project-fn-ret-invariant.rs
index d42d99d7783..1075fd6e092 100644
--- a/src/test/ui/associated-types/cache/project-fn-ret-invariant.rs
+++ b/src/test/ui/associated-types/cache/project-fn-ret-invariant.rs
@@ -7,11 +7,6 @@
 // revisions: ok oneuse transmute krisskross
 //[ok] check-pass
 
-// ignore-compare-mode-nll
-// FIXME(nll): When stabilizing, this test should be replaced with `project-fn-ret-invariant-nll.rs`
-// The two would normally be just revisions, but this test uses revisions heavily, so splitting into
-// a separate test is just easier.
-
 #![allow(dead_code, unused_variables)]
 
 use std::marker::PhantomData;
@@ -43,7 +38,9 @@ fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
 fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
     let f = foo; // <-- No consistent type can be inferred for `f` here.
     let a = bar(f, x);
-    let b = bar(f, y); //[oneuse]~ ERROR lifetime mismatch [E0623]
+    //[oneuse]~^ ERROR lifetime may not live long enough
+    //[oneuse]~| ERROR lifetime may not live long enough
+    let b = bar(f, y);
     (a, b)
 }
 
@@ -52,14 +49,16 @@ fn baz<'a, 'b>(x: Type<'a>) -> Type<'static> {
     // Cannot instantiate `foo` with any lifetime other than `'a`,
     // since it is provided as input.
 
-    bar(foo, x) //[transmute]~ ERROR E0759
+    bar(foo, x) //[transmute]~ ERROR lifetime may not live long enough
 }
 
 #[cfg(krisskross)] // two instantiations, mixing and matching: BAD
 fn transmute<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
-    let a = bar(foo, y); //[krisskross]~ ERROR E0623
+    let a = bar(foo, y);
     let b = bar(foo, x);
-    (a, b) //[krisskross]~ ERROR E0623
+    (a, b)
+    //[krisskross]~^ ERROR lifetime may not live long enough
+    //[krisskross]~| ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr
index 8c1d9d1e284..b64cb2c3d0b 100644
--- a/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr
+++ b/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr
@@ -1,21 +1,15 @@
-error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/project-fn-ret-invariant.rs:55:9
+error: lifetime may not live long enough
+  --> $DIR/project-fn-ret-invariant.rs:52:5
    |
 LL | fn baz<'a, 'b>(x: Type<'a>) -> Type<'static> {
-   |                   -------- this data with lifetime `'a`...
+   |        -- lifetime `'a` defined here
 ...
 LL |     bar(foo, x)
-   |         ^^^  - ...is used and required to live as long as `'static` here
+   |     ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
    |
-note: `'static` lifetime requirement introduced by the return type
-  --> $DIR/project-fn-ret-invariant.rs:51:37
-   |
-LL | fn baz<'a, 'b>(x: Type<'a>) -> Type<'static> {
-   |                                     ^^^^^^^ `'static` requirement introduced here
-...
-LL |     bar(foo, x)
-   |     ----------- because of this returned expression
+   = note: requirement occurs because of the type `Type<'_>`, which makes the generic argument `'_` invariant
+   = note: the struct `Type<'a>` is invariant over the parameter `'a`
+   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0759`.
diff --git a/src/test/ui/associated-types/higher-ranked-projection.bad.nll.stderr b/src/test/ui/associated-types/higher-ranked-projection.bad.nll.stderr
deleted file mode 100644
index de254b7a163..00000000000
--- a/src/test/ui/associated-types/higher-ranked-projection.bad.nll.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/higher-ranked-projection.rs:25:5
-   |
-LL |     foo(());
-   |     ^^^^^^^ one type is more general than the other
-   |
-   = note: expected reference `&'a ()`
-              found reference `&()`
-note: the lifetime requirement is introduced here
-  --> $DIR/higher-ranked-projection.rs:15:33
-   |
-LL |     where for<'a> &'a T: Mirror<Image=U>
-   |                                 ^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/associated-types/higher-ranked-projection.bad.stderr b/src/test/ui/associated-types/higher-ranked-projection.bad.stderr
index 65533f93c94..239f4553938 100644
--- a/src/test/ui/associated-types/higher-ranked-projection.bad.stderr
+++ b/src/test/ui/associated-types/higher-ranked-projection.bad.stderr
@@ -1,13 +1,13 @@
 error[E0308]: mismatched types
-  --> $DIR/higher-ranked-projection.rs:25:5
+  --> $DIR/higher-ranked-projection.rs:23:5
    |
 LL |     foo(());
-   |     ^^^ lifetime mismatch
+   |     ^^^^^^^ one type is more general than the other
    |
    = note: expected reference `&'a ()`
               found reference `&()`
 note: the lifetime requirement is introduced here
-  --> $DIR/higher-ranked-projection.rs:15:33
+  --> $DIR/higher-ranked-projection.rs:14:33
    |
 LL |     where for<'a> &'a T: Mirror<Image=U>
    |                                 ^^^^^^^
diff --git a/src/test/ui/associated-types/higher-ranked-projection.badbase.stderr b/src/test/ui/associated-types/higher-ranked-projection.badbase.stderr
index 732f5d9584b..8b2b87223a5 100644
--- a/src/test/ui/associated-types/higher-ranked-projection.badbase.stderr
+++ b/src/test/ui/associated-types/higher-ranked-projection.badbase.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/higher-ranked-projection.rs:25:5
    |
 LL |     foo(());
-   |     ^^^ lifetime mismatch
+   |     ^^^^^^^ one type is more general than the other
    |
    = note: expected reference `&'a ()`
               found reference `&()`
diff --git a/src/test/ui/associated-types/higher-ranked-projection.badnll.stderr b/src/test/ui/associated-types/higher-ranked-projection.badnll.stderr
index 8b2b87223a5..217392aa35b 100644
--- a/src/test/ui/associated-types/higher-ranked-projection.badnll.stderr
+++ b/src/test/ui/associated-types/higher-ranked-projection.badnll.stderr
@@ -1,17 +1,2 @@
-error[E0308]: mismatched types
-  --> $DIR/higher-ranked-projection.rs:25:5
-   |
-LL |     foo(());
-   |     ^^^^^^^ one type is more general than the other
-   |
-   = note: expected reference `&'a ()`
-              found reference `&()`
-note: the lifetime requirement is introduced here
-  --> $DIR/higher-ranked-projection.rs:16:33
-   |
-LL |     where for<'a> &'a T: Mirror<Image=U>
-   |                                 ^^^^^^^
+error: unknown debugging option: `borrowck`
 
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/associated-types/higher-ranked-projection.rs b/src/test/ui/associated-types/higher-ranked-projection.rs
index 8b1046b6bbc..7e6c509a272 100644
--- a/src/test/ui/associated-types/higher-ranked-projection.rs
+++ b/src/test/ui/associated-types/higher-ranked-projection.rs
@@ -1,7 +1,5 @@
-// ignore-compare-mode-nll
-// revisions: good badbase badnll
+// revisions: good bad
 //[good] check-pass
-// [badnll]compile-flags: -Zborrowck=mir
 
 trait Mirror {
     type Image;
@@ -11,7 +9,7 @@ impl<T> Mirror for T {
     type Image = T;
 }
 
-#[cfg(any(badbase, badnll))]
+#[cfg(bad)]
 fn foo<U, T>(_t: T)
     where for<'a> &'a T: Mirror<Image=U>
 {}
@@ -23,6 +21,5 @@ fn foo<U, T>(_t: T)
 
 fn main() {
     foo(());
-    //[badbase]~^ ERROR mismatched types
-    //[badnll]~^^ ERROR mismatched types
+    //[bad]~^ ERROR mismatched types
 }
diff --git a/src/test/ui/ast-json/ast-json-ice.rs b/src/test/ui/ast-json/ast-json-ice.rs
deleted file mode 100644
index ce93e4b5d4b..00000000000
--- a/src/test/ui/ast-json/ast-json-ice.rs
+++ /dev/null
@@ -1,56 +0,0 @@
-// Test that AST json serialization doesn't ICE (#63728).
-
-// revisions: expand noexpand
-
-//[expand] compile-flags: -Zast-json
-//[noexpand] compile-flags: -Zast-json-noexpand
-
-// check-pass
-// dont-check-compiler-stdout - don't check for any AST change.
-
-enum V {
-    A(i32),
-    B { f: [i64; 3 + 4] }
-}
-
-trait X {
-    type Output;
-    fn read(&self) -> Self::Output;
-    fn write(&mut self, _: Self::Output);
-}
-
-macro_rules! call_println {
-    ($y:ident) => { println!("{}", $y) }
-}
-
-fn main() {
-    let x: (i32) = 35;
-    let y = x as i64<> + 5;
-
-    call_println!(y);
-
-    struct A;
-}
-
-// Regressions tests for issues #78398 and #78510 (captured tokens in associated and foreign items)
-
-struct S;
-
-macro_rules! mac_extern {
-    ($i:item) => {
-        extern "C" { $i }
-    }
-}
-macro_rules! mac_assoc {
-    ($i:item) => {
-        impl S { $i }
-        trait Bar { $i }
-    }
-}
-
-mac_extern! {
-    fn foo();
-}
-mac_assoc! {
-    fn foo() {}
-}
diff --git a/src/test/ui/ast-json/ast-json-noexpand-output.rs b/src/test/ui/ast-json/ast-json-noexpand-output.rs
deleted file mode 100644
index cba539f0065..00000000000
--- a/src/test/ui/ast-json/ast-json-noexpand-output.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-// Check that AST json printing works.
-#![crate_type = "lib"]
-
-// check-pass
-// compile-flags: -Zast-json-noexpand
-// normalize-stdout-test ":\d+" -> ":0"
-
-// Only include a single item to reduce how often the test output needs
-// updating.
-extern crate core;
diff --git a/src/test/ui/ast-json/ast-json-noexpand-output.stdout b/src/test/ui/ast-json/ast-json-noexpand-output.stdout
deleted file mode 100644
index 6f6e9b38e94..00000000000
--- a/src/test/ui/ast-json/ast-json-noexpand-output.stdout
+++ /dev/null
@@ -1 +0,0 @@
-{"attrs":[{"kind":{"variant":"Normal","fields":[{"path":{"span":{"lo":0,"hi":0},"segments":[{"ident":{"name":"crate_type","span":{"lo":0,"hi":0}},"id":0,"args":null}],"tokens":null},"args":{"variant":"Eq","fields":[{"lo":0,"hi":0},{"variant":"Ast","fields":[{"id":0,"kind":{"variant":"Lit","fields":[{"token":{"kind":"Str","symbol":"lib","suffix":null},"kind":{"variant":"Str","fields":["lib","Cooked"]},"span":{"lo":0,"hi":0}}]},"span":{"lo":0,"hi":0},"attrs":{"0":null},"tokens":{"0":[[{"variant":"Token","fields":[{"kind":{"variant":"Literal","fields":[{"kind":"Str","symbol":"lib","suffix":null}]},"span":{"lo":0,"hi":0}}]},"Alone"]]}}]}]},"tokens":null},{"0":[[{"variant":"Token","fields":[{"kind":"Pound","span":{"lo":0,"hi":0}}]},"Joint"],[{"variant":"Token","fields":[{"kind":"Not","span":{"lo":0,"hi":0}}]},"Alone"],[{"variant":"Delimited","fields":[{"open":{"lo":0,"hi":0},"close":{"lo":0,"hi":0}},"Bracket",{"0":[[{"variant":"Token","fields":[{"kind":{"variant":"Ident","fields":["crate_type",false]},"span":{"lo":0,"hi":0}}]},"Alone"],[{"variant":"Token","fields":[{"kind":"Eq","span":{"lo":0,"hi":0}}]},"Alone"],[{"variant":"Token","fields":[{"kind":{"variant":"Literal","fields":[{"kind":"Str","symbol":"lib","suffix":null}]},"span":{"lo":0,"hi":0}}]},"Alone"]]}]},"Alone"]]}]},"id":null,"style":"Inner","span":{"lo":0,"hi":0}}],"items":[{"attrs":[],"id":0,"span":{"lo":0,"hi":0},"vis":{"kind":"Inherited","span":{"lo":0,"hi":0},"tokens":null},"ident":{"name":"core","span":{"lo":0,"hi":0}},"kind":{"variant":"ExternCrate","fields":[null]},"tokens":null}],"spans":{"inner_span":{"lo":0,"hi":0},"inject_use_span":{"lo":0,"hi":0}},"id":0,"is_placeholder":false}
diff --git a/src/test/ui/ast-json/ast-json-output.rs b/src/test/ui/ast-json/ast-json-output.rs
deleted file mode 100644
index 2e009149ed6..00000000000
--- a/src/test/ui/ast-json/ast-json-output.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-// Check that AST json printing works.
-#![crate_type = "lib"]
-
-// check-pass
-// compile-flags: -Zast-json
-// normalize-stdout-test ":\d+" -> ":0"
-
-// Only include a single item to reduce how often the test output needs
-// updating.
-extern crate core;
diff --git a/src/test/ui/ast-json/ast-json-output.stdout b/src/test/ui/ast-json/ast-json-output.stdout
deleted file mode 100644
index 5637ce596b3..00000000000
--- a/src/test/ui/ast-json/ast-json-output.stdout
+++ /dev/null
@@ -1 +0,0 @@
-{"attrs":[{"kind":{"variant":"Normal","fields":[{"path":{"span":{"lo":0,"hi":0},"segments":[{"ident":{"name":"crate_type","span":{"lo":0,"hi":0}},"id":0,"args":null}],"tokens":null},"args":{"variant":"Eq","fields":[{"lo":0,"hi":0},{"variant":"Ast","fields":[{"id":0,"kind":{"variant":"Lit","fields":[{"token":{"kind":"Str","symbol":"lib","suffix":null},"kind":{"variant":"Str","fields":["lib","Cooked"]},"span":{"lo":0,"hi":0}}]},"span":{"lo":0,"hi":0},"attrs":{"0":null},"tokens":{"0":[[{"variant":"Token","fields":[{"kind":{"variant":"Literal","fields":[{"kind":"Str","symbol":"lib","suffix":null}]},"span":{"lo":0,"hi":0}}]},"Alone"]]}}]}]},"tokens":null},{"0":[[{"variant":"Token","fields":[{"kind":"Pound","span":{"lo":0,"hi":0}}]},"Joint"],[{"variant":"Token","fields":[{"kind":"Not","span":{"lo":0,"hi":0}}]},"Alone"],[{"variant":"Delimited","fields":[{"open":{"lo":0,"hi":0},"close":{"lo":0,"hi":0}},"Bracket",{"0":[[{"variant":"Token","fields":[{"kind":{"variant":"Ident","fields":["crate_type",false]},"span":{"lo":0,"hi":0}}]},"Alone"],[{"variant":"Token","fields":[{"kind":"Eq","span":{"lo":0,"hi":0}}]},"Alone"],[{"variant":"Token","fields":[{"kind":{"variant":"Literal","fields":[{"kind":"Str","symbol":"lib","suffix":null}]},"span":{"lo":0,"hi":0}}]},"Alone"]]}]},"Alone"]]}]},"id":null,"style":"Inner","span":{"lo":0,"hi":0}}],"items":[{"attrs":[{"kind":{"variant":"Normal","fields":[{"path":{"span":{"lo":0,"hi":0},"segments":[{"ident":{"name":"prelude_import","span":{"lo":0,"hi":0}},"id":0,"args":null}],"tokens":null},"args":"Empty","tokens":null},null]},"id":null,"style":"Outer","span":{"lo":0,"hi":0}}],"id":0,"span":{"lo":0,"hi":0},"vis":{"kind":"Inherited","span":{"lo":0,"hi":0},"tokens":null},"ident":{"name":"","span":{"lo":0,"hi":0}},"kind":{"variant":"Use","fields":[{"prefix":{"span":{"lo":0,"hi":0},"segments":[{"ident":{"name":"{{root}}","span":{"lo":0,"hi":0}},"id":0,"args":null},{"ident":{"name":"std","span":{"lo":0,"hi":0}},"id":0,"args":null},{"ident":{"name":"prelude","span":{"lo":0,"hi":0}},"id":0,"args":null},{"ident":{"name":"rust_2015","span":{"lo":0,"hi":0}},"id":0,"args":null}],"tokens":null},"kind":"Glob","span":{"lo":0,"hi":0}}]},"tokens":null},{"attrs":[{"kind":{"variant":"Normal","fields":[{"path":{"span":{"lo":0,"hi":0},"segments":[{"ident":{"name":"macro_use","span":{"lo":0,"hi":0}},"id":0,"args":null}],"tokens":null},"args":"Empty","tokens":null},null]},"id":null,"style":"Outer","span":{"lo":0,"hi":0}}],"id":0,"span":{"lo":0,"hi":0},"vis":{"kind":"Inherited","span":{"lo":0,"hi":0},"tokens":null},"ident":{"name":"std","span":{"lo":0,"hi":0}},"kind":{"variant":"ExternCrate","fields":[null]},"tokens":null},{"attrs":[],"id":0,"span":{"lo":0,"hi":0},"vis":{"kind":"Inherited","span":{"lo":0,"hi":0},"tokens":null},"ident":{"name":"core","span":{"lo":0,"hi":0}},"kind":{"variant":"ExternCrate","fields":[null]},"tokens":null}],"spans":{"inner_span":{"lo":0,"hi":0},"inject_use_span":{"lo":0,"hi":0}},"id":0,"is_placeholder":false}
diff --git a/src/test/ui/async-await/issue-76547.base.stderr b/src/test/ui/async-await/issue-76547.base.stderr
deleted file mode 100644
index 109883fbeb7..00000000000
--- a/src/test/ui/async-await/issue-76547.base.stderr
+++ /dev/null
@@ -1,31 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/issue-76547.rs:24:13
-   |
-LL | async fn fut(bufs: &mut [&mut [u8]]) {
-   |                    ---------------- these two types are declared with different lifetimes...
-LL |     ListFut(bufs).await
-   |             ^^^^ ...but data from `bufs` flows into `bufs` here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter
-   |
-LL | async fn fut<'a>(bufs: &'a mut [&'a mut [u8]]) {
-   |             ++++        ++       ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/issue-76547.rs:39:14
-   |
-LL | async fn fut2(bufs: &mut [&mut [u8]]) -> i32 {
-   |                     ---------------- these two types are declared with different lifetimes...
-LL |     ListFut2(bufs).await
-   |              ^^^^ ...but data from `bufs` flows into `bufs` here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter
-   |
-LL | async fn fut2<'a>(bufs: &'a mut [&'a mut [u8]]) -> i32 {
-   |              ++++        ++       ++
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/async-await/issue-76547.rs b/src/test/ui/async-await/issue-76547.rs
index 45c7ab63135..587feb6247c 100644
--- a/src/test/ui/async-await/issue-76547.rs
+++ b/src/test/ui/async-await/issue-76547.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 // Test for diagnostic improvement issue #76547
 // edition:2018
 
@@ -22,8 +18,7 @@ impl<'a> Future for ListFut<'a> {
 
 async fn fut(bufs: &mut [&mut [u8]]) {
     ListFut(bufs).await
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 pub struct ListFut2<'a>(&'a mut [&'a mut [u8]]);
@@ -37,8 +32,7 @@ impl<'a> Future for ListFut2<'a> {
 
 async fn fut2(bufs: &mut [&mut [u8]]) -> i32 {
     ListFut2(bufs).await
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/async-await/issue-76547.nll.stderr b/src/test/ui/async-await/issue-76547.stderr
index 0a5a52cb79e..4d96cce824b 100644
--- a/src/test/ui/async-await/issue-76547.nll.stderr
+++ b/src/test/ui/async-await/issue-76547.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-76547.rs:24:13
+  --> $DIR/issue-76547.rs:20:13
    |
 LL | async fn fut(bufs: &mut [&mut [u8]]) {
    |                    -     - let's call the lifetime of this reference `'2`
@@ -14,7 +14,7 @@ LL | async fn fut<'a>(bufs: &'a mut [&'a mut [u8]]) {
    |             ++++        ++       ++
 
 error: lifetime may not live long enough
-  --> $DIR/issue-76547.rs:39:14
+  --> $DIR/issue-76547.rs:34:14
    |
 LL | async fn fut2(bufs: &mut [&mut [u8]]) -> i32 {
    |                     -     - let's call the lifetime of this reference `'2`
diff --git a/src/test/ui/async-await/issues/issue-62097.base.stderr b/src/test/ui/async-await/issues/issue-62097.base.stderr
deleted file mode 100644
index 7577b95fa2e..00000000000
--- a/src/test/ui/async-await/issues/issue-62097.base.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error[E0759]: `self` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/issue-62097.rs:16:31
-   |
-LL |     pub async fn run_dummy_fn(&self) {
-   |                               ^^^^^ this data with an anonymous lifetime `'_`...
-LL |
-LL |         foo(|| self.bar()).await;
-   |         --- ...is used and required to live as long as `'static` here
-   |
-note: `'static` lifetime requirement introduced by this bound
-  --> $DIR/issue-62097.rs:8:19
-   |
-LL |     F: FnOnce() + 'static
-   |                   ^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0759`.
diff --git a/src/test/ui/async-await/issues/issue-62097.rs b/src/test/ui/async-await/issues/issue-62097.rs
index d2260cd68c1..a24c84cffc7 100644
--- a/src/test/ui/async-await/issues/issue-62097.rs
+++ b/src/test/ui/async-await/issues/issue-62097.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 // edition:2018
 async fn foo<F>(fun: F)
 where
@@ -14,10 +10,9 @@ struct Struct;
 
 impl Struct {
     pub async fn run_dummy_fn(&self) {
-        //[base]~^ ERROR E0759
         foo(|| self.bar()).await;
-        //[nll]~^ ERROR closure may outlive the current function
-        //[nll]~| ERROR borrowed data escapes outside of associated function
+        //~^ ERROR closure may outlive the current function
+        //~| ERROR borrowed data escapes outside of associated function
     }
 
     pub fn bar(&self) {}
diff --git a/src/test/ui/async-await/issues/issue-62097.nll.stderr b/src/test/ui/async-await/issues/issue-62097.stderr
index b2b7c46d348..786f6213260 100644
--- a/src/test/ui/async-await/issues/issue-62097.nll.stderr
+++ b/src/test/ui/async-await/issues/issue-62097.stderr
@@ -1,5 +1,5 @@
 error[E0373]: closure may outlive the current function, but it borrows `self`, which is owned by the current function
-  --> $DIR/issue-62097.rs:18:13
+  --> $DIR/issue-62097.rs:13:13
    |
 LL |         foo(|| self.bar()).await;
    |             ^^ ---- `self` is borrowed here
@@ -7,7 +7,7 @@ LL |         foo(|| self.bar()).await;
    |             may outlive borrowed value `self`
    |
 note: function requires argument type to outlive `'static`
-  --> $DIR/issue-62097.rs:18:9
+  --> $DIR/issue-62097.rs:13:9
    |
 LL |         foo(|| self.bar()).await;
    |         ^^^^^^^^^^^^^^^^^^
@@ -17,14 +17,13 @@ LL |         foo(move || self.bar()).await;
    |             ++++
 
 error[E0521]: borrowed data escapes outside of associated function
-  --> $DIR/issue-62097.rs:18:9
+  --> $DIR/issue-62097.rs:13:9
    |
 LL |     pub async fn run_dummy_fn(&self) {
    |                               -----
    |                               |
    |                               `self` is a reference that is only valid in the associated function body
    |                               let's call the lifetime of this reference `'1`
-LL |
 LL |         foo(|| self.bar()).await;
    |         ^^^^^^^^^^^^^^^^^^
    |         |
diff --git a/src/test/ui/async-await/issues/issue-63388-1.base.stderr b/src/test/ui/async-await/issues/issue-63388-1.base.stderr
deleted file mode 100644
index f5409a7ca5d..00000000000
--- a/src/test/ui/async-await/issues/issue-63388-1.base.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0621]: explicit lifetime required in the type of `foo`
-  --> $DIR/issue-63388-1.rs:19:9
-   |
-LL |         &'a self, foo: &dyn Foo
-   |                        -------- help: add explicit lifetime `'a` to the type of `foo`: `&'a (dyn Foo + 'a)`
-...
-LL |         foo
-   |         ^^^ lifetime `'a` required
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0621`.
diff --git a/src/test/ui/async-await/issues/issue-63388-1.rs b/src/test/ui/async-await/issues/issue-63388-1.rs
index f00f9295406..32bcbb11116 100644
--- a/src/test/ui/async-await/issues/issue-63388-1.rs
+++ b/src/test/ui/async-await/issues/issue-63388-1.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 // edition:2018
 
 struct Xyz {
@@ -15,9 +11,8 @@ impl Xyz {
         &'a self, foo: &dyn Foo
     ) -> &dyn Foo
     {
-        //[nll]~^ ERROR explicit lifetime required in the type of `foo` [E0621]
+        //~^ ERROR explicit lifetime required in the type of `foo` [E0621]
         foo
-        //[base]~^ ERROR explicit lifetime required in the type of `foo` [E0621]
     }
 }
 
diff --git a/src/test/ui/async-await/issues/issue-63388-1.nll.stderr b/src/test/ui/async-await/issues/issue-63388-1.stderr
index 9263a81bb6a..88542315ec0 100644
--- a/src/test/ui/async-await/issues/issue-63388-1.nll.stderr
+++ b/src/test/ui/async-await/issues/issue-63388-1.stderr
@@ -1,5 +1,5 @@
 error[E0621]: explicit lifetime required in the type of `foo`
-  --> $DIR/issue-63388-1.rs:17:5
+  --> $DIR/issue-63388-1.rs:13:5
    |
 LL |           &'a self, foo: &dyn Foo
    |                          -------- help: add explicit lifetime `'a` to the type of `foo`: `&'a (dyn Foo + 'a)`
@@ -7,7 +7,6 @@ LL |       ) -> &dyn Foo
 LL | /     {
 LL | |
 LL | |         foo
-LL | |
 LL | |     }
    | |_____^ lifetime `'a` required
 
diff --git a/src/test/ui/async-await/issues/issue-72312.base.stderr b/src/test/ui/async-await/issues/issue-72312.base.stderr
deleted file mode 100644
index a4bdc447f65..00000000000
--- a/src/test/ui/async-await/issues/issue-72312.base.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-error[E0759]: `self` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/issue-72312.rs:14:24
-   |
-LL |     pub async fn start(&self) {
-   |                        ^^^^^ this data with an anonymous lifetime `'_`...
-...
-LL |             &self;
-   |             ----- ...is used here...
-   |
-note: ...and is required to live as long as `'static` here
-  --> $DIR/issue-72312.rs:20:9
-   |
-LL |         require_static(async move {
-   |         ^^^^^^^^^^^^^^
-note: `'static` lifetime requirement introduced by this bound
-  --> $DIR/issue-72312.rs:6:22
-   |
-LL | fn require_static<T: 'static>(val: T) -> T {
-   |                      ^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0759`.
diff --git a/src/test/ui/async-await/issues/issue-72312.rs b/src/test/ui/async-await/issues/issue-72312.rs
index c1eceefd643..74122cf00a9 100644
--- a/src/test/ui/async-await/issues/issue-72312.rs
+++ b/src/test/ui/async-await/issues/issue-72312.rs
@@ -1,10 +1,5 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 // edition:2018
 fn require_static<T: 'static>(val: T) -> T {
-    //[base]~^ NOTE 'static` lifetime requirement introduced by this bound
     val
 }
 
@@ -12,17 +7,13 @@ struct Problem;
 
 impl Problem {
     pub async fn start(&self) {
-        //[base]~^ ERROR E0759
-        //[base]~| NOTE this data with an anonymous lifetime `'_`
-        //[base]~| NOTE in this expansion of desugaring of `async` block or function
-        //[nll]~^^^^ NOTE let's call
-        //[nll]~| NOTE `self` is a reference
+        //~^ NOTE let's call
+        //~| NOTE `self` is a reference
         require_static(async move {
-            //[base]~^ NOTE ...and is required to live as long as `'static` here
-            //[nll]~^^ ERROR borrowed data escapes
-            //[nll]~| NOTE `self` escapes
-            //[nll]~| NOTE argument requires
-            &self; //[base]~ NOTE ...is used here...
+            //~^ ERROR borrowed data escapes
+            //~| NOTE `self` escapes
+            //~| NOTE argument requires
+            &self;
         });
     }
 }
diff --git a/src/test/ui/async-await/issues/issue-72312.nll.stderr b/src/test/ui/async-await/issues/issue-72312.stderr
index 02e47721e0c..aa947b69003 100644
--- a/src/test/ui/async-await/issues/issue-72312.nll.stderr
+++ b/src/test/ui/async-await/issues/issue-72312.stderr
@@ -1,5 +1,5 @@
 error[E0521]: borrowed data escapes outside of associated function
-  --> $DIR/issue-72312.rs:20:9
+  --> $DIR/issue-72312.rs:12:9
    |
 LL |       pub async fn start(&self) {
    |                          -----
@@ -11,7 +11,6 @@ LL | /         require_static(async move {
 LL | |
 LL | |
 LL | |
-LL | |
 LL | |             &self;
 LL | |         });
    | |          ^
diff --git a/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.base.stderr b/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.base.stderr
deleted file mode 100644
index 907c1f6c407..00000000000
--- a/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.base.stderr
+++ /dev/null
@@ -1,34 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ret-impl-trait-one.rs:14:85
-   |
-LL |   async fn async_ret_impl_trait3<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> + 'b {
-   |  ______________________________________________________------_____-------------------_^
-   | |                                                      |
-   | |                                                      this parameter and the return type are declared with different lifetimes...
-LL | |
-LL | |
-LL | |     (a, b)
-LL | | }
-   | |_^ ...but data from `a` is returned here
-
-error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
-  --> $DIR/ret-impl-trait-one.rs:21:80
-   |
-LL |   async fn async_ret_impl_trait1<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> {
-   |  ____________________________________--__________________________________________^
-   | |                                    |
-   | |                                    hidden type `(&'a u8, &'b u8)` captures the lifetime `'b` as defined here
-LL | |
-LL | |     (a, b)
-LL | | }
-   | |_^
-   |
-help: to declare that the `impl Trait` captures `'b`, you can add an explicit `'b` lifetime bound
-   |
-LL | async fn async_ret_impl_trait1<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> + 'b {
-   |                                                                                ++++
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0623, E0700.
-For more information about an error, try `rustc --explain E0623`.
diff --git a/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.rs b/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.rs
index f4c309b4c10..aebc77d265e 100644
--- a/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.rs
+++ b/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 // edition:2018
 
 // Test that a feature gate is needed to use `impl Trait` as the
@@ -12,8 +8,7 @@ impl<T> Trait<'_> for T { }
 
 // Fails to recognize that both 'a and 'b are mentioned and should thus be accepted
 async fn async_ret_impl_trait3<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> + 'b {
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
     (a, b)
 }
 
diff --git a/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.nll.stderr b/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr
index dbf7293a389..cdb141c0e3e 100644
--- a/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.nll.stderr
+++ b/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ret-impl-trait-one.rs:14:85
+  --> $DIR/ret-impl-trait-one.rs:10:85
    |
 LL |   async fn async_ret_impl_trait3<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> + 'b {
    |  ________________________________--__--_______________________________________________^
@@ -7,7 +7,6 @@ LL |   async fn async_ret_impl_trait3<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trai
    | |                                |   lifetime `'b` defined here
    | |                                lifetime `'a` defined here
 LL | |
-LL | |
 LL | |     (a, b)
 LL | | }
    | |_^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
@@ -15,7 +14,7 @@ LL | | }
    = help: consider adding the following bound: `'a: 'b`
 
 error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
-  --> $DIR/ret-impl-trait-one.rs:21:80
+  --> $DIR/ret-impl-trait-one.rs:16:80
    |
 LL |   async fn async_ret_impl_trait1<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> {
    |  ____________________________________--__________________________________________^
diff --git a/src/test/ui/attributes/attrs-on-params.rs b/src/test/ui/attributes/attrs-on-params.rs
index 0e606eac1e8..158a4500bde 100644
--- a/src/test/ui/attributes/attrs-on-params.rs
+++ b/src/test/ui/attributes/attrs-on-params.rs
@@ -2,7 +2,7 @@
 
 fn function(#[inline] param: u32) {
     //~^ ERROR attribute should be applied to function or closure
-    //~| ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes
+    //~| ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes
 }
 
 fn main() {}
diff --git a/src/test/ui/attributes/attrs-on-params.stderr b/src/test/ui/attributes/attrs-on-params.stderr
index 003f43d371a..306e862cb58 100644
--- a/src/test/ui/attributes/attrs-on-params.stderr
+++ b/src/test/ui/attributes/attrs-on-params.stderr
@@ -1,4 +1,4 @@
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/attrs-on-params.rs:3:13
    |
 LL | fn function(#[inline] param: u32) {
diff --git a/src/test/ui/borrowck/borrowck-drop-from-guard.rs b/src/test/ui/borrowck/borrowck-drop-from-guard.rs
index 67a2275dcf7..4995029a70f 100644
--- a/src/test/ui/borrowck/borrowck-drop-from-guard.rs
+++ b/src/test/ui/borrowck/borrowck-drop-from-guard.rs
@@ -1,5 +1,3 @@
-//compile-flags: -Z borrowck=mir
-
 fn foo(_:String) {}
 
 fn main()
diff --git a/src/test/ui/borrowck/borrowck-drop-from-guard.stderr b/src/test/ui/borrowck/borrowck-drop-from-guard.stderr
index 77dda0a32b3..cd0d2fee942 100644
--- a/src/test/ui/borrowck/borrowck-drop-from-guard.stderr
+++ b/src/test/ui/borrowck/borrowck-drop-from-guard.stderr
@@ -1,5 +1,5 @@
 error[E0382]: use of moved value: `my_str`
-  --> $DIR/borrowck-drop-from-guard.rs:11:23
+  --> $DIR/borrowck-drop-from-guard.rs:9:23
    |
 LL |     let my_str = "hello".to_owned();
    |         ------ move occurs because `my_str` has type `String`, which does not implement the `Copy` trait
diff --git a/src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.edition.stderr b/src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.edition.stderr
deleted file mode 100644
index d88185af778..00000000000
--- a/src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.edition.stderr
+++ /dev/null
@@ -1,13 +0,0 @@
-error[E0507]: cannot move out of `foo` in pattern guard
-  --> $DIR/borrowck-feature-nll-overrides-migrate.rs:22:18
-   |
-LL |                 (|| { let bar = foo; bar.take() })();
-   |                  ^^             --- move occurs because `foo` has type `&mut Option<&i32>`, which does not implement the `Copy` trait
-   |                  |
-   |                  move out of `foo` occurs here
-   |
-   = note: variables bound in patterns cannot be moved from until after the end of the pattern guard
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0507`.
diff --git a/src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.rs b/src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.rs
deleted file mode 100644
index 51f2ff75da8..00000000000
--- a/src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.rs
+++ /dev/null
@@ -1,30 +0,0 @@
-// This is a test that the `#![feature(nll)]` opt-in overrides the
-// migration mode. The intention here is to emulate the goal behavior
-// that `--edition 2018` effects on borrowck (modeled here by `-Z
-// borrowck=migrate`) are themselves overridden by the
-// `#![feature(nll)]` opt-in.
-//
-// Therefore, for developer convenience, under `#[feature(nll)]` the
-// NLL checks will be emitted as errors *even* in the presence of `-Z
-// borrowck=migrate`.
-
-// revisions: zflag edition
-//[zflag]compile-flags: -Z borrowck=migrate
-//[edition]edition:2018
-
-#![feature(nll)]
-
-fn main() {
-    match Some(&4) {
-        None => {},
-        ref mut foo
-            if {
-                (|| { let bar = foo; bar.take() })();
-                //[zflag]~^ ERROR cannot move out of `foo` in pattern guard [E0507]
-                //[edition]~^^ ERROR cannot move out of `foo` in pattern guard [E0507]
-                false
-            } => {},
-        Some(ref _s) => println!("Note this arm is bogus; the `Some` became `None` in the guard."),
-        _ => println!("Here is some supposedly unreachable code."),
-    }
-}
diff --git a/src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.zflag.stderr b/src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.zflag.stderr
deleted file mode 100644
index d88185af778..00000000000
--- a/src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.zflag.stderr
+++ /dev/null
@@ -1,13 +0,0 @@
-error[E0507]: cannot move out of `foo` in pattern guard
-  --> $DIR/borrowck-feature-nll-overrides-migrate.rs:22:18
-   |
-LL |                 (|| { let bar = foo; bar.take() })();
-   |                  ^^             --- move occurs because `foo` has type `&mut Option<&i32>`, which does not implement the `Copy` trait
-   |                  |
-   |                  move out of `foo` occurs here
-   |
-   = note: variables bound in patterns cannot be moved from until after the end of the pattern guard
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0507`.
diff --git a/src/test/ui/borrowck/borrowck-local-borrow.rs b/src/test/ui/borrowck/borrowck-local-borrow.rs
index ea4589338c4..0aaa4e4c684 100644
--- a/src/test/ui/borrowck/borrowck-local-borrow.rs
+++ b/src/test/ui/borrowck/borrowck-local-borrow.rs
@@ -2,9 +2,6 @@
 // error-pattern:panic 1
 // ignore-emscripten no processes
 
-// revisions: migrate mir
-//[mir]compile-flags: -Z borrowck=mir
-
 fn main() {
     let x = 2;
     let y = &x;
diff --git a/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.base.stderr b/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.base.stderr
deleted file mode 100644
index 3d6d00a0f95..00000000000
--- a/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.base.stderr
+++ /dev/null
@@ -1,13 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/borrowck-reborrow-from-shorter-lived-andmut.rs:13:5
-   |
-LL | fn copy_borrowed_ptr<'a,'b>(p: &'a mut S<'b>) -> S<'b> {
-   |                                -------------     -----
-   |                                |
-   |                                this parameter and the return type are declared with different lifetimes...
-LL |     S { pointer: &mut *p.pointer }
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...but data from `p` is returned here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.rs b/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.rs
index 60101d06820..779cb3bbec1 100644
--- a/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.rs
+++ b/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 // Test that assignments to an `&mut` pointer which is found in a
 // borrowed (but otherwise non-aliasable) location is illegal.
 
@@ -11,8 +7,7 @@ struct S<'a> {
 
 fn copy_borrowed_ptr<'a,'b>(p: &'a mut S<'b>) -> S<'b> {
     S { pointer: &mut *p.pointer }
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.nll.stderr b/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.stderr
index 7c4de57320e..f28c42ce2d5 100644
--- a/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.nll.stderr
+++ b/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/borrowck-reborrow-from-shorter-lived-andmut.rs:13:5
+  --> $DIR/borrowck-reborrow-from-shorter-lived-andmut.rs:9:5
    |
 LL | fn copy_borrowed_ptr<'a,'b>(p: &'a mut S<'b>) -> S<'b> {
    |                      -- -- lifetime `'b` defined here
diff --git a/src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.nll.stderr b/src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.nll.stderr
deleted file mode 100644
index 10400cff5e5..00000000000
--- a/src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.nll.stderr
+++ /dev/null
@@ -1,54 +0,0 @@
-error[E0594]: cannot assign to `x`, as it is not declared as mutable
-  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:17:46
-   |
-LL |     pub fn e(x: &'static mut isize) {
-   |              - help: consider changing this to be mutable: `mut x`
-LL |         static mut Y: isize = 3;
-LL |         let mut c1 = |y: &'static mut isize| x = y;
-   |                                              ^^^^^ cannot assign
-
-error[E0594]: cannot assign to `x`, as it is not declared as mutable
-  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:28:50
-   |
-LL |     pub fn ee(x: &'static mut isize) {
-   |               - help: consider changing this to be mutable: `mut x`
-...
-LL |             let mut c2 = |y: &'static mut isize| x = y;
-   |                                                  ^^^^^ cannot assign
-
-error[E0594]: cannot assign to `x`, as it is not declared as mutable
-  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:40:14
-   |
-LL |     pub fn capture_assign_whole(x: (i32,)) {
-   |                                 - help: consider changing this to be mutable: `mut x`
-LL |         || { x = (1,); };
-   |              ^^^^^^^^ cannot assign
-
-error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
-  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:45:14
-   |
-LL |     pub fn capture_assign_part(x: (i32,)) {
-   |                                - help: consider changing this to be mutable: `mut x`
-LL |         || { x.0 = 1; };
-   |              ^^^^^^^ cannot assign
-
-error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
-  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:50:14
-   |
-LL |     pub fn capture_reborrow_whole(x: (i32,)) {
-   |                                   - help: consider changing this to be mutable: `mut x`
-LL |         || { &mut x; };
-   |              ^^^^^^ cannot borrow as mutable
-
-error[E0596]: cannot borrow `x.0` as mutable, as `x` is not declared as mutable
-  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:55:14
-   |
-LL |     pub fn capture_reborrow_part(x: (i32,)) {
-   |                                  - help: consider changing this to be mutable: `mut x`
-LL |         || { &mut x.0; };
-   |              ^^^^^^^^ cannot borrow as mutable
-
-error: aborting due to 6 previous errors
-
-Some errors have detailed explanations: E0594, E0596.
-For more information about an error, try `rustc --explain E0594`.
diff --git a/src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs b/src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs
index fe7ed8ed3fa..b3cce1b3a06 100644
--- a/src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs
+++ b/src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs
@@ -2,21 +2,12 @@
 // analysis of a closure body may only be caught when AST-borrowck
 // looks at some parent.
 
-// revisions: migrate nll
-//[nll]compile-flags: -Z borrowck=mir
-
-// Since we are testing nll (and migration) explicitly as a separate
-// revisions, don't worry about the --compare-mode=nll on this test.
-
-// ignore-compare-mode-nll
-
 // transcribed from borrowck-closures-unique.rs
 mod borrowck_closures_unique {
     pub fn e(x: &'static mut isize) {
         static mut Y: isize = 3;
         let mut c1 = |y: &'static mut isize| x = y;
-        //[migrate]~^ ERROR is not declared as mutable
-        //[nll]~^^ ERROR is not declared as mutable
+        //~^ ERROR is not declared as mutable
         unsafe { c1(&mut Y); }
     }
 }
@@ -26,8 +17,7 @@ mod borrowck_closures_unique_grandparent {
         static mut Z: isize = 3;
         let mut c1 = |z: &'static mut isize| {
             let mut c2 = |y: &'static mut isize| x = y;
-        //[migrate]~^ ERROR is not declared as mutable
-        //[nll]~^^ ERROR is not declared as mutable
+        //~^ ERROR is not declared as mutable
             c2(z);
         };
         unsafe { c1(&mut Z); }
@@ -38,23 +28,19 @@ mod borrowck_closures_unique_grandparent {
 mod mutability_errors {
     pub fn capture_assign_whole(x: (i32,)) {
         || { x = (1,); };
-        //[migrate]~^ ERROR is not declared as mutable
-        //[nll]~^^ ERROR is not declared as mutable
+        //~^ ERROR is not declared as mutable
     }
     pub fn capture_assign_part(x: (i32,)) {
         || { x.0 = 1; };
-        //[migrate]~^ ERROR is not declared as mutable
-        //[nll]~^^ ERROR is not declared as mutable
+        //~^ ERROR is not declared as mutable
     }
     pub fn capture_reborrow_whole(x: (i32,)) {
         || { &mut x; };
-        //[migrate]~^ ERROR is not declared as mutable
-        //[nll]~^^ ERROR is not declared as mutable
+        //~^ ERROR is not declared as mutable
     }
     pub fn capture_reborrow_part(x: (i32,)) {
         || { &mut x.0; };
-        //[migrate]~^ ERROR is not declared as mutable
-        //[nll]~^^ ERROR is not declared as mutable
+        //~^ ERROR is not declared as mutable
     }
 }
 
diff --git a/src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.migrate.stderr b/src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr
index 10400cff5e5..4c299cdc455 100644
--- a/src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.migrate.stderr
+++ b/src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr
@@ -1,5 +1,5 @@
 error[E0594]: cannot assign to `x`, as it is not declared as mutable
-  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:17:46
+  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:9:46
    |
 LL |     pub fn e(x: &'static mut isize) {
    |              - help: consider changing this to be mutable: `mut x`
@@ -8,7 +8,7 @@ LL |         let mut c1 = |y: &'static mut isize| x = y;
    |                                              ^^^^^ cannot assign
 
 error[E0594]: cannot assign to `x`, as it is not declared as mutable
-  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:28:50
+  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:19:50
    |
 LL |     pub fn ee(x: &'static mut isize) {
    |               - help: consider changing this to be mutable: `mut x`
@@ -17,7 +17,7 @@ LL |             let mut c2 = |y: &'static mut isize| x = y;
    |                                                  ^^^^^ cannot assign
 
 error[E0594]: cannot assign to `x`, as it is not declared as mutable
-  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:40:14
+  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:30:14
    |
 LL |     pub fn capture_assign_whole(x: (i32,)) {
    |                                 - help: consider changing this to be mutable: `mut x`
@@ -25,7 +25,7 @@ LL |         || { x = (1,); };
    |              ^^^^^^^^ cannot assign
 
 error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
-  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:45:14
+  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:34:14
    |
 LL |     pub fn capture_assign_part(x: (i32,)) {
    |                                - help: consider changing this to be mutable: `mut x`
@@ -33,7 +33,7 @@ LL |         || { x.0 = 1; };
    |              ^^^^^^^ cannot assign
 
 error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
-  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:50:14
+  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:38:14
    |
 LL |     pub fn capture_reborrow_whole(x: (i32,)) {
    |                                   - help: consider changing this to be mutable: `mut x`
@@ -41,7 +41,7 @@ LL |         || { &mut x; };
    |              ^^^^^^ cannot borrow as mutable
 
 error[E0596]: cannot borrow `x.0` as mutable, as `x` is not declared as mutable
-  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:55:14
+  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:42:14
    |
 LL |     pub fn capture_reborrow_part(x: (i32,)) {
    |                                  - help: consider changing this to be mutable: `mut x`
diff --git a/src/test/ui/borrowck/issue-71546.rs b/src/test/ui/borrowck/issue-71546.rs
index 943f7f86e55..b20c39193de 100644
--- a/src/test/ui/borrowck/issue-71546.rs
+++ b/src/test/ui/borrowck/issue-71546.rs
@@ -1,18 +1,20 @@
 // Regression test for #71546.
 
-// ignore-compare-mode-nll
-// NLL stderr is different from the original one.
-
 pub fn serialize_as_csv<V>(value: &V) -> Result<String, &str>
 where
     V: 'static,
     for<'a> &'a V: IntoIterator,
     for<'a> <&'a V as IntoIterator>::Item: ToString + 'static,
 {
-    let csv_str: String = value //~ ERROR: the associated type `<&'a V as IntoIterator>::Item` may not live long enough
+    let csv_str: String = value
+        //~^ ERROR higher-ranked lifetime error
+        //~| ERROR higher-ranked lifetime error
+        //~| ERROR higher-ranked lifetime error
         .into_iter()
         .map(|elem| elem.to_string())
+        //~^ ERROR higher-ranked lifetime error
         .collect::<String>();
+        //~^ ERROR higher-ranked lifetime error
     Ok(csv_str)
 }
 
diff --git a/src/test/ui/borrowck/issue-71546.stderr b/src/test/ui/borrowck/issue-71546.stderr
index d479ca8f1d8..b8d79f0939b 100644
--- a/src/test/ui/borrowck/issue-71546.stderr
+++ b/src/test/ui/borrowck/issue-71546.stderr
@@ -1,20 +1,59 @@
-error[E0310]: the associated type `<&'a V as IntoIterator>::Item` may not live long enough
-  --> $DIR/issue-71546.rs:12:27
+error: higher-ranked lifetime error
+  --> $DIR/issue-71546.rs:9:27
    |
 LL |       let csv_str: String = value
    |  ___________________________^
+LL | |
+LL | |
+LL | |
 LL | |         .into_iter()
 LL | |         .map(|elem| elem.to_string())
    | |_____________________________________^
    |
-   = help: consider adding an explicit lifetime bound `<&'a V as IntoIterator>::Item: 'static`...
-   = note: ...so that the type `<&'a V as IntoIterator>::Item` will meet its required lifetime bounds...
-note: ...that is required by this bound
-  --> $DIR/issue-71546.rs:10:55
+   = note: could not prove for<'r> [closure@$DIR/issue-71546.rs:14:14: 14:37] well-formed
+
+error: higher-ranked lifetime error
+  --> $DIR/issue-71546.rs:9:27
+   |
+LL |       let csv_str: String = value
+   |  ___________________________^
+LL | |
+LL | |
+LL | |
+LL | |         .into_iter()
+LL | |         .map(|elem| elem.to_string())
+   | |_____________________________________^
+   |
+   = note: could not prove for<'r, 's> Map<<&'r V as IntoIterator>::IntoIter, [closure@$DIR/issue-71546.rs:14:14: 14:37]> well-formed
+
+error: higher-ranked lifetime error
+  --> $DIR/issue-71546.rs:9:27
+   |
+LL |       let csv_str: String = value
+   |  ___________________________^
+LL | |
+LL | |
+LL | |
+...  |
+LL | |
+LL | |         .collect::<String>();
+   | |____________________________^
+   |
+   = note: could not prove for<'r, 's> Map<<&'r V as IntoIterator>::IntoIter, [closure@$DIR/issue-71546.rs:14:14: 14:37]> well-formed
+
+error: higher-ranked lifetime error
+  --> $DIR/issue-71546.rs:14:14
+   |
+LL |         .map(|elem| elem.to_string())
+   |              ^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: could not prove for<'a> <&'a V as IntoIterator>::Item: 'static
+
+error: higher-ranked lifetime error
+  --> $DIR/issue-71546.rs:16:10
    |
-LL |     for<'a> <&'a V as IntoIterator>::Item: ToString + 'static,
-   |                                                       ^^^^^^^
+LL |         .collect::<String>();
+   |          ^^^^^^^
 
-error: aborting due to previous error
+error: aborting due to 5 previous errors
 
-For more information about this error, try `rustc --explain E0310`.
diff --git a/src/test/ui/borrowck/two-phase-activation-sharing-interference.nll_target.stderr b/src/test/ui/borrowck/two-phase-activation-sharing-interference.nll_target.stderr
index 40786c032b1..aacf178932e 100644
--- a/src/test/ui/borrowck/two-phase-activation-sharing-interference.nll_target.stderr
+++ b/src/test/ui/borrowck/two-phase-activation-sharing-interference.nll_target.stderr
@@ -1,5 +1,5 @@
 error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
-  --> $DIR/two-phase-activation-sharing-interference.rs:30:15
+  --> $DIR/two-phase-activation-sharing-interference.rs:28:15
    |
 LL |     let y = &mut x;
    |             ------ mutable borrow occurs here
@@ -10,7 +10,7 @@ LL |     *y += 1;
    |     ------- mutable borrow later used here
 
 error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
-  --> $DIR/two-phase-activation-sharing-interference.rs:38:13
+  --> $DIR/two-phase-activation-sharing-interference.rs:36:13
    |
 LL |     let y = &mut x;
    |             ------ mutable borrow occurs here
@@ -21,7 +21,7 @@ LL |     *y += 1;
    |     ------- mutable borrow later used here
 
 error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
-  --> $DIR/two-phase-activation-sharing-interference.rs:49:13
+  --> $DIR/two-phase-activation-sharing-interference.rs:47:13
    |
 LL |     let y = &mut x;
    |             ------ mutable borrow occurs here
@@ -32,7 +32,7 @@ LL |     *y += 1;
    |     ------- mutable borrow later used here
 
 error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
-  --> $DIR/two-phase-activation-sharing-interference.rs:60:14
+  --> $DIR/two-phase-activation-sharing-interference.rs:58:14
    |
 LL |     let y = &mut x;
    |             ------ mutable borrow occurs here
diff --git a/src/test/ui/borrowck/two-phase-activation-sharing-interference.rs b/src/test/ui/borrowck/two-phase-activation-sharing-interference.rs
index 4d77ac915b1..8b880ff6416 100644
--- a/src/test/ui/borrowck/two-phase-activation-sharing-interference.rs
+++ b/src/test/ui/borrowck/two-phase-activation-sharing-interference.rs
@@ -1,9 +1,7 @@
 // revisions: nll_target
 
 // The following revisions are disabled due to missing support from two-phase beyond autorefs
-//[nll_beyond] compile-flags: -Z borrowck=mir -Z two-phase-beyond-autoref
-
-//[nll_target] compile-flags: -Z borrowck=mir
+//[nll_beyond] compile-flags: -Z two-phase-beyond-autoref
 
 // This is an important corner case pointed out by Niko: one is
 // allowed to initiate a shared borrow during a reservation, but it
diff --git a/src/test/ui/borrowck/two-phase-allow-access-during-reservation.nll_target.stderr b/src/test/ui/borrowck/two-phase-allow-access-during-reservation.nll_target.stderr
index bba3393fc14..a6c65421d91 100644
--- a/src/test/ui/borrowck/two-phase-allow-access-during-reservation.nll_target.stderr
+++ b/src/test/ui/borrowck/two-phase-allow-access-during-reservation.nll_target.stderr
@@ -1,5 +1,5 @@
 error[E0503]: cannot use `i` because it was mutably borrowed
-  --> $DIR/two-phase-allow-access-during-reservation.rs:28:19
+  --> $DIR/two-phase-allow-access-during-reservation.rs:26:19
    |
 LL |     /*1*/ let p = &mut i; // (reservation of `i` starts here)
    |                   ------ borrow of `i` occurs here
@@ -11,7 +11,7 @@ LL |     /*3*/ *p += 1;        // (mutable borrow of `i` starts here, since `p`
    |           ------- borrow later used here
 
 error[E0503]: cannot use `i` because it was mutably borrowed
-  --> $DIR/two-phase-allow-access-during-reservation.rs:33:19
+  --> $DIR/two-phase-allow-access-during-reservation.rs:31:19
    |
 LL |     /*1*/ let p = &mut i; // (reservation of `i` starts here)
    |                   ------ borrow of `i` occurs here
diff --git a/src/test/ui/borrowck/two-phase-allow-access-during-reservation.rs b/src/test/ui/borrowck/two-phase-allow-access-during-reservation.rs
index 3afa679ce39..67d0842070f 100644
--- a/src/test/ui/borrowck/two-phase-allow-access-during-reservation.rs
+++ b/src/test/ui/borrowck/two-phase-allow-access-during-reservation.rs
@@ -1,9 +1,7 @@
 // revisions: nll_target
 
 // The following revisions are disabled due to missing support for two_phase_beyond_autoref
-//[nll_beyond] compile-flags: -Z borrowck=mir -Z two_phase_beyond_autoref
-
-//[nll_target] compile-flags: -Z borrowck=mir
+//[nll_beyond] compile-flags: -Z two_phase_beyond_autoref
 
 // This is the second counter-example from Niko's blog post
 // smallcultfollowing.com/babysteps/blog/2017/03/01/nested-method-calls-via-two-phase-borrowing/
diff --git a/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.rs b/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.rs
index f2097fdf823..dd2ef4e27ee 100644
--- a/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.rs
+++ b/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.rs
@@ -1,5 +1,3 @@
-// compile-flags: -Z borrowck=mir
-
 // This is the third counter-example from Niko's blog post
 // smallcultfollowing.com/babysteps/blog/2017/03/01/nested-method-calls-via-two-phase-borrowing/
 //
diff --git a/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.stderr b/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.stderr
index a89bb941532..21b0eddb902 100644
--- a/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.stderr
+++ b/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.stderr
@@ -1,5 +1,5 @@
 error[E0502]: cannot borrow `vec` as mutable because it is also borrowed as immutable
-  --> $DIR/two-phase-cannot-nest-mut-self-calls.rs:16:9
+  --> $DIR/two-phase-cannot-nest-mut-self-calls.rs:14:9
    |
 LL |       vec.get({
    |       -   --- immutable borrow later used by call
diff --git a/src/test/ui/borrowck/two-phase-method-receivers.rs b/src/test/ui/borrowck/two-phase-method-receivers.rs
index 6838f6c7efd..6b879af5aec 100644
--- a/src/test/ui/borrowck/two-phase-method-receivers.rs
+++ b/src/test/ui/borrowck/two-phase-method-receivers.rs
@@ -1,5 +1,3 @@
-// compile-flags: -Z borrowck=mir
-
 // run-pass
 
 struct Foo<'a> {
diff --git a/src/test/ui/borrowck/two-phase-multiple-activations.rs b/src/test/ui/borrowck/two-phase-multiple-activations.rs
index 599138a9ce0..53fb71ebed4 100644
--- a/src/test/ui/borrowck/two-phase-multiple-activations.rs
+++ b/src/test/ui/borrowck/two-phase-multiple-activations.rs
@@ -1,5 +1,3 @@
-// compile-flags: -Z borrowck=mir
-
 // run-pass
 
 use std::io::Result;
diff --git a/src/test/ui/borrowck/two-phase-nonrecv-autoref.base.stderr b/src/test/ui/borrowck/two-phase-nonrecv-autoref.base.stderr
index 3518a663e59..efd63a08aae 100644
--- a/src/test/ui/borrowck/two-phase-nonrecv-autoref.base.stderr
+++ b/src/test/ui/borrowck/two-phase-nonrecv-autoref.base.stderr
@@ -1,5 +1,5 @@
 error[E0499]: cannot borrow `*f` as mutable more than once at a time
-  --> $DIR/two-phase-nonrecv-autoref.rs:51:11
+  --> $DIR/two-phase-nonrecv-autoref.rs:50:11
    |
 LL |         f(f(10));
    |         - ^ second mutable borrow occurs here
@@ -8,7 +8,7 @@ LL |         f(f(10));
    |         first borrow later used by call
 
 error[E0382]: use of moved value: `f`
-  --> $DIR/two-phase-nonrecv-autoref.rs:58:11
+  --> $DIR/two-phase-nonrecv-autoref.rs:57:11
    |
 LL |     fn twice_ten_so<F: FnOnce(i32) -> i32>(f: Box<F>) {
    |                                            - move occurs because `f` has type `Box<F>`, which does not implement the `Copy` trait
@@ -18,7 +18,7 @@ LL |         f(f(10));
    |         value moved here
 
 error[E0499]: cannot borrow `*f` as mutable more than once at a time
-  --> $DIR/two-phase-nonrecv-autoref.rs:63:11
+  --> $DIR/two-phase-nonrecv-autoref.rs:62:11
    |
 LL |         f(f(10));
    |         - ^ second mutable borrow occurs here
@@ -27,7 +27,7 @@ LL |         f(f(10));
    |         first borrow later used by call
 
 error[E0382]: use of moved value: `f`
-  --> $DIR/two-phase-nonrecv-autoref.rs:70:11
+  --> $DIR/two-phase-nonrecv-autoref.rs:69:11
    |
 LL |     fn twice_ten_oo(f: Box<dyn FnOnce(i32) -> i32>) {
    |                     - move occurs because `f` has type `Box<dyn FnOnce(i32) -> i32>`, which does not implement the `Copy` trait
@@ -37,7 +37,7 @@ LL |         f(f(10));
    |         value moved here
 
 error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable
-  --> $DIR/two-phase-nonrecv-autoref.rs:108:27
+  --> $DIR/two-phase-nonrecv-autoref.rs:107:27
    |
 LL |     double_access(&mut a, &a);
    |     ------------- ------  ^^ immutable borrow occurs here
@@ -46,7 +46,7 @@ LL |     double_access(&mut a, &a);
    |     mutable borrow later used by call
 
 error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable
-  --> $DIR/two-phase-nonrecv-autoref.rs:133:7
+  --> $DIR/two-phase-nonrecv-autoref.rs:132:7
    |
 LL |     i[i[3]] = 4;
    |     --^----
@@ -56,18 +56,18 @@ LL |     i[i[3]] = 4;
    |     mutable borrow later used here
    |
 help: try adding a local storing this...
-  --> $DIR/two-phase-nonrecv-autoref.rs:133:7
+  --> $DIR/two-phase-nonrecv-autoref.rs:132:7
    |
 LL |     i[i[3]] = 4;
    |       ^^^^
 help: ...and then using that local here
-  --> $DIR/two-phase-nonrecv-autoref.rs:133:5
+  --> $DIR/two-phase-nonrecv-autoref.rs:132:5
    |
 LL |     i[i[3]] = 4;
    |     ^^^^^^^
 
 error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable
-  --> $DIR/two-phase-nonrecv-autoref.rs:139:7
+  --> $DIR/two-phase-nonrecv-autoref.rs:138:7
    |
 LL |     i[i[3]] = i[4];
    |     --^----
@@ -77,12 +77,12 @@ LL |     i[i[3]] = i[4];
    |     mutable borrow later used here
    |
 help: try adding a local storing this...
-  --> $DIR/two-phase-nonrecv-autoref.rs:139:7
+  --> $DIR/two-phase-nonrecv-autoref.rs:138:7
    |
 LL |     i[i[3]] = i[4];
    |       ^^^^
 help: ...and then using that local here
-  --> $DIR/two-phase-nonrecv-autoref.rs:139:5
+  --> $DIR/two-phase-nonrecv-autoref.rs:138:5
    |
 LL |     i[i[3]] = i[4];
    |     ^^^^^^^
diff --git a/src/test/ui/borrowck/two-phase-nonrecv-autoref.nll.stderr b/src/test/ui/borrowck/two-phase-nonrecv-autoref.nll.stderr
deleted file mode 100644
index 3518a663e59..00000000000
--- a/src/test/ui/borrowck/two-phase-nonrecv-autoref.nll.stderr
+++ /dev/null
@@ -1,93 +0,0 @@
-error[E0499]: cannot borrow `*f` as mutable more than once at a time
-  --> $DIR/two-phase-nonrecv-autoref.rs:51:11
-   |
-LL |         f(f(10));
-   |         - ^ second mutable borrow occurs here
-   |         |
-   |         first mutable borrow occurs here
-   |         first borrow later used by call
-
-error[E0382]: use of moved value: `f`
-  --> $DIR/two-phase-nonrecv-autoref.rs:58:11
-   |
-LL |     fn twice_ten_so<F: FnOnce(i32) -> i32>(f: Box<F>) {
-   |                                            - move occurs because `f` has type `Box<F>`, which does not implement the `Copy` trait
-LL |         f(f(10));
-   |         - ^ value used here after move
-   |         |
-   |         value moved here
-
-error[E0499]: cannot borrow `*f` as mutable more than once at a time
-  --> $DIR/two-phase-nonrecv-autoref.rs:63:11
-   |
-LL |         f(f(10));
-   |         - ^ second mutable borrow occurs here
-   |         |
-   |         first mutable borrow occurs here
-   |         first borrow later used by call
-
-error[E0382]: use of moved value: `f`
-  --> $DIR/two-phase-nonrecv-autoref.rs:70:11
-   |
-LL |     fn twice_ten_oo(f: Box<dyn FnOnce(i32) -> i32>) {
-   |                     - move occurs because `f` has type `Box<dyn FnOnce(i32) -> i32>`, which does not implement the `Copy` trait
-LL |         f(f(10));
-   |         - ^ value used here after move
-   |         |
-   |         value moved here
-
-error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable
-  --> $DIR/two-phase-nonrecv-autoref.rs:108:27
-   |
-LL |     double_access(&mut a, &a);
-   |     ------------- ------  ^^ immutable borrow occurs here
-   |     |             |
-   |     |             mutable borrow occurs here
-   |     mutable borrow later used by call
-
-error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable
-  --> $DIR/two-phase-nonrecv-autoref.rs:133:7
-   |
-LL |     i[i[3]] = 4;
-   |     --^----
-   |     | |
-   |     | immutable borrow occurs here
-   |     mutable borrow occurs here
-   |     mutable borrow later used here
-   |
-help: try adding a local storing this...
-  --> $DIR/two-phase-nonrecv-autoref.rs:133:7
-   |
-LL |     i[i[3]] = 4;
-   |       ^^^^
-help: ...and then using that local here
-  --> $DIR/two-phase-nonrecv-autoref.rs:133:5
-   |
-LL |     i[i[3]] = 4;
-   |     ^^^^^^^
-
-error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable
-  --> $DIR/two-phase-nonrecv-autoref.rs:139:7
-   |
-LL |     i[i[3]] = i[4];
-   |     --^----
-   |     | |
-   |     | immutable borrow occurs here
-   |     mutable borrow occurs here
-   |     mutable borrow later used here
-   |
-help: try adding a local storing this...
-  --> $DIR/two-phase-nonrecv-autoref.rs:139:7
-   |
-LL |     i[i[3]] = i[4];
-   |       ^^^^
-help: ...and then using that local here
-  --> $DIR/two-phase-nonrecv-autoref.rs:139:5
-   |
-LL |     i[i[3]] = i[4];
-   |     ^^^^^^^
-
-error: aborting due to 7 previous errors
-
-Some errors have detailed explanations: E0382, E0499, E0502.
-For more information about an error, try `rustc --explain E0382`.
diff --git a/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs b/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs
index b6cc099a614..3d395d1f264 100644
--- a/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs
+++ b/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs
@@ -1,7 +1,6 @@
-// revisions: base nll
-//[nll]compile-flags: -Z borrowck=mir
+// revisions: base
 
-//[g2p]compile-flags: -Z borrowck=mir -Z two-phase-beyond-autoref
+//[g2p]compile-flags: -Z two-phase-beyond-autoref
 // the above revision is disabled until two-phase-beyond-autoref support is better
 
 // This is a test checking that when we limit two-phase borrows to
diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2015.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2015.stderr
deleted file mode 100644
index 69c3d7915e4..00000000000
--- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2015.stderr
+++ /dev/null
@@ -1,25 +0,0 @@
-error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
-  --> $DIR/two-phase-reservation-sharing-interference-2.rs:19:5
-   |
-LL |     let shared = &v;
-   |                  -- immutable borrow occurs here
-LL | 
-LL |     v.extend(shared);
-   |     ^^------^^^^^^^^
-   |     | |
-   |     | immutable borrow later used by call
-   |     mutable borrow occurs here
-
-error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
-  --> $DIR/two-phase-reservation-sharing-interference-2.rs:29:5
-   |
-LL |     v.extend(&v);
-   |     ^^------^--^
-   |     | |      |
-   |     | |      immutable borrow occurs here
-   |     | immutable borrow later used by call
-   |     mutable borrow occurs here
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0502`.
diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2018.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2018.stderr
deleted file mode 100644
index 69c3d7915e4..00000000000
--- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2018.stderr
+++ /dev/null
@@ -1,25 +0,0 @@
-error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
-  --> $DIR/two-phase-reservation-sharing-interference-2.rs:19:5
-   |
-LL |     let shared = &v;
-   |                  -- immutable borrow occurs here
-LL | 
-LL |     v.extend(shared);
-   |     ^^------^^^^^^^^
-   |     | |
-   |     | immutable borrow later used by call
-   |     mutable borrow occurs here
-
-error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
-  --> $DIR/two-phase-reservation-sharing-interference-2.rs:29:5
-   |
-LL |     v.extend(&v);
-   |     ^^------^--^
-   |     | |      |
-   |     | |      immutable borrow occurs here
-   |     | immutable borrow later used by call
-   |     mutable borrow occurs here
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0502`.
diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll.stderr
deleted file mode 100644
index cbbbde61917..00000000000
--- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll.stderr
+++ /dev/null
@@ -1,25 +0,0 @@
-error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
-  --> $DIR/two-phase-reservation-sharing-interference-2.rs:19:5
-   |
-LL |     let shared = &v;
-   |                  -- immutable borrow occurs here
-LL | 
-LL |     v.extend(shared);
-   |     ^^------^^^^^^^^
-   |     | |
-   |     | immutable borrow later used by call
-   |     mutable borrow occurs here
-
-error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
-  --> $DIR/two-phase-reservation-sharing-interference-2.rs:27:5
-   |
-LL |     v.extend(&v);
-   |     ^^------^--^
-   |     | |      |
-   |     | |      immutable borrow occurs here
-   |     | immutable borrow later used by call
-   |     mutable borrow occurs here
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0502`.
diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2015.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2015.stderr
deleted file mode 100644
index 69c3d7915e4..00000000000
--- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2015.stderr
+++ /dev/null
@@ -1,25 +0,0 @@
-error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
-  --> $DIR/two-phase-reservation-sharing-interference-2.rs:19:5
-   |
-LL |     let shared = &v;
-   |                  -- immutable borrow occurs here
-LL | 
-LL |     v.extend(shared);
-   |     ^^------^^^^^^^^
-   |     | |
-   |     | immutable borrow later used by call
-   |     mutable borrow occurs here
-
-error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
-  --> $DIR/two-phase-reservation-sharing-interference-2.rs:29:5
-   |
-LL |     v.extend(&v);
-   |     ^^------^--^
-   |     | |      |
-   |     | |      immutable borrow occurs here
-   |     | immutable borrow later used by call
-   |     mutable borrow occurs here
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0502`.
diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2018.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2018.stderr
deleted file mode 100644
index 69c3d7915e4..00000000000
--- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2018.stderr
+++ /dev/null
@@ -1,25 +0,0 @@
-error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
-  --> $DIR/two-phase-reservation-sharing-interference-2.rs:19:5
-   |
-LL |     let shared = &v;
-   |                  -- immutable borrow occurs here
-LL | 
-LL |     v.extend(shared);
-   |     ^^------^^^^^^^^
-   |     | |
-   |     | immutable borrow later used by call
-   |     mutable borrow occurs here
-
-error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
-  --> $DIR/two-phase-reservation-sharing-interference-2.rs:29:5
-   |
-LL |     v.extend(&v);
-   |     ^^------^--^
-   |     | |      |
-   |     | |      immutable borrow occurs here
-   |     | immutable borrow later used by call
-   |     mutable borrow occurs here
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0502`.
diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.rs b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.rs
index 3e125869ef1..27e599c6cd5 100644
--- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.rs
+++ b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.rs
@@ -2,31 +2,21 @@
 // accidentally allowed under migrate/nll, then linted against in migrate mode
 // but disallowed under NLL. Now, we accept it everywhere.
 
-//ignore-compare-mode-nll
 //ignore-compare-mode-polonius
 
-//revisions: base nll
-
-//[migrate2018] edition:2018
-//[nll2018] edition:2018
-
-#![cfg_attr(nll, feature(nll))]
-
 fn double_conflicts() {
     let mut v = vec![0, 1, 2];
     let shared = &v;
 
     v.extend(shared);
-    //[base]~^ ERROR cannot borrow `v` as mutable
-    //[nll]~^^ ERROR cannot borrow `v` as mutable
+    //~^ ERROR cannot borrow `v` as mutable
 }
 
 fn activation_conflict() {
     let mut v = vec![0, 1, 2];
 
     v.extend(&v);
-    //[base]~^ ERROR cannot borrow `v` as mutable
-    //[nll]~^^ ERROR cannot borrow `v` as mutable
+    //~^ ERROR cannot borrow `v` as mutable
 }
 
 fn reservation_allowed() {
diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.base.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.stderr
index cbbbde61917..e4dc4dc5999 100644
--- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.base.stderr
+++ b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.stderr
@@ -1,5 +1,5 @@
 error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
-  --> $DIR/two-phase-reservation-sharing-interference-2.rs:19:5
+  --> $DIR/two-phase-reservation-sharing-interference-2.rs:11:5
    |
 LL |     let shared = &v;
    |                  -- immutable borrow occurs here
@@ -11,7 +11,7 @@ LL |     v.extend(shared);
    |     mutable borrow occurs here
 
 error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
-  --> $DIR/two-phase-reservation-sharing-interference-2.rs:27:5
+  --> $DIR/two-phase-reservation-sharing-interference-2.rs:18:5
    |
 LL |     v.extend(&v);
    |     ^^------^--^
diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference.nll_target.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference.nll_target.stderr
index 2cbdc0901bc..e3e4057d6a7 100644
--- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference.nll_target.stderr
+++ b/src/test/ui/borrowck/two-phase-reservation-sharing-interference.nll_target.stderr
@@ -1,5 +1,5 @@
 error[E0502]: cannot borrow `vec` as mutable because it is also borrowed as immutable
-  --> $DIR/two-phase-reservation-sharing-interference.rs:34:17
+  --> $DIR/two-phase-reservation-sharing-interference.rs:32:17
    |
 LL |         let shared = &vec;
    |                      ---- immutable borrow occurs here
diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference.rs b/src/test/ui/borrowck/two-phase-reservation-sharing-interference.rs
index 50248a55838..e0f4afa7527 100644
--- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference.rs
+++ b/src/test/ui/borrowck/two-phase-reservation-sharing-interference.rs
@@ -1,11 +1,9 @@
 // revisions: nll_target
 
 // The nll_beyond revision is disabled due to missing support from two-phase beyond autorefs
-//[nll_beyond]compile-flags: -Z borrowck=mir -Z two-phase-beyond-autoref
+//[nll_beyond]compile-flags: -Z two-phase-beyond-autoref
 //[nll_beyond]should-fail
 
-//[nll_target]compile-flags: -Z borrowck=mir
-
 // This is a corner case that the current implementation is (probably)
 // treating more conservatively than is necessary. But it also does
 // not seem like a terribly important use case to cover.
diff --git a/src/test/ui/borrowck/two-phase-sneaky.rs b/src/test/ui/borrowck/two-phase-sneaky.rs
index b6e33d5d1b8..bf06366debe 100644
--- a/src/test/ui/borrowck/two-phase-sneaky.rs
+++ b/src/test/ui/borrowck/two-phase-sneaky.rs
@@ -1,5 +1,3 @@
-// cmpile-flags: -Z borrowck=mir
-
 // This is the first counter-example from Niko's blog post
 // smallcultfollowing.com/babysteps/blog/2017/03/01/nested-method-calls-via-two-phase-borrowing/
 // of a danger for code to crash if we just turned off the check for whether
diff --git a/src/test/ui/borrowck/two-phase-sneaky.stderr b/src/test/ui/borrowck/two-phase-sneaky.stderr
index cffbf0706fe..0dbed98b841 100644
--- a/src/test/ui/borrowck/two-phase-sneaky.stderr
+++ b/src/test/ui/borrowck/two-phase-sneaky.stderr
@@ -1,5 +1,5 @@
 error[E0499]: cannot borrow `v` as mutable more than once at a time
-  --> $DIR/two-phase-sneaky.rs:12:9
+  --> $DIR/two-phase-sneaky.rs:10:9
    |
 LL |     v[0].push_str({
    |     -    -------- first borrow later used by call
diff --git a/src/test/ui/cast/casts-issue-46365.rs b/src/test/ui/cast/casts-issue-46365.rs
index a2205b718c1..50aa1a856a7 100644
--- a/src/test/ui/cast/casts-issue-46365.rs
+++ b/src/test/ui/cast/casts-issue-46365.rs
@@ -3,5 +3,6 @@ struct Lorem {
 }
 
 fn main() {
-    let _foo: *mut Lorem = core::ptr::NonNull::dangling().as_ptr(); // no error here
+    // Testing `as` casts, so deliberately not using `ptr::null`.
+    let _foo: *mut Lorem = 0 as *mut _; // no error here
 }
diff --git a/src/test/ui/check-cfg/well-known-values.stderr b/src/test/ui/check-cfg/well-known-values.stderr
index 8b04c770fb5..a1f7e17d778 100644
--- a/src/test/ui/check-cfg/well-known-values.stderr
+++ b/src/test/ui/check-cfg/well-known-values.stderr
@@ -7,7 +7,7 @@ LL | #[cfg(target_os = "linuz")]
    |                   help: did you mean: `"linux"`
    |
    = note: `#[warn(unexpected_cfgs)]` on by default
-   = note: expected values for `target_os` are: android, cuda, dragonfly, emscripten, espidf, freebsd, fuchsia, haiku, hermit, horizon, illumos, ios, l4re, linux, macos, netbsd, none, openbsd, psp, redox, solaris, solid_asp3, tvos, uefi, unknown, vxworks, wasi, windows
+   = note: expected values for `target_os` are: android, cuda, dragonfly, emscripten, espidf, freebsd, fuchsia, haiku, hermit, horizon, illumos, ios, l4re, linux, macos, netbsd, none, openbsd, psp, redox, solaris, solid_asp3, tvos, uefi, unknown, vxworks, wasi, windows, xous
 
 warning: unexpected `cfg` condition value
   --> $DIR/well-known-values.rs:14:7
diff --git a/src/test/ui/closure-expected-type/expect-fn-supply-fn.base.stderr b/src/test/ui/closure-expected-type/expect-fn-supply-fn.base.stderr
deleted file mode 100644
index c3efe16e251..00000000000
--- a/src/test/ui/closure-expected-type/expect-fn-supply-fn.base.stderr
+++ /dev/null
@@ -1,68 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/expect-fn-supply-fn.rs:20:52
-   |
-LL |     with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
-   |                                                    ^^^^^^^^^^^ lifetime mismatch
-   |
-   = note: expected fn pointer `fn(&u32)`
-              found fn pointer `fn(&'x u32)`
-note: the anonymous lifetime #1 defined here...
-  --> $DIR/expect-fn-supply-fn.rs:20:48
-   |
-LL |     with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
-   |                                                ^^^^^^^^^^^^^^^^^^^^^^
-note: ...does not necessarily outlive the lifetime `'x` as defined here
-  --> $DIR/expect-fn-supply-fn.rs:17:36
-   |
-LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
-   |                                    ^^
-
-error[E0308]: mismatched types
-  --> $DIR/expect-fn-supply-fn.rs:20:52
-   |
-LL |     with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
-   |                                                    ^^^^^^^^^^^ lifetime mismatch
-   |
-   = note: expected fn pointer `fn(&u32)`
-              found fn pointer `fn(&'x u32)`
-note: the lifetime `'x` as defined here...
-  --> $DIR/expect-fn-supply-fn.rs:17:36
-   |
-LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
-   |                                    ^^
-note: ...does not necessarily outlive the anonymous lifetime #1 defined here
-  --> $DIR/expect-fn-supply-fn.rs:20:48
-   |
-LL |     with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
-   |                                                ^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0308]: mismatched types
-  --> $DIR/expect-fn-supply-fn.rs:38:52
-   |
-LL |     with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
-   |                                                    ^^^^^^^^ one type is more general than the other
-   |
-   = note: expected fn pointer `fn(&u32)`
-              found fn pointer `for<'r> fn(&'r u32)`
-
-error[E0308]: mismatched types
-  --> $DIR/expect-fn-supply-fn.rs:45:53
-   |
-LL |     with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {});
-   |                                                     ^^^^^^^^^^^ one type is more general than the other
-   |
-   = note: expected fn pointer `for<'r> fn(&'r u32)`
-              found fn pointer `fn(&'x u32)`
-
-error[E0308]: mismatched types
-  --> $DIR/expect-fn-supply-fn.rs:54:53
-   |
-LL |     with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| {
-   |                                                     ^^^^^^^ one type is more general than the other
-   |
-   = note: expected fn pointer `for<'r> fn(&'r u32)`
-              found fn pointer `fn(&u32)`
-
-error: aborting due to 5 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/closure-expected-type/expect-fn-supply-fn.rs b/src/test/ui/closure-expected-type/expect-fn-supply-fn.rs
index 1715f56ff63..7f1c140279c 100644
--- a/src/test/ui/closure-expected-type/expect-fn-supply-fn.rs
+++ b/src/test/ui/closure-expected-type/expect-fn-supply-fn.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn with_closure_expecting_fn_with_free_region<F>(_: F)
 where
     F: for<'a> FnOnce(fn(&'a u32), &i32),
@@ -18,10 +14,8 @@ fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
     // Here, the type given for `'x` "obscures" a region from the
     // expected signature that is bound at closure level.
     with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
-    //[base]~^ ERROR mismatched types
-    //[base]~| ERROR mismatched types
-    //[nll]~^^^ ERROR lifetime may not live long enough
-    //[nll]~| ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
+    //~| ERROR lifetime may not live long enough
 }
 
 fn expect_free_supply_free_from_closure() {
diff --git a/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr b/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr
index 52e2898d2bb..26f47eb684d 100644
--- a/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr
+++ b/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/expect-fn-supply-fn.rs:20:49
+  --> $DIR/expect-fn-supply-fn.rs:16:49
    |
 LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
    |                                    -- lifetime `'x` defined here
@@ -11,7 +11,7 @@ LL |     with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
    |                                                 requires that `'1` must outlive `'x`
 
 error: lifetime may not live long enough
-  --> $DIR/expect-fn-supply-fn.rs:20:49
+  --> $DIR/expect-fn-supply-fn.rs:16:49
    |
 LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
    |                                    -- lifetime `'x` defined here
@@ -20,7 +20,7 @@ LL |     with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
    |                                                 ^ requires that `'x` must outlive `'static`
 
 error[E0308]: mismatched types
-  --> $DIR/expect-fn-supply-fn.rs:38:49
+  --> $DIR/expect-fn-supply-fn.rs:32:49
    |
 LL |     with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
    |                                                 ^ one type is more general than the other
@@ -29,7 +29,7 @@ LL |     with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
               found fn pointer `fn(&u32)`
 
 error[E0308]: mismatched types
-  --> $DIR/expect-fn-supply-fn.rs:45:50
+  --> $DIR/expect-fn-supply-fn.rs:39:50
    |
 LL |     with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {});
    |                                                  ^ one type is more general than the other
@@ -38,7 +38,7 @@ LL |     with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {});
               found fn pointer `for<'r> fn(&'r u32)`
 
 error[E0308]: mismatched types
-  --> $DIR/expect-fn-supply-fn.rs:54:50
+  --> $DIR/expect-fn-supply-fn.rs:48:50
    |
 LL |     with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| {
    |                                                  ^ one type is more general than the other
diff --git a/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.base.stderr b/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.base.stderr
deleted file mode 100644
index 93ed51fa7e1..00000000000
--- a/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.base.stderr
+++ /dev/null
@@ -1,28 +0,0 @@
-error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:9:9
-   |
-LL |   fn foo(x: &()) {
-   |             --- this data with an anonymous lifetime `'_`...
-LL |       bar(|| {
-   |  _________^
-LL | |
-LL | |
-LL | |
-LL | |         let _ = x;
-LL | |     })
-   | |_____^ ...is used here...
-   |
-note: ...and is required to live as long as `'static` here
-  --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:9:5
-   |
-LL |     bar(|| {
-   |     ^^^
-note: `'static` lifetime requirement introduced by this bound
-  --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:5:39
-   |
-LL | fn bar<F>(blk: F) where F: FnOnce() + 'static {
-   |                                       ^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0759`.
diff --git a/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.rs b/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.rs
index 6c49cd76b13..7327d825668 100644
--- a/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.rs
+++ b/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.rs
@@ -1,15 +1,10 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 fn bar<F>(blk: F) where F: FnOnce() + 'static {
 }
 
 fn foo(x: &()) {
     bar(|| {
-        //[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
-        //[nll]~^^ ERROR borrowed data escapes
-        //[nll]~| ERROR closure may outlive
+        //~^ ERROR borrowed data escapes
+        //~| ERROR closure may outlive
         let _ = x;
     })
 }
diff --git a/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.nll.stderr b/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.stderr
index dc5188a8651..85df5c1e5b3 100644
--- a/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.nll.stderr
+++ b/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.stderr
@@ -1,5 +1,5 @@
 error[E0521]: borrowed data escapes outside of function
-  --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:9:5
+  --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:5:5
    |
 LL |   fn foo(x: &()) {
    |          -  - let's call the lifetime of this reference `'1`
@@ -8,7 +8,6 @@ LL |   fn foo(x: &()) {
 LL | /     bar(|| {
 LL | |
 LL | |
-LL | |
 LL | |         let _ = x;
 LL | |     })
    | |      ^
@@ -17,7 +16,7 @@ LL | |     })
    |        argument requires that `'1` must outlive `'static`
 
 error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
-  --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:9:9
+  --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:5:9
    |
 LL |     bar(|| {
    |         ^^ may outlive borrowed value `x`
@@ -26,12 +25,11 @@ LL |         let _ = x;
    |                 - `x` is borrowed here
    |
 note: function requires argument type to outlive `'static`
-  --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:9:5
+  --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:5:5
    |
 LL | /     bar(|| {
 LL | |
 LL | |
-LL | |
 LL | |         let _ = x;
 LL | |     })
    | |______^
diff --git a/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.base.stderr b/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.base.stderr
deleted file mode 100644
index be81efd27c4..00000000000
--- a/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.base.stderr
+++ /dev/null
@@ -1,55 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/expect-region-supply-region-2.rs:18:33
-   |
-LL |     closure_expecting_bound(|x: &'x u32| {
-   |                                 ^^^^^^^ lifetime mismatch
-   |
-   = note: expected reference `&u32`
-              found reference `&'x u32`
-note: the anonymous lifetime #1 defined here...
-  --> $DIR/expect-region-supply-region-2.rs:18:29
-   |
-LL |       closure_expecting_bound(|x: &'x u32| {
-   |  _____________________________^
-LL | |
-LL | |
-LL | |
-...  |
-LL | |         f = Some(x);
-LL | |     });
-   | |_____^
-note: ...does not necessarily outlive the lifetime `'x` as defined here
-  --> $DIR/expect-region-supply-region-2.rs:13:30
-   |
-LL | fn expect_bound_supply_named<'x>() {
-   |                              ^^
-
-error[E0308]: mismatched types
-  --> $DIR/expect-region-supply-region-2.rs:18:33
-   |
-LL |     closure_expecting_bound(|x: &'x u32| {
-   |                                 ^^^^^^^ lifetime mismatch
-   |
-   = note: expected reference `&u32`
-              found reference `&'x u32`
-note: the lifetime `'x` as defined here...
-  --> $DIR/expect-region-supply-region-2.rs:13:30
-   |
-LL | fn expect_bound_supply_named<'x>() {
-   |                              ^^
-note: ...does not necessarily outlive the anonymous lifetime #1 defined here
-  --> $DIR/expect-region-supply-region-2.rs:18:29
-   |
-LL |       closure_expecting_bound(|x: &'x u32| {
-   |  _____________________________^
-LL | |
-LL | |
-LL | |
-...  |
-LL | |         f = Some(x);
-LL | |     });
-   | |_____^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.rs b/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.rs
index 072ba57c10b..9b51bbd58a3 100644
--- a/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.rs
+++ b/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 #![allow(warnings)]
 
 fn closure_expecting_bound<F>(_: F)
@@ -16,10 +12,8 @@ fn expect_bound_supply_named<'x>() {
     // Here we give a type annotation that `x` should be free. We get
     // an error because of that.
     closure_expecting_bound(|x: &'x u32| {
-        //[base]~^ ERROR mismatched types
-        //[base]~| ERROR mismatched types
-        //[nll]~^^^ ERROR lifetime may not live long enough
-        //[nll]~| ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
+        //~| ERROR lifetime may not live long enough
 
         // Borrowck doesn't get a chance to run, but if it did it should error
         // here.
diff --git a/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.nll.stderr b/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.stderr
index 4a9a19422d7..9aab51c986c 100644
--- a/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.nll.stderr
+++ b/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/expect-region-supply-region-2.rs:18:30
+  --> $DIR/expect-region-supply-region-2.rs:14:30
    |
 LL | fn expect_bound_supply_named<'x>() {
    |                              -- lifetime `'x` defined here
@@ -10,7 +10,7 @@ LL |     closure_expecting_bound(|x: &'x u32| {
    |                              requires that `'1` must outlive `'x`
 
 error: lifetime may not live long enough
-  --> $DIR/expect-region-supply-region-2.rs:18:30
+  --> $DIR/expect-region-supply-region-2.rs:14:30
    |
 LL | fn expect_bound_supply_named<'x>() {
    |                              -- lifetime `'x` defined here
diff --git a/src/test/ui/codegen/auxiliary/issue-97708-aux.rs b/src/test/ui/codegen/auxiliary/issue-97708-aux.rs
new file mode 100644
index 00000000000..e296bd39113
--- /dev/null
+++ b/src/test/ui/codegen/auxiliary/issue-97708-aux.rs
@@ -0,0 +1,41 @@
+use std::{ptr::NonNull, task::Poll};
+
+struct TaskRef;
+
+struct Header {
+    vtable: &'static Vtable,
+}
+
+struct Vtable {
+    poll: unsafe fn(TaskRef) -> Poll<()>,
+    deallocate: unsafe fn(NonNull<Header>),
+}
+
+// in the "Header" type, which is a private type in maitake
+impl Header {
+    pub(crate) const fn new_stub() -> Self {
+        unsafe fn nop(_ptr: TaskRef) -> Poll<()> {
+            Poll::Pending
+        }
+
+        unsafe fn nop_deallocate(ptr: NonNull<Header>) {
+            unreachable!("stub task ({ptr:p}) should never be deallocated!");
+        }
+
+        Self { vtable: &Vtable { poll: nop, deallocate: nop_deallocate } }
+    }
+}
+
+// This is a public type in `maitake`
+#[repr(transparent)]
+#[cfg_attr(loom, allow(dead_code))]
+pub struct TaskStub {
+    hdr: Header,
+}
+
+impl TaskStub {
+    /// Create a new unique stub [`Task`].
+    pub const fn new() -> Self {
+        Self { hdr: Header::new_stub() }
+    }
+}
diff --git a/src/test/ui/codegen/issue-97708.rs b/src/test/ui/codegen/issue-97708.rs
new file mode 100644
index 00000000000..8cb28e9f1f6
--- /dev/null
+++ b/src/test/ui/codegen/issue-97708.rs
@@ -0,0 +1,9 @@
+// build-pass
+// aux-build:issue-97708-aux.rs
+
+extern crate issue_97708_aux;
+use issue_97708_aux::TaskStub;
+
+static TASK_STUB: TaskStub = TaskStub::new();
+
+fn main() {}
diff --git a/src/test/ui/conditional-compilation/cfg_accessible-bugs.rs b/src/test/ui/conditional-compilation/cfg_accessible-bugs.rs
new file mode 100644
index 00000000000..ae18bc55c4f
--- /dev/null
+++ b/src/test/ui/conditional-compilation/cfg_accessible-bugs.rs
@@ -0,0 +1,18 @@
+// This test is a collection of test that should pass.
+//
+// check-fail
+
+#![feature(cfg_accessible)]
+#![feature(trait_alias)]
+
+trait TraitAlias = std::fmt::Debug + Send;
+
+// FIXME: Currently shows "cannot determine" but should be `false`
+#[cfg_accessible(unresolved)] //~ ERROR cannot determine
+const C: bool = true;
+
+// FIXME: Currently shows "not sure" but should be `false`
+#[cfg_accessible(TraitAlias::unresolved)] //~ ERROR not sure whether the path is accessible or not
+const D: bool = true;
+
+fn main() {}
diff --git a/src/test/ui/conditional-compilation/cfg_accessible-bugs.stderr b/src/test/ui/conditional-compilation/cfg_accessible-bugs.stderr
new file mode 100644
index 00000000000..81f02387835
--- /dev/null
+++ b/src/test/ui/conditional-compilation/cfg_accessible-bugs.stderr
@@ -0,0 +1,16 @@
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-bugs.rs:15:18
+   |
+LL | #[cfg_accessible(TraitAlias::unresolved)]
+   |                  ^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: cannot determine whether the path is accessible or not
+  --> $DIR/cfg_accessible-bugs.rs:11:1
+   |
+LL | #[cfg_accessible(unresolved)]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/conditional-compilation/cfg_accessible-not_sure.edition2015.stderr b/src/test/ui/conditional-compilation/cfg_accessible-not_sure.edition2015.stderr
new file mode 100644
index 00000000000..7d5dd589027
--- /dev/null
+++ b/src/test/ui/conditional-compilation/cfg_accessible-not_sure.edition2015.stderr
@@ -0,0 +1,122 @@
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:14:18
+   |
+LL | #[cfg_accessible(Struct::existing)]
+   |                  ^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:16:18
+   |
+LL | #[cfg_accessible(Struct::unresolved)]
+   |                  ^^^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:25:18
+   |
+LL | #[cfg_accessible(Union::existing)]
+   |                  ^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:27:18
+   |
+LL | #[cfg_accessible(Union::unresolved)]
+   |                  ^^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:36:18
+   |
+LL | #[cfg_accessible(Enum::Existing::existing)]
+   |                  ^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:38:18
+   |
+LL | #[cfg_accessible(Enum::Existing::unresolved)]
+   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:40:18
+   |
+LL | #[cfg_accessible(Enum::unresolved)]
+   |                  ^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:50:18
+   |
+LL | #[cfg_accessible(Trait::existing)]
+   |                  ^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:52:18
+   |
+LL | #[cfg_accessible(Trait::unresolved)]
+   |                  ^^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:59:18
+   |
+LL | #[cfg_accessible(TypeAlias::existing)]
+   |                  ^^^^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:61:18
+   |
+LL | #[cfg_accessible(TypeAlias::unresolved)]
+   |                  ^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:70:18
+   |
+LL | #[cfg_accessible(ForeignType::unresolved)]
+   |                  ^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:79:18
+   |
+LL | #[cfg_accessible(AssocType::AssocType::unresolved)]
+   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:84:18
+   |
+LL | #[cfg_accessible(u8::unresolved)]
+   |                  ^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:86:18
+   |
+LL | #[cfg_accessible(u8::is_ascii)]
+   |                  ^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: aborting due to 15 previous errors
+
diff --git a/src/test/ui/conditional-compilation/cfg_accessible-not_sure.edition2021.stderr b/src/test/ui/conditional-compilation/cfg_accessible-not_sure.edition2021.stderr
new file mode 100644
index 00000000000..7d5dd589027
--- /dev/null
+++ b/src/test/ui/conditional-compilation/cfg_accessible-not_sure.edition2021.stderr
@@ -0,0 +1,122 @@
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:14:18
+   |
+LL | #[cfg_accessible(Struct::existing)]
+   |                  ^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:16:18
+   |
+LL | #[cfg_accessible(Struct::unresolved)]
+   |                  ^^^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:25:18
+   |
+LL | #[cfg_accessible(Union::existing)]
+   |                  ^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:27:18
+   |
+LL | #[cfg_accessible(Union::unresolved)]
+   |                  ^^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:36:18
+   |
+LL | #[cfg_accessible(Enum::Existing::existing)]
+   |                  ^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:38:18
+   |
+LL | #[cfg_accessible(Enum::Existing::unresolved)]
+   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:40:18
+   |
+LL | #[cfg_accessible(Enum::unresolved)]
+   |                  ^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:50:18
+   |
+LL | #[cfg_accessible(Trait::existing)]
+   |                  ^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:52:18
+   |
+LL | #[cfg_accessible(Trait::unresolved)]
+   |                  ^^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:59:18
+   |
+LL | #[cfg_accessible(TypeAlias::existing)]
+   |                  ^^^^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:61:18
+   |
+LL | #[cfg_accessible(TypeAlias::unresolved)]
+   |                  ^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:70:18
+   |
+LL | #[cfg_accessible(ForeignType::unresolved)]
+   |                  ^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:79:18
+   |
+LL | #[cfg_accessible(AssocType::AssocType::unresolved)]
+   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:84:18
+   |
+LL | #[cfg_accessible(u8::unresolved)]
+   |                  ^^^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: not sure whether the path is accessible or not
+  --> $DIR/cfg_accessible-not_sure.rs:86:18
+   |
+LL | #[cfg_accessible(u8::is_ascii)]
+   |                  ^^^^^^^^^^^^
+   |
+   = note: the type may have associated items, but we are currently not checking them
+
+error: aborting due to 15 previous errors
+
diff --git a/src/test/ui/conditional-compilation/cfg_accessible-not_sure.rs b/src/test/ui/conditional-compilation/cfg_accessible-not_sure.rs
new file mode 100644
index 00000000000..d68acd2451f
--- /dev/null
+++ b/src/test/ui/conditional-compilation/cfg_accessible-not_sure.rs
@@ -0,0 +1,89 @@
+// revisions: edition2015 edition2021
+// [edition2015]compile-flags: --edition=2015
+// [edition2021]compile-flags: --edition=2021
+
+#![feature(extern_types)]
+#![feature(cfg_accessible)]
+
+// Struct::unresolved - error
+
+struct Struct {
+    existing: u8,
+}
+
+#[cfg_accessible(Struct::existing)] //~ ERROR not sure
+const A: bool = true;
+#[cfg_accessible(Struct::unresolved)] //~ ERROR not sure
+const B: bool = true;
+
+// Union::unresolved - error
+
+struct Union {
+    existing: u8,
+}
+
+#[cfg_accessible(Union::existing)] //~ ERROR not sure
+const A: bool = true;
+#[cfg_accessible(Union::unresolved)] //~ ERROR not sure
+const B: bool = true;
+
+// Enum::unresolved - error
+
+enum Enum {
+    Existing { existing: u8 },
+}
+
+#[cfg_accessible(Enum::Existing::existing)] //~ ERROR not sure
+const A: bool = true;
+#[cfg_accessible(Enum::Existing::unresolved)] //~ ERROR not sure
+const B: bool = true;
+#[cfg_accessible(Enum::unresolved)] //~ ERROR not sure
+const C: bool = true;
+
+// Trait::unresolved - false or error, depending on edition (error if you can write Trait::foo
+// instead of <dyn Trait>::foo for methods like impl dyn Trait { fn foo() {} })
+
+trait Trait {}
+impl dyn Trait { fn existing() {} }
+
+// FIXME: Should be a error for edition > 2015
+#[cfg_accessible(Trait::existing)] //~ ERROR not sure
+const A: bool = true;
+#[cfg_accessible(Trait::unresolved)] //~ ERROR not sure
+const B: bool = true;
+
+// TypeAlias::unresolved - error
+
+type TypeAlias = Struct;
+
+#[cfg_accessible(TypeAlias::existing)] //~ ERROR not sure
+const A: bool = true;
+#[cfg_accessible(TypeAlias::unresolved)] //~ ERROR not sure
+const B: bool = true;
+
+// ForeignType::unresolved - error
+
+extern {
+    type ForeignType;
+}
+
+#[cfg_accessible(ForeignType::unresolved)] //~ ERROR not sure
+const A: bool = true;
+
+// AssocType::unresolved - error
+
+trait AssocType {
+    type AssocType;
+}
+
+#[cfg_accessible(AssocType::AssocType::unresolved)] //~ ERROR not sure
+const A: bool = true;
+
+// PrimitiveType::unresolved - error
+
+#[cfg_accessible(u8::unresolved)] //~ ERROR not sure
+const A: bool = true;
+#[cfg_accessible(u8::is_ascii)] //~ ERROR not sure
+const B: bool = true;
+
+fn main() {}
diff --git a/src/test/ui/conditional-compilation/cfg_accessible-private.rs b/src/test/ui/conditional-compilation/cfg_accessible-private.rs
new file mode 100644
index 00000000000..5b095675c79
--- /dev/null
+++ b/src/test/ui/conditional-compilation/cfg_accessible-private.rs
@@ -0,0 +1,21 @@
+// check-pass
+
+#![feature(cfg_accessible)]
+
+mod private {
+    struct Struct;
+    enum Enum{}
+    union Union{_a:u8}
+}
+
+#[cfg_accessible(private::Struct)]
+const A: bool = true;
+
+#[cfg_accessible(private::Enum)]
+const A: bool = true;
+
+#[cfg_accessible(private::Union)]
+const A: bool = true;
+
+const A: bool = false; // Will conflict if any of those is accessible
+fn main() {}
diff --git a/src/test/ui/conditional-compilation/cfg_accessible.rs b/src/test/ui/conditional-compilation/cfg_accessible.rs
index 07b0be5b1ae..df380d0d16f 100644
--- a/src/test/ui/conditional-compilation/cfg_accessible.rs
+++ b/src/test/ui/conditional-compilation/cfg_accessible.rs
@@ -5,20 +5,35 @@ mod m {
     struct ExistingPrivate;
 }
 
+trait Trait {
+    type Assoc;
+}
+
+enum Enum {
+    Existing,
+}
+
+#[cfg_accessible(Enum)]
+struct ExistingResolved;
+
+#[cfg_accessible(Enum::Existing)]
+struct ExistingResolvedVariant;
+
 #[cfg_accessible(m::ExistingPublic)]
 struct ExistingPublic;
 
-// FIXME: Not implemented yet.
-#[cfg_accessible(m::ExistingPrivate)] //~ ERROR not sure whether the path is accessible or not
+#[cfg_accessible(m::ExistingPrivate)]
 struct ExistingPrivate;
 
-// FIXME: Not implemented yet.
-#[cfg_accessible(m::NonExistent)] //~ ERROR not sure whether the path is accessible or not
-struct ExistingPrivate;
+#[cfg_accessible(m::NonExistent)]
+struct NonExistingPrivate;
 
 #[cfg_accessible(n::AccessibleExpanded)] // OK, `cfg_accessible` can wait and retry.
 struct AccessibleExpanded;
 
+#[cfg_accessible(Trait::Assoc)]
+struct AccessibleTraitAssoc;
+
 macro_rules! generate_accessible_expanded {
     () => {
         mod n {
@@ -29,15 +44,12 @@ macro_rules! generate_accessible_expanded {
 
 generate_accessible_expanded!();
 
-struct S {
-    field: u8,
-}
-
-// FIXME: Not implemented yet.
-#[cfg_accessible(S::field)] //~ ERROR not sure whether the path is accessible or not
-struct Field;
-
 fn main() {
     ExistingPublic;
     AccessibleExpanded;
+    AccessibleTraitAssoc;
+
+    ExistingPrivate; //~ ERROR cannot find
+    NonExistingPrivate; //~ ERROR cannot find
+    NonExistingTraitAlias; //~ ERROR cannot find
 }
diff --git a/src/test/ui/conditional-compilation/cfg_accessible.stderr b/src/test/ui/conditional-compilation/cfg_accessible.stderr
index 167765cd66e..e3731a1ad71 100644
--- a/src/test/ui/conditional-compilation/cfg_accessible.stderr
+++ b/src/test/ui/conditional-compilation/cfg_accessible.stderr
@@ -1,38 +1,27 @@
-error: not sure whether the path is accessible or not
-  --> $DIR/cfg_accessible.rs:12:18
+error[E0425]: cannot find value `ExistingPrivate` in this scope
+  --> $DIR/cfg_accessible.rs:52:5
    |
-LL | #[cfg_accessible(m::ExistingPrivate)]
-   |                  ^^^^^^^^^^^^^^^^^^
+LL |     ExistingPrivate;
+   |     ^^^^^^^^^^^^^^^ not found in this scope
    |
-note: `cfg_accessible` is not fully implemented
-  --> $DIR/cfg_accessible.rs:12:18
+note: unit struct `m::ExistingPrivate` exists but is inaccessible
+  --> $DIR/cfg_accessible.rs:5:5
    |
-LL | #[cfg_accessible(m::ExistingPrivate)]
-   |                  ^^^^^^^^^^^^^^^^^^
+LL |     struct ExistingPrivate;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^ not accessible
 
-error: not sure whether the path is accessible or not
-  --> $DIR/cfg_accessible.rs:16:18
+error[E0425]: cannot find value `NonExistingPrivate` in this scope
+  --> $DIR/cfg_accessible.rs:53:5
    |
-LL | #[cfg_accessible(m::NonExistent)]
-   |                  ^^^^^^^^^^^^^^
-   |
-note: `cfg_accessible` is not fully implemented
-  --> $DIR/cfg_accessible.rs:16:18
-   |
-LL | #[cfg_accessible(m::NonExistent)]
-   |                  ^^^^^^^^^^^^^^
+LL |     NonExistingPrivate;
+   |     ^^^^^^^^^^^^^^^^^^ not found in this scope
 
-error: not sure whether the path is accessible or not
-  --> $DIR/cfg_accessible.rs:37:18
-   |
-LL | #[cfg_accessible(S::field)]
-   |                  ^^^^^^^^
-   |
-note: `cfg_accessible` is not fully implemented
-  --> $DIR/cfg_accessible.rs:37:18
+error[E0425]: cannot find value `NonExistingTraitAlias` in this scope
+  --> $DIR/cfg_accessible.rs:54:5
    |
-LL | #[cfg_accessible(S::field)]
-   |                  ^^^^^^^^
+LL |     NonExistingTraitAlias;
+   |     ^^^^^^^^^^^^^^^^^^^^^ not found in this scope
 
 error: aborting due to 3 previous errors
 
+For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/const-generics/invariant.base.stderr b/src/test/ui/const-generics/invariant.base.stderr
deleted file mode 100644
index 255900e19bb..00000000000
--- a/src/test/ui/const-generics/invariant.base.stderr
+++ /dev/null
@@ -1,26 +0,0 @@
-warning: conflicting implementations of trait `SadBee` for type `for<'a> fn(&'a ())`
-  --> $DIR/invariant.rs:18:1
-   |
-LL | impl SadBee for for<'a> fn(&'a ()) {
-   | ---------------------------------- first implementation here
-...
-LL | impl SadBee for fn(&'static ()) {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a> fn(&'a ())`
-   |
-   = note: `#[warn(coherence_leak_check)]` on by default
-   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
-   = note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105>
-   = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
-
-error[E0308]: mismatched types
-  --> $DIR/invariant.rs:31:5
-   |
-LL |     v
-   |     ^ one type is more general than the other
-   |
-   = note: expected reference `&'static Foo<fn(&'static ())>`
-              found reference `&'static Foo<for<'a> fn(&'a ())>`
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/invariant.rs b/src/test/ui/const-generics/invariant.rs
index 65d1ee9420c..ee191b65c2c 100644
--- a/src/test/ui/const-generics/invariant.rs
+++ b/src/test/ui/const-generics/invariant.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 #![feature(generic_const_exprs)]
 #![allow(incomplete_features)]
 use std::marker::PhantomData;
diff --git a/src/test/ui/const-generics/invariant.nll.stderr b/src/test/ui/const-generics/invariant.stderr
index f684f7fddc8..ce0fad10471 100644
--- a/src/test/ui/const-generics/invariant.nll.stderr
+++ b/src/test/ui/const-generics/invariant.stderr
@@ -1,5 +1,5 @@
 warning: conflicting implementations of trait `SadBee` for type `for<'a> fn(&'a ())`
-  --> $DIR/invariant.rs:18:1
+  --> $DIR/invariant.rs:14:1
    |
 LL | impl SadBee for for<'a> fn(&'a ()) {
    | ---------------------------------- first implementation here
@@ -13,7 +13,7 @@ LL | impl SadBee for fn(&'static ()) {
    = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
 
 error[E0308]: mismatched types
-  --> $DIR/invariant.rs:31:5
+  --> $DIR/invariant.rs:27:5
    |
 LL |     v
    |     ^ one type is more general than the other
diff --git a/src/test/ui/consts/const-blocks/migrate-fail.rs b/src/test/ui/consts/const-blocks/migrate-fail.rs
index d5a17249cc9..fddbfbb9d32 100644
--- a/src/test/ui/consts/const-blocks/migrate-fail.rs
+++ b/src/test/ui/consts/const-blocks/migrate-fail.rs
@@ -1,5 +1,3 @@
-// ignore-compare-mode-nll
-// compile-flags: -Z borrowck=migrate
 #![allow(warnings)]
 
 // Some type that is not copyable.
diff --git a/src/test/ui/consts/const-blocks/migrate-fail.stderr b/src/test/ui/consts/const-blocks/migrate-fail.stderr
index 2e7ff5cb8b3..803281c0794 100644
--- a/src/test/ui/consts/const-blocks/migrate-fail.stderr
+++ b/src/test/ui/consts/const-blocks/migrate-fail.stderr
@@ -1,5 +1,5 @@
 error[E0277]: the trait bound `Bar: Copy` is not satisfied
-  --> $DIR/migrate-fail.rs:13:38
+  --> $DIR/migrate-fail.rs:11:38
    |
 LL |         let arr: [Option<Bar>; 2] = [x; 2];
    |                                      ^ the trait `Copy` is not implemented for `Bar`
@@ -12,7 +12,7 @@ LL | #[derive(Copy)]
    |
 
 error[E0277]: the trait bound `Bar: Copy` is not satisfied
-  --> $DIR/migrate-fail.rs:19:38
+  --> $DIR/migrate-fail.rs:17:38
    |
 LL |         let arr: [Option<Bar>; 2] = [x; 2];
    |                                      ^ the trait `Copy` is not implemented for `Bar`
diff --git a/src/test/ui/consts/const-blocks/migrate-pass.rs b/src/test/ui/consts/const-blocks/migrate-pass.rs
index 3195717fa38..fd66f5aa64f 100644
--- a/src/test/ui/consts/const-blocks/migrate-pass.rs
+++ b/src/test/ui/consts/const-blocks/migrate-pass.rs
@@ -1,6 +1,4 @@
 // check-pass
-// compile-flags: -Z borrowck=migrate
-// ignore-compare-mode-nll
 #![allow(warnings)]
 
 // Some type that is not copyable.
diff --git a/src/test/ui/consts/const-blocks/nll-fail.rs b/src/test/ui/consts/const-blocks/nll-fail.rs
index 9d4aef39e54..fddbfbb9d32 100644
--- a/src/test/ui/consts/const-blocks/nll-fail.rs
+++ b/src/test/ui/consts/const-blocks/nll-fail.rs
@@ -1,4 +1,3 @@
-// ignore-compare-mode-nll
 #![allow(warnings)]
 
 // Some type that is not copyable.
diff --git a/src/test/ui/consts/const-blocks/nll-fail.stderr b/src/test/ui/consts/const-blocks/nll-fail.stderr
index c0d273b5a9a..8841af15dc0 100644
--- a/src/test/ui/consts/const-blocks/nll-fail.stderr
+++ b/src/test/ui/consts/const-blocks/nll-fail.stderr
@@ -1,5 +1,5 @@
 error[E0277]: the trait bound `Bar: Copy` is not satisfied
-  --> $DIR/nll-fail.rs:12:38
+  --> $DIR/nll-fail.rs:11:38
    |
 LL |         let arr: [Option<Bar>; 2] = [x; 2];
    |                                      ^ the trait `Copy` is not implemented for `Bar`
@@ -12,7 +12,7 @@ LL | #[derive(Copy)]
    |
 
 error[E0277]: the trait bound `Bar: Copy` is not satisfied
-  --> $DIR/nll-fail.rs:18:38
+  --> $DIR/nll-fail.rs:17:38
    |
 LL |         let arr: [Option<Bar>; 2] = [x; 2];
    |                                      ^ the trait `Copy` is not implemented for `Bar`
diff --git a/src/test/ui/consts/const-blocks/nll-pass.rs b/src/test/ui/consts/const-blocks/nll-pass.rs
index d8defa19483..fd66f5aa64f 100644
--- a/src/test/ui/consts/const-blocks/nll-pass.rs
+++ b/src/test/ui/consts/const-blocks/nll-pass.rs
@@ -1,5 +1,4 @@
 // check-pass
-// ignore-compare-mode-nll
 #![allow(warnings)]
 
 // Some type that is not copyable.
diff --git a/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr b/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr
index 7c2df205cbf..c19f6342b5b 100644
--- a/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr
+++ b/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr
@@ -1,28 +1,28 @@
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const-pointer-values-in-various-types.rs:26:5
+error: any use of this value will cause an error
+  --> $DIR/const-pointer-values-in-various-types.rs:26:49
    |
 LL |     const I32_REF_USIZE_UNION: usize = unsafe { Nonsense { int_32_ref: &3 }.u };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc3, but expected plain (non-pointer) bytes
+   |     --------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
+   |                                                 |
+   |                                                 unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 8, align: 8) {
-               ╾───────alloc3────────╼                         │ ╾──────╼
-           }
+   = note: `#[deny(const_err)]` on by default
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error: any use of this value will cause an error
-  --> $DIR/const-pointer-values-in-various-types.rs:29:43
+  --> $DIR/const-pointer-values-in-various-types.rs:30:43
    |
 LL |     const I32_REF_U8_UNION: u8 = unsafe { Nonsense { int_32_ref: &3 }.uint_8 };
    |     --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
    |                                           |
    |                                           unable to turn pointer into raw bytes
    |
-   = note: `#[deny(const_err)]` on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error: any use of this value will cause an error
-  --> $DIR/const-pointer-values-in-various-types.rs:33:45
+  --> $DIR/const-pointer-values-in-various-types.rs:34:45
    |
 LL |     const I32_REF_U16_UNION: u16 = unsafe { Nonsense { int_32_ref: &3 }.uint_16 };
    |     ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@@ -33,7 +33,7 @@ LL |     const I32_REF_U16_UNION: u16 = unsafe { Nonsense { int_32_ref: &3 }.uin
    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error: any use of this value will cause an error
-  --> $DIR/const-pointer-values-in-various-types.rs:37:45
+  --> $DIR/const-pointer-values-in-various-types.rs:38:45
    |
 LL |     const I32_REF_U32_UNION: u32 = unsafe { Nonsense { int_32_ref: &3 }.uint_32 };
    |     ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@@ -43,19 +43,19 @@ LL |     const I32_REF_U32_UNION: u32 = unsafe { Nonsense { int_32_ref: &3 }.uin
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const-pointer-values-in-various-types.rs:41:5
+error: any use of this value will cause an error
+  --> $DIR/const-pointer-values-in-various-types.rs:42:45
    |
 LL |     const I32_REF_U64_UNION: u64 = unsafe { Nonsense { int_32_ref: &3 }.uint_64 };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc19, but expected plain (non-pointer) bytes
+   |     ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
+   |                                             |
+   |                                             unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 8, align: 8) {
-               ╾───────alloc19───────╼                         │ ╾──────╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const-pointer-values-in-various-types.rs:44:5
+  --> $DIR/const-pointer-values-in-various-types.rs:46:5
    |
 LL |     const I32_REF_U128_UNION: u128 = unsafe { Nonsense { int_32_ref: &3 }.uint_128 };
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected initialized bytes
@@ -66,7 +66,7 @@ LL |     const I32_REF_U128_UNION: u128 = unsafe { Nonsense { int_32_ref: &3 }.u
            }
 
 error: any use of this value will cause an error
-  --> $DIR/const-pointer-values-in-various-types.rs:47:43
+  --> $DIR/const-pointer-values-in-various-types.rs:49:43
    |
 LL |     const I32_REF_I8_UNION: i8 = unsafe { Nonsense { int_32_ref: &3 }.int_8 };
    |     --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@@ -77,7 +77,7 @@ LL |     const I32_REF_I8_UNION: i8 = unsafe { Nonsense { int_32_ref: &3 }.int_8
    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error: any use of this value will cause an error
-  --> $DIR/const-pointer-values-in-various-types.rs:51:45
+  --> $DIR/const-pointer-values-in-various-types.rs:53:45
    |
 LL |     const I32_REF_I16_UNION: i16 = unsafe { Nonsense { int_32_ref: &3 }.int_16 };
    |     ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@@ -88,7 +88,7 @@ LL |     const I32_REF_I16_UNION: i16 = unsafe { Nonsense { int_32_ref: &3 }.int
    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error: any use of this value will cause an error
-  --> $DIR/const-pointer-values-in-various-types.rs:55:45
+  --> $DIR/const-pointer-values-in-various-types.rs:57:45
    |
 LL |     const I32_REF_I32_UNION: i32 = unsafe { Nonsense { int_32_ref: &3 }.int_32 };
    |     ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@@ -98,19 +98,19 @@ LL |     const I32_REF_I32_UNION: i32 = unsafe { Nonsense { int_32_ref: &3 }.int
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const-pointer-values-in-various-types.rs:59:5
+error: any use of this value will cause an error
+  --> $DIR/const-pointer-values-in-various-types.rs:61:45
    |
 LL |     const I32_REF_I64_UNION: i64 = unsafe { Nonsense { int_32_ref: &3 }.int_64 };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc39, but expected plain (non-pointer) bytes
+   |     ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
+   |                                             |
+   |                                             unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 8, align: 8) {
-               ╾───────alloc39───────╼                         │ ╾──────╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const-pointer-values-in-various-types.rs:62:5
+  --> $DIR/const-pointer-values-in-various-types.rs:65:5
    |
 LL |     const I32_REF_I128_UNION: i128 = unsafe { Nonsense { int_32_ref: &3 }.int_128 };
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected initialized bytes
@@ -121,7 +121,7 @@ LL |     const I32_REF_I128_UNION: i128 = unsafe { Nonsense { int_32_ref: &3 }.i
            }
 
 error: any use of this value will cause an error
-  --> $DIR/const-pointer-values-in-various-types.rs:65:45
+  --> $DIR/const-pointer-values-in-various-types.rs:68:45
    |
 LL |     const I32_REF_F32_UNION: f32 = unsafe { Nonsense { int_32_ref: &3 }.float_32 };
    |     ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@@ -131,19 +131,19 @@ LL |     const I32_REF_F32_UNION: f32 = unsafe { Nonsense { int_32_ref: &3 }.flo
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const-pointer-values-in-various-types.rs:69:5
+error: any use of this value will cause an error
+  --> $DIR/const-pointer-values-in-various-types.rs:72:45
    |
 LL |     const I32_REF_F64_UNION: f64 = unsafe { Nonsense { int_32_ref: &3 }.float_64 };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc51, but expected plain (non-pointer) bytes
+   |     ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
+   |                                             |
+   |                                             unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 8, align: 8) {
-               ╾───────alloc51───────╼                         │ ╾──────╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error: any use of this value will cause an error
-  --> $DIR/const-pointer-values-in-various-types.rs:72:47
+  --> $DIR/const-pointer-values-in-various-types.rs:76:47
    |
 LL |     const I32_REF_BOOL_UNION: bool = unsafe { Nonsense { int_32_ref: &3 }.truthy_falsey };
    |     ------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@@ -154,7 +154,7 @@ LL |     const I32_REF_BOOL_UNION: bool = unsafe { Nonsense { int_32_ref: &3 }.t
    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error: any use of this value will cause an error
-  --> $DIR/const-pointer-values-in-various-types.rs:76:47
+  --> $DIR/const-pointer-values-in-various-types.rs:80:47
    |
 LL |     const I32_REF_CHAR_UNION: char = unsafe { Nonsense { int_32_ref: &3 }.character };
    |     ------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@@ -165,7 +165,7 @@ LL |     const I32_REF_CHAR_UNION: char = unsafe { Nonsense { int_32_ref: &3 }.c
    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error: any use of this value will cause an error
-  --> $DIR/const-pointer-values-in-various-types.rs:80:39
+  --> $DIR/const-pointer-values-in-various-types.rs:84:39
    |
 LL |     const STR_U8_UNION: u8 = unsafe { Nonsense { stringy: "3" }.uint_8 };
    |     ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@@ -176,7 +176,7 @@ LL |     const STR_U8_UNION: u8 = unsafe { Nonsense { stringy: "3" }.uint_8 };
    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error: any use of this value will cause an error
-  --> $DIR/const-pointer-values-in-various-types.rs:84:41
+  --> $DIR/const-pointer-values-in-various-types.rs:88:41
    |
 LL |     const STR_U16_UNION: u16 = unsafe { Nonsense { stringy: "3" }.uint_16 };
    |     ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@@ -187,7 +187,7 @@ LL |     const STR_U16_UNION: u16 = unsafe { Nonsense { stringy: "3" }.uint_16 }
    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error: any use of this value will cause an error
-  --> $DIR/const-pointer-values-in-various-types.rs:88:41
+  --> $DIR/const-pointer-values-in-various-types.rs:92:41
    |
 LL |     const STR_U32_UNION: u32 = unsafe { Nonsense { stringy: "3" }.uint_32 };
    |     ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@@ -197,19 +197,19 @@ LL |     const STR_U32_UNION: u32 = unsafe { Nonsense { stringy: "3" }.uint_32 }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const-pointer-values-in-various-types.rs:92:5
+error: any use of this value will cause an error
+  --> $DIR/const-pointer-values-in-various-types.rs:96:41
    |
 LL |     const STR_U64_UNION: u64 = unsafe { Nonsense { stringy: "3" }.uint_64 };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc72, but expected plain (non-pointer) bytes
+   |     ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
+   |                                         |
+   |                                         unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 8, align: 8) {
-               ╾───────alloc72───────╼                         │ ╾──────╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error: any use of this value will cause an error
-  --> $DIR/const-pointer-values-in-various-types.rs:95:43
+  --> $DIR/const-pointer-values-in-various-types.rs:100:43
    |
 LL |     const STR_U128_UNION: u128 = unsafe { Nonsense { stringy: "3" }.uint_128 };
    |     --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@@ -220,7 +220,7 @@ LL |     const STR_U128_UNION: u128 = unsafe { Nonsense { stringy: "3" }.uint_12
    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error: any use of this value will cause an error
-  --> $DIR/const-pointer-values-in-various-types.rs:99:39
+  --> $DIR/const-pointer-values-in-various-types.rs:104:39
    |
 LL |     const STR_I8_UNION: i8 = unsafe { Nonsense { stringy: "3" }.int_8 };
    |     ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@@ -231,7 +231,7 @@ LL |     const STR_I8_UNION: i8 = unsafe { Nonsense { stringy: "3" }.int_8 };
    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error: any use of this value will cause an error
-  --> $DIR/const-pointer-values-in-various-types.rs:103:41
+  --> $DIR/const-pointer-values-in-various-types.rs:108:41
    |
 LL |     const STR_I16_UNION: i16 = unsafe { Nonsense { stringy: "3" }.int_16 };
    |     ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@@ -242,7 +242,7 @@ LL |     const STR_I16_UNION: i16 = unsafe { Nonsense { stringy: "3" }.int_16 };
    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error: any use of this value will cause an error
-  --> $DIR/const-pointer-values-in-various-types.rs:107:41
+  --> $DIR/const-pointer-values-in-various-types.rs:112:41
    |
 LL |     const STR_I32_UNION: i32 = unsafe { Nonsense { stringy: "3" }.int_32 };
    |     ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@@ -252,19 +252,19 @@ LL |     const STR_I32_UNION: i32 = unsafe { Nonsense { stringy: "3" }.int_32 };
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const-pointer-values-in-various-types.rs:111:5
+error: any use of this value will cause an error
+  --> $DIR/const-pointer-values-in-various-types.rs:116:41
    |
 LL |     const STR_I64_UNION: i64 = unsafe { Nonsense { stringy: "3" }.int_64 };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc87, but expected plain (non-pointer) bytes
+   |     ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
+   |                                         |
+   |                                         unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 8, align: 8) {
-               ╾───────alloc87───────╼                         │ ╾──────╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error: any use of this value will cause an error
-  --> $DIR/const-pointer-values-in-various-types.rs:114:43
+  --> $DIR/const-pointer-values-in-various-types.rs:120:43
    |
 LL |     const STR_I128_UNION: i128 = unsafe { Nonsense { stringy: "3" }.int_128 };
    |     --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@@ -275,7 +275,7 @@ LL |     const STR_I128_UNION: i128 = unsafe { Nonsense { stringy: "3" }.int_128
    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error: any use of this value will cause an error
-  --> $DIR/const-pointer-values-in-various-types.rs:118:41
+  --> $DIR/const-pointer-values-in-various-types.rs:124:41
    |
 LL |     const STR_F32_UNION: f32 = unsafe { Nonsense { stringy: "3" }.float_32 };
    |     ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@@ -285,19 +285,19 @@ LL |     const STR_F32_UNION: f32 = unsafe { Nonsense { stringy: "3" }.float_32
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const-pointer-values-in-various-types.rs:122:5
+error: any use of this value will cause an error
+  --> $DIR/const-pointer-values-in-various-types.rs:128:41
    |
 LL |     const STR_F64_UNION: f64 = unsafe { Nonsense { stringy: "3" }.float_64 };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc96, but expected plain (non-pointer) bytes
+   |     ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
+   |                                         |
+   |                                         unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 8, align: 8) {
-               ╾───────alloc96───────╼                         │ ╾──────╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error: any use of this value will cause an error
-  --> $DIR/const-pointer-values-in-various-types.rs:125:43
+  --> $DIR/const-pointer-values-in-various-types.rs:132:43
    |
 LL |     const STR_BOOL_UNION: bool = unsafe { Nonsense { stringy: "3" }.truthy_falsey };
    |     --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@@ -308,7 +308,7 @@ LL |     const STR_BOOL_UNION: bool = unsafe { Nonsense { stringy: "3" }.truthy_
    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error: any use of this value will cause an error
-  --> $DIR/const-pointer-values-in-various-types.rs:129:43
+  --> $DIR/const-pointer-values-in-various-types.rs:136:43
    |
 LL |     const STR_CHAR_UNION: char = unsafe { Nonsense { stringy: "3" }.character };
    |     --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
diff --git a/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs b/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs
index a1a932639db..f10a67392e8 100644
--- a/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs
+++ b/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs
@@ -24,7 +24,8 @@ union Nonsense {
 
 fn main() {
     const I32_REF_USIZE_UNION: usize = unsafe { Nonsense { int_32_ref: &3 }.u };
-    //~^ ERROR it is undefined behavior to use this value
+    //~^ ERROR any use of this value will cause an error
+    //~| WARN this was previously accepted by the compiler but is being phased out
 
     const I32_REF_U8_UNION: u8 = unsafe { Nonsense { int_32_ref: &3 }.uint_8 };
     //~^ ERROR any use of this value will cause an error
@@ -39,7 +40,8 @@ fn main() {
     //~| WARN this was previously accepted by the compiler but is being phased out
 
     const I32_REF_U64_UNION: u64 = unsafe { Nonsense { int_32_ref: &3 }.uint_64 };
-    //~^ ERROR it is undefined behavior to use this value
+    //~^ ERROR any use of this value will cause an error
+    //~| WARN this was previously accepted by the compiler but is being phased out
 
     const I32_REF_U128_UNION: u128 = unsafe { Nonsense { int_32_ref: &3 }.uint_128 };
     //~^ ERROR it is undefined behavior to use this value
@@ -57,7 +59,8 @@ fn main() {
     //~| WARN this was previously accepted by the compiler but is being phased out
 
     const I32_REF_I64_UNION: i64 = unsafe { Nonsense { int_32_ref: &3 }.int_64 };
-    //~^ ERROR it is undefined behavior to use this value
+    //~^ ERROR any use of this value will cause an error
+    //~| WARN this was previously accepted by the compiler but is being phased out
 
     const I32_REF_I128_UNION: i128 = unsafe { Nonsense { int_32_ref: &3 }.int_128 };
     //~^ ERROR it is undefined behavior to use this value
@@ -67,7 +70,8 @@ fn main() {
     //~| WARN this was previously accepted by the compiler but is being phased out
 
     const I32_REF_F64_UNION: f64 = unsafe { Nonsense { int_32_ref: &3 }.float_64 };
-    //~^ ERROR it is undefined behavior to use this value
+    //~^ ERROR any use of this value will cause an error
+    //~| WARN this was previously accepted by the compiler but is being phased out
 
     const I32_REF_BOOL_UNION: bool = unsafe { Nonsense { int_32_ref: &3 }.truthy_falsey };
     //~^ ERROR any use of this value will cause an error
@@ -90,7 +94,8 @@ fn main() {
     //~| WARN this was previously accepted by the compiler but is being phased out
 
     const STR_U64_UNION: u64 = unsafe { Nonsense { stringy: "3" }.uint_64 };
-    //~^ ERROR it is undefined behavior to use this value
+    //~^ ERROR any use of this value will cause an error
+    //~| WARN this was previously accepted by the compiler but is being phased out
 
     const STR_U128_UNION: u128 = unsafe { Nonsense { stringy: "3" }.uint_128 };
     //~^ ERROR any use of this value will cause an error
@@ -109,7 +114,8 @@ fn main() {
     //~| WARN this was previously accepted by the compiler but is being phased out
 
     const STR_I64_UNION: i64 = unsafe { Nonsense { stringy: "3" }.int_64 };
-    //~^ ERROR it is undefined behavior to use this value
+    //~^ ERROR any use of this value will cause an error
+    //~| WARN this was previously accepted by the compiler but is being phased out
 
     const STR_I128_UNION: i128 = unsafe { Nonsense { stringy: "3" }.int_128 };
     //~^ ERROR any use of this value will cause an error
@@ -120,7 +126,8 @@ fn main() {
     //~| WARN this was previously accepted by the compiler but is being phased out
 
     const STR_F64_UNION: f64 = unsafe { Nonsense { stringy: "3" }.float_64 };
-    //~^ ERROR it is undefined behavior to use this value
+    //~^ ERROR any use of this value will cause an error
+    //~| WARN this was previously accepted by the compiler but is being phased out
 
     const STR_BOOL_UNION: bool = unsafe { Nonsense { stringy: "3" }.truthy_falsey };
     //~^ ERROR any use of this value will cause an error
diff --git a/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr b/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr
index 01ae1349947..83ac6c90a43 100644
--- a/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr
+++ b/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr
@@ -1,13 +1,14 @@
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ref_to_int_match.rs:25:1
+error: any use of this value will cause an error
+  --> $DIR/ref_to_int_match.rs:25:27
    |
 LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc3, but expected plain (non-pointer) bytes
+   | --------------------------^^^^^^^^^^^^^^^^---
+   |                           |
+   |                           unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 4, align: 4) {
-               ╾─alloc3──╼                                     │ ╾──╼
-           }
+   = note: `#[deny(const_err)]` on by default
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error: could not evaluate constant pattern
   --> $DIR/ref_to_int_match.rs:7:14
@@ -23,4 +24,3 @@ LL |         10..=BAR => {},
 
 error: aborting due to 3 previous errors
 
-For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr b/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr
index 7847330f9ce..83ac6c90a43 100644
--- a/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr
+++ b/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr
@@ -1,13 +1,14 @@
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ref_to_int_match.rs:25:1
+error: any use of this value will cause an error
+  --> $DIR/ref_to_int_match.rs:25:27
    |
 LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc3, but expected plain (non-pointer) bytes
+   | --------------------------^^^^^^^^^^^^^^^^---
+   |                           |
+   |                           unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 8, align: 8) {
-               ╾───────alloc3────────╼                         │ ╾──────╼
-           }
+   = note: `#[deny(const_err)]` on by default
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error: could not evaluate constant pattern
   --> $DIR/ref_to_int_match.rs:7:14
@@ -23,4 +24,3 @@ LL |         10..=BAR => {},
 
 error: aborting due to 3 previous errors
 
-For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/ref_to_int_match.rs b/src/test/ui/consts/const-eval/ref_to_int_match.rs
index b098adf8389..3f342d9165d 100644
--- a/src/test/ui/consts/const-eval/ref_to_int_match.rs
+++ b/src/test/ui/consts/const-eval/ref_to_int_match.rs
@@ -22,4 +22,6 @@ type Int = u64;
 #[cfg(target_pointer_width="32")]
 type Int = u32;
 
-const BAR: Int = unsafe { Foo { r: &42 }.f }; //~ ERROR it is undefined behavior to use this value
+const BAR: Int = unsafe { Foo { r: &42 }.f };
+//~^ ERROR any use of this value will cause an error
+//~| WARN this was previously accepted by the compiler but is being phased out
diff --git a/src/test/ui/consts/const-eval/ub-enum.32bit.stderr b/src/test/ui/consts/const-eval/ub-enum.32bit.stderr
index 655e1823843..c6fa14d0534 100644
--- a/src/test/ui/consts/const-eval/ub-enum.32bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-enum.32bit.stderr
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:24:1
+  --> $DIR/ub-enum.rs:23:1
    |
 LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<enum-tag>: encountered 0x00000001, but expected a valid enum tag
@@ -9,30 +9,27 @@ LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
                01 00 00 00                                     │ ....
            }
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:27:1
+error: any use of this value will cause an error
+  --> $DIR/ub-enum.rs:26:1
    |
 LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<enum-tag>: encountered pointer to alloc9, but expected plain (non-pointer) bytes
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 4, align: 4) {
-               ╾─alloc9──╼                                     │ ╾──╼
-           }
+   = note: `#[deny(const_err)]` on by default
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
-error[E0080]: it is undefined behavior to use this value
+error: any use of this value will cause an error
   --> $DIR/ub-enum.rs:30:1
    |
 LL | const BAD_ENUM_WRAPPED: Wrap<Enum> = unsafe { mem::transmute(&1) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .0.<enum-tag>: encountered pointer to alloc13, but expected plain (non-pointer) bytes
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 4, align: 4) {
-               ╾─alloc13─╼                                     │ ╾──╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:42:1
+  --> $DIR/ub-enum.rs:43:1
    |
 LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<enum-tag>: encountered 0x00000000, but expected a valid enum tag
@@ -42,30 +39,26 @@ LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
                00 00 00 00                                     │ ....
            }
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:44:1
+error: any use of this value will cause an error
+  --> $DIR/ub-enum.rs:45:1
    |
 LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<enum-tag>: encountered pointer to alloc19, but expected plain (non-pointer) bytes
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 4, align: 4) {
-               ╾─alloc19─╼                                     │ ╾──╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:47:1
+error: any use of this value will cause an error
+  --> $DIR/ub-enum.rs:49:1
    |
 LL | const BAD_ENUM2_WRAPPED: Wrap<Enum2> = unsafe { mem::transmute(&0) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .0.<enum-tag>: encountered pointer to alloc23, but expected plain (non-pointer) bytes
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 4, align: 4) {
-               ╾─alloc23─╼                                     │ ╾──╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:56:1
+  --> $DIR/ub-enum.rs:59:1
    |
 LL | const BAD_ENUM2_UNDEF : Enum2 = unsafe { MaybeUninit { uninit: () }.init };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<enum-tag>: encountered uninitialized bytes, but expected initialized bytes
@@ -75,19 +68,17 @@ LL | const BAD_ENUM2_UNDEF : Enum2 = unsafe { MaybeUninit { uninit: () }.init };
                __ __ __ __                                     │ ░░░░
            }
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:60:1
+error: any use of this value will cause an error
+  --> $DIR/ub-enum.rs:63:1
    |
 LL | const BAD_ENUM2_OPTION_PTR: Option<Enum2> = unsafe { mem::transmute(&0) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<enum-tag>: encountered pointer to alloc30, but expected plain (non-pointer) bytes
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 4, align: 4) {
-               ╾─alloc30─╼                                     │ ╾──╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:77:1
+  --> $DIR/ub-enum.rs:81:1
    |
 LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute(1u8) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<enum-variant(B)>.0: encountered a value of the never type `!`
@@ -98,7 +89,7 @@ LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:79:1
+  --> $DIR/ub-enum.rs:83:1
    |
 LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<enum-variant(D)>.0: encountered a value of uninhabited type Never
@@ -109,7 +100,7 @@ LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:87:1
+  --> $DIR/ub-enum.rs:91:1
    |
 LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute(!0u32) }));
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<enum-variant(Some)>.0.1: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
@@ -120,13 +111,13 @@ LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::tran
            }
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-enum.rs:92:77
+  --> $DIR/ub-enum.rs:96:77
    |
 LL | const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(0u64) };
    |                                                                             ^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-enum.rs:94:77
+  --> $DIR/ub-enum.rs:98:77
    |
 LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(0u64) };
    |                                                                             ^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
diff --git a/src/test/ui/consts/const-eval/ub-enum.64bit.stderr b/src/test/ui/consts/const-eval/ub-enum.64bit.stderr
index 2273487a0fb..25be593ab83 100644
--- a/src/test/ui/consts/const-eval/ub-enum.64bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-enum.64bit.stderr
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:24:1
+  --> $DIR/ub-enum.rs:23:1
    |
 LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<enum-tag>: encountered 0x0000000000000001, but expected a valid enum tag
@@ -9,30 +9,27 @@ LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
                01 00 00 00 00 00 00 00                         │ ........
            }
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:27:1
+error: any use of this value will cause an error
+  --> $DIR/ub-enum.rs:26:1
    |
 LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<enum-tag>: encountered pointer to alloc9, but expected plain (non-pointer) bytes
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 8, align: 8) {
-               ╾───────alloc9────────╼                         │ ╾──────╼
-           }
+   = note: `#[deny(const_err)]` on by default
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
-error[E0080]: it is undefined behavior to use this value
+error: any use of this value will cause an error
   --> $DIR/ub-enum.rs:30:1
    |
 LL | const BAD_ENUM_WRAPPED: Wrap<Enum> = unsafe { mem::transmute(&1) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .0.<enum-tag>: encountered pointer to alloc13, but expected plain (non-pointer) bytes
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 8, align: 8) {
-               ╾───────alloc13───────╼                         │ ╾──────╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:42:1
+  --> $DIR/ub-enum.rs:43:1
    |
 LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<enum-tag>: encountered 0x0000000000000000, but expected a valid enum tag
@@ -42,30 +39,26 @@ LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
                00 00 00 00 00 00 00 00                         │ ........
            }
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:44:1
+error: any use of this value will cause an error
+  --> $DIR/ub-enum.rs:45:1
    |
 LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<enum-tag>: encountered pointer to alloc19, but expected plain (non-pointer) bytes
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 8, align: 8) {
-               ╾───────alloc19───────╼                         │ ╾──────╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:47:1
+error: any use of this value will cause an error
+  --> $DIR/ub-enum.rs:49:1
    |
 LL | const BAD_ENUM2_WRAPPED: Wrap<Enum2> = unsafe { mem::transmute(&0) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .0.<enum-tag>: encountered pointer to alloc23, but expected plain (non-pointer) bytes
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 8, align: 8) {
-               ╾───────alloc23───────╼                         │ ╾──────╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:56:1
+  --> $DIR/ub-enum.rs:59:1
    |
 LL | const BAD_ENUM2_UNDEF : Enum2 = unsafe { MaybeUninit { uninit: () }.init };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<enum-tag>: encountered uninitialized bytes, but expected initialized bytes
@@ -75,19 +68,17 @@ LL | const BAD_ENUM2_UNDEF : Enum2 = unsafe { MaybeUninit { uninit: () }.init };
                __ __ __ __ __ __ __ __                         │ ░░░░░░░░
            }
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:60:1
+error: any use of this value will cause an error
+  --> $DIR/ub-enum.rs:63:1
    |
 LL | const BAD_ENUM2_OPTION_PTR: Option<Enum2> = unsafe { mem::transmute(&0) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<enum-tag>: encountered pointer to alloc30, but expected plain (non-pointer) bytes
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 8, align: 8) {
-               ╾───────alloc30───────╼                         │ ╾──────╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:77:1
+  --> $DIR/ub-enum.rs:81:1
    |
 LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute(1u8) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<enum-variant(B)>.0: encountered a value of the never type `!`
@@ -98,7 +89,7 @@ LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:79:1
+  --> $DIR/ub-enum.rs:83:1
    |
 LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<enum-variant(D)>.0: encountered a value of uninhabited type Never
@@ -109,7 +100,7 @@ LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:87:1
+  --> $DIR/ub-enum.rs:91:1
    |
 LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute(!0u32) }));
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<enum-variant(Some)>.0.1: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
@@ -120,13 +111,13 @@ LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::tran
            }
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-enum.rs:92:77
+  --> $DIR/ub-enum.rs:96:77
    |
 LL | const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(0u64) };
    |                                                                             ^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-enum.rs:94:77
+  --> $DIR/ub-enum.rs:98:77
    |
 LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(0u64) };
    |                                                                             ^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
diff --git a/src/test/ui/consts/const-eval/ub-enum.rs b/src/test/ui/consts/const-eval/ub-enum.rs
index 86288685303..d8d2a499b1d 100644
--- a/src/test/ui/consts/const-eval/ub-enum.rs
+++ b/src/test/ui/consts/const-eval/ub-enum.rs
@@ -1,6 +1,5 @@
 // stderr-per-bitwidth
 #![feature(never_type)]
-#![allow(const_err)] // make sure we cannot allow away the errors tested here
 
 use std::mem;
 
@@ -25,10 +24,12 @@ const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
 //~^ ERROR is undefined behavior
 
 const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) };
-//~^ ERROR is undefined behavior
+//~^ ERROR any use of this value will cause an error
+//~| WARN this was previously accepted by the compiler but is being phased out
 
 const BAD_ENUM_WRAPPED: Wrap<Enum> = unsafe { mem::transmute(&1) };
-//~^ ERROR is undefined behavior
+//~^ ERROR any use of this value will cause an error
+//~| WARN this was previously accepted by the compiler but is being phased out
 
 // # simple enum with discriminant 2
 
@@ -42,10 +43,12 @@ enum Enum2 {
 const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
 //~^ ERROR is undefined behavior
 const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) };
-//~^ ERROR is undefined behavior
+//~^ ERROR any use of this value will cause an error
+//~| WARN this was previously accepted by the compiler but is being phased out
 // something wrapping the enum so that we test layout first, not enum
 const BAD_ENUM2_WRAPPED: Wrap<Enum2> = unsafe { mem::transmute(&0) };
-//~^ ERROR is undefined behavior
+//~^ ERROR any use of this value will cause an error
+//~| WARN this was previously accepted by the compiler but is being phased out
 
 // Undef enum discriminant.
 #[repr(C)]
@@ -58,7 +61,8 @@ const BAD_ENUM2_UNDEF : Enum2 = unsafe { MaybeUninit { uninit: () }.init };
 
 // Pointer value in an enum with a niche that is not just 0.
 const BAD_ENUM2_OPTION_PTR: Option<Enum2> = unsafe { mem::transmute(&0) };
-//~^ ERROR is undefined behavior
+//~^ ERROR any use of this value will cause an error
+//~| WARN this was previously accepted by the compiler but is being phased out
 
 // # valid discriminant for uninhabited variant
 
diff --git a/src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr b/src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr
index eebe7d090a3..8a4f23c033e 100644
--- a/src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr
@@ -42,41 +42,62 @@ LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
                00 00 00 00                                     │ ....
            }
 
-error[E0080]: it is undefined behavior to use this value
+error: any use of this value will cause an error
   --> $DIR/ub-ref-ptr.rs:31:1
    |
 LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc15, but expected plain (non-pointer) bytes
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 4, align: 4) {
-               ╾─alloc15─╼                                     │ ╾──╼
-           }
+   = note: `#[deny(const_err)]` on by default
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:34:1
+error: any use of this value will cause an error
+  --> $DIR/ub-ref-ptr.rs:35:39
    |
 LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<deref>: encountered a pointer, but expected plain (non-pointer) bytes
+   | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
+   |                                       |
+   |                                       unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 4, align: 4) {
-               ╾─alloc21─╼                                     │ ╾──╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:37:1
+error: any use of this value will cause an error
+  --> $DIR/ub-ref-ptr.rs:35:38
+   |
+LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
+   | -------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
+   |                                      |
+   |                                      referenced constant has errors
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+
+error: any use of this value will cause an error
+  --> $DIR/ub-ref-ptr.rs:41:86
    |
 LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<deref>: encountered a pointer, but expected plain (non-pointer) bytes
+   | -------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^----
+   |                                                                                      |
+   |                                                                                      unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 4, align: 4) {
-               ╾─alloc26─╼                                     │ ╾──╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+
+error: any use of this value will cause an error
+  --> $DIR/ub-ref-ptr.rs:41:85
+   |
+LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
+   | ------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^^----
+   |                                                                                     |
+   |                                                                                     referenced constant has errors
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:40:1
+  --> $DIR/ub-ref-ptr.rs:47:1
    |
 LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a dangling reference (address 0x539 is unallocated)
@@ -87,7 +108,7 @@ LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:43:1
+  --> $DIR/ub-ref-ptr.rs:50:1
    |
 LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a dangling box (address 0x539 is unallocated)
@@ -98,7 +119,7 @@ LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:46:1
+  --> $DIR/ub-ref-ptr.rs:53:1
    |
 LL | const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized raw pointer
@@ -109,7 +130,7 @@ LL | const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:49:1
+  --> $DIR/ub-ref-ptr.rs:56:1
    |
 LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a null function pointer
@@ -120,7 +141,7 @@ LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:51:1
+  --> $DIR/ub-ref-ptr.rs:58:1
    |
 LL | const UNINIT_FN_PTR: fn() = unsafe { MaybeUninit { uninit: () }.init };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected a proper pointer or integer value
@@ -131,7 +152,7 @@ LL | const UNINIT_FN_PTR: fn() = unsafe { MaybeUninit { uninit: () }.init };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:53:1
+  --> $DIR/ub-ref-ptr.rs:60:1
    |
 LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x0000000d, but expected a function pointer
@@ -142,7 +163,7 @@ LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:55:1
+  --> $DIR/ub-ref-ptr.rs:62:1
    |
 LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc43, but expected a function pointer
@@ -152,6 +173,6 @@ LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
                ╾─alloc43─╼                                     │ ╾──╼
            }
 
-error: aborting due to 14 previous errors
+error: aborting due to 16 previous errors
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr b/src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr
index f2acb934070..da1c6d1a07f 100644
--- a/src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr
@@ -42,41 +42,62 @@ LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
                00 00 00 00 00 00 00 00                         │ ........
            }
 
-error[E0080]: it is undefined behavior to use this value
+error: any use of this value will cause an error
   --> $DIR/ub-ref-ptr.rs:31:1
    |
 LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc15, but expected plain (non-pointer) bytes
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 8, align: 8) {
-               ╾───────alloc15───────╼                         │ ╾──────╼
-           }
+   = note: `#[deny(const_err)]` on by default
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:34:1
+error: any use of this value will cause an error
+  --> $DIR/ub-ref-ptr.rs:35:39
    |
 LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<deref>: encountered a pointer, but expected plain (non-pointer) bytes
+   | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
+   |                                       |
+   |                                       unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 8, align: 8) {
-               ╾───────alloc21───────╼                         │ ╾──────╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:37:1
+error: any use of this value will cause an error
+  --> $DIR/ub-ref-ptr.rs:35:38
+   |
+LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
+   | -------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
+   |                                      |
+   |                                      referenced constant has errors
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+
+error: any use of this value will cause an error
+  --> $DIR/ub-ref-ptr.rs:41:86
    |
 LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<deref>: encountered a pointer, but expected plain (non-pointer) bytes
+   | -------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^----
+   |                                                                                      |
+   |                                                                                      unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 8, align: 8) {
-               ╾───────alloc26───────╼                         │ ╾──────╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+
+error: any use of this value will cause an error
+  --> $DIR/ub-ref-ptr.rs:41:85
+   |
+LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
+   | ------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^^----
+   |                                                                                     |
+   |                                                                                     referenced constant has errors
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:40:1
+  --> $DIR/ub-ref-ptr.rs:47:1
    |
 LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a dangling reference (address 0x539 is unallocated)
@@ -87,7 +108,7 @@ LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:43:1
+  --> $DIR/ub-ref-ptr.rs:50:1
    |
 LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a dangling box (address 0x539 is unallocated)
@@ -98,7 +119,7 @@ LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:46:1
+  --> $DIR/ub-ref-ptr.rs:53:1
    |
 LL | const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized raw pointer
@@ -109,7 +130,7 @@ LL | const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:49:1
+  --> $DIR/ub-ref-ptr.rs:56:1
    |
 LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a null function pointer
@@ -120,7 +141,7 @@ LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:51:1
+  --> $DIR/ub-ref-ptr.rs:58:1
    |
 LL | const UNINIT_FN_PTR: fn() = unsafe { MaybeUninit { uninit: () }.init };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected a proper pointer or integer value
@@ -131,7 +152,7 @@ LL | const UNINIT_FN_PTR: fn() = unsafe { MaybeUninit { uninit: () }.init };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:53:1
+  --> $DIR/ub-ref-ptr.rs:60:1
    |
 LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x000000000000000d, but expected a function pointer
@@ -142,7 +163,7 @@ LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:55:1
+  --> $DIR/ub-ref-ptr.rs:62:1
    |
 LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc43, but expected a function pointer
@@ -152,6 +173,6 @@ LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
                ╾───────alloc43───────╼                         │ ╾──────╼
            }
 
-error: aborting due to 14 previous errors
+error: aborting due to 16 previous errors
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/ub-ref-ptr.rs b/src/test/ui/consts/const-eval/ub-ref-ptr.rs
index 1887cb24bf4..17b0d29c514 100644
--- a/src/test/ui/consts/const-eval/ub-ref-ptr.rs
+++ b/src/test/ui/consts/const-eval/ub-ref-ptr.rs
@@ -1,6 +1,6 @@
 // ignore-tidy-linelength
 // stderr-per-bitwidth
-#![allow(const_err, invalid_value)] // make sure we cannot allow away the errors tested here
+#![allow(invalid_value)]
 
 use std::mem;
 
@@ -29,13 +29,20 @@ const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
 // but that would fail to compile; so we ended up breaking user code that would
 // have worked fine had we not promoted.
 const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
-//~^ ERROR it is undefined behavior to use this value
+//~^ ERROR any use of this value will cause an error
+//~| WARN this was previously accepted by the compiler but is being phased out
 
 const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
-//~^ ERROR it is undefined behavior to use this value
+//~^ ERROR any use of this value will cause an error
+//~| WARN this was previously accepted by the compiler but is being phased out
+//~| ERROR any use of this value will cause an error
+//~| WARN this was previously accepted by the compiler but is being phased out
 
 const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
-//~^ ERROR it is undefined behavior to use this value
+//~^ ERROR any use of this value will cause an error
+//~| WARN this was previously accepted by the compiler but is being phased out
+//~| ERROR any use of this value will cause an error
+//~| WARN this was previously accepted by the compiler but is being phased out
 
 const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
 //~^ ERROR it is undefined behavior to use this value
diff --git a/src/test/ui/consts/const-eval/ub-wide-ptr.32bit.stderr b/src/test/ui/consts/const-eval/ub-wide-ptr.32bit.stderr
index 46901bd3b9b..a5e3d078bd0 100644
--- a/src/test/ui/consts/const-eval/ub-wide-ptr.32bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-wide-ptr.32bit.stderr
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:38:1
+  --> $DIR/ub-wide-ptr.rs:37:1
    |
 LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a dangling reference (going beyond the bounds of its allocation)
@@ -10,7 +10,7 @@ LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:40:1
+  --> $DIR/ub-wide-ptr.rs:39:1
    |
 LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::MAX)) },);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .0: encountered invalid reference metadata: slice is bigger than largest supported object
@@ -20,30 +20,27 @@ LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, us
                ╾─allocN─╼ ff ff ff ff                         │ ╾──╼....
            }
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:43:1
+error: any use of this value will cause an error
+  --> $DIR/ub-wide-ptr.rs:42:1
    |
 LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered non-integer slice length in wide pointer
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 8, align: 4) {
-               ╾─allocN─╼ ╾─allocN─╼                         │ ╾──╼╾──╼
-           }
+   = note: `#[deny(const_err)]` on by default
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
-error[E0080]: it is undefined behavior to use this value
+error: any use of this value will cause an error
   --> $DIR/ub-wide-ptr.rs:46:1
    |
 LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered non-integer slice length in wide pointer
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 8, align: 4) {
-               ╾─allocN─╼ ╾─allocN─╼                         │ ╾──╼╾──╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:48:1
+  --> $DIR/ub-wide-ptr.rs:49:1
    |
 LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered invalid reference metadata: slice is bigger than largest supported object
@@ -54,7 +51,7 @@ LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize:
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:52:1
+  --> $DIR/ub-wide-ptr.rs:53:1
    |
 LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<deref>: encountered uninitialized data in `str`
@@ -65,7 +62,7 @@ LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit:
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:55:1
+  --> $DIR/ub-wide-ptr.rs:56:1
    |
 LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<deref>.0: encountered uninitialized data in `str`
@@ -76,7 +73,7 @@ LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUni
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:62:1
+  --> $DIR/ub-wide-ptr.rs:63:1
    |
 LL | / const SLICE_LENGTH_UNINIT: &[u8] = unsafe {
 LL | |
@@ -91,7 +88,7 @@ LL | | };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:68:1
+  --> $DIR/ub-wide-ptr.rs:69:1
    |
 LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a dangling reference (going beyond the bounds of its allocation)
@@ -102,7 +99,7 @@ LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:71:1
+  --> $DIR/ub-wide-ptr.rs:72:1
    |
 LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::MAX)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered invalid reference metadata: slice is bigger than largest supported object
@@ -112,19 +109,17 @@ LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, is
                ╾─allocN─╼ ff ff ff 7f                         │ ╾──╼....
            }
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:74:1
+error: any use of this value will cause an error
+  --> $DIR/ub-wide-ptr.rs:75:1
    |
 LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered non-integer slice length in wide pointer
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 8, align: 4) {
-               ╾─allocN─╼ ╾─allocN─╼                         │ ╾──╼╾──╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:77:1
+  --> $DIR/ub-wide-ptr.rs:79:1
    |
 LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a dangling box (going beyond the bounds of its allocation)
@@ -134,19 +129,17 @@ LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999us
                ╾─allocN─╼ e7 03 00 00                         │ ╾──╼....
            }
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:80:1
+error: any use of this value will cause an error
+  --> $DIR/ub-wide-ptr.rs:82:1
    |
 LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered non-integer slice length in wide pointer
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 8, align: 4) {
-               ╾─allocN─╼ ╾─allocN─╼                         │ ╾──╼╾──╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:84:1
+  --> $DIR/ub-wide-ptr.rs:87:1
    |
 LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<deref>[0]: encountered 0x03, but expected a boolean
@@ -157,7 +150,7 @@ LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:90:1
+  --> $DIR/ub-wide-ptr.rs:93:1
    |
 LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<deref>.0: encountered 0x03, but expected a boolean
@@ -168,7 +161,7 @@ LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:93:1
+  --> $DIR/ub-wide-ptr.rs:96:1
    |
 LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<deref>.1[0]: encountered 0x03, but expected a boolean
@@ -179,7 +172,7 @@ LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::tran
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:100:1
+  --> $DIR/ub-wide-ptr.rs:103:1
    |
 LL | / const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe {
 LL | |
@@ -194,7 +187,7 @@ LL | | };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:108:1
+  --> $DIR/ub-wide-ptr.rs:111:1
    |
 LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .0: encountered too small vtable
@@ -205,7 +198,7 @@ LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:111:1
+  --> $DIR/ub-wide-ptr.rs:114:1
    |
 LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .0: encountered too small vtable
@@ -216,7 +209,7 @@ LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:114:1
+  --> $DIR/ub-wide-ptr.rs:117:1
    |
 LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .0: encountered dangling vtable pointer in wide pointer
@@ -227,7 +220,7 @@ LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:116:1
+  --> $DIR/ub-wide-ptr.rs:119:1
    |
 LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered unaligned vtable pointer in wide pointer
@@ -238,7 +231,7 @@ LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:118:1
+  --> $DIR/ub-wide-ptr.rs:121:1
    |
 LL | const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92u8, &[0usize; 8])) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered invalid drop function pointer in vtable (not pointing to a function)
@@ -249,7 +242,7 @@ LL | const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:120:1
+  --> $DIR/ub-wide-ptr.rs:123:1
    |
 LL | const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u8, &[1usize; 8])) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered invalid drop function pointer in vtable (not pointing to a function)
@@ -260,7 +253,7 @@ LL | const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:122:1
+  --> $DIR/ub-wide-ptr.rs:125:1
    |
 LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .0: encountered invalid drop function pointer in vtable (not pointing to a function)
@@ -271,7 +264,7 @@ LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::trans
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:126:1
+  --> $DIR/ub-wide-ptr.rs:129:1
    |
 LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<deref>.<dyn-downcast>: encountered 0x03, but expected a boolean
@@ -282,7 +275,7 @@ LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_,
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:130:1
+  --> $DIR/ub-wide-ptr.rs:133:1
    |
 LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered dangling vtable pointer in wide pointer
@@ -293,7 +286,7 @@ LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:132:1
+  --> $DIR/ub-wide-ptr.rs:135:1
    |
 LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered too small vtable
@@ -304,13 +297,13 @@ LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transm
            }
 
 error[E0080]: could not evaluate static initializer
-  --> $DIR/ub-wide-ptr.rs:138:5
+  --> $DIR/ub-wide-ptr.rs:141:5
    |
 LL |     mem::transmute::<_, &dyn Trait>((&92u8, 0usize))
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: null pointer is not a valid pointer
 
 error[E0080]: could not evaluate static initializer
-  --> $DIR/ub-wide-ptr.rs:142:5
+  --> $DIR/ub-wide-ptr.rs:145:5
    |
 LL |     mem::transmute::<_, &dyn Trait>((&92u8, &3u64))
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: allocN has size N, so pointer to 12 bytes starting at offset N is out-of-bounds
diff --git a/src/test/ui/consts/const-eval/ub-wide-ptr.64bit.stderr b/src/test/ui/consts/const-eval/ub-wide-ptr.64bit.stderr
index b76f8892867..a3ba62ca87b 100644
--- a/src/test/ui/consts/const-eval/ub-wide-ptr.64bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-wide-ptr.64bit.stderr
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:38:1
+  --> $DIR/ub-wide-ptr.rs:37:1
    |
 LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a dangling reference (going beyond the bounds of its allocation)
@@ -10,7 +10,7 @@ LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:40:1
+  --> $DIR/ub-wide-ptr.rs:39:1
    |
 LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::MAX)) },);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .0: encountered invalid reference metadata: slice is bigger than largest supported object
@@ -20,30 +20,27 @@ LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, us
                ╾───────allocN───────╼ ff ff ff ff ff ff ff ff │ ╾──────╼........
            }
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:43:1
+error: any use of this value will cause an error
+  --> $DIR/ub-wide-ptr.rs:42:1
    |
 LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered non-integer slice length in wide pointer
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 16, align: 8) {
-               ╾───────allocN───────╼ ╾───────allocN───────╼ │ ╾──────╼╾──────╼
-           }
+   = note: `#[deny(const_err)]` on by default
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
-error[E0080]: it is undefined behavior to use this value
+error: any use of this value will cause an error
   --> $DIR/ub-wide-ptr.rs:46:1
    |
 LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered non-integer slice length in wide pointer
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 16, align: 8) {
-               ╾───────allocN───────╼ ╾───────allocN───────╼ │ ╾──────╼╾──────╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:48:1
+  --> $DIR/ub-wide-ptr.rs:49:1
    |
 LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered invalid reference metadata: slice is bigger than largest supported object
@@ -54,7 +51,7 @@ LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize:
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:52:1
+  --> $DIR/ub-wide-ptr.rs:53:1
    |
 LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<deref>: encountered uninitialized data in `str`
@@ -65,7 +62,7 @@ LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit:
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:55:1
+  --> $DIR/ub-wide-ptr.rs:56:1
    |
 LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<deref>.0: encountered uninitialized data in `str`
@@ -76,7 +73,7 @@ LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUni
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:62:1
+  --> $DIR/ub-wide-ptr.rs:63:1
    |
 LL | / const SLICE_LENGTH_UNINIT: &[u8] = unsafe {
 LL | |
@@ -91,7 +88,7 @@ LL | | };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:68:1
+  --> $DIR/ub-wide-ptr.rs:69:1
    |
 LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a dangling reference (going beyond the bounds of its allocation)
@@ -102,7 +99,7 @@ LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:71:1
+  --> $DIR/ub-wide-ptr.rs:72:1
    |
 LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::MAX)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered invalid reference metadata: slice is bigger than largest supported object
@@ -112,19 +109,17 @@ LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, is
                ╾───────allocN───────╼ ff ff ff ff ff ff ff 7f │ ╾──────╼........
            }
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:74:1
+error: any use of this value will cause an error
+  --> $DIR/ub-wide-ptr.rs:75:1
    |
 LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered non-integer slice length in wide pointer
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 16, align: 8) {
-               ╾───────allocN───────╼ ╾───────allocN───────╼ │ ╾──────╼╾──────╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:77:1
+  --> $DIR/ub-wide-ptr.rs:79:1
    |
 LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a dangling box (going beyond the bounds of its allocation)
@@ -134,19 +129,17 @@ LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999us
                ╾───────allocN───────╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........
            }
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:80:1
+error: any use of this value will cause an error
+  --> $DIR/ub-wide-ptr.rs:82:1
    |
 LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered non-integer slice length in wide pointer
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
-   = note: the raw bytes of the constant (size: 16, align: 8) {
-               ╾───────allocN───────╼ ╾───────allocN───────╼ │ ╾──────╼╾──────╼
-           }
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:84:1
+  --> $DIR/ub-wide-ptr.rs:87:1
    |
 LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<deref>[0]: encountered 0x03, but expected a boolean
@@ -157,7 +150,7 @@ LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:90:1
+  --> $DIR/ub-wide-ptr.rs:93:1
    |
 LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<deref>.0: encountered 0x03, but expected a boolean
@@ -168,7 +161,7 @@ LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:93:1
+  --> $DIR/ub-wide-ptr.rs:96:1
    |
 LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<deref>.1[0]: encountered 0x03, but expected a boolean
@@ -179,7 +172,7 @@ LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::tran
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:100:1
+  --> $DIR/ub-wide-ptr.rs:103:1
    |
 LL | / const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe {
 LL | |
@@ -194,7 +187,7 @@ LL | | };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:108:1
+  --> $DIR/ub-wide-ptr.rs:111:1
    |
 LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .0: encountered too small vtable
@@ -205,7 +198,7 @@ LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:111:1
+  --> $DIR/ub-wide-ptr.rs:114:1
    |
 LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .0: encountered too small vtable
@@ -216,7 +209,7 @@ LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:114:1
+  --> $DIR/ub-wide-ptr.rs:117:1
    |
 LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .0: encountered dangling vtable pointer in wide pointer
@@ -227,7 +220,7 @@ LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:116:1
+  --> $DIR/ub-wide-ptr.rs:119:1
    |
 LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered unaligned vtable pointer in wide pointer
@@ -238,7 +231,7 @@ LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:118:1
+  --> $DIR/ub-wide-ptr.rs:121:1
    |
 LL | const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92u8, &[0usize; 8])) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered invalid drop function pointer in vtable (not pointing to a function)
@@ -249,7 +242,7 @@ LL | const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:120:1
+  --> $DIR/ub-wide-ptr.rs:123:1
    |
 LL | const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u8, &[1usize; 8])) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered invalid drop function pointer in vtable (not pointing to a function)
@@ -260,7 +253,7 @@ LL | const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:122:1
+  --> $DIR/ub-wide-ptr.rs:125:1
    |
 LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .0: encountered invalid drop function pointer in vtable (not pointing to a function)
@@ -271,7 +264,7 @@ LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::trans
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:126:1
+  --> $DIR/ub-wide-ptr.rs:129:1
    |
 LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<deref>.<dyn-downcast>: encountered 0x03, but expected a boolean
@@ -282,7 +275,7 @@ LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_,
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:130:1
+  --> $DIR/ub-wide-ptr.rs:133:1
    |
 LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered dangling vtable pointer in wide pointer
@@ -293,7 +286,7 @@ LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-wide-ptr.rs:132:1
+  --> $DIR/ub-wide-ptr.rs:135:1
    |
 LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered too small vtable
@@ -304,13 +297,13 @@ LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transm
            }
 
 error[E0080]: could not evaluate static initializer
-  --> $DIR/ub-wide-ptr.rs:138:5
+  --> $DIR/ub-wide-ptr.rs:141:5
    |
 LL |     mem::transmute::<_, &dyn Trait>((&92u8, 0usize))
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: null pointer is not a valid pointer
 
 error[E0080]: could not evaluate static initializer
-  --> $DIR/ub-wide-ptr.rs:142:5
+  --> $DIR/ub-wide-ptr.rs:145:5
    |
 LL |     mem::transmute::<_, &dyn Trait>((&92u8, &3u64))
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: allocN has size N, so pointer to 24 bytes starting at offset N is out-of-bounds
diff --git a/src/test/ui/consts/const-eval/ub-wide-ptr.rs b/src/test/ui/consts/const-eval/ub-wide-ptr.rs
index ea48a095df9..763e6ba2967 100644
--- a/src/test/ui/consts/const-eval/ub-wide-ptr.rs
+++ b/src/test/ui/consts/const-eval/ub-wide-ptr.rs
@@ -1,7 +1,6 @@
 // stderr-per-bitwidth
 // ignore-tidy-linelength
 #![allow(unused)]
-#![allow(const_err)] // make sure we cannot allow away the errors tested here
 
 use std::mem;
 
@@ -41,10 +40,12 @@ const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::
 //~^ ERROR it is undefined behavior to use this value
 // bad str
 const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
-//~^ ERROR it is undefined behavior to use this value
+//~^ ERROR any use of this value will cause an error
+//~| WARN this was previously accepted by the compiler but is being phased out
 // bad str in user-defined unsized type
 const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
-//~^ ERROR it is undefined behavior to use this value
+//~^ ERROR any use of this value will cause an error
+//~| WARN this was previously accepted by the compiler but is being phased out
 const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) };
 //~^ ERROR it is undefined behavior to use this value
 
@@ -72,13 +73,15 @@ const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::
 //~^ ERROR it is undefined behavior to use this value
 // bad slice: length not an int
 const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
-//~^ ERROR it is undefined behavior to use this value
+//~^ ERROR any use of this value will cause an error
+//~| WARN this was previously accepted by the compiler but is being phased out
 // bad slice box: length too big
 const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) };
 //~^ ERROR it is undefined behavior to use this value
 // bad slice box: length not an int
 const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
-//~^ ERROR it is undefined behavior to use this value
+//~^ ERROR any use of this value will cause an error
+//~| WARN this was previously accepted by the compiler but is being phased out
 
 // bad data *inside* the slice
 const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
diff --git a/src/test/ui/consts/miri_unleashed/ptr_arith.stderr b/src/test/ui/consts/miri_unleashed/ptr_arith.stderr
index 61d34e2e35d..47142752f0e 100644
--- a/src/test/ui/consts/miri_unleashed/ptr_arith.stderr
+++ b/src/test/ui/consts/miri_unleashed/ptr_arith.stderr
@@ -14,7 +14,7 @@ error[E0080]: could not evaluate static initializer
   --> $DIR/ptr_arith.rs:23:14
    |
 LL |     let _v = x + 0;
-   |              ^^^^^ unable to turn pointer into raw bytes
+   |              ^ unable to turn pointer into raw bytes
 
 warning: skipping const checks
    |
diff --git a/src/test/ui/consts/ptr_comparisons.stderr b/src/test/ui/consts/ptr_comparisons.stderr
index 678ce5d3a35..12f6ca0b51a 100644
--- a/src/test/ui/consts/ptr_comparisons.stderr
+++ b/src/test/ui/consts/ptr_comparisons.stderr
@@ -34,7 +34,7 @@ error: any use of this value will cause an error
   --> $DIR/ptr_comparisons.rs:70:27
    |
 LL | const _: usize = unsafe { *std::mem::transmute::<&&usize, &usize>(&FOO) + 4 };
-   | --------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
+   | --------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------
    |                           |
    |                           unable to turn pointer into raw bytes
    |
diff --git a/src/test/ui/derives/issue-97343.rs b/src/test/ui/derives/issue-97343.rs
index adec6c7a5c5..6f0e4d55aeb 100644
--- a/src/test/ui/derives/issue-97343.rs
+++ b/src/test/ui/derives/issue-97343.rs
@@ -1,7 +1,7 @@
 use std::fmt::Debug;
 
 #[derive(Debug)]
-pub struct Irrelevant<Irrelevant> { //~ ERROR type arguments are not allowed for this type
+pub struct Irrelevant<Irrelevant> { //~ ERROR type arguments are not allowed on type parameter
     irrelevant: Irrelevant,
 }
 
diff --git a/src/test/ui/derives/issue-97343.stderr b/src/test/ui/derives/issue-97343.stderr
index eedd54f1e9f..ac797a8f501 100644
--- a/src/test/ui/derives/issue-97343.stderr
+++ b/src/test/ui/derives/issue-97343.stderr
@@ -1,11 +1,19 @@
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on type parameter `Irrelevant`
   --> $DIR/issue-97343.rs:4:23
    |
 LL | #[derive(Debug)]
-   |          ----- in this derive macro expansion
+   |          -----
+   |          |
+   |          not allowed on this
+   |          in this derive macro expansion
 LL | pub struct Irrelevant<Irrelevant> {
    |                       ^^^^^^^^^^ type argument not allowed
    |
+note: type parameter `Irrelevant` defined here
+  --> $DIR/issue-97343.rs:4:23
+   |
+LL | pub struct Irrelevant<Irrelevant> {
+   |                       ^^^^^^^^^^
    = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0109.stderr b/src/test/ui/error-codes/E0109.stderr
index 577e286fcc6..e0e437e18ae 100644
--- a/src/test/ui/error-codes/E0109.stderr
+++ b/src/test/ui/error-codes/E0109.stderr
@@ -1,8 +1,16 @@
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/E0109.rs:1:14
    |
 LL | type X = u32<i32>;
-   |              ^^^ type argument not allowed
+   |          --- ^^^ type argument not allowed
+   |          |
+   |          not allowed on this
+   |
+help: primitive type `u32` doesn't have generic parameters
+   |
+LL - type X = u32<i32>;
+LL + type X = u32;
+   | 
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/error-codes/E0110.stderr b/src/test/ui/error-codes/E0110.stderr
index b0221318087..15e1b959193 100644
--- a/src/test/ui/error-codes/E0110.stderr
+++ b/src/test/ui/error-codes/E0110.stderr
@@ -1,8 +1,16 @@
-error[E0109]: lifetime arguments are not allowed for this type
+error[E0109]: lifetime arguments are not allowed on this type
   --> $DIR/E0110.rs:1:14
    |
 LL | type X = u32<'static>;
-   |              ^^^^^^^ lifetime argument not allowed
+   |          --- ^^^^^^^ lifetime argument not allowed
+   |          |
+   |          not allowed on this
+   |
+help: primitive type `u32` doesn't have generic parameters
+   |
+LL - type X = u32<'static>;
+LL + type X = u32;
+   | 
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/error-codes/E0161.edition.stderr b/src/test/ui/error-codes/E0161.base.stderr
index fb082bc1eab..fb578cda17e 100644
--- a/src/test/ui/error-codes/E0161.edition.stderr
+++ b/src/test/ui/error-codes/E0161.base.stderr
@@ -1,5 +1,5 @@
 error[E0161]: cannot move a value of type dyn Bar: the size of dyn Bar cannot be statically determined
-  --> $DIR/E0161.rs:32:5
+  --> $DIR/E0161.rs:16:5
    |
 LL |     x.f();
    |     ^^^^^
diff --git a/src/test/ui/error-codes/E0161.migrate.stderr b/src/test/ui/error-codes/E0161.migrate.stderr
deleted file mode 100644
index fb082bc1eab..00000000000
--- a/src/test/ui/error-codes/E0161.migrate.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0161]: cannot move a value of type dyn Bar: the size of dyn Bar cannot be statically determined
-  --> $DIR/E0161.rs:32:5
-   |
-LL |     x.f();
-   |     ^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0161`.
diff --git a/src/test/ui/error-codes/E0161.nll.stderr b/src/test/ui/error-codes/E0161.nll.stderr
deleted file mode 100644
index fb082bc1eab..00000000000
--- a/src/test/ui/error-codes/E0161.nll.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0161]: cannot move a value of type dyn Bar: the size of dyn Bar cannot be statically determined
-  --> $DIR/E0161.rs:32:5
-   |
-LL |     x.f();
-   |     ^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0161`.
diff --git a/src/test/ui/error-codes/E0161.rs b/src/test/ui/error-codes/E0161.rs
index f3a7b68c7cf..c906e3c352d 100644
--- a/src/test/ui/error-codes/E0161.rs
+++ b/src/test/ui/error-codes/E0161.rs
@@ -1,28 +1,12 @@
 // Check that E0161 is a hard error in all possible configurations that might
 // affect it.
 
-// revisions: migrate nll zflags edition migrateul nllul zflagsul editionul
-//[zflags]compile-flags: -Z borrowck=migrate
-//[edition]edition:2018
-//[zflagsul]compile-flags: -Z borrowck=migrate
-//[editionul]edition:2018
-//[migrateul] check-pass
-//[nllul] check-pass
-//[zflagsul] check-pass
-//[editionul] check-pass
-
-// Since we are testing nll (and migration) explicitly as a separate
-// revisions, don't worry about the --compare-mode=nll on this test.
-
-// ignore-compare-mode-nll
+// revisions: base ul
+//[base] check-fail
+//[ul] check-pass
 
 #![allow(incomplete_features)]
-#![cfg_attr(nll, feature(nll))]
-#![cfg_attr(nllul, feature(nll))]
-#![cfg_attr(migrateul, feature(unsized_locals))]
-#![cfg_attr(zflagsul, feature(unsized_locals))]
-#![cfg_attr(nllul, feature(unsized_locals))]
-#![cfg_attr(editionul, feature(unsized_locals))]
+#![cfg_attr(ul, feature(unsized_locals))]
 
 trait Bar {
     fn f(self);
@@ -30,7 +14,7 @@ trait Bar {
 
 fn foo(x: Box<dyn Bar>) {
     x.f();
-    //[migrate,nll,zflags,edition]~^ ERROR E0161
+    //[base]~^ ERROR E0161
 }
 
 fn main() {}
diff --git a/src/test/ui/error-codes/E0161.zflags.stderr b/src/test/ui/error-codes/E0161.zflags.stderr
deleted file mode 100644
index fb082bc1eab..00000000000
--- a/src/test/ui/error-codes/E0161.zflags.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0161]: cannot move a value of type dyn Bar: the size of dyn Bar cannot be statically determined
-  --> $DIR/E0161.rs:32:5
-   |
-LL |     x.f();
-   |     ^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0161`.
diff --git a/src/test/ui/error-codes/E0490.base.stderr b/src/test/ui/error-codes/E0490.base.stderr
deleted file mode 100644
index 5cb62e19ccf..00000000000
--- a/src/test/ui/error-codes/E0490.base.stderr
+++ /dev/null
@@ -1,76 +0,0 @@
-error[E0490]: a value of type `&'b ()` is borrowed for too long
-  --> $DIR/E0490.rs:6:20
-   |
-LL |     let x: &'a _ = &y;
-   |                    ^^
-   |
-note: the type is valid for the lifetime `'a` as defined here
-  --> $DIR/E0490.rs:5:6
-   |
-LL | fn f<'a, 'b>(y: &'b ()) {
-   |      ^^
-note: but the borrow lasts for the lifetime `'b` as defined here
-  --> $DIR/E0490.rs:5:10
-   |
-LL | fn f<'a, 'b>(y: &'b ()) {
-   |          ^^
-
-error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements
-  --> $DIR/E0490.rs:6:20
-   |
-LL |     let x: &'a _ = &y;
-   |                    ^^
-   |
-note: first, the lifetime cannot outlive the lifetime `'b` as defined here...
-  --> $DIR/E0490.rs:5:10
-   |
-LL | fn f<'a, 'b>(y: &'b ()) {
-   |          ^^
-note: ...so that the type `&'b ()` is not borrowed for too long
-  --> $DIR/E0490.rs:6:20
-   |
-LL |     let x: &'a _ = &y;
-   |                    ^^
-note: but, the lifetime must be valid for the lifetime `'a` as defined here...
-  --> $DIR/E0490.rs:5:6
-   |
-LL | fn f<'a, 'b>(y: &'b ()) {
-   |      ^^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/E0490.rs:6:20
-   |
-LL |     let x: &'a _ = &y;
-   |                    ^^
-
-error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
-  --> $DIR/E0490.rs:6:20
-   |
-LL |     let x: &'a _ = &y;
-   |                    ^^
-   |
-note: first, the lifetime cannot outlive the lifetime `'b` as defined here...
-  --> $DIR/E0490.rs:5:10
-   |
-LL | fn f<'a, 'b>(y: &'b ()) {
-   |          ^^
-note: ...so that the expression is assignable
-  --> $DIR/E0490.rs:6:20
-   |
-LL |     let x: &'a _ = &y;
-   |                    ^^
-   = note: expected `&'a &()`
-              found `&'a &'b ()`
-note: but, the lifetime must be valid for the lifetime `'a` as defined here...
-  --> $DIR/E0490.rs:5:6
-   |
-LL | fn f<'a, 'b>(y: &'b ()) {
-   |      ^^
-note: ...so that the reference type `&'a &()` does not outlive the data it points at
-  --> $DIR/E0490.rs:6:12
-   |
-LL |     let x: &'a _ = &y;
-   |            ^^^^^
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/error-codes/E0490.nll.stderr b/src/test/ui/error-codes/E0490.nll.stderr
deleted file mode 100644
index 80bf076e2bd..00000000000
--- a/src/test/ui/error-codes/E0490.nll.stderr
+++ /dev/null
@@ -1,28 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/E0490.rs:6:12
-   |
-LL | fn f<'a, 'b>(y: &'b ()) {
-   |      --  -- lifetime `'b` defined here
-   |      |
-   |      lifetime `'a` defined here
-LL |     let x: &'a _ = &y;
-   |            ^^^^^ type annotation requires that `'b` must outlive `'a`
-   |
-   = help: consider adding the following bound: `'b: 'a`
-
-error[E0597]: `y` does not live long enough
-  --> $DIR/E0490.rs:6:20
-   |
-LL | fn f<'a, 'b>(y: &'b ()) {
-   |      -- lifetime `'a` defined here
-LL |     let x: &'a _ = &y;
-   |            -----   ^^ borrowed value does not live long enough
-   |            |
-   |            type annotation requires that `y` is borrowed for `'a`
-...
-LL | }
-   |  - `y` dropped here while still borrowed
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0597`.
diff --git a/src/test/ui/error-codes/E0490.rs b/src/test/ui/error-codes/E0490.rs
deleted file mode 100644
index 304548215dc..00000000000
--- a/src/test/ui/error-codes/E0490.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
-fn f<'a, 'b>(y: &'b ()) {
-    let x: &'a _ = &y;
-    //[base]~^ E0490
-    //[base]~| E0495
-    //[base]~| E0495
-    //[nll]~^^^^ lifetime may not live long enough
-    //[nll]~| E0597
-}
-
-fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-nll.rs b/src/test/ui/feature-gates/feature-gate-nll.rs
deleted file mode 100644
index fd6c5b67ef6..00000000000
--- a/src/test/ui/feature-gates/feature-gate-nll.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// There isn't a great way to test feature(nll), since it just disables migrate
-// mode and changes some error messages.
-
-// FIXME(Centril): This test is probably obsolete now and `nll` should become
-// `accepted`.
-
-// Don't use compare-mode=nll, since that turns on NLL.
-// ignore-compare-mode-nll
-// ignore-compare-mode-polonius
-
-fn main() {
-    let mut x = (33, &0);
-
-    let m = &mut x;
-    let p = &*x.1;
-    //~^ ERROR cannot borrow
-    m;
-}
diff --git a/src/test/ui/feature-gates/feature-gate-nll.stderr b/src/test/ui/feature-gates/feature-gate-nll.stderr
deleted file mode 100644
index edfc22c32c9..00000000000
--- a/src/test/ui/feature-gates/feature-gate-nll.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0502]: cannot borrow `*x.1` as immutable because it is also borrowed as mutable
-  --> $DIR/feature-gate-nll.rs:15:13
-   |
-LL |     let m = &mut x;
-   |             ------ mutable borrow occurs here
-LL |     let p = &*x.1;
-   |             ^^^^^ immutable borrow occurs here
-LL |
-LL |     m;
-   |     - mutable borrow later used here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0502`.
diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type.base.stderr b/src/test/ui/fn/implied-bounds-unnorm-associated-type.base.stderr
deleted file mode 100644
index 6f0ea1af057..00000000000
--- a/src/test/ui/fn/implied-bounds-unnorm-associated-type.base.stderr
+++ /dev/null
@@ -1,13 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/implied-bounds-unnorm-associated-type.rs:18:5
-   |
-LL | fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str {
-   |                 -------      ----------
-   |                 |
-   |                 these two types are declared with different lifetimes...
-LL |     s
-   |     ^ ...but data from `s` flows here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type.rs b/src/test/ui/fn/implied-bounds-unnorm-associated-type.rs
index 30bd042009b..04b6f4dd84e 100644
--- a/src/test/ui/fn/implied-bounds-unnorm-associated-type.rs
+++ b/src/test/ui/fn/implied-bounds-unnorm-associated-type.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 // check-fail
 // See issue #91068. Types in the substs of an associated type can't be implied
 // to be WF, since they don't actually have to be constructed.
@@ -16,8 +12,7 @@ impl<T> Trait for T {
 
 fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str {
     s
-    //[base]~^ ERROR lifetime mismatch [E0623]
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type.nll.stderr b/src/test/ui/fn/implied-bounds-unnorm-associated-type.stderr
index a7a91f3e685..8096f08385c 100644
--- a/src/test/ui/fn/implied-bounds-unnorm-associated-type.nll.stderr
+++ b/src/test/ui/fn/implied-bounds-unnorm-associated-type.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/implied-bounds-unnorm-associated-type.rs:18:5
+  --> $DIR/implied-bounds-unnorm-associated-type.rs:14:5
    |
 LL | fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str {
    |      --  -- lifetime `'b` defined here
diff --git a/src/test/ui/generator/auto-trait-regions.base.stderr b/src/test/ui/generator/auto-trait-regions.base.stderr
deleted file mode 100644
index d44c8eb1b82..00000000000
--- a/src/test/ui/generator/auto-trait-regions.base.stderr
+++ /dev/null
@@ -1,38 +0,0 @@
-error: implementation of `Foo` is not general enough
-  --> $DIR/auto-trait-regions.rs:35:5
-   |
-LL |     assert_foo(gen);
-   |     ^^^^^^^^^^ implementation of `Foo` is not general enough
-   |
-   = note: `&'0 OnlyFooIfStaticRef` must implement `Foo`, for any lifetime `'0`...
-   = note: ...but `Foo` is actually implemented for the type `&'static OnlyFooIfStaticRef`
-
-error: implementation of `Foo` is not general enough
-  --> $DIR/auto-trait-regions.rs:35:5
-   |
-LL |     assert_foo(gen);
-   |     ^^^^^^^^^^ implementation of `Foo` is not general enough
-   |
-   = note: `&'0 OnlyFooIfStaticRef` must implement `Foo`, for any lifetime `'0`...
-   = note: ...but `Foo` is actually implemented for the type `&'static OnlyFooIfStaticRef`
-
-error: implementation of `Foo` is not general enough
-  --> $DIR/auto-trait-regions.rs:56:5
-   |
-LL |     assert_foo(gen);
-   |     ^^^^^^^^^^ implementation of `Foo` is not general enough
-   |
-   = note: `Foo` would have to be implemented for the type `A<'0, '1>`, for any two lifetimes `'0` and `'1`...
-   = note: ...but `Foo` is actually implemented for the type `A<'_, '2>`, for some specific lifetime `'2`
-
-error: implementation of `Foo` is not general enough
-  --> $DIR/auto-trait-regions.rs:56:5
-   |
-LL |     assert_foo(gen);
-   |     ^^^^^^^^^^ implementation of `Foo` is not general enough
-   |
-   = note: `Foo` would have to be implemented for the type `A<'0, '1>`, for any two lifetimes `'0` and `'1`...
-   = note: ...but `Foo` is actually implemented for the type `A<'_, '2>`, for some specific lifetime `'2`
-
-error: aborting due to 4 previous errors
-
diff --git a/src/test/ui/generator/auto-trait-regions.rs b/src/test/ui/generator/auto-trait-regions.rs
index 98af4a39391..ea4b0d554cd 100644
--- a/src/test/ui/generator/auto-trait-regions.rs
+++ b/src/test/ui/generator/auto-trait-regions.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 #![feature(generators)]
 #![feature(auto_traits)]
 #![feature(negative_impls)]
@@ -34,7 +30,6 @@ fn main() {
     };
     assert_foo(gen);
     //~^ ERROR implementation of `Foo` is not general enough
-    //[base]~^^ ERROR implementation of `Foo` is not general enough
 
     // Allow impls which matches any lifetime
     let x = &OnlyFooIfRef(No);
@@ -48,12 +43,11 @@ fn main() {
     // Disallow impls which relates lifetimes in the generator interior
     let gen = || {
         let a = A(&mut true, &mut true, No);
-        //[nll]~^ temporary value dropped while borrowed
-        //[nll]~| temporary value dropped while borrowed
+        //~^ temporary value dropped while borrowed
+        //~| temporary value dropped while borrowed
         yield;
         assert_foo(a);
     };
     assert_foo(gen);
     //~^ ERROR not general enough
-    //[base]~^^ ERROR not general enough
 }
diff --git a/src/test/ui/generator/auto-trait-regions.nll.stderr b/src/test/ui/generator/auto-trait-regions.stderr
index 25456881fa0..23324af6171 100644
--- a/src/test/ui/generator/auto-trait-regions.nll.stderr
+++ b/src/test/ui/generator/auto-trait-regions.stderr
@@ -1,5 +1,5 @@
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/auto-trait-regions.rs:50:24
+  --> $DIR/auto-trait-regions.rs:45:24
    |
 LL |         let a = A(&mut true, &mut true, No);
    |                        ^^^^                - temporary value is freed at the end of this statement
@@ -12,7 +12,7 @@ LL |         assert_foo(a);
    = note: consider using a `let` binding to create a longer lived value
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/auto-trait-regions.rs:50:35
+  --> $DIR/auto-trait-regions.rs:45:35
    |
 LL |         let a = A(&mut true, &mut true, No);
    |                                   ^^^^     - temporary value is freed at the end of this statement
@@ -25,7 +25,7 @@ LL |         assert_foo(a);
    = note: consider using a `let` binding to create a longer lived value
 
 error: implementation of `Foo` is not general enough
-  --> $DIR/auto-trait-regions.rs:35:5
+  --> $DIR/auto-trait-regions.rs:31:5
    |
 LL |     assert_foo(gen);
    |     ^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
@@ -34,7 +34,7 @@ LL |     assert_foo(gen);
    = note: ...but `Foo` is actually implemented for the type `&'static OnlyFooIfStaticRef`
 
 error: implementation of `Foo` is not general enough
-  --> $DIR/auto-trait-regions.rs:56:5
+  --> $DIR/auto-trait-regions.rs:51:5
    |
 LL |     assert_foo(gen);
    |     ^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
diff --git a/src/test/ui/generator/generator-region-requirements.base.stderr b/src/test/ui/generator/generator-region-requirements.base.stderr
deleted file mode 100644
index 89f6a81ad3b..00000000000
--- a/src/test/ui/generator/generator-region-requirements.base.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/generator-region-requirements.rs:12:9
-   |
-LL | fn dangle(x: &mut i32) -> &'static mut i32 {
-   |              -------- this data with an anonymous lifetime `'_`...
-...
-LL |         x
-   |         ^ ...is used here...
-...
-LL |             GeneratorState::Complete(c) => return c,
-   |                                                   - ...and is required to live as long as `'static` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0759`.
diff --git a/src/test/ui/generator/generator-region-requirements.rs b/src/test/ui/generator/generator-region-requirements.rs
index ec718b17460..7269a79ca3f 100644
--- a/src/test/ui/generator/generator-region-requirements.rs
+++ b/src/test/ui/generator/generator-region-requirements.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 #![feature(generators, generator_trait)]
 use std::ops::{Generator, GeneratorState};
 use std::pin::Pin;
@@ -10,12 +6,11 @@ fn dangle(x: &mut i32) -> &'static mut i32 {
     let mut g = || {
         yield;
         x
-        //[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
     };
     loop {
         match Pin::new(&mut g).resume(()) {
             GeneratorState::Complete(c) => return c,
-            //[nll]~^ ERROR lifetime may not live long enough
+            //~^ ERROR lifetime may not live long enough
             GeneratorState::Yielded(_) => (),
         }
     }
diff --git a/src/test/ui/generator/generator-region-requirements.nll.stderr b/src/test/ui/generator/generator-region-requirements.stderr
index 9f54c6c9dc1..87f60467287 100644
--- a/src/test/ui/generator/generator-region-requirements.nll.stderr
+++ b/src/test/ui/generator/generator-region-requirements.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/generator-region-requirements.rs:17:51
+  --> $DIR/generator-region-requirements.rs:12:51
    |
 LL | fn dangle(x: &mut i32) -> &'static mut i32 {
    |              - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/generator/issue-87142.rs b/src/test/ui/generator/issue-87142.rs
new file mode 100644
index 00000000000..fc10d04d46c
--- /dev/null
+++ b/src/test/ui/generator/issue-87142.rs
@@ -0,0 +1,32 @@
+// compile-flags: -Cdebuginfo=2
+// build-pass
+
+// Regression test for #87142
+// This test needs the above flags and the "lib" crate type.
+
+#![feature(type_alias_impl_trait, generator_trait, generators)]
+#![crate_type = "lib"]
+
+use std::ops::Generator;
+
+pub trait GeneratorProviderAlt: Sized {
+    type Gen: Generator<(), Return = (), Yield = ()>;
+
+    fn start(ctx: Context<Self>) -> Self::Gen;
+}
+
+pub struct Context<G: 'static + GeneratorProviderAlt> {
+    pub link: Box<G::Gen>,
+}
+
+impl GeneratorProviderAlt for () {
+    type Gen = impl Generator<(), Return = (), Yield = ()>;
+    fn start(ctx: Context<Self>) -> Self::Gen {
+        move || {
+            match ctx {
+                _ => (),
+            }
+            yield ();
+        }
+    }
+}
diff --git a/src/test/ui/generator/resume-arg-late-bound.base.stderr b/src/test/ui/generator/resume-arg-late-bound.base.stderr
deleted file mode 100644
index 8521951d0c9..00000000000
--- a/src/test/ui/generator/resume-arg-late-bound.base.stderr
+++ /dev/null
@@ -1,49 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/resume-arg-late-bound.rs:19:5
-   |
-LL |     test(gen);
-   |     ^^^^ lifetime mismatch
-   |
-   = note: expected type `for<'a> Generator<&'a mut bool>`
-              found type `Generator<&mut bool>`
-note: the required lifetime does not necessarily outlive the anonymous lifetime #1 defined here
-  --> $DIR/resume-arg-late-bound.rs:15:15
-   |
-LL |       let gen = |arg: &mut bool| {
-   |  _______________^
-LL | |         yield ();
-LL | |         *arg = true;
-LL | |     };
-   | |_____^
-note: the lifetime requirement is introduced here
-  --> $DIR/resume-arg-late-bound.rs:12:17
-   |
-LL | fn test(a: impl for<'a> Generator<&'a mut bool>) {}
-   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0308]: mismatched types
-  --> $DIR/resume-arg-late-bound.rs:19:5
-   |
-LL |     test(gen);
-   |     ^^^^ lifetime mismatch
-   |
-   = note: expected type `for<'a> Generator<&'a mut bool>`
-              found type `Generator<&mut bool>`
-note: the anonymous lifetime #1 defined here doesn't meet the lifetime requirements
-  --> $DIR/resume-arg-late-bound.rs:15:15
-   |
-LL |       let gen = |arg: &mut bool| {
-   |  _______________^
-LL | |         yield ();
-LL | |         *arg = true;
-LL | |     };
-   | |_____^
-note: the lifetime requirement is introduced here
-  --> $DIR/resume-arg-late-bound.rs:12:17
-   |
-LL | fn test(a: impl for<'a> Generator<&'a mut bool>) {}
-   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/generator/resume-arg-late-bound.rs b/src/test/ui/generator/resume-arg-late-bound.rs
index b973d8a300a..1c35ba80d2b 100644
--- a/src/test/ui/generator/resume-arg-late-bound.rs
+++ b/src/test/ui/generator/resume-arg-late-bound.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 //! Tests that we cannot produce a generator that accepts a resume argument
 //! with any lifetime and then stores it across a `yield`.
 
@@ -18,5 +14,4 @@ fn main() {
     };
     test(gen);
     //~^ ERROR mismatched types
-    //[base]~^^ ERROR mismatched types
 }
diff --git a/src/test/ui/generator/resume-arg-late-bound.nll.stderr b/src/test/ui/generator/resume-arg-late-bound.stderr
index 868d1352f25..b5144c607a8 100644
--- a/src/test/ui/generator/resume-arg-late-bound.nll.stderr
+++ b/src/test/ui/generator/resume-arg-late-bound.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/resume-arg-late-bound.rs:19:5
+  --> $DIR/resume-arg-late-bound.rs:15:5
    |
 LL |     test(gen);
    |     ^^^^^^^^^ one type is more general than the other
@@ -7,7 +7,7 @@ LL |     test(gen);
    = note: expected type `for<'a> Generator<&'a mut bool>`
               found type `Generator<&mut bool>`
 note: the lifetime requirement is introduced here
-  --> $DIR/resume-arg-late-bound.rs:12:17
+  --> $DIR/resume-arg-late-bound.rs:8:17
    |
 LL | fn test(a: impl for<'a> Generator<&'a mut bool>) {}
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/generic-associated-types/bugs/issue-89352.base.stderr b/src/test/ui/generic-associated-types/bugs/issue-89352.base.stderr
deleted file mode 100644
index 81125a7d6f3..00000000000
--- a/src/test/ui/generic-associated-types/bugs/issue-89352.base.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/issue-89352.rs:36:13
-   |
-LL |         let a = A::reborrow::<'ai, 's>(self.a.clone());
-   |             ^ lifetime mismatch
-   |
-   = note: expected type `<<A as GenAssoc<T>>::Iter<'s> as Sized>`
-              found type `<<A as GenAssoc<T>>::Iter<'ai> as Sized>`
-note: the lifetime `'s` as defined here...
-  --> $DIR/issue-89352.rs:35:13
-   |
-LL |     fn iter<'s>(&'s self) -> Self::Iter<'s> {
-   |             ^^
-note: ...does not necessarily outlive the lifetime `'ai` as defined here
-  --> $DIR/issue-89352.rs:30:6
-   |
-LL | impl<'ai, T: 'ai, A: GenAssoc<T>> GenAssoc<T> for Wrapper<'ai, T, A>
-   |      ^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/generic-associated-types/elided-in-expr-position.stderr b/src/test/ui/generic-associated-types/elided-in-expr-position.stderr
index 9263f3d67e3..b395a1cfd8a 100644
--- a/src/test/ui/generic-associated-types/elided-in-expr-position.stderr
+++ b/src/test/ui/generic-associated-types/elided-in-expr-position.stderr
@@ -11,7 +11,7 @@ LL |     type Assoc<'a> where Self: 'a;
    |          ^^^^^ --
 help: add missing lifetime argument
    |
-LL |     fn g(&self) -> Self::Assoc<'_>;
+LL |     fn g(&self) -> Self::Assoc<'a>;
    |                          ~~~~~~~~~
 
 error[E0107]: missing generics for associated type `Trait::Assoc`
@@ -27,7 +27,7 @@ LL |     type Assoc<'a> where Self: 'a;
    |          ^^^^^ --
 help: add missing lifetime argument
    |
-LL |     fn g(&self) -> Self::Assoc<'_> {
+LL |     fn g(&self) -> Self::Assoc<'a> {
    |                          ~~~~~~~~~
 
 error: aborting due to 2 previous errors
diff --git a/src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr b/src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr
index aa1e50014fe..3da7794b3d2 100644
--- a/src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr
+++ b/src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr
@@ -1,5 +1,5 @@
 error[E0276]: impl has stricter requirements than trait
-  --> $DIR/lending_iterator.rs:16:45
+  --> $DIR/lending_iterator.rs:14:45
    |
 LL |     fn from_iter<T: for<'x> LendingIterator<Item<'x> = A>>(iter: T) -> Self;
    |     ------------------------------------------------------------------------ definition of `from_iter` from trait
@@ -7,20 +7,6 @@ LL |     fn from_iter<T: for<'x> LendingIterator<Item<'x> = A>>(iter: T) -> Self
 LL |     fn from_iter<I: for<'x> LendingIterator<Item<'x> = A>>(mut iter: I) -> Self {
    |                                             ^^^^^^^^^^^^ impl has extra requirement `I: 'x`
 
-error[E0311]: the parameter type `Self` may not live long enough
-  --> $DIR/lending_iterator.rs:37:9
-   |
-LL |         <B as FromLendingIterator<A>>::from_iter(self)
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = help: consider adding an explicit lifetime bound `Self: 'a`...
-   = note: ...so that the type `Self` will meet its required lifetime bounds...
-note: ...that is required by this bound
-  --> $DIR/lending_iterator.rs:12:45
-   |
-LL |     fn from_iter<T: for<'x> LendingIterator<Item<'x> = A>>(iter: T) -> Self;
-   |                                             ^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
 For more information about this error, try `rustc --explain E0276`.
diff --git a/src/test/ui/generic-associated-types/extended/lending_iterator.rs b/src/test/ui/generic-associated-types/extended/lending_iterator.rs
index 6048e6e87c0..ede16476636 100644
--- a/src/test/ui/generic-associated-types/extended/lending_iterator.rs
+++ b/src/test/ui/generic-associated-types/extended/lending_iterator.rs
@@ -1,5 +1,3 @@
-// FIXME(nll): this is experimental anyways, don't really care about the output
-// ignore-compare-mode-nll
 // revisions: base extended
 //[base] check-fail
 //[extended] check-pass
@@ -35,7 +33,6 @@ pub trait LendingIterator {
         Self: for<'q> LendingIterator<Item<'q> = A>,
     {
         <B as FromLendingIterator<A>>::from_iter(self)
-        //[base]~^ the parameter type
     }
 }
 
diff --git a/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs b/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs
index f01da8c61ed..c55b0530c9d 100644
--- a/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs
+++ b/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs
@@ -10,4 +10,9 @@ fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {}
   //~| ERROR this associated type takes 0 generic arguments but 1 generic argument
   //~| ERROR this associated type takes 1 lifetime argument but 0 lifetime arguments
 
+
+fn bar<'a>(arg: Box<dyn X<Y() = ()>>) {}
+  //~^ ERROR: parenthesized generic arguments cannot be used
+  //~| ERROR this associated type takes 1 lifetime argument but 0 lifetime arguments
+
 fn main() {}
diff --git a/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr b/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr
index 6014a02c4d9..162214063e7 100644
--- a/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr
+++ b/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr
@@ -9,6 +9,19 @@ error: parenthesized generic arguments cannot be used in associated type constra
    |
 LL | fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {}
    |                           ^^^^^
+   |
+help: use angle brackets instead
+   |
+LL | fn foo<'a>(arg: Box<dyn X<Y<'a> = &'a ()>>) {}
+   |                            ~  ~
+
+error: parenthesized generic arguments cannot be used in associated type constraints
+  --> $DIR/gat-trait-path-parenthesised-args.rs:14:27
+   |
+LL | fn bar<'a>(arg: Box<dyn X<Y() = ()>>) {}
+   |                           ^--
+   |                            |
+   |                            help: remove these parentheses
 
 error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
   --> $DIR/gat-trait-path-parenthesised-args.rs:7:27
@@ -40,6 +53,22 @@ note: associated type defined here, with 0 generic parameters
 LL |   type Y<'a>;
    |        ^
 
-error: aborting due to 4 previous errors
+error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
+  --> $DIR/gat-trait-path-parenthesised-args.rs:14:27
+   |
+LL | fn bar<'a>(arg: Box<dyn X<Y() = ()>>) {}
+   |                           ^ expected 1 lifetime argument
+   |
+note: associated type defined here, with 1 lifetime parameter: `'a`
+  --> $DIR/gat-trait-path-parenthesised-args.rs:4:8
+   |
+LL |   type Y<'a>;
+   |        ^ --
+help: add missing lifetime argument
+   |
+LL | fn bar<'a>(arg: Box<dyn X<Y('a) = ()>>) {}
+   |                             ++
+
+error: aborting due to 6 previous errors
 
 For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/generic-associated-types/issue-81862.stderr b/src/test/ui/generic-associated-types/issue-81862.stderr
index 024f8ad89f7..c664b3ee668 100644
--- a/src/test/ui/generic-associated-types/issue-81862.stderr
+++ b/src/test/ui/generic-associated-types/issue-81862.stderr
@@ -11,7 +11,7 @@ LL |     type Item<'a>;
    |          ^^^^ --
 help: add missing lifetime argument
    |
-LL |     fn next(&mut self) -> Option<Self::Item<'_>>;
+LL |     fn next(&mut self) -> Option<Self::Item<'a>>;
    |                                        ~~~~~~~~
 
 error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/bugs/issue-89352.rs b/src/test/ui/generic-associated-types/issue-89352.rs
index a9f0dd0a0b4..d9c656d5f58 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-89352.rs
+++ b/src/test/ui/generic-associated-types/issue-89352.rs
@@ -1,16 +1,4 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
-//[base] check-fail
-//[nll] check-pass
-// known-bug
-
-// This should pass, but we end up with `A::Iter<'ai>: Sized` for some specific
-// `'ai`. We also know that `for<'at> A::Iter<'at>: Sized` from the definition,
-// but we prefer param env candidates. We changed this to preference in #92191,
-// but this led to unintended consequences (#93262). Suprisingly, this passes
-// under NLL. So only a bug in migrate mode.
+// check-pass
 
 #![feature(generic_associated_types)]
 
diff --git a/src/test/ui/generic-associated-types/issue-91139.rs b/src/test/ui/generic-associated-types/issue-91139.rs
index 78b2b63dadc..03dc8ef93fe 100644
--- a/src/test/ui/generic-associated-types/issue-91139.rs
+++ b/src/test/ui/generic-associated-types/issue-91139.rs
@@ -1,13 +1,4 @@
-// revisions: migrate nll
-//[nll]compile-flags: -Z borrowck=mir
-
-// Since we are testing nll (and migration) explicitly as a separate
-// revisions, don't worry about the --compare-mode=nll on this test.
-
-// ignore-compare-mode-nll
-
-//[nll] check-pass
-//[migrate] check-fail
+//check-pass
 
 #![feature(generic_associated_types)]
 
@@ -25,7 +16,6 @@ impl<T> Foo<T> for () {
 
 fn foo<T>() {
     let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
-    //[migrate]~^ the parameter type `T` may not live long enough
 }
 
 pub fn main() {}
diff --git a/src/test/ui/generic-associated-types/issue-92096.rs b/src/test/ui/generic-associated-types/issue-92096.rs
index 066132a5d98..bfe0fc15fd3 100644
--- a/src/test/ui/generic-associated-types/issue-92096.rs
+++ b/src/test/ui/generic-associated-types/issue-92096.rs
@@ -1,10 +1,6 @@
 // edition:2018
-// [nll] check-pass
-// revisions: migrate nll
-// Explicitly testing nll with revision, so ignore compare-mode=nll
-// ignore-compare-mode-nll
+// check-pass
 
-#![cfg_attr(nll, feature(nll))]
 #![feature(generic_associated_types)]
 
 use std::future::Future;
@@ -18,8 +14,6 @@ trait Client {
 }
 
 fn call_connect<C>(c: &'_ C) -> impl '_ + Future + Send
-//[migrate]~^ ERROR the parameter
-//[migrate]~| ERROR the parameter
 where
     C: Client + Send + Sync,
 {
diff --git a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.base.stderr b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.base.stderr
deleted file mode 100644
index 341e2e05d1c..00000000000
--- a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.base.stderr
+++ /dev/null
@@ -1,33 +0,0 @@
-error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/projection-type-lifetime-mismatch.rs:21:7
-   |
-LL | fn f(x: &impl for<'a> X<Y<'a> = &'a ()>) -> &'static () {
-   |         ------------------------------- this data with an anonymous lifetime `'_`...
-LL |     x.m()
-   |     - ^
-   |     |
-   |     ...is used and required to live as long as `'static` here
-
-error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/projection-type-lifetime-mismatch.rs:27:7
-   |
-LL | fn g<T: for<'a> X<Y<'a> = &'a ()>>(x: &T) -> &'static () {
-   |                                       -- this data with an anonymous lifetime `'_`...
-LL |     x.m()
-   |     - ^
-   |     |
-   |     ...is used and required to live as long as `'static` here
-
-error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/projection-type-lifetime-mismatch.rs:33:7
-   |
-LL | fn h(x: &()) -> &'static () {
-   |         --- this data with an anonymous lifetime `'_`...
-LL |     x.m()
-   |     - ^
-   |     |
-   |     ...is used and required to live as long as `'static` here
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0759`.
diff --git a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs
index 9f14c6f3dc0..a40c0c2c4c7 100644
--- a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs
+++ b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 #![feature(generic_associated_types)]
 
 pub trait X {
@@ -19,20 +15,17 @@ impl X for () {
 
 fn f(x: &impl for<'a> X<Y<'a> = &'a ()>) -> &'static () {
     x.m()
-    //[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn g<T: for<'a> X<Y<'a> = &'a ()>>(x: &T) -> &'static () {
     x.m()
-    //[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn h(x: &()) -> &'static () {
     x.m()
-    //[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.nll.stderr b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.stderr
index 00395af4889..4620aa34e84 100644
--- a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.nll.stderr
+++ b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/projection-type-lifetime-mismatch.rs:21:5
+  --> $DIR/projection-type-lifetime-mismatch.rs:17:5
    |
 LL | fn f(x: &impl for<'a> X<Y<'a> = &'a ()>) -> &'static () {
    |         - let's call the lifetime of this reference `'1`
@@ -7,7 +7,7 @@ LL |     x.m()
    |     ^^^^^ returning this value requires that `'1` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/projection-type-lifetime-mismatch.rs:27:5
+  --> $DIR/projection-type-lifetime-mismatch.rs:22:5
    |
 LL | fn g<T: for<'a> X<Y<'a> = &'a ()>>(x: &T) -> &'static () {
    |                                       - let's call the lifetime of this reference `'1`
@@ -15,7 +15,7 @@ LL |     x.m()
    |     ^^^^^ returning this value requires that `'1` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/projection-type-lifetime-mismatch.rs:33:5
+  --> $DIR/projection-type-lifetime-mismatch.rs:27:5
    |
 LL | fn h(x: &()) -> &'static () {
    |         - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/generic-associated-types/trait-objects.base.stderr b/src/test/ui/generic-associated-types/trait-objects.base.stderr
index eed12f56be2..1df76a21bf9 100644
--- a/src/test/ui/generic-associated-types/trait-objects.base.stderr
+++ b/src/test/ui/generic-associated-types/trait-objects.base.stderr
@@ -1,11 +1,11 @@
 error[E0038]: the trait `StreamingIterator` cannot be made into an object
-  --> $DIR/trait-objects.rs:16:21
+  --> $DIR/trait-objects.rs:14:21
    |
 LL | fn min_size(x: &mut dyn for<'a> StreamingIterator<Item<'a> = &'a i32>) -> usize {
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `StreamingIterator` cannot be made into an object
    |
 note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
-  --> $DIR/trait-objects.rs:10:10
+  --> $DIR/trait-objects.rs:8:10
    |
 LL | trait StreamingIterator {
    |       ----------------- this trait cannot be made into an object...
diff --git a/src/test/ui/generic-associated-types/trait-objects.extended.stderr b/src/test/ui/generic-associated-types/trait-objects.extended.stderr
index c7b072256ad..52d48d57859 100644
--- a/src/test/ui/generic-associated-types/trait-objects.extended.stderr
+++ b/src/test/ui/generic-associated-types/trait-objects.extended.stderr
@@ -1,12 +1,17 @@
-error[E0621]: explicit lifetime required in the type of `x`
-  --> $DIR/trait-objects.rs:18:7
+error[E0521]: borrowed data escapes outside of function
+  --> $DIR/trait-objects.rs:16:5
    |
 LL | fn min_size(x: &mut dyn for<'a> StreamingIterator<Item<'a> = &'a i32>) -> usize {
-   |                ------------------------------------------------------ help: add explicit lifetime `'a` to the type of `x`: `&'a mut (dyn StreamingIterator<for<'a> Item = &'a i32> + 'a)`
+   |             -  - let's call the lifetime of this reference `'1`
+   |             |
+   |             `x` is a reference that is only valid in the function body
 LL |
 LL |     x.size_hint().0
-   |       ^^^^^^^^^ lifetime `'a` required
+   |     ^^^^^^^^^^^^^
+   |     |
+   |     `x` escapes the function body here
+   |     argument requires that `'1` must outlive `'static`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0621`.
+For more information about this error, try `rustc --explain E0521`.
diff --git a/src/test/ui/generic-associated-types/trait-objects.rs b/src/test/ui/generic-associated-types/trait-objects.rs
index d742d2051be..c1da1e0a326 100644
--- a/src/test/ui/generic-associated-types/trait-objects.rs
+++ b/src/test/ui/generic-associated-types/trait-objects.rs
@@ -1,5 +1,3 @@
-// FIXME(nll): this is experimental anyways, don't really care about the output
-// ignore-compare-mode-nll
 // revisions: base extended
 
 #![feature(generic_associated_types)]
@@ -16,7 +14,7 @@ trait StreamingIterator {
 fn min_size(x: &mut dyn for<'a> StreamingIterator<Item<'a> = &'a i32>) -> usize {
     //[base]~^ the trait `StreamingIterator` cannot be made into an object
     x.size_hint().0
-    //[extended]~^ explicit lifetime required
+    //[extended]~^ borrowed data escapes
 }
 
 fn main() {}
diff --git a/src/test/ui/higher-rank-trait-bounds/issue-59311.base.stderr b/src/test/ui/higher-rank-trait-bounds/issue-59311.base.stderr
deleted file mode 100644
index ec576ee529a..00000000000
--- a/src/test/ui/higher-rank-trait-bounds/issue-59311.base.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0477]: the type `&'a V` does not fulfill the required lifetime
-  --> $DIR/issue-59311.rs:21:5
-   |
-LL |     v.t(|| {});
-   |     ^^^^^^^^^^
-   |
-note: type must satisfy the static lifetime as required by this binding
-  --> $DIR/issue-59311.rs:19:24
-   |
-LL |     for<'a> &'a V: T + 'static,
-   |                        ^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0477`.
diff --git a/src/test/ui/higher-rank-trait-bounds/issue-59311.rs b/src/test/ui/higher-rank-trait-bounds/issue-59311.rs
index a63c5754f8f..3ad548450e5 100644
--- a/src/test/ui/higher-rank-trait-bounds/issue-59311.rs
+++ b/src/test/ui/higher-rank-trait-bounds/issue-59311.rs
@@ -6,10 +6,6 @@
 // an error, but the regression test is here to ensure
 // that it does not ICE. See discussion on #74889 for details.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 pub trait T {
     fn t<F: Fn()>(&self, _: F) {}
 }
@@ -19,9 +15,8 @@ where
     for<'a> &'a V: T + 'static,
 {
     v.t(|| {});
-    //[base]~^ ERROR: `&'a V` does not fulfill the required lifetime
-    //[nll]~^^ ERROR: higher-ranked lifetime error
-    //[nll]~| ERROR: higher-ranked lifetime error
+    //~^ ERROR: higher-ranked lifetime error
+    //~| ERROR: higher-ranked lifetime error
 }
 
 fn main() {}
diff --git a/src/test/ui/higher-rank-trait-bounds/issue-59311.nll.stderr b/src/test/ui/higher-rank-trait-bounds/issue-59311.stderr
index 7f98cefdf01..15e83ab5a34 100644
--- a/src/test/ui/higher-rank-trait-bounds/issue-59311.nll.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/issue-59311.stderr
@@ -1,13 +1,13 @@
 error: higher-ranked lifetime error
-  --> $DIR/issue-59311.rs:21:5
+  --> $DIR/issue-59311.rs:17:5
    |
 LL |     v.t(|| {});
    |     ^^^^^^^^^^
    |
-   = note: could not prove [closure@$DIR/issue-59311.rs:21:9: 21:14] well-formed
+   = note: could not prove [closure@$DIR/issue-59311.rs:17:9: 17:14] well-formed
 
 error: higher-ranked lifetime error
-  --> $DIR/issue-59311.rs:21:9
+  --> $DIR/issue-59311.rs:17:9
    |
 LL |     v.t(|| {});
    |         ^^^^^
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.base.stderr b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.base.stderr
deleted file mode 100644
index c24afdd418b..00000000000
--- a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.base.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: implementation of `Parser` is not general enough
-  --> $DIR/issue-71955.rs:49:5
-   |
-LL |     foo(bar, "string", |s| s.len() == 5);
-   |     ^^^ implementation of `Parser` is not general enough
-   |
-   = note: `for<'a> fn(&'a str) -> (&'a str, &'a str) {bar}` must implement `Parser<'0>`, for any lifetime `'0`...
-   = note: ...but it actually implements `Parser<'1>`, for some specific lifetime `'1`
-
-error: implementation of `Parser` is not general enough
-  --> $DIR/issue-71955.rs:53:5
-   |
-LL |     foo(baz, "string", |s| s.0.len() == 5);
-   |     ^^^ implementation of `Parser` is not general enough
-   |
-   = note: `for<'a> fn(&'a str) -> (&'a str, Wrapper<'a>) {baz}` must implement `Parser<'0>`, for any lifetime `'0`...
-   = note: ...but it actually implements `Parser<'1>`, for some specific lifetime `'1`
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.migrate.stderr b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.migrate.stderr
index e6ffe38ee92..0f38f8e3283 100644
--- a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.migrate.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.migrate.stderr
@@ -1,20 +1,79 @@
-error: implementation of `Parser` is not general enough
+error[E0308]: mismatched types
   --> $DIR/issue-71955.rs:54:5
    |
 LL |     foo(bar, "string", |s| s.len() == 5);
-   |     ^^^ implementation of `Parser` is not general enough
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
    |
-   = note: `for<'a> fn(&'a str) -> (&'a str, &'a str) {bar}` must implement `Parser<'0>`, for any lifetime `'0`...
-   = note: ...but it actually implements `Parser<'1>`, for some specific lifetime `'1`
+   = note: expected type `for<'r, 's> FnOnce<(&'r &'s str,)>`
+              found type `for<'r> FnOnce<(&'r &str,)>`
+note: this closure does not fulfill the lifetime requirements
+  --> $DIR/issue-71955.rs:54:24
+   |
+LL |     foo(bar, "string", |s| s.len() == 5);
+   |                        ^^^^^^^^^^^^^^^^
+note: the lifetime requirement is introduced here
+  --> $DIR/issue-71955.rs:34:9
+   |
+LL |     F2: FnOnce(&<F1 as Parser>::Output) -> bool
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0308]: mismatched types
+  --> $DIR/issue-71955.rs:54:5
+   |
+LL |     foo(bar, "string", |s| s.len() == 5);
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+   |
+   = note: expected type `FnOnce<(&&str,)>`
+              found type `for<'r> FnOnce<(&'r &str,)>`
+note: this closure does not fulfill the lifetime requirements
+  --> $DIR/issue-71955.rs:54:24
+   |
+LL |     foo(bar, "string", |s| s.len() == 5);
+   |                        ^^^^^^^^^^^^^^^^
+note: the lifetime requirement is introduced here
+  --> $DIR/issue-71955.rs:34:44
+   |
+LL |     F2: FnOnce(&<F1 as Parser>::Output) -> bool
+   |                                            ^^^^
 
-error: implementation of `Parser` is not general enough
+error[E0308]: mismatched types
   --> $DIR/issue-71955.rs:58:5
    |
 LL |     foo(baz, "string", |s| s.0.len() == 5);
-   |     ^^^ implementation of `Parser` is not general enough
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+   |
+   = note: expected type `for<'r, 's> FnOnce<(&'r Wrapper<'s>,)>`
+              found type `for<'r> FnOnce<(&'r Wrapper<'_>,)>`
+note: this closure does not fulfill the lifetime requirements
+  --> $DIR/issue-71955.rs:58:24
+   |
+LL |     foo(baz, "string", |s| s.0.len() == 5);
+   |                        ^^^^^^^^^^^^^^^^^^
+note: the lifetime requirement is introduced here
+  --> $DIR/issue-71955.rs:34:9
+   |
+LL |     F2: FnOnce(&<F1 as Parser>::Output) -> bool
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0308]: mismatched types
+  --> $DIR/issue-71955.rs:58:5
+   |
+LL |     foo(baz, "string", |s| s.0.len() == 5);
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+   |
+   = note: expected type `FnOnce<(&Wrapper<'_>,)>`
+              found type `for<'r> FnOnce<(&'r Wrapper<'_>,)>`
+note: this closure does not fulfill the lifetime requirements
+  --> $DIR/issue-71955.rs:58:24
+   |
+LL |     foo(baz, "string", |s| s.0.len() == 5);
+   |                        ^^^^^^^^^^^^^^^^^^
+note: the lifetime requirement is introduced here
+  --> $DIR/issue-71955.rs:34:44
    |
-   = note: `for<'a> fn(&'a str) -> (&'a str, Wrapper<'a>) {baz}` must implement `Parser<'0>`, for any lifetime `'0`...
-   = note: ...but it actually implements `Parser<'1>`, for some specific lifetime `'1`
+LL |     F2: FnOnce(&<F1 as Parser>::Output) -> bool
+   |                                            ^^^^
 
-error: aborting due to 2 previous errors
+error: aborting due to 4 previous errors
 
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.rs b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.rs
index 8d283afd09d..1d90226a3f4 100644
--- a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.rs
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 // check-fail
 #![feature(rustc_attrs)]
 
@@ -47,11 +43,9 @@ fn main() {
     }
 
     foo(bar, "string", |s| s.len() == 5);
-    //[base]~^ ERROR implementation of `Parser` is not general enough
-    //[nll]~^^ ERROR mismatched types
-    //[nll]~| ERROR mismatched types
+    //~^ ERROR mismatched types
+    //~| ERROR mismatched types
     foo(baz, "string", |s| s.0.len() == 5);
-    //[base]~^ ERROR implementation of `Parser` is not general enough
-    //[nll]~^^ ERROR mismatched types
-    //[nll]~| ERROR mismatched types
+    //~^ ERROR mismatched types
+    //~| ERROR mismatched types
 }
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.nll.stderr b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.stderr
index 9d3cd4dee53..340371031e8 100644
--- a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.nll.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-71955.rs:49:5
+  --> $DIR/issue-71955.rs:45:5
    |
 LL |     foo(bar, "string", |s| s.len() == 5);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
@@ -7,18 +7,18 @@ LL |     foo(bar, "string", |s| s.len() == 5);
    = note: expected type `for<'r, 's> FnOnce<(&'r &'s str,)>`
               found type `for<'r> FnOnce<(&'r &str,)>`
 note: this closure does not fulfill the lifetime requirements
-  --> $DIR/issue-71955.rs:49:24
+  --> $DIR/issue-71955.rs:45:24
    |
 LL |     foo(bar, "string", |s| s.len() == 5);
    |                        ^^^^^^^^^^^^^^^^
 note: the lifetime requirement is introduced here
-  --> $DIR/issue-71955.rs:29:9
+  --> $DIR/issue-71955.rs:25:9
    |
 LL |     F2: FnOnce(&<F1 as Parser>::Output) -> bool
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/issue-71955.rs:49:5
+  --> $DIR/issue-71955.rs:45:5
    |
 LL |     foo(bar, "string", |s| s.len() == 5);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
@@ -26,18 +26,18 @@ LL |     foo(bar, "string", |s| s.len() == 5);
    = note: expected type `FnOnce<(&&str,)>`
               found type `for<'r> FnOnce<(&'r &str,)>`
 note: this closure does not fulfill the lifetime requirements
-  --> $DIR/issue-71955.rs:49:24
+  --> $DIR/issue-71955.rs:45:24
    |
 LL |     foo(bar, "string", |s| s.len() == 5);
    |                        ^^^^^^^^^^^^^^^^
 note: the lifetime requirement is introduced here
-  --> $DIR/issue-71955.rs:29:44
+  --> $DIR/issue-71955.rs:25:44
    |
 LL |     F2: FnOnce(&<F1 as Parser>::Output) -> bool
    |                                            ^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/issue-71955.rs:53:5
+  --> $DIR/issue-71955.rs:48:5
    |
 LL |     foo(baz, "string", |s| s.0.len() == 5);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
@@ -45,18 +45,18 @@ LL |     foo(baz, "string", |s| s.0.len() == 5);
    = note: expected type `for<'r, 's> FnOnce<(&'r Wrapper<'s>,)>`
               found type `for<'r> FnOnce<(&'r Wrapper<'_>,)>`
 note: this closure does not fulfill the lifetime requirements
-  --> $DIR/issue-71955.rs:53:24
+  --> $DIR/issue-71955.rs:48:24
    |
 LL |     foo(baz, "string", |s| s.0.len() == 5);
    |                        ^^^^^^^^^^^^^^^^^^
 note: the lifetime requirement is introduced here
-  --> $DIR/issue-71955.rs:29:9
+  --> $DIR/issue-71955.rs:25:9
    |
 LL |     F2: FnOnce(&<F1 as Parser>::Output) -> bool
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/issue-71955.rs:53:5
+  --> $DIR/issue-71955.rs:48:5
    |
 LL |     foo(baz, "string", |s| s.0.len() == 5);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
@@ -64,12 +64,12 @@ LL |     foo(baz, "string", |s| s.0.len() == 5);
    = note: expected type `FnOnce<(&Wrapper<'_>,)>`
               found type `for<'r> FnOnce<(&'r Wrapper<'_>,)>`
 note: this closure does not fulfill the lifetime requirements
-  --> $DIR/issue-71955.rs:53:24
+  --> $DIR/issue-71955.rs:48:24
    |
 LL |     foo(baz, "string", |s| s.0.len() == 5);
    |                        ^^^^^^^^^^^^^^^^^^
 note: the lifetime requirement is introduced here
-  --> $DIR/issue-71955.rs:29:44
+  --> $DIR/issue-71955.rs:25:44
    |
 LL |     F2: FnOnce(&<F1 as Parser>::Output) -> bool
    |                                            ^^^^
diff --git a/src/test/ui/hr-subtype/hr-subtype-nll.bound_a_b_ret_a_vs_bound_a_ret_a.stderr b/src/test/ui/hr-subtype/hr-subtype-nll.bound_a_b_ret_a_vs_bound_a_ret_a.stderr
deleted file mode 100644
index 3edb1064e3e..00000000000
--- a/src/test/ui/hr-subtype/hr-subtype-nll.bound_a_b_ret_a_vs_bound_a_ret_a.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/hr-subtype-nll.rs:60:13
-   |
-LL |               gimme::<$t1>(None::<$t2>);
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
-...
-LL | / check! { bound_a_b_ret_a_vs_bound_a_ret_a: (for<'a,'b> fn(&'a u32, &'b u32) -> &'a u32,
-LL | | for<'a>    fn(&'a u32, &'a u32) -> &'a u32) }
-   | |_____________________________________________- in this macro invocation
-   |
-   = note: expected enum `Option<for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32>`
-              found enum `Option<for<'a> fn(&'a u32, &'a u32) -> &'a u32>`
-   = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/hr-subtype/hr-subtype-nll.bound_a_vs_free_x.stderr b/src/test/ui/hr-subtype/hr-subtype-nll.bound_a_vs_free_x.stderr
deleted file mode 100644
index f02eeea90bf..00000000000
--- a/src/test/ui/hr-subtype/hr-subtype-nll.bound_a_vs_free_x.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/hr-subtype-nll.rs:60:13
-   |
-LL |               gimme::<$t1>(None::<$t2>);
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
-...
-LL | / check! { bound_a_vs_free_x: (for<'a> fn(&'a u32),
-LL | | fn(&'x u32)) }
-   | |______________- in this macro invocation
-   |
-   = note: expected enum `Option<for<'a> fn(&'a u32)>`
-              found enum `Option<fn(&u32)>`
-   = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/hr-subtype/hr-subtype-nll.bound_inv_a_b_vs_bound_inv_a.stderr b/src/test/ui/hr-subtype/hr-subtype-nll.bound_inv_a_b_vs_bound_inv_a.stderr
deleted file mode 100644
index bfc9793fe5d..00000000000
--- a/src/test/ui/hr-subtype/hr-subtype-nll.bound_inv_a_b_vs_bound_inv_a.stderr
+++ /dev/null
@@ -1,31 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/hr-subtype-nll.rs:60:13
-   |
-LL |               gimme::<$t1>(None::<$t2>);
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
-...
-LL | / check! { bound_inv_a_b_vs_bound_inv_a: (for<'a,'b> fn(Inv<'a>, Inv<'b>),
-LL | | for<'a>    fn(Inv<'a>, Inv<'a>)) }
-   | |__________________________________- in this macro invocation
-   |
-   = note: expected enum `Option<for<'a, 'b> fn(Inv<'a>, Inv<'b>)>`
-              found enum `Option<for<'a> fn(Inv<'a>, Inv<'a>)>`
-   = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0308]: mismatched types
-  --> $DIR/hr-subtype-nll.rs:60:13
-   |
-LL |               gimme::<$t1>(None::<$t2>);
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
-...
-LL | / check! { bound_inv_a_b_vs_bound_inv_a: (for<'a,'b> fn(Inv<'a>, Inv<'b>),
-LL | | for<'a>    fn(Inv<'a>, Inv<'a>)) }
-   | |__________________________________- in this macro invocation
-   |
-   = note: expected enum `Option<for<'a, 'b> fn(Inv<'a>, Inv<'b>)>`
-              found enum `Option<for<'a> fn(Inv<'a>, Inv<'a>)>`
-   = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/hr-subtype/hr-subtype-nll.free_inv_x_vs_free_inv_y.stderr b/src/test/ui/hr-subtype/hr-subtype-nll.free_inv_x_vs_free_inv_y.stderr
deleted file mode 100644
index ee0dc877fd1..00000000000
--- a/src/test/ui/hr-subtype/hr-subtype-nll.free_inv_x_vs_free_inv_y.stderr
+++ /dev/null
@@ -1,42 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/hr-subtype-nll.rs:54:13
-   |
-LL |           fn subtype<'x, 'y: 'x, 'z: 'y>() {
-   |                      --  -- lifetime `'y` defined here
-   |                      |
-   |                      lifetime `'x` defined here
-LL |               gimme::<$t2>(None::<$t1>);
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y`
-...
-LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
-LL | | fn(Inv<'y>)) }
-   | |______________- in this macro invocation
-   |
-   = help: consider adding the following bound: `'x: 'y`
-   = note: requirement occurs because of the type `Inv<'_>`, which makes the generic argument `'_` invariant
-   = note: the struct `Inv<'a>` is invariant over the parameter `'a`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-   = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: lifetime may not live long enough
-  --> $DIR/hr-subtype-nll.rs:60:13
-   |
-LL |           fn supertype<'x, 'y: 'x, 'z: 'y>() {
-   |                        --  -- lifetime `'y` defined here
-   |                        |
-   |                        lifetime `'x` defined here
-LL |               gimme::<$t1>(None::<$t2>);
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y`
-...
-LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
-LL | | fn(Inv<'y>)) }
-   | |______________- in this macro invocation
-   |
-   = help: consider adding the following bound: `'x: 'y`
-   = note: requirement occurs because of the type `Inv<'_>`, which makes the generic argument `'_` invariant
-   = note: the struct `Inv<'a>` is invariant over the parameter `'a`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-   = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/hr-subtype/hr-subtype-nll.free_x_vs_free_y.stderr b/src/test/ui/hr-subtype/hr-subtype-nll.free_x_vs_free_y.stderr
deleted file mode 100644
index 75904d6df99..00000000000
--- a/src/test/ui/hr-subtype/hr-subtype-nll.free_x_vs_free_y.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/hr-subtype-nll.rs:60:13
-   |
-LL |           fn supertype<'x, 'y: 'x, 'z: 'y>() {
-   |                        --  -- lifetime `'y` defined here
-   |                        |
-   |                        lifetime `'x` defined here
-LL |               gimme::<$t1>(None::<$t2>);
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y`
-...
-LL | / check! { free_x_vs_free_y: (fn(&'x u32),
-LL | | fn(&'y u32)) }
-   | |______________- in this macro invocation
-   |
-   = help: consider adding the following bound: `'x: 'y`
-   = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/hr-subtype/hr-subtype-nll.rs b/src/test/ui/hr-subtype/hr-subtype-nll.rs
deleted file mode 100644
index 7fc1692b350..00000000000
--- a/src/test/ui/hr-subtype/hr-subtype-nll.rs
+++ /dev/null
@@ -1,117 +0,0 @@
-// Targeted tests for the higher-ranked subtyping code.
-
-#![allow(dead_code)]
-
-// revisions: bound_a_vs_bound_a
-// revisions: bound_a_vs_bound_b
-// revisions: bound_inv_a_vs_bound_inv_b
-// revisions: bound_co_a_vs_bound_co_b
-// revisions: bound_a_vs_free_x
-// revisions: free_x_vs_free_x
-// revisions: free_x_vs_free_y
-// revisions: free_inv_x_vs_free_inv_y
-// revisions: bound_a_b_vs_bound_a
-// revisions: bound_co_a_b_vs_bound_co_a
-// revisions: bound_contra_a_contra_b_ret_co_a
-// revisions: bound_co_a_co_b_ret_contra_a
-// revisions: bound_inv_a_b_vs_bound_inv_a
-// revisions: bound_a_b_ret_a_vs_bound_a_ret_a
-
-//[bound_a_vs_bound_a] check-pass
-//[bound_a_vs_bound_b] check-pass
-//[bound_inv_a_vs_bound_inv_b] check-pass
-//[bound_co_a_vs_bound_co_b] check-pass
-//[free_x_vs_free_x] check-pass
-//[bound_co_a_b_vs_bound_co_a] check-pass
-//[bound_co_a_co_b_ret_contra_a] check-pass
-//[bound_a_b_vs_bound_a] check-pass
-//[bound_contra_a_contra_b_ret_co_a] check-pass
-
-// compile-flags: -Z borrowck=mir
-// ignore-compare-mode-nll
-// FIXME(nll): When stabilizing, this test should be replace with `hr-subtype.rs`
-// The two would normally be just revisions, but this test uses revisions heavily, so splitting into
-// a separate test is just easier.
-
-fn gimme<T>(_: Option<T>) {}
-
-struct Inv<'a> {
-    x: *mut &'a u32,
-}
-
-struct Co<'a> {
-    x: fn(&'a u32),
-}
-
-struct Contra<'a> {
-    x: &'a u32,
-}
-
-macro_rules! check {
-    ($rev:ident: ($t1:ty, $t2:ty)) => {
-        #[cfg($rev)]
-        fn subtype<'x, 'y: 'x, 'z: 'y>() {
-            gimme::<$t2>(None::<$t1>);
-            //[free_inv_x_vs_free_inv_y]~^ ERROR
-        }
-
-        #[cfg($rev)]
-        fn supertype<'x, 'y: 'x, 'z: 'y>() {
-            gimme::<$t1>(None::<$t2>);
-            //[bound_a_vs_free_x]~^ ERROR
-            //[free_x_vs_free_y]~^^ ERROR
-            //[bound_inv_a_b_vs_bound_inv_a]~^^^ ERROR
-            //[bound_inv_a_b_vs_bound_inv_a]~| ERROR
-            //[bound_a_b_ret_a_vs_bound_a_ret_a]~^^^^^ ERROR
-            //[free_inv_x_vs_free_inv_y]~^^^^^^ ERROR
-        }
-    };
-}
-
-// If both have bound regions, they are equivalent, regardless of
-// variant.
-check! { bound_a_vs_bound_a: (for<'a> fn(&'a u32),
-for<'a> fn(&'a u32)) }
-check! { bound_a_vs_bound_b: (for<'a> fn(&'a u32),
-for<'b> fn(&'b u32)) }
-check! { bound_inv_a_vs_bound_inv_b: (for<'a> fn(Inv<'a>),
-for<'b> fn(Inv<'b>)) }
-check! { bound_co_a_vs_bound_co_b: (for<'a> fn(Co<'a>),
-for<'b> fn(Co<'b>)) }
-
-// Bound is a subtype of free.
-check! { bound_a_vs_free_x: (for<'a> fn(&'a u32),
-fn(&'x u32)) }
-
-// Two free regions are relatable if subtyping holds.
-check! { free_x_vs_free_x: (fn(&'x u32),
-fn(&'x u32)) }
-check! { free_x_vs_free_y: (fn(&'x u32),
-fn(&'y u32)) }
-check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
-fn(Inv<'y>)) }
-
-// Somewhat surprisingly, a fn taking two distinct bound lifetimes and
-// a fn taking one bound lifetime can be interchangeable, but only if
-// we are co- or contra-variant with respect to both lifetimes.
-//
-// The reason is:
-// - if we are covariant, then 'a and 'b can be set to the call-site
-//   intersection;
-// - if we are contravariant, then 'a can be inferred to 'static.
-check! { bound_a_b_vs_bound_a: (for<'a,'b> fn(&'a u32, &'b u32),
-for<'a>    fn(&'a u32, &'a u32)) }
-check! { bound_co_a_b_vs_bound_co_a: (for<'a,'b> fn(Co<'a>, Co<'b>),
-for<'a>    fn(Co<'a>, Co<'a>)) }
-check! { bound_contra_a_contra_b_ret_co_a: (for<'a,'b> fn(Contra<'a>, Contra<'b>) -> Co<'a>,
-for<'a>    fn(Contra<'a>, Contra<'a>) -> Co<'a>) }
-check! { bound_co_a_co_b_ret_contra_a: (for<'a,'b> fn(Co<'a>, Co<'b>) -> Contra<'a>,
-for<'a>    fn(Co<'a>, Co<'a>) -> Contra<'a>) }
-
-// If we make those lifetimes invariant, then the two types are not interchangeable.
-check! { bound_inv_a_b_vs_bound_inv_a: (for<'a,'b> fn(Inv<'a>, Inv<'b>),
-for<'a>    fn(Inv<'a>, Inv<'a>)) }
-check! { bound_a_b_ret_a_vs_bound_a_ret_a: (for<'a,'b> fn(&'a u32, &'b u32) -> &'a u32,
-for<'a>    fn(&'a u32, &'a u32) -> &'a u32) }
-
-fn main() {}
diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr
index 13e9fa8a894..b7264c7e933 100644
--- a/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr
+++ b/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr
@@ -1,8 +1,8 @@
 error[E0308]: mismatched types
-  --> $DIR/hr-subtype.rs:59:26
+  --> $DIR/hr-subtype.rs:54:13
    |
 LL |               gimme::<$t1>(None::<$t2>);
-   |                            ^^^^^^^^^^^ one type is more general than the other
+   |               ^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
 ...
 LL | / check! { bound_a_b_ret_a_vs_bound_a_ret_a: (for<'a,'b> fn(&'a u32, &'b u32) -> &'a u32,
 LL | | for<'a>    fn(&'a u32, &'a u32) -> &'a u32) }
diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr
index b66ff5a392e..2355979b0f9 100644
--- a/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr
+++ b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr
@@ -1,15 +1,15 @@
 error[E0308]: mismatched types
-  --> $DIR/hr-subtype.rs:59:26
+  --> $DIR/hr-subtype.rs:54:13
    |
 LL |               gimme::<$t1>(None::<$t2>);
-   |                            ^^^^^^^^^^^ one type is more general than the other
+   |               ^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
 ...
 LL | / check! { bound_a_vs_free_x: (for<'a> fn(&'a u32),
 LL | | fn(&'x u32)) }
    | |______________- in this macro invocation
    |
    = note: expected enum `Option<for<'a> fn(&'a u32)>`
-              found enum `Option<fn(&'x u32)>`
+              found enum `Option<fn(&u32)>`
    = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to previous error
diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr
index fa715fd354e..a73c03feb87 100644
--- a/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr
+++ b/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr
@@ -1,8 +1,8 @@
 error[E0308]: mismatched types
-  --> $DIR/hr-subtype.rs:59:26
+  --> $DIR/hr-subtype.rs:54:13
    |
 LL |               gimme::<$t1>(None::<$t2>);
-   |                            ^^^^^^^^^^^ one type is more general than the other
+   |               ^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
 ...
 LL | / check! { bound_inv_a_b_vs_bound_inv_a: (for<'a,'b> fn(Inv<'a>, Inv<'b>),
 LL | | for<'a>    fn(Inv<'a>, Inv<'a>)) }
@@ -12,6 +12,20 @@ LL | | for<'a>    fn(Inv<'a>, Inv<'a>)) }
               found enum `Option<for<'a> fn(Inv<'a>, Inv<'a>)>`
    = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error: aborting due to previous error
+error[E0308]: mismatched types
+  --> $DIR/hr-subtype.rs:54:13
+   |
+LL |               gimme::<$t1>(None::<$t2>);
+   |               ^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+...
+LL | / check! { bound_inv_a_b_vs_bound_inv_a: (for<'a,'b> fn(Inv<'a>, Inv<'b>),
+LL | | for<'a>    fn(Inv<'a>, Inv<'a>)) }
+   | |__________________________________- in this macro invocation
+   |
+   = note: expected enum `Option<for<'a, 'b> fn(Inv<'a>, Inv<'b>)>`
+              found enum `Option<for<'a> fn(Inv<'a>, Inv<'a>)>`
+   = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr b/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr
index 377689603aa..31d36d7168b 100644
--- a/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr
+++ b/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr
@@ -1,67 +1,42 @@
-error[E0308]: mismatched types
-  --> $DIR/hr-subtype.rs:53:26
-   |
-LL |               gimme::<$t2>(None::<$t1>);
-   |                            ^^^^^^^^^^^ lifetime mismatch
-...
-LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
-LL | | fn(Inv<'y>)) }
-   | |______________- in this macro invocation
-   |
-   = note: expected enum `Option<fn(Inv<'y>)>`
-              found enum `Option<fn(Inv<'x>)>`
-note: the lifetime `'x` as defined here...
-  --> $DIR/hr-subtype.rs:52:20
+error: lifetime may not live long enough
+  --> $DIR/hr-subtype.rs:48:13
    |
 LL |           fn subtype<'x, 'y: 'x, 'z: 'y>() {
-   |                      ^^
+   |                      --  -- lifetime `'y` defined here
+   |                      |
+   |                      lifetime `'x` defined here
+LL |               gimme::<$t2>(None::<$t1>);
+   |               ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y`
 ...
 LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
 LL | | fn(Inv<'y>)) }
    | |______________- in this macro invocation
-note: ...does not necessarily outlive the lifetime `'y` as defined here
-  --> $DIR/hr-subtype.rs:52:24
    |
-LL |           fn subtype<'x, 'y: 'x, 'z: 'y>() {
-   |                          ^^
-...
-LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
-LL | | fn(Inv<'y>)) }
-   | |______________- in this macro invocation
+   = help: consider adding the following bound: `'x: 'y`
+   = note: requirement occurs because of the type `Inv<'_>`, which makes the generic argument `'_` invariant
+   = note: the struct `Inv<'a>` is invariant over the parameter `'a`
+   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
    = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0308]: mismatched types
-  --> $DIR/hr-subtype.rs:59:26
-   |
-LL |               gimme::<$t1>(None::<$t2>);
-   |                            ^^^^^^^^^^^ lifetime mismatch
-...
-LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
-LL | | fn(Inv<'y>)) }
-   | |______________- in this macro invocation
-   |
-   = note: expected enum `Option<fn(Inv<'x>)>`
-              found enum `Option<fn(Inv<'y>)>`
-note: the lifetime `'x` as defined here...
-  --> $DIR/hr-subtype.rs:58:22
+error: lifetime may not live long enough
+  --> $DIR/hr-subtype.rs:54:13
    |
 LL |           fn supertype<'x, 'y: 'x, 'z: 'y>() {
-   |                        ^^
+   |                        --  -- lifetime `'y` defined here
+   |                        |
+   |                        lifetime `'x` defined here
+LL |               gimme::<$t1>(None::<$t2>);
+   |               ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y`
 ...
 LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
 LL | | fn(Inv<'y>)) }
    | |______________- in this macro invocation
-note: ...does not necessarily outlive the lifetime `'y` as defined here
-  --> $DIR/hr-subtype.rs:58:26
    |
-LL |           fn supertype<'x, 'y: 'x, 'z: 'y>() {
-   |                            ^^
-...
-LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
-LL | | fn(Inv<'y>)) }
-   | |______________- in this macro invocation
+   = help: consider adding the following bound: `'x: 'y`
+   = note: requirement occurs because of the type `Inv<'_>`, which makes the generic argument `'_` invariant
+   = note: the struct `Inv<'a>` is invariant over the parameter `'a`
+   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
    = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.stderr b/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.stderr
index 9e5eb972f47..269cde54c7e 100644
--- a/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.stderr
+++ b/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.stderr
@@ -1,35 +1,19 @@
-error[E0308]: mismatched types
-  --> $DIR/hr-subtype.rs:59:26
-   |
-LL |               gimme::<$t1>(None::<$t2>);
-   |                            ^^^^^^^^^^^ lifetime mismatch
-...
-LL | / check! { free_x_vs_free_y: (fn(&'x u32),
-LL | | fn(&'y u32)) }
-   | |______________- in this macro invocation
-   |
-   = note: expected enum `Option<fn(&'x u32)>`
-              found enum `Option<fn(&'y u32)>`
-note: the lifetime `'x` as defined here...
-  --> $DIR/hr-subtype.rs:58:22
+error: lifetime may not live long enough
+  --> $DIR/hr-subtype.rs:54:13
    |
 LL |           fn supertype<'x, 'y: 'x, 'z: 'y>() {
-   |                        ^^
+   |                        --  -- lifetime `'y` defined here
+   |                        |
+   |                        lifetime `'x` defined here
+LL |               gimme::<$t1>(None::<$t2>);
+   |               ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y`
 ...
 LL | / check! { free_x_vs_free_y: (fn(&'x u32),
 LL | | fn(&'y u32)) }
    | |______________- in this macro invocation
-note: ...does not necessarily outlive the lifetime `'y` as defined here
-  --> $DIR/hr-subtype.rs:58:26
    |
-LL |           fn supertype<'x, 'y: 'x, 'z: 'y>() {
-   |                            ^^
-...
-LL | / check! { free_x_vs_free_y: (fn(&'x u32),
-LL | | fn(&'y u32)) }
-   | |______________- in this macro invocation
+   = help: consider adding the following bound: `'x: 'y`
    = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/hr-subtype/hr-subtype.rs b/src/test/ui/hr-subtype/hr-subtype.rs
index 33929cdb868..c770e0de85c 100644
--- a/src/test/ui/hr-subtype/hr-subtype.rs
+++ b/src/test/ui/hr-subtype/hr-subtype.rs
@@ -27,11 +27,6 @@
 //[bound_a_b_vs_bound_a] check-pass
 //[bound_contra_a_contra_b_ret_co_a] check-pass
 
-// ignore-compare-mode-nll
-// FIXME(nll): When stabilizing, this test should be replaced with `hr-subtype-nll.rs`
-// The two would normally be just revisions, but this test uses revisions heavily, so splitting into
-// a separate test is just easier.
-
 fn gimme<T>(_: Option<T>) {}
 
 struct Inv<'a> {
@@ -60,8 +55,9 @@ macro_rules! check {
             //[bound_a_vs_free_x]~^ ERROR
             //[free_x_vs_free_y]~^^ ERROR
             //[bound_inv_a_b_vs_bound_inv_a]~^^^ ERROR
-            //[bound_a_b_ret_a_vs_bound_a_ret_a]~^^^^ ERROR
-            //[free_inv_x_vs_free_inv_y]~^^^^^ ERROR
+            //[bound_inv_a_b_vs_bound_inv_a]~| ERROR
+            //[bound_a_b_ret_a_vs_bound_a_ret_a]~^^^^^ ERROR
+            //[free_inv_x_vs_free_inv_y]~^^^^^^ ERROR
         }
     };
 }
diff --git a/src/test/ui/hr-subtype/placeholder-pattern-fail.base.stderr b/src/test/ui/hr-subtype/placeholder-pattern-fail.base.stderr
deleted file mode 100644
index c6cb77d8d8d..00000000000
--- a/src/test/ui/hr-subtype/placeholder-pattern-fail.base.stderr
+++ /dev/null
@@ -1,42 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/placeholder-pattern-fail.rs:13:47
-   |
-LL |     let _: for<'a, 'b> fn(Inv<'a>, Inv<'b>) = sub;
-   |                                               ^^^ one type is more general than the other
-   |
-   = note: expected fn pointer `for<'a, 'b> fn(Inv<'a>, Inv<'b>)`
-              found fn pointer `for<'a> fn(Inv<'a>, Inv<'a>)`
-
-error[E0308]: mismatched types
-  --> $DIR/placeholder-pattern-fail.rs:18:31
-   |
-LL |     let _x: (&'static i32,) = x;
-   |                               ^ lifetime mismatch
-   |
-   = note: expected tuple `(&'static i32,)`
-              found tuple `(&'c i32,)`
-note: the lifetime `'c` as defined here...
-  --> $DIR/placeholder-pattern-fail.rs:17:12
-   |
-LL | fn simple1<'c>(x: (&'c i32,)) {
-   |            ^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error[E0308]: mismatched types
-  --> $DIR/placeholder-pattern-fail.rs:23:30
-   |
-LL |     let _: (&'static i32,) = x;
-   |                              ^ lifetime mismatch
-   |
-   = note: expected tuple `(&'static i32,)`
-              found tuple `(&'c i32,)`
-note: the lifetime `'c` as defined here...
-  --> $DIR/placeholder-pattern-fail.rs:22:12
-   |
-LL | fn simple2<'c>(x: (&'c i32,)) {
-   |            ^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/hr-subtype/placeholder-pattern-fail.rs b/src/test/ui/hr-subtype/placeholder-pattern-fail.rs
index ac276a88982..bd4533e0433 100644
--- a/src/test/ui/hr-subtype/placeholder-pattern-fail.rs
+++ b/src/test/ui/hr-subtype/placeholder-pattern-fail.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 // Check that incorrect higher ranked subtyping
 // causes an error.
 struct Inv<'a>(fn(&'a ()) -> &'a ());
@@ -16,12 +12,10 @@ fn hr_subtype<'c>(f: for<'a, 'b> fn(Inv<'a>, Inv<'a>)) {
 
 fn simple1<'c>(x: (&'c i32,)) {
     let _x: (&'static i32,) = x;
-    //[base]~^ ERROR mismatched types
 }
 
 fn simple2<'c>(x: (&'c i32,)) {
     let _: (&'static i32,) = x;
-    //[base]~^ ERROR mismatched types
 }
 
 fn main() {
diff --git a/src/test/ui/hr-subtype/placeholder-pattern-fail.nll.stderr b/src/test/ui/hr-subtype/placeholder-pattern-fail.stderr
index a1f713d8afb..73b0a317364 100644
--- a/src/test/ui/hr-subtype/placeholder-pattern-fail.nll.stderr
+++ b/src/test/ui/hr-subtype/placeholder-pattern-fail.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/placeholder-pattern-fail.rs:13:47
+  --> $DIR/placeholder-pattern-fail.rs:9:47
    |
 LL |     let _: for<'a, 'b> fn(Inv<'a>, Inv<'b>) = sub;
    |                                               ^^^ one type is more general than the other
diff --git a/src/test/ui/hrtb/hrtb-conflate-regions.base.stderr b/src/test/ui/hrtb/hrtb-conflate-regions.base.stderr
deleted file mode 100644
index e55e56f916b..00000000000
--- a/src/test/ui/hrtb/hrtb-conflate-regions.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: implementation of `Foo` is not general enough
-  --> $DIR/hrtb-conflate-regions.rs:31:10
-   |
-LL | fn b() { want_foo2::<SomeStruct>(); }
-   |          ^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
-   |
-   = note: `SomeStruct` must implement `Foo<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
-   = note: ...but it actually implements `Foo<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/hrtb/hrtb-conflate-regions.rs b/src/test/ui/hrtb/hrtb-conflate-regions.rs
index 11285d07575..e83686404a3 100644
--- a/src/test/ui/hrtb/hrtb-conflate-regions.rs
+++ b/src/test/ui/hrtb/hrtb-conflate-regions.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 // Test that an impl with only one bound region `'a` cannot be used to
 // satisfy a constraint where there are two bound regions.
 
@@ -29,8 +25,7 @@ impl<'a> Foo<(&'a isize, &'a isize)> for SomeStruct
 
 fn a() { want_foo1::<SomeStruct>(); } // OK -- foo wants just one region
 fn b() { want_foo2::<SomeStruct>(); }
-//[base]~^ ERROR
-//[nll]~^^ ERROR implementation of
-//[nll]~| ERROR implementation of
+//~^ ERROR implementation of
+//~| ERROR implementation of
 
 fn main() { }
diff --git a/src/test/ui/hrtb/hrtb-conflate-regions.nll.stderr b/src/test/ui/hrtb/hrtb-conflate-regions.stderr
index 61b549b9cd7..46f5308dd87 100644
--- a/src/test/ui/hrtb/hrtb-conflate-regions.nll.stderr
+++ b/src/test/ui/hrtb/hrtb-conflate-regions.stderr
@@ -1,5 +1,5 @@
 error: implementation of `Foo` is not general enough
-  --> $DIR/hrtb-conflate-regions.rs:31:10
+  --> $DIR/hrtb-conflate-regions.rs:27:10
    |
 LL | fn b() { want_foo2::<SomeStruct>(); }
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
@@ -8,7 +8,7 @@ LL | fn b() { want_foo2::<SomeStruct>(); }
    = note: ...but it actually implements `Foo<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
 
 error: implementation of `Foo` is not general enough
-  --> $DIR/hrtb-conflate-regions.rs:31:10
+  --> $DIR/hrtb-conflate-regions.rs:27:10
    |
 LL | fn b() { want_foo2::<SomeStruct>(); }
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.base.stderr b/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.base.stderr
deleted file mode 100644
index 006b6756b1e..00000000000
--- a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: implementation of `Trait` is not general enough
-  --> $DIR/hrtb-exists-forall-trait-contravariant.rs:38:5
-   |
-LL |     foo::<()>();
-   |     ^^^^^^^^^ implementation of `Trait` is not general enough
-   |
-   = note: `()` must implement `Trait<for<'b> fn(&'b u32)>`
-   = note: ...but it actually implements `Trait<fn(&'0 u32)>`, for some specific lifetime `'0`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.rs b/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.rs
index 4b33dcb2cab..921061916fc 100644
--- a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.rs
+++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 // Test a case where variance and higher-ranked types interact in surprising ways.
 //
 // In particular, we test this pattern in trait solving, where it is not connected
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.nll.stderr b/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.stderr
index 23b50728264..364b613fc77 100644
--- a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.nll.stderr
+++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.stderr
@@ -1,5 +1,5 @@
 error: implementation of `Trait` is not general enough
-  --> $DIR/hrtb-exists-forall-trait-contravariant.rs:38:5
+  --> $DIR/hrtb-exists-forall-trait-contravariant.rs:34:5
    |
 LL |     foo::<()>();
    |     ^^^^^^^^^^^ implementation of `Trait` is not general enough
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.base.stderr b/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.base.stderr
deleted file mode 100644
index 05575b01834..00000000000
--- a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: implementation of `Trait` is not general enough
-  --> $DIR/hrtb-exists-forall-trait-invariant.rs:32:5
-   |
-LL |     foo::<()>();
-   |     ^^^^^^^^^ implementation of `Trait` is not general enough
-   |
-   = note: `()` must implement `Trait<for<'b> fn(Cell<&'b u32>)>`
-   = note: ...but it actually implements `Trait<fn(Cell<&'0 u32>)>`, for some specific lifetime `'0`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.rs b/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.rs
index c779bc3f46c..9b9e4496a87 100644
--- a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.rs
+++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 // Test an `exists<'a> { forall<'b> { 'a = 'b } }` pattern -- which should not compile!
 //
 // In particular, we test this pattern in trait solving, where it is not connected
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.nll.stderr b/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.stderr
index 58d59f60379..cb2ce8a4116 100644
--- a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.nll.stderr
+++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.stderr
@@ -1,5 +1,5 @@
 error: implementation of `Trait` is not general enough
-  --> $DIR/hrtb-exists-forall-trait-invariant.rs:32:5
+  --> $DIR/hrtb-exists-forall-trait-invariant.rs:28:5
    |
 LL |     foo::<()>();
    |     ^^^^^^^^^^^ implementation of `Trait` is not general enough
diff --git a/src/test/ui/hrtb/hrtb-just-for-static.base.stderr b/src/test/ui/hrtb/hrtb-just-for-static.base.stderr
deleted file mode 100644
index 6e20b100664..00000000000
--- a/src/test/ui/hrtb/hrtb-just-for-static.base.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: implementation of `Foo` is not general enough
-  --> $DIR/hrtb-just-for-static.rs:28:5
-   |
-LL |     want_hrtb::<StaticInt>()
-   |     ^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
-   |
-   = note: `StaticInt` must implement `Foo<&'0 isize>`, for any lifetime `'0`...
-   = note: ...but it actually implements `Foo<&'static isize>`
-
-error: implementation of `Foo` is not general enough
-  --> $DIR/hrtb-just-for-static.rs:34:5
-   |
-LL |     want_hrtb::<&'a u32>()
-   |     ^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
-   |
-   = note: `Foo<&'0 isize>` would have to be implemented for the type `&'a u32`, for any lifetime `'0`...
-   = note: ...but `Foo<&'1 isize>` is actually implemented for the type `&'1 u32`, for some specific lifetime `'1`
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/hrtb/hrtb-just-for-static.rs b/src/test/ui/hrtb/hrtb-just-for-static.rs
index dc70609c168..ffafdce2a6c 100644
--- a/src/test/ui/hrtb/hrtb-just-for-static.rs
+++ b/src/test/ui/hrtb/hrtb-just-for-static.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 // Test a case where you have an impl of `Foo<X>` for all `X` that
 // is being applied to `for<'a> Foo<&'a mut X>`. Issue #19730.
 
@@ -32,9 +28,8 @@ fn give_static() {
 impl<'a> Foo<&'a isize> for &'a u32 { }
 fn give_some<'a>() {
     want_hrtb::<&'a u32>()
-    //[base]~^ ERROR
-    //[nll]~^^ ERROR lifetime may not live long enough
-    //[nll]~| ERROR implementation of `Foo` is not general enough
+    //~^ ERROR lifetime may not live long enough
+    //~| ERROR implementation of `Foo` is not general enough
 }
 
 fn main() { }
diff --git a/src/test/ui/hrtb/hrtb-just-for-static.nll.stderr b/src/test/ui/hrtb/hrtb-just-for-static.stderr
index 090bd9f68ad..a5770431eaf 100644
--- a/src/test/ui/hrtb/hrtb-just-for-static.nll.stderr
+++ b/src/test/ui/hrtb/hrtb-just-for-static.stderr
@@ -1,5 +1,5 @@
 error: implementation of `Foo` is not general enough
-  --> $DIR/hrtb-just-for-static.rs:28:5
+  --> $DIR/hrtb-just-for-static.rs:24:5
    |
 LL |     want_hrtb::<StaticInt>()
    |     ^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
@@ -8,7 +8,7 @@ LL |     want_hrtb::<StaticInt>()
    = note: ...but it actually implements `Foo<&'static isize>`
 
 error: lifetime may not live long enough
-  --> $DIR/hrtb-just-for-static.rs:34:5
+  --> $DIR/hrtb-just-for-static.rs:30:5
    |
 LL | fn give_some<'a>() {
    |              -- lifetime `'a` defined here
@@ -16,7 +16,7 @@ LL |     want_hrtb::<&'a u32>()
    |     ^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
 
 error: implementation of `Foo` is not general enough
-  --> $DIR/hrtb-just-for-static.rs:34:5
+  --> $DIR/hrtb-just-for-static.rs:30:5
    |
 LL |     want_hrtb::<&'a u32>()
    |     ^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
diff --git a/src/test/ui/hrtb/hrtb-perfect-forwarding.base.stderr b/src/test/ui/hrtb/hrtb-perfect-forwarding.base.stderr
deleted file mode 100644
index 678a1137cd6..00000000000
--- a/src/test/ui/hrtb/hrtb-perfect-forwarding.base.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: implementation of `Bar` is not general enough
-  --> $DIR/hrtb-perfect-forwarding.rs:47:5
-   |
-LL |     foo_hrtb_bar_not(&mut t);
-   |     ^^^^^^^^^^^^^^^^ implementation of `Bar` is not general enough
-   |
-   = note: `T` must implement `Bar<&'0 isize>`, for any lifetime `'0`...
-   = note: ...but it actually implements `Bar<&'b isize>`
-
-error: implementation of `Bar` is not general enough
-  --> $DIR/hrtb-perfect-forwarding.rs:47:5
-   |
-LL |     foo_hrtb_bar_not(&mut t);
-   |     ^^^^^^^^^^^^^^^^ implementation of `Bar` is not general enough
-   |
-   = note: `T` must implement `Bar<&'0 isize>`, for any lifetime `'0`...
-   = note: ...but it actually implements `Bar<&'b isize>`
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/hrtb/hrtb-perfect-forwarding.rs b/src/test/ui/hrtb/hrtb-perfect-forwarding.rs
index 2db9f661cf4..d45fa183c0c 100644
--- a/src/test/ui/hrtb/hrtb-perfect-forwarding.rs
+++ b/src/test/ui/hrtb/hrtb-perfect-forwarding.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 // Test a case where you have an impl of `Foo<X>` for all `X` that
 // is being applied to `for<'a> Foo<&'a mut X>`. Issue #19730.
 
@@ -17,7 +13,7 @@ impl<'a, X, F> Foo<X> for &'a mut F where F: Foo<X> + Bar<X> {}
 
 impl<'a, X, F> Bar<X> for &'a mut F where F: Bar<X> {}
 
-fn no_hrtb<'b, T>(mut t: T) //[nll]~ WARN function cannot return
+fn no_hrtb<'b, T>(mut t: T) //~ WARN function cannot return
 where
     T: Bar<&'b isize>,
 {
@@ -26,7 +22,7 @@ where
     no_hrtb(&mut t);
 }
 
-fn bar_hrtb<T>(mut t: T) //[nll]~ WARN function cannot return
+fn bar_hrtb<T>(mut t: T) //~ WARN function cannot return
 where
     T: for<'b> Bar<&'b isize>,
 {
@@ -36,7 +32,7 @@ where
     bar_hrtb(&mut t);
 }
 
-fn foo_hrtb_bar_not<'b, T>(mut t: T) //[nll]~ WARN function cannot return
+fn foo_hrtb_bar_not<'b, T>(mut t: T) //~ WARN function cannot return
 where
     T: for<'a> Foo<&'a isize> + Bar<&'b isize>,
 {
@@ -46,11 +42,10 @@ where
     // clause only specifies `T : Bar<&'b isize>`.
     foo_hrtb_bar_not(&mut t);
     //~^ ERROR implementation of `Bar` is not general enough
-    //[base]~^^ ERROR implementation of `Bar` is not general enough
-    //[nll]~^^^ ERROR lifetime may not live long enough
+    //~^^ ERROR lifetime may not live long enough
 }
 
-fn foo_hrtb_bar_hrtb<T>(mut t: T) //[nll]~ WARN function cannot return
+fn foo_hrtb_bar_hrtb<T>(mut t: T) //~ WARN function cannot return
 where
     T: for<'a> Foo<&'a isize> + for<'b> Bar<&'b isize>,
 {
diff --git a/src/test/ui/hrtb/hrtb-perfect-forwarding.nll.stderr b/src/test/ui/hrtb/hrtb-perfect-forwarding.stderr
index 3643ce62d40..68da46d46bd 100644
--- a/src/test/ui/hrtb/hrtb-perfect-forwarding.nll.stderr
+++ b/src/test/ui/hrtb/hrtb-perfect-forwarding.stderr
@@ -1,5 +1,5 @@
 warning: function cannot return without recursing
-  --> $DIR/hrtb-perfect-forwarding.rs:20:1
+  --> $DIR/hrtb-perfect-forwarding.rs:16:1
    |
 LL | / fn no_hrtb<'b, T>(mut t: T)
 LL | | where
@@ -15,7 +15,7 @@ LL | | }
    = help: a `loop` may express intention better if this is on purpose
 
 warning: function cannot return without recursing
-  --> $DIR/hrtb-perfect-forwarding.rs:29:1
+  --> $DIR/hrtb-perfect-forwarding.rs:25:1
    |
 LL | / fn bar_hrtb<T>(mut t: T)
 LL | | where
@@ -30,7 +30,7 @@ LL | | }
    = help: a `loop` may express intention better if this is on purpose
 
 warning: function cannot return without recursing
-  --> $DIR/hrtb-perfect-forwarding.rs:39:1
+  --> $DIR/hrtb-perfect-forwarding.rs:35:1
    |
 LL | / fn foo_hrtb_bar_not<'b, T>(mut t: T)
 LL | | where
@@ -39,7 +39,7 @@ LL | | {
 ...  |
 LL | |     foo_hrtb_bar_not(&mut t);
    | |     ------------------------ recursive call site
-...  |
+LL | |
 LL | |
 LL | | }
    | |_^ cannot return without recursing
@@ -47,7 +47,7 @@ LL | | }
    = help: a `loop` may express intention better if this is on purpose
 
 error: lifetime may not live long enough
-  --> $DIR/hrtb-perfect-forwarding.rs:47:5
+  --> $DIR/hrtb-perfect-forwarding.rs:43:5
    |
 LL | fn foo_hrtb_bar_not<'b, T>(mut t: T)
    |                     -- lifetime `'b` defined here
@@ -56,7 +56,7 @@ LL |     foo_hrtb_bar_not(&mut t);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'b` must outlive `'static`
 
 error: implementation of `Bar` is not general enough
-  --> $DIR/hrtb-perfect-forwarding.rs:47:5
+  --> $DIR/hrtb-perfect-forwarding.rs:43:5
    |
 LL |     foo_hrtb_bar_not(&mut t);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Bar` is not general enough
@@ -65,7 +65,7 @@ LL |     foo_hrtb_bar_not(&mut t);
    = note: ...but it actually implements `Bar<&'1 isize>`, for some specific lifetime `'1`
 
 warning: function cannot return without recursing
-  --> $DIR/hrtb-perfect-forwarding.rs:53:1
+  --> $DIR/hrtb-perfect-forwarding.rs:48:1
    |
 LL | / fn foo_hrtb_bar_hrtb<T>(mut t: T)
 LL | | where
diff --git a/src/test/ui/hrtb/issue-30786.nll.stderr b/src/test/ui/hrtb/issue-30786.nll.stderr
deleted file mode 100644
index dba3911d99c..00000000000
--- a/src/test/ui/hrtb/issue-30786.nll.stderr
+++ /dev/null
@@ -1,53 +0,0 @@
-error[E0599]: the method `filterx` exists for struct `Map<Repeat, [closure@$DIR/issue-30786.rs:121:27: 121:36]>`, but its trait bounds were not satisfied
-  --> $DIR/issue-30786.rs:122:22
-   |
-LL | pub struct Map<S, F> {
-   | --------------------
-   | |
-   | method `filterx` not found for this
-   | doesn't satisfy `_: StreamExt`
-...
-LL |     let filter = map.filterx(|x: &_| true);
-   |                      ^^^^^^^ method cannot be called on `Map<Repeat, [closure@$DIR/issue-30786.rs:121:27: 121:36]>` due to unsatisfied trait bounds
-   |
-note: the following trait bounds were not satisfied:
-      `&'a mut &Map<Repeat, [closure@$DIR/issue-30786.rs:121:27: 121:36]>: Stream`
-      `&'a mut &mut Map<Repeat, [closure@$DIR/issue-30786.rs:121:27: 121:36]>: Stream`
-      `&'a mut Map<Repeat, [closure@$DIR/issue-30786.rs:121:27: 121:36]>: Stream`
-  --> $DIR/issue-30786.rs:100:50
-   |
-LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
-   |         ---------     -                          ^^^^^^ unsatisfied trait bound introduced here
-help: one of the expressions' fields has a method of the same name
-   |
-LL |     let filter = map.stream.filterx(|x: &_| true);
-   |                      +++++++
-
-error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>`, but its trait bounds were not satisfied
-  --> $DIR/issue-30786.rs:134:24
-   |
-LL | pub struct Filter<S, F> {
-   | -----------------------
-   | |
-   | method `countx` not found for this
-   | doesn't satisfy `_: StreamExt`
-...
-LL |     let count = filter.countx();
-   |                        ^^^^^^ method cannot be called on `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>` due to unsatisfied trait bounds
-   |
-note: the following trait bounds were not satisfied:
-      `&'a mut &Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>: Stream`
-      `&'a mut &mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>: Stream`
-      `&'a mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>: Stream`
-  --> $DIR/issue-30786.rs:100:50
-   |
-LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
-   |         ---------     -                          ^^^^^^ unsatisfied trait bound introduced here
-help: one of the expressions' fields has a method of the same name
-   |
-LL |     let count = filter.stream.countx();
-   |                        +++++++
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0599`.
diff --git a/src/test/ui/hrtb/issue-30786.rs b/src/test/ui/hrtb/issue-30786.rs
index c2e01909870..e5f46f711c2 100644
--- a/src/test/ui/hrtb/issue-30786.rs
+++ b/src/test/ui/hrtb/issue-30786.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 // rust-lang/rust#30786: the use of `for<'b> &'b mut A: Stream<Item=T`
 // should act as assertion that item does not borrow from its stream;
 // but an earlier buggy rustc allowed `.map(|x: &_| x)` which does
diff --git a/src/test/ui/hrtb/issue-30786.base.stderr b/src/test/ui/hrtb/issue-30786.stderr
index dba3911d99c..1ee549e54a9 100644
--- a/src/test/ui/hrtb/issue-30786.base.stderr
+++ b/src/test/ui/hrtb/issue-30786.stderr
@@ -1,5 +1,5 @@
-error[E0599]: the method `filterx` exists for struct `Map<Repeat, [closure@$DIR/issue-30786.rs:121:27: 121:36]>`, but its trait bounds were not satisfied
-  --> $DIR/issue-30786.rs:122:22
+error[E0599]: the method `filterx` exists for struct `Map<Repeat, [closure@$DIR/issue-30786.rs:117:27: 117:36]>`, but its trait bounds were not satisfied
+  --> $DIR/issue-30786.rs:118:22
    |
 LL | pub struct Map<S, F> {
    | --------------------
@@ -8,13 +8,13 @@ LL | pub struct Map<S, F> {
    | doesn't satisfy `_: StreamExt`
 ...
 LL |     let filter = map.filterx(|x: &_| true);
-   |                      ^^^^^^^ method cannot be called on `Map<Repeat, [closure@$DIR/issue-30786.rs:121:27: 121:36]>` due to unsatisfied trait bounds
+   |                      ^^^^^^^ method cannot be called on `Map<Repeat, [closure@$DIR/issue-30786.rs:117:27: 117:36]>` due to unsatisfied trait bounds
    |
 note: the following trait bounds were not satisfied:
-      `&'a mut &Map<Repeat, [closure@$DIR/issue-30786.rs:121:27: 121:36]>: Stream`
-      `&'a mut &mut Map<Repeat, [closure@$DIR/issue-30786.rs:121:27: 121:36]>: Stream`
-      `&'a mut Map<Repeat, [closure@$DIR/issue-30786.rs:121:27: 121:36]>: Stream`
-  --> $DIR/issue-30786.rs:100:50
+      `&'a mut &Map<Repeat, [closure@$DIR/issue-30786.rs:117:27: 117:36]>: Stream`
+      `&'a mut &mut Map<Repeat, [closure@$DIR/issue-30786.rs:117:27: 117:36]>: Stream`
+      `&'a mut Map<Repeat, [closure@$DIR/issue-30786.rs:117:27: 117:36]>: Stream`
+  --> $DIR/issue-30786.rs:96:50
    |
 LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
    |         ---------     -                          ^^^^^^ unsatisfied trait bound introduced here
@@ -23,8 +23,8 @@ help: one of the expressions' fields has a method of the same name
 LL |     let filter = map.stream.filterx(|x: &_| true);
    |                      +++++++
 
-error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>`, but its trait bounds were not satisfied
-  --> $DIR/issue-30786.rs:134:24
+error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:42]>`, but its trait bounds were not satisfied
+  --> $DIR/issue-30786.rs:130:24
    |
 LL | pub struct Filter<S, F> {
    | -----------------------
@@ -33,13 +33,13 @@ LL | pub struct Filter<S, F> {
    | doesn't satisfy `_: StreamExt`
 ...
 LL |     let count = filter.countx();
-   |                        ^^^^^^ method cannot be called on `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>` due to unsatisfied trait bounds
+   |                        ^^^^^^ method cannot be called on `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:42]>` due to unsatisfied trait bounds
    |
 note: the following trait bounds were not satisfied:
-      `&'a mut &Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>: Stream`
-      `&'a mut &mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>: Stream`
-      `&'a mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>: Stream`
-  --> $DIR/issue-30786.rs:100:50
+      `&'a mut &Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:42]>: Stream`
+      `&'a mut &mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:42]>: Stream`
+      `&'a mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:42]>: Stream`
+  --> $DIR/issue-30786.rs:96:50
    |
 LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
    |         ---------     -                          ^^^^^^ unsatisfied trait bound introduced here
diff --git a/src/test/ui/hrtb/issue-46989.base.stderr b/src/test/ui/hrtb/issue-46989.base.stderr
deleted file mode 100644
index d1f6fed10fd..00000000000
--- a/src/test/ui/hrtb/issue-46989.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: implementation of `Foo` is not general enough
-  --> $DIR/issue-46989.rs:42:5
-   |
-LL |     assert_foo::<fn(&i32)>();
-   |     ^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
-   |
-   = note: `Foo` would have to be implemented for the type `for<'r> fn(&'r i32)`
-   = note: ...but `Foo` is actually implemented for the type `fn(&'0 i32)`, for some specific lifetime `'0`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/hrtb/issue-46989.rs b/src/test/ui/hrtb/issue-46989.rs
index 0bb6d7a18eb..4a09f4be156 100644
--- a/src/test/ui/hrtb/issue-46989.rs
+++ b/src/test/ui/hrtb/issue-46989.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 // Regression test for #46989:
 //
 // In the move to universes, this test started passing.
diff --git a/src/test/ui/hrtb/issue-46989.nll.stderr b/src/test/ui/hrtb/issue-46989.stderr
index e1ddd7235f5..309e1a676ed 100644
--- a/src/test/ui/hrtb/issue-46989.nll.stderr
+++ b/src/test/ui/hrtb/issue-46989.stderr
@@ -1,5 +1,5 @@
 error: implementation of `Foo` is not general enough
-  --> $DIR/issue-46989.rs:42:5
+  --> $DIR/issue-46989.rs:38:5
    |
 LL |     assert_foo::<fn(&i32)>();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
diff --git a/src/test/ui/impl-header-lifetime-elision/dyn-trait.base.stderr b/src/test/ui/impl-header-lifetime-elision/dyn-trait.base.stderr
deleted file mode 100644
index a01560e70e3..00000000000
--- a/src/test/ui/impl-header-lifetime-elision/dyn-trait.base.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/dyn-trait.rs:24:16
-   |
-LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
-   |                                 ------------------- this data with lifetime `'a`...
-LL |     static_val(x);
-   |                ^ ...is used here...
-   |
-note: ...and is required to live as long as `'static` here
-  --> $DIR/dyn-trait.rs:24:5
-   |
-LL |     static_val(x);
-   |     ^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0759`.
diff --git a/src/test/ui/impl-header-lifetime-elision/dyn-trait.rs b/src/test/ui/impl-header-lifetime-elision/dyn-trait.rs
index a103034a537..c508c0ac9d5 100644
--- a/src/test/ui/impl-header-lifetime-elision/dyn-trait.rs
+++ b/src/test/ui/impl-header-lifetime-elision/dyn-trait.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 // Test that `impl MyTrait<'_> for &i32` is equivalent to `impl<'a,
 // 'b> MyTrait<'a> for &'b i32`.
 
@@ -22,8 +18,7 @@ fn static_val<T: StaticTrait>(_: T) {
 
 fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
     static_val(x);
-    //[base]~^ ERROR E0759
-    //[nll]~^^ ERROR borrowed data escapes outside of function
+    //~^ ERROR borrowed data escapes outside of function
 }
 
 fn not_static_val<T: NotStaticTrait>(_: T) {
diff --git a/src/test/ui/impl-header-lifetime-elision/dyn-trait.nll.stderr b/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr
index 762698c4fc1..88c260b18cb 100644
--- a/src/test/ui/impl-header-lifetime-elision/dyn-trait.nll.stderr
+++ b/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr
@@ -1,5 +1,5 @@
 error[E0521]: borrowed data escapes outside of function
-  --> $DIR/dyn-trait.rs:24:5
+  --> $DIR/dyn-trait.rs:20:5
    |
 LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
    |                          --  - `x` is a reference that is only valid in the function body
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-elided.rs b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-elided.rs
index d0277336b25..0bddce49b40 100644
--- a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-elided.rs
+++ b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-elided.rs
@@ -1,7 +1,5 @@
 // edition:2018
-// build-pass (FIXME(62277): could be check-pass?)
-// revisions: migrate mir
-//[mir]compile-flags: -Z borrowck=mir
+// build-pass (FIXME(62277): could be check-pass?
 
 trait Trait<'a, 'b> {}
 impl<T> Trait<'_, '_> for T {}
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs
index 529dcd8ece6..e363fdb36e3 100644
--- a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs
+++ b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs
@@ -1,7 +1,5 @@
 // edition:2018
 // check-pass
-// revisions: migrate mir
-//[mir]compile-flags: -Z borrowck=mir
 
 #![feature(type_alias_impl_trait)]
 trait Trait<'a, 'b> {}
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original.rs b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original.rs
index be455f53350..0f21dd5ffe5 100644
--- a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original.rs
+++ b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original.rs
@@ -1,7 +1,5 @@
 // edition:2018
 // build-pass (FIXME(62277): could be check-pass?)
-// revisions: migrate mir
-//[mir]compile-flags: -Z borrowck=mir
 
 trait Trait<'a, 'b> {}
 impl<T> Trait<'_, '_> for T {}
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-other.rs b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-other.rs
index 7235d89019f..13ad1f7215f 100644
--- a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-other.rs
+++ b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-other.rs
@@ -1,7 +1,5 @@
 // edition:2018
 // build-pass (FIXME(62277): could be check-pass?)
-// revisions: migrate mir
-//[mir]compile-flags: -Z borrowck=mir
 
 trait Trait<'a, 'b> {}
 impl<T> Trait<'_, '_> for T {}
diff --git a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.base.stderr b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.base.stderr
deleted file mode 100644
index 45cc935b7cc..00000000000
--- a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.base.stderr
+++ /dev/null
@@ -1,227 +0,0 @@
-error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
-  --> $DIR/must_outlive_least_region_or_bound.rs:7:35
-   |
-LL | fn elided(x: &i32) -> impl Copy { x }
-   |              ----                 ^
-   |              |
-   |              hidden type `&i32` captures the anonymous lifetime defined here
-   |
-help: to declare that the `impl Trait` captures `'_`, you can add an explicit `'_` lifetime bound
-   |
-LL | fn elided(x: &i32) -> impl Copy + '_ { x }
-   |                                 ++++
-
-error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
-  --> $DIR/must_outlive_least_region_or_bound.rs:10:44
-   |
-LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x }
-   |             --                             ^
-   |             |
-   |             hidden type `&'a i32` captures the lifetime `'a` as defined here
-   |
-help: to declare that the `impl Trait` captures `'a`, you can add an explicit `'a` lifetime bound
-   |
-LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x }
-   |                                          ++++
-
-error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/must_outlive_least_region_or_bound.rs:13:46
-   |
-LL | fn elided2(x: &i32) -> impl Copy + 'static { x }
-   |               ----                           ^ ...is used here...
-   |               |
-   |               this data with an anonymous lifetime `'_`...
-   |
-note: ...and is required to live as long as `'static` here
-  --> $DIR/must_outlive_least_region_or_bound.rs:13:24
-   |
-LL | fn elided2(x: &i32) -> impl Copy + 'static { x }
-   |                        ^^^^^^^^^^^^^^^^^^^
-help: consider changing the `impl Trait`'s explicit `'static` bound to the lifetime of argument `x`
-   |
-LL | fn elided2(x: &i32) -> impl Copy + '_ { x }
-   |                                    ~~
-help: alternatively, add an explicit `'static` bound to this reference
-   |
-LL | fn elided2(x: &'static i32) -> impl Copy + 'static { x }
-   |               ~~~~~~~~~~~~
-
-error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/must_outlive_least_region_or_bound.rs:17:55
-   |
-LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x }
-   |                     -------                           ^ ...is used here...
-   |                     |
-   |                     this data with lifetime `'a`...
-   |
-note: ...and is required to live as long as `'static` here
-  --> $DIR/must_outlive_least_region_or_bound.rs:17:33
-   |
-LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x }
-   |                                 ^^^^^^^^^^^^^^^^^^^
-help: consider changing the `impl Trait`'s explicit `'static` bound to the lifetime of argument `x`
-   |
-LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'a { x }
-   |                                             ~~
-help: alternatively, add an explicit `'static` bound to this reference
-   |
-LL | fn explicit2<'a>(x: &'static i32) -> impl Copy + 'static { x }
-   |                     ~~~~~~~~~~~~
-
-error[E0621]: explicit lifetime required in the type of `x`
-  --> $DIR/must_outlive_least_region_or_bound.rs:21:24
-   |
-LL | fn foo<'a>(x: &i32) -> impl Copy + 'a { x }
-   |               ----     ^^^^^^^^^^^^^^ lifetime `'a` required
-   |               |
-   |               help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
-
-error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/must_outlive_least_region_or_bound.rs:36:65
-   |
-LL | fn elided5(x: &i32) -> (Box<dyn Debug>, impl Debug) { (Box::new(x), x) }
-   |               ---- this data with an anonymous lifetime `'_`... ^ ...is used and required to live as long as `'static` here
-   |
-help: to declare that the trait object captures data from argument `x`, you can add an explicit `'_` lifetime bound
-   |
-LL | fn elided5(x: &i32) -> (Box<dyn Debug + '_>, impl Debug) { (Box::new(x), x) }
-   |                                       ++++
-help: to declare that the `impl Trait` captures data from argument `x`, you can add an explicit `'_` lifetime bound
-   |
-LL | fn elided5(x: &i32) -> (Box<dyn Debug>, impl Debug + '_) { (Box::new(x), x) }
-   |                                                    ++++
-
-error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/must_outlive_least_region_or_bound.rs:43:69
-   |
-LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x }
-   |                      ------- this data with lifetime `'a`...        ^ ...is used here...
-   |
-note: ...and is required to live as long as `'static` here
-  --> $DIR/must_outlive_least_region_or_bound.rs:43:34
-   |
-LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x }
-   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-help: consider changing the `impl Trait`'s explicit `'static` bound to the lifetime of argument `x`
-   |
-LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'a { x }
-   |                                                           ~~
-help: alternatively, add an explicit `'static` bound to this reference
-   |
-LL | fn with_bound<'a>(x: &'static i32) -> impl LifetimeTrait<'a> + 'static { x }
-   |                      ~~~~~~~~~~~~
-
-error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
-  --> $DIR/must_outlive_least_region_or_bound.rs:50:5
-   |
-LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) {
-   |                              -- hidden type `[closure@$DIR/must_outlive_least_region_or_bound.rs:50:5: 50:31]` captures the lifetime `'b` as defined here
-LL |     move |_| println!("{}", y)
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-help: to declare that the `impl Trait` captures `'b`, you can add an explicit `'b` lifetime bound
-   |
-LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) + 'b {
-   |                                                                              ++++
-
-error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/must_outlive_least_region_or_bound.rs:54:51
-   |
-LL | fn ty_param_wont_outlive_static<T:Debug>(x: T) -> impl Debug + 'static {
-   |                                                   ^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
-   |
-help: consider adding an explicit lifetime bound...
-   |
-LL | fn ty_param_wont_outlive_static<T:Debug + 'static>(x: T) -> impl Debug + 'static {
-   |                                         +++++++++
-
-error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/must_outlive_least_region_or_bound.rs:24:50
-   |
-LL | fn elided3(x: &i32) -> Box<dyn Debug> { Box::new(x) }
-   |               ----                               ^ ...is used and required to live as long as `'static` here
-   |               |
-   |               this data with an anonymous lifetime `'_`...
-   |
-note: `'static` lifetime requirement introduced by the return type
-  --> $DIR/must_outlive_least_region_or_bound.rs:24:28
-   |
-LL | fn elided3(x: &i32) -> Box<dyn Debug> { Box::new(x) }
-   |                            ^^^^^^^^^    ----------- because of this returned expression
-   |                            |
-   |                            `'static` requirement introduced here
-help: to declare that the trait object captures data from argument `x`, you can add an explicit `'_` lifetime bound
-   |
-LL | fn elided3(x: &i32) -> Box<dyn Debug + '_> { Box::new(x) }
-   |                                      ++++
-
-error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/must_outlive_least_region_or_bound.rs:27:59
-   |
-LL | fn explicit3<'a>(x: &'a i32) -> Box<dyn Debug> { Box::new(x) }
-   |                     -------                               ^ ...is used and required to live as long as `'static` here
-   |                     |
-   |                     this data with lifetime `'a`...
-   |
-note: `'static` lifetime requirement introduced by the return type
-  --> $DIR/must_outlive_least_region_or_bound.rs:27:37
-   |
-LL | fn explicit3<'a>(x: &'a i32) -> Box<dyn Debug> { Box::new(x) }
-   |                                     ^^^^^^^^^    ----------- because of this returned expression
-   |                                     |
-   |                                     `'static` requirement introduced here
-help: to declare that the trait object captures data from argument `x`, you can add an explicit `'a` lifetime bound
-   |
-LL | fn explicit3<'a>(x: &'a i32) -> Box<dyn Debug + 'a> { Box::new(x) }
-   |                                               ++++
-
-error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/must_outlive_least_region_or_bound.rs:30:60
-   |
-LL | fn elided4(x: &i32) -> Box<dyn Debug + 'static> { Box::new(x) }
-   |               ----                                         ^ ...is used and required to live as long as `'static` here
-   |               |
-   |               this data with an anonymous lifetime `'_`...
-   |
-note: `'static` lifetime requirement introduced by the return type
-  --> $DIR/must_outlive_least_region_or_bound.rs:30:40
-   |
-LL | fn elided4(x: &i32) -> Box<dyn Debug + 'static> { Box::new(x) }
-   |                                        ^^^^^^^    ----------- because of this returned expression
-   |                                        |
-   |                                        `'static` requirement introduced here
-help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x`
-   |
-LL | fn elided4(x: &i32) -> Box<dyn Debug + '_> { Box::new(x) }
-   |                                        ~~
-help: alternatively, add an explicit `'static` bound to this reference
-   |
-LL | fn elided4(x: &'static i32) -> Box<dyn Debug + 'static> { Box::new(x) }
-   |               ~~~~~~~~~~~~
-
-error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/must_outlive_least_region_or_bound.rs:33:69
-   |
-LL | fn explicit4<'a>(x: &'a i32) -> Box<dyn Debug + 'static> { Box::new(x) }
-   |                     ------- this data with lifetime `'a`...         ^ ...is used and required to live as long as `'static` here
-   |
-note: `'static` lifetime requirement introduced by the return type
-  --> $DIR/must_outlive_least_region_or_bound.rs:33:49
-   |
-LL | fn explicit4<'a>(x: &'a i32) -> Box<dyn Debug + 'static> { Box::new(x) }
-   |                                                 ^^^^^^^    ----------- because of this returned expression
-   |                                                 |
-   |                                                 `'static` requirement introduced here
-help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x`
-   |
-LL | fn explicit4<'a>(x: &'a i32) -> Box<dyn Debug + 'a> { Box::new(x) }
-   |                                                 ~~
-help: alternatively, add an explicit `'static` bound to this reference
-   |
-LL | fn explicit4<'a>(x: &'static i32) -> Box<dyn Debug + 'static> { Box::new(x) }
-   |                     ~~~~~~~~~~~~
-
-error: aborting due to 13 previous errors
-
-Some errors have detailed explanations: E0310, E0621, E0700, E0759.
-For more information about an error, try `rustc --explain E0310`.
diff --git a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs
index 6bb3141b012..18404f98603 100644
--- a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs
+++ b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 use std::fmt::Debug;
 
 fn elided(x: &i32) -> impl Copy { x }
@@ -11,38 +7,30 @@ fn explicit<'a>(x: &'a i32) -> impl Copy { x }
 //~^ ERROR: captures lifetime that does not appear in bounds
 
 fn elided2(x: &i32) -> impl Copy + 'static { x }
-//[base]~^ ERROR E0759
-//[nll]~^^ ERROR lifetime may not live long enough
+//~^ ERROR lifetime may not live long enough
 
 fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x }
-//[base]~^ ERROR E0759
-//[nll]~^^ ERROR lifetime may not live long enough
+//~^ ERROR lifetime may not live long enough
 
 fn foo<'a>(x: &i32) -> impl Copy + 'a { x }
 //~^ ERROR explicit lifetime required in the type of `x`
 
 fn elided3(x: &i32) -> Box<dyn Debug> { Box::new(x) }
-//[base]~^ ERROR E0759
 
 fn explicit3<'a>(x: &'a i32) -> Box<dyn Debug> { Box::new(x) }
-//[base]~^ ERROR E0759
 
 fn elided4(x: &i32) -> Box<dyn Debug + 'static> { Box::new(x) }
-//[base]~^ ERROR E0759
 
 fn explicit4<'a>(x: &'a i32) -> Box<dyn Debug + 'static> { Box::new(x) }
-//[base]~^ ERROR E0759
 
 fn elided5(x: &i32) -> (Box<dyn Debug>, impl Debug) { (Box::new(x), x) }
-//[base]~^ ERROR E0759
-//[nll]~^^ ERROR lifetime may not live long enough
+//~^ ERROR lifetime may not live long enough
 
 trait LifetimeTrait<'a> {}
 impl<'a> LifetimeTrait<'a> for &'a i32 {}
 
 fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x }
-//[base]~^ ERROR E0759
-//[nll]~^^ ERROR lifetime may not live long enough
+//~^ ERROR lifetime may not live long enough
 
 // Tests that a closure type containing 'b cannot be returned from a type where
 // only 'a was expected.
@@ -52,9 +40,8 @@ fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) {
 }
 
 fn ty_param_wont_outlive_static<T:Debug>(x: T) -> impl Debug + 'static {
-    //[base]~^ ERROR the parameter type `T` may not live long enough
     x
-    //[nll]~^ ERROR the parameter type `T` may not live long enough
+    //~^ ERROR the parameter type `T` may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr
index 0252e546fb0..f8ff2177bf5 100644
--- a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr
+++ b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr
@@ -1,5 +1,5 @@
 error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
-  --> $DIR/must_outlive_least_region_or_bound.rs:7:35
+  --> $DIR/must_outlive_least_region_or_bound.rs:3:35
    |
 LL | fn elided(x: &i32) -> impl Copy { x }
    |              ----                 ^
@@ -12,7 +12,7 @@ LL | fn elided(x: &i32) -> impl Copy + '_ { x }
    |                                 ++++
 
 error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
-  --> $DIR/must_outlive_least_region_or_bound.rs:10:44
+  --> $DIR/must_outlive_least_region_or_bound.rs:6:44
    |
 LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x }
    |             --                             ^
@@ -25,7 +25,7 @@ LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x }
    |                                          ++++
 
 error: lifetime may not live long enough
-  --> $DIR/must_outlive_least_region_or_bound.rs:13:46
+  --> $DIR/must_outlive_least_region_or_bound.rs:9:46
    |
 LL | fn elided2(x: &i32) -> impl Copy + 'static { x }
    |               -                              ^ returning this value requires that `'1` must outlive `'static`
@@ -42,7 +42,7 @@ LL | fn elided2(x: &'static i32) -> impl Copy + 'static { x }
    |               ~~~~~~~~~~~~
 
 error: lifetime may not live long enough
-  --> $DIR/must_outlive_least_region_or_bound.rs:17:55
+  --> $DIR/must_outlive_least_region_or_bound.rs:12:55
    |
 LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x }
    |              -- lifetime `'a` defined here            ^ returning this value requires that `'a` must outlive `'static`
@@ -57,7 +57,7 @@ LL | fn explicit2<'a>(x: &'static i32) -> impl Copy + 'static { x }
    |                     ~~~~~~~~~~~~
 
 error[E0621]: explicit lifetime required in the type of `x`
-  --> $DIR/must_outlive_least_region_or_bound.rs:21:41
+  --> $DIR/must_outlive_least_region_or_bound.rs:15:41
    |
 LL | fn foo<'a>(x: &i32) -> impl Copy + 'a { x }
    |               ----                      ^ lifetime `'a` required
@@ -65,7 +65,7 @@ LL | fn foo<'a>(x: &i32) -> impl Copy + 'a { x }
    |               help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
 
 error: lifetime may not live long enough
-  --> $DIR/must_outlive_least_region_or_bound.rs:36:55
+  --> $DIR/must_outlive_least_region_or_bound.rs:26:55
    |
 LL | fn elided5(x: &i32) -> (Box<dyn Debug>, impl Debug) { (Box::new(x), x) }
    |               -                                       ^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'static`
@@ -82,7 +82,7 @@ LL | fn elided5(x: &i32) -> (Box<dyn Debug>, impl Debug + '_) { (Box::new(x), x)
    |                                                    ++++
 
 error: lifetime may not live long enough
-  --> $DIR/must_outlive_least_region_or_bound.rs:43:69
+  --> $DIR/must_outlive_least_region_or_bound.rs:32:69
    |
 LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x }
    |               -- lifetime `'a` defined here                         ^ returning this value requires that `'a` must outlive `'static`
@@ -97,10 +97,10 @@ LL | fn with_bound<'a>(x: &'static i32) -> impl LifetimeTrait<'a> + 'static { x
    |                      ~~~~~~~~~~~~
 
 error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
-  --> $DIR/must_outlive_least_region_or_bound.rs:50:5
+  --> $DIR/must_outlive_least_region_or_bound.rs:38:5
    |
 LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) {
-   |                              -- hidden type `[closure@$DIR/must_outlive_least_region_or_bound.rs:50:5: 50:31]` captures the lifetime `'b` as defined here
+   |                              -- hidden type `[closure@$DIR/must_outlive_least_region_or_bound.rs:38:5: 38:31]` captures the lifetime `'b` as defined here
 LL |     move |_| println!("{}", y)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
@@ -110,7 +110,7 @@ LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32
    |                                                                              ++++
 
 error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/must_outlive_least_region_or_bound.rs:56:5
+  --> $DIR/must_outlive_least_region_or_bound.rs:43:5
    |
 LL |     x
    |     ^ ...so that the type `T` will meet its required lifetime bounds
diff --git a/src/test/ui/impl-trait/type_parameters_captured.base.stderr b/src/test/ui/impl-trait/type_parameters_captured.base.stderr
deleted file mode 100644
index cfa1d93d571..00000000000
--- a/src/test/ui/impl-trait/type_parameters_captured.base.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/type_parameters_captured.rs:11:20
-   |
-LL | fn foo<T>(x: T) -> impl Any + 'static {
-   |                    ^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
-   |
-help: consider adding an explicit lifetime bound...
-   |
-LL | fn foo<T: 'static>(x: T) -> impl Any + 'static {
-   |         +++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0310`.
diff --git a/src/test/ui/impl-trait/type_parameters_captured.rs b/src/test/ui/impl-trait/type_parameters_captured.rs
index 0618beeef97..81ee7d3f8a5 100644
--- a/src/test/ui/impl-trait/type_parameters_captured.rs
+++ b/src/test/ui/impl-trait/type_parameters_captured.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 use std::fmt::Debug;
 
 trait Any {}
@@ -9,9 +5,8 @@ impl<T> Any for T {}
 
 // Check that type parameters are captured and not considered 'static
 fn foo<T>(x: T) -> impl Any + 'static {
-    //[base]~^ ERROR the parameter type `T` may not live long enough
     x
-    //[nll]~^ ERROR the parameter type `T` may not live long enough
+    //~^ ERROR the parameter type `T` may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/impl-trait/type_parameters_captured.nll.stderr b/src/test/ui/impl-trait/type_parameters_captured.stderr
index a07ba564490..fb502cfdd2b 100644
--- a/src/test/ui/impl-trait/type_parameters_captured.nll.stderr
+++ b/src/test/ui/impl-trait/type_parameters_captured.stderr
@@ -1,5 +1,5 @@
 error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/type_parameters_captured.rs:13:5
+  --> $DIR/type_parameters_captured.rs:8:5
    |
 LL |     x
    |     ^ ...so that the type `T` will meet its required lifetime bounds
diff --git a/src/test/ui/impl-trait/universal_wrong_hrtb.rs b/src/test/ui/impl-trait/universal_wrong_hrtb.rs
new file mode 100644
index 00000000000..b9551c2ceb0
--- /dev/null
+++ b/src/test/ui/impl-trait/universal_wrong_hrtb.rs
@@ -0,0 +1,8 @@
+trait Trait<'a> {
+    type Assoc;
+}
+
+fn test_argument_position(x: impl for<'a> Trait<'a, Assoc = impl Copy + 'a>) {}
+//~^ ERROR `impl Trait` can only mention lifetimes bound at the fn or impl level
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/universal_wrong_hrtb.stderr b/src/test/ui/impl-trait/universal_wrong_hrtb.stderr
new file mode 100644
index 00000000000..37eb8dfa1a1
--- /dev/null
+++ b/src/test/ui/impl-trait/universal_wrong_hrtb.stderr
@@ -0,0 +1,14 @@
+error: `impl Trait` can only mention lifetimes bound at the fn or impl level
+  --> $DIR/universal_wrong_hrtb.rs:5:73
+   |
+LL | fn test_argument_position(x: impl for<'a> Trait<'a, Assoc = impl Copy + 'a>) {}
+   |                                                                         ^^
+   |
+note: lifetime declared here
+  --> $DIR/universal_wrong_hrtb.rs:5:39
+   |
+LL | fn test_argument_position(x: impl for<'a> Trait<'a, Assoc = impl Copy + 'a>) {}
+   |                                       ^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/issues/issue-10291.base.stderr b/src/test/ui/issues/issue-10291.base.stderr
deleted file mode 100644
index cad22b2f3ea..00000000000
--- a/src/test/ui/issues/issue-10291.base.stderr
+++ /dev/null
@@ -1,25 +0,0 @@
-error[E0312]: lifetime of reference outlives lifetime of borrowed content...
-  --> $DIR/issue-10291.rs:7:9
-   |
-LL |         x
-   |         ^
-   |
-note: ...the reference is valid for the anonymous lifetime #1 defined here...
-  --> $DIR/issue-10291.rs:6:69
-   |
-LL |       drop::<Box<dyn for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
-   |  _____________________________________________________________________^
-LL | |         x
-LL | |
-LL | |
-LL | |     }));
-   | |_____^
-note: ...but the borrowed content is only valid for the lifetime `'x` as defined here
-  --> $DIR/issue-10291.rs:5:9
-   |
-LL | fn test<'x>(x: &'x isize) {
-   |         ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0312`.
diff --git a/src/test/ui/issues/issue-10291.rs b/src/test/ui/issues/issue-10291.rs
index 8ee3ce44d3d..31b9e124046 100644
--- a/src/test/ui/issues/issue-10291.rs
+++ b/src/test/ui/issues/issue-10291.rs
@@ -1,12 +1,7 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn test<'x>(x: &'x isize) {
     drop::<Box<dyn for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
         x
-        //[base]~^ ERROR E0312
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }));
 }
 
diff --git a/src/test/ui/issues/issue-10291.nll.stderr b/src/test/ui/issues/issue-10291.stderr
index 47c4d4945f3..a7b827d27a8 100644
--- a/src/test/ui/issues/issue-10291.nll.stderr
+++ b/src/test/ui/issues/issue-10291.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-10291.rs:7:9
+  --> $DIR/issue-10291.rs:3:9
    |
 LL | fn test<'x>(x: &'x isize) {
    |         -- lifetime `'x` defined here
diff --git a/src/test/ui/issues/issue-13058.base.stderr b/src/test/ui/issues/issue-13058.base.stderr
deleted file mode 100644
index 2b9fff3f981..00000000000
--- a/src/test/ui/issues/issue-13058.base.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0621]: explicit lifetime required in the type of `cont`
-  --> $DIR/issue-13058.rs:18:26
-   |
-LL | fn check<'r, I: Iterator<Item=usize>, T: Itble<'r, usize, I>>(cont: &T) -> bool
-   |                                                                     -- help: add explicit lifetime `'r` to the type of `cont`: `&'r T`
-LL | {
-LL |     let cont_iter = cont.iter();
-   |                          ^^^^ lifetime `'r` required
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0621`.
diff --git a/src/test/ui/issues/issue-13058.rs b/src/test/ui/issues/issue-13058.rs
index cbd52a802e8..a5806feb720 100644
--- a/src/test/ui/issues/issue-13058.rs
+++ b/src/test/ui/issues/issue-13058.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 use std::ops::Range;
 
 trait Itble<'r, T, I: Iterator<Item=T>> { fn iter(&'r self) -> I; }
diff --git a/src/test/ui/issues/issue-13058.nll.stderr b/src/test/ui/issues/issue-13058.stderr
index ddefa8a62c9..8368978deab 100644
--- a/src/test/ui/issues/issue-13058.nll.stderr
+++ b/src/test/ui/issues/issue-13058.stderr
@@ -1,5 +1,5 @@
 error[E0621]: explicit lifetime required in the type of `cont`
-  --> $DIR/issue-13058.rs:18:21
+  --> $DIR/issue-13058.rs:14:21
    |
 LL | fn check<'r, I: Iterator<Item=usize>, T: Itble<'r, usize, I>>(cont: &T) -> bool
    |                                                                     -- help: add explicit lifetime `'r` to the type of `cont`: `&'r T`
diff --git a/src/test/ui/issues/issue-15034.base.stderr b/src/test/ui/issues/issue-15034.base.stderr
deleted file mode 100644
index 293692c1ddc..00000000000
--- a/src/test/ui/issues/issue-15034.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0621]: explicit lifetime required in the type of `lexer`
-  --> $DIR/issue-15034.rs:21:25
-   |
-LL |     pub fn new(lexer: &'a mut Lexer) -> Parser<'a> {
-   |                       ------------- help: add explicit lifetime `'a` to the type of `lexer`: `&'a mut Lexer<'a>`
-LL |         Parser { lexer: lexer }
-   |                         ^^^^^ lifetime `'a` required
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0621`.
diff --git a/src/test/ui/issues/issue-15034.rs b/src/test/ui/issues/issue-15034.rs
index f95275e3a7b..9ea6ed89ca2 100644
--- a/src/test/ui/issues/issue-15034.rs
+++ b/src/test/ui/issues/issue-15034.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 pub struct Lexer<'a> {
     input: &'a str,
 }
diff --git a/src/test/ui/issues/issue-15034.nll.stderr b/src/test/ui/issues/issue-15034.stderr
index 54af22fb726..f142e260a23 100644
--- a/src/test/ui/issues/issue-15034.nll.stderr
+++ b/src/test/ui/issues/issue-15034.stderr
@@ -1,5 +1,5 @@
 error[E0621]: explicit lifetime required in the type of `lexer`
-  --> $DIR/issue-15034.rs:21:9
+  --> $DIR/issue-15034.rs:17:9
    |
 LL |     pub fn new(lexer: &'a mut Lexer) -> Parser<'a> {
    |                       ------------- help: add explicit lifetime `'a` to the type of `lexer`: `&'a mut Lexer<'a>`
diff --git a/src/test/ui/issues/issue-16683.base.stderr b/src/test/ui/issues/issue-16683.base.stderr
deleted file mode 100644
index f684dd04a36..00000000000
--- a/src/test/ui/issues/issue-16683.base.stderr
+++ /dev/null
@@ -1,32 +0,0 @@
-error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
-  --> $DIR/issue-16683.rs:8:14
-   |
-LL |         self.a();
-   |              ^
-   |
-note: first, the lifetime cannot outlive the anonymous lifetime defined here...
-  --> $DIR/issue-16683.rs:7:10
-   |
-LL |     fn b(&self) {
-   |          ^^^^^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/issue-16683.rs:8:9
-   |
-LL |         self.a();
-   |         ^^^^
-note: but, the lifetime must be valid for the lifetime `'a` as defined here...
-  --> $DIR/issue-16683.rs:5:9
-   |
-LL | trait T<'a> {
-   |         ^^
-note: ...so that the types are compatible
-  --> $DIR/issue-16683.rs:8:14
-   |
-LL |         self.a();
-   |              ^
-   = note: expected `&'a Self`
-              found `&Self`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/issues/issue-16683.rs b/src/test/ui/issues/issue-16683.rs
index 05969bc7b9f..72fa21bddd1 100644
--- a/src/test/ui/issues/issue-16683.rs
+++ b/src/test/ui/issues/issue-16683.rs
@@ -1,13 +1,8 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait T<'a> {
     fn a(&'a self) -> &'a bool;
     fn b(&self) {
         self.a();
-        //[base]~^ ERROR cannot infer
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
diff --git a/src/test/ui/issues/issue-16683.nll.stderr b/src/test/ui/issues/issue-16683.stderr
index 308d6352602..fff681b2e0b 100644
--- a/src/test/ui/issues/issue-16683.nll.stderr
+++ b/src/test/ui/issues/issue-16683.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-16683.rs:8:9
+  --> $DIR/issue-16683.rs:4:9
    |
 LL | trait T<'a> {
    |         -- lifetime `'a` defined here
diff --git a/src/test/ui/issues/issue-16922.base.stderr b/src/test/ui/issues/issue-16922.base.stderr
deleted file mode 100644
index e139de2019d..00000000000
--- a/src/test/ui/issues/issue-16922.base.stderr
+++ /dev/null
@@ -1,16 +0,0 @@
-error[E0759]: `value` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/issue-16922.rs:8:14
-   |
-LL | fn foo<T: Any>(value: &T) -> Box<dyn Any> {
-   |                       -- this data with an anonymous lifetime `'_`...
-LL |     Box::new(value) as Box<dyn Any>
-   |              ^^^^^ ...is used and required to live as long as `'static` here
-   |
-help: to declare that the trait object captures data from argument `value`, you can add an explicit `'_` lifetime bound
-   |
-LL | fn foo<T: Any>(value: &T) -> Box<dyn Any + '_> {
-   |                                          ++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0759`.
diff --git a/src/test/ui/issues/issue-16922.rs b/src/test/ui/issues/issue-16922.rs
index 1767017eb3d..bbbbf72dbd5 100644
--- a/src/test/ui/issues/issue-16922.rs
+++ b/src/test/ui/issues/issue-16922.rs
@@ -1,13 +1,8 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 use std::any::Any;
 
 fn foo<T: Any>(value: &T) -> Box<dyn Any> {
     Box::new(value) as Box<dyn Any>
-    //[base]~^ ERROR E0759
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/issues/issue-16922.nll.stderr b/src/test/ui/issues/issue-16922.stderr
index 00a42e67242..9d9f32a97c0 100644
--- a/src/test/ui/issues/issue-16922.nll.stderr
+++ b/src/test/ui/issues/issue-16922.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-16922.rs:8:5
+  --> $DIR/issue-16922.rs:4:5
    |
 LL | fn foo<T: Any>(value: &T) -> Box<dyn Any> {
    |                       - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/issues/issue-17728.base.stderr b/src/test/ui/issues/issue-17728.base.stderr
deleted file mode 100644
index b52dc444593..00000000000
--- a/src/test/ui/issues/issue-17728.base.stderr
+++ /dev/null
@@ -1,39 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/issue-17728.rs:19:28
-   |
-LL |     fn attemptTraverse(&self, room: &Room, directionStr: &str) -> Result<&Room, &str> {
-   |                                     -----                         -------------------
-   |                                     |
-   |                                     this parameter and the return type are declared with different lifetimes...
-...
-LL |             Some(entry) => Ok(entry),
-   |                            ^^^^^^^^^ ...but data from `room` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter
-   |
-LL |     fn attemptTraverse<'a>(&'a self, room: &'a Room, directionStr: &str) -> Result<&Room, &str> {
-   |                       ++++  ++              ++
-
-error[E0308]: `match` arms have incompatible types
-  --> $DIR/issue-17728.rs:113:14
-   |
-LL | /     match to_parse {
-LL | |         "w" | "west" => RoomDirection::West,
-LL | |         "e" | "east" => RoomDirection::East,
-LL | |         "n" | "north" => RoomDirection::North,
-...  |
-LL | |         "down" => RoomDirection::Down,
-   | |                   ------------------- this and all prior arms are found to be of type `RoomDirection`
-LL | |         _ => None
-   | |              ^^^^ expected enum `RoomDirection`, found enum `Option`
-LL | |     }
-   | |_____- `match` arms have incompatible types
-   |
-   = note: expected enum `RoomDirection`
-              found enum `Option<_>`
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0308, E0623.
-For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/issues/issue-17728.rs b/src/test/ui/issues/issue-17728.rs
index 91b71ad6d0b..6aca159c47e 100644
--- a/src/test/ui/issues/issue-17728.rs
+++ b/src/test/ui/issues/issue-17728.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 use std::fmt::{Debug, Formatter, Error};
 use std::collections::HashMap;
 
@@ -17,7 +13,6 @@ trait TraversesWorld {
         let maybe_room = room.direction_to_room.get(&direction);
         match maybe_room {
             Some(entry) => Ok(entry),
-            //[base]~^ ERROR lifetime mismatch [E0623]
             _ => Err("Direction does not exist in room.")
         }
     }
diff --git a/src/test/ui/issues/issue-17728.nll.stderr b/src/test/ui/issues/issue-17728.stderr
index ddfb890eac3..3b25902d757 100644
--- a/src/test/ui/issues/issue-17728.nll.stderr
+++ b/src/test/ui/issues/issue-17728.stderr
@@ -1,5 +1,5 @@
 error[E0308]: `match` arms have incompatible types
-  --> $DIR/issue-17728.rs:113:14
+  --> $DIR/issue-17728.rs:108:14
    |
 LL | /     match to_parse {
 LL | |         "w" | "west" => RoomDirection::West,
diff --git a/src/test/ui/issues/issue-17758.base.stderr b/src/test/ui/issues/issue-17758.base.stderr
deleted file mode 100644
index 202238a49cb..00000000000
--- a/src/test/ui/issues/issue-17758.base.stderr
+++ /dev/null
@@ -1,32 +0,0 @@
-error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
-  --> $DIR/issue-17758.rs:11:14
-   |
-LL |         self.foo();
-   |              ^^^
-   |
-note: first, the lifetime cannot outlive the anonymous lifetime defined here...
-  --> $DIR/issue-17758.rs:10:12
-   |
-LL |     fn bar(&self) {
-   |            ^^^^^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/issue-17758.rs:11:9
-   |
-LL |         self.foo();
-   |         ^^^^
-note: but, the lifetime must be valid for the lifetime `'a` as defined here...
-  --> $DIR/issue-17758.rs:8:11
-   |
-LL | trait Foo<'a> {
-   |           ^^
-note: ...so that the types are compatible
-  --> $DIR/issue-17758.rs:11:14
-   |
-LL |         self.foo();
-   |              ^^^
-   = note: expected `&'a Self`
-              found `&Self`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/issues/issue-17758.rs b/src/test/ui/issues/issue-17758.rs
index 8090022b6d0..e2ee84694e3 100644
--- a/src/test/ui/issues/issue-17758.rs
+++ b/src/test/ui/issues/issue-17758.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 // Test that regionck suggestions in a provided method of a trait
 // don't ICE
 
@@ -9,8 +5,7 @@ trait Foo<'a> {
     fn foo(&'a self);
     fn bar(&self) {
         self.foo();
-        //[base]~^ ERROR cannot infer
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
diff --git a/src/test/ui/issues/issue-17758.nll.stderr b/src/test/ui/issues/issue-17758.stderr
index 32030540a84..613ef6b907c 100644
--- a/src/test/ui/issues/issue-17758.nll.stderr
+++ b/src/test/ui/issues/issue-17758.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-17758.rs:11:9
+  --> $DIR/issue-17758.rs:7:9
    |
 LL | trait Foo<'a> {
    |           -- lifetime `'a` defined here
diff --git a/src/test/ui/issues/issue-22706.rs b/src/test/ui/issues/issue-22706.rs
index 28e8a722804..bb8a58d3d2e 100644
--- a/src/test/ui/issues/issue-22706.rs
+++ b/src/test/ui/issues/issue-22706.rs
@@ -1,3 +1,3 @@
 fn is_copy<T: ::std::marker<i32>::Copy>() {}
-//~^ ERROR type arguments are not allowed for this type [E0109]
+//~^ ERROR type arguments are not allowed on module `marker` [E0109]
 fn main() {}
diff --git a/src/test/ui/issues/issue-22706.stderr b/src/test/ui/issues/issue-22706.stderr
index c5929397f65..66911f081d7 100644
--- a/src/test/ui/issues/issue-22706.stderr
+++ b/src/test/ui/issues/issue-22706.stderr
@@ -1,8 +1,10 @@
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on module `marker`
   --> $DIR/issue-22706.rs:1:29
    |
 LL | fn is_copy<T: ::std::marker<i32>::Copy>() {}
-   |                             ^^^ type argument not allowed
+   |                      ------ ^^^ type argument not allowed
+   |                      |
+   |                      not allowed on this
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/issues/issue-26217.base.stderr b/src/test/ui/issues/issue-26217.base.stderr
deleted file mode 100644
index 8b1ef806abb..00000000000
--- a/src/test/ui/issues/issue-26217.base.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0477]: the type `&'a i32` does not fulfill the required lifetime
-  --> $DIR/issue-26217.rs:8:5
-   |
-LL |     foo::<&'a i32>();
-   |     ^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0477`.
diff --git a/src/test/ui/issues/issue-26217.rs b/src/test/ui/issues/issue-26217.rs
index 6cc60b05dc6..422625e73c1 100644
--- a/src/test/ui/issues/issue-26217.rs
+++ b/src/test/ui/issues/issue-26217.rs
@@ -1,13 +1,8 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn foo<T>() where for<'a> T: 'a {}
 
 fn bar<'a>() {
     foo::<&'a i32>();
-    //[base]~^ ERROR the type `&'a i32` does not fulfill the required lifetime
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/issues/issue-26217.nll.stderr b/src/test/ui/issues/issue-26217.stderr
index c8b7d620557..c7601caacdc 100644
--- a/src/test/ui/issues/issue-26217.nll.stderr
+++ b/src/test/ui/issues/issue-26217.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-26217.rs:8:5
+  --> $DIR/issue-26217.rs:4:5
    |
 LL | fn bar<'a>() {
    |        -- lifetime `'a` defined here
diff --git a/src/test/ui/issues/issue-40000.base.stderr b/src/test/ui/issues/issue-40000.base.stderr
deleted file mode 100644
index a8518dde22e..00000000000
--- a/src/test/ui/issues/issue-40000.base.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/issue-40000.rs:10:9
-   |
-LL |     foo(bar);
-   |         ^^^ one type is more general than the other
-   |
-   = note: expected trait object `dyn for<'r> Fn(&'r i32)`
-              found trait object `dyn Fn(&i32)`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/issues/issue-40000.rs b/src/test/ui/issues/issue-40000.rs
index 3639413bfaf..a6e05e7ba02 100644
--- a/src/test/ui/issues/issue-40000.rs
+++ b/src/test/ui/issues/issue-40000.rs
@@ -1,13 +1,9 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn main() {
     let bar: fn(&mut u32) = |_| {};
 
     fn foo(x: Box<dyn Fn(&i32)>) {}
     let bar = Box::new(|x: &i32| {}) as Box<dyn Fn(_)>;
     foo(bar);
-    //~^ ERROR E0308
-    //[nll]~^^ ERROR mismatched types
+    //~^ ERROR mismatched types
+    //~| ERROR mismatched types
 }
diff --git a/src/test/ui/issues/issue-40000.nll.stderr b/src/test/ui/issues/issue-40000.stderr
index 81df9969a4f..e6f0b5fbfba 100644
--- a/src/test/ui/issues/issue-40000.nll.stderr
+++ b/src/test/ui/issues/issue-40000.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-40000.rs:10:9
+  --> $DIR/issue-40000.rs:6:9
    |
 LL |     foo(bar);
    |         ^^^ one type is more general than the other
@@ -8,7 +8,7 @@ LL |     foo(bar);
               found trait object `dyn Fn(&i32)`
 
 error[E0308]: mismatched types
-  --> $DIR/issue-40000.rs:10:9
+  --> $DIR/issue-40000.rs:6:9
    |
 LL |     foo(bar);
    |         ^^^ one type is more general than the other
diff --git a/src/test/ui/issues/issue-46983.base.stderr b/src/test/ui/issues/issue-46983.base.stderr
deleted file mode 100644
index 97ed4d65093..00000000000
--- a/src/test/ui/issues/issue-46983.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/issue-46983.rs:6:5
-   |
-LL | fn foo(x: &u32) -> &'static u32 {
-   |           ---- this data with an anonymous lifetime `'_`...
-LL |     &*x
-   |     ^^^ ...is used and required to live as long as `'static` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0759`.
diff --git a/src/test/ui/issues/issue-46983.rs b/src/test/ui/issues/issue-46983.rs
index e3ecdc8deac..4bd49a8796b 100644
--- a/src/test/ui/issues/issue-46983.rs
+++ b/src/test/ui/issues/issue-46983.rs
@@ -1,11 +1,6 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn foo(x: &u32) -> &'static u32 {
     &*x
-    //[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/issues/issue-46983.nll.stderr b/src/test/ui/issues/issue-46983.stderr
index 1327ff80c80..38a219bbd7b 100644
--- a/src/test/ui/issues/issue-46983.nll.stderr
+++ b/src/test/ui/issues/issue-46983.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-46983.rs:6:5
+  --> $DIR/issue-46983.rs:2:5
    |
 LL | fn foo(x: &u32) -> &'static u32 {
    |           - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/issues/issue-52533.base.stderr b/src/test/ui/issues/issue-52533.base.stderr
deleted file mode 100644
index 6556a52de14..00000000000
--- a/src/test/ui/issues/issue-52533.base.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0312]: lifetime of reference outlives lifetime of borrowed content...
-  --> $DIR/issue-52533.rs:9:16
-   |
-LL |     foo(|a, b| b)
-   |                ^
-   |
-note: ...the reference is valid for the anonymous lifetime #1 defined here...
-  --> $DIR/issue-52533.rs:9:9
-   |
-LL |     foo(|a, b| b)
-   |         ^^^^^^^^
-note: ...but the borrowed content is only valid for the anonymous lifetime #2 defined here
-  --> $DIR/issue-52533.rs:9:9
-   |
-LL |     foo(|a, b| b)
-   |         ^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0312`.
diff --git a/src/test/ui/issues/issue-52533.rs b/src/test/ui/issues/issue-52533.rs
index bc6264d0e2f..bb9a1911fdd 100644
--- a/src/test/ui/issues/issue-52533.rs
+++ b/src/test/ui/issues/issue-52533.rs
@@ -1,12 +1,7 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn foo(_: impl for<'a> FnOnce(&'a u32, &u32) -> &'a u32) {
 }
 
 fn main() {
     foo(|a, b| b)
-    //[base]~^ ERROR lifetime of reference outlives lifetime of borrowed content...
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
diff --git a/src/test/ui/issues/issue-52533.nll.stderr b/src/test/ui/issues/issue-52533.stderr
index 75fe5a5b862..c764736d798 100644
--- a/src/test/ui/issues/issue-52533.nll.stderr
+++ b/src/test/ui/issues/issue-52533.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-52533.rs:9:16
+  --> $DIR/issue-52533.rs:5:16
    |
 LL |     foo(|a, b| b)
    |          -  -  ^ closure was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
diff --git a/src/test/ui/issues/issue-54302-cases.base.stderr b/src/test/ui/issues/issue-54302-cases.base.stderr
deleted file mode 100644
index db91edf51e3..00000000000
--- a/src/test/ui/issues/issue-54302-cases.base.stderr
+++ /dev/null
@@ -1,38 +0,0 @@
-error: implementation of `Foo` is not general enough
-  --> $DIR/issue-54302-cases.rs:67:5
-   |
-LL |     <u32 as RefFoo<u32>>::ref_foo(a)
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
-   |
-   = note: `Foo<'static, u32>` would have to be implemented for the type `&'0 u32`, for any lifetime `'0`...
-   = note: ...but `Foo<'_, u32>` is actually implemented for the type `&'1 u32`, for some specific lifetime `'1`
-
-error: implementation of `Foo` is not general enough
-  --> $DIR/issue-54302-cases.rs:73:5
-   |
-LL |     <i32 as RefFoo<i32>>::ref_foo(a)
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
-   |
-   = note: `Foo<'static, i32>` would have to be implemented for the type `&'0 i32`, for any lifetime `'0`...
-   = note: ...but `Foo<'_, i32>` is actually implemented for the type `&'1 i32`, for some specific lifetime `'1`
-
-error: implementation of `Foo` is not general enough
-  --> $DIR/issue-54302-cases.rs:79:5
-   |
-LL |     <u64 as RefFoo<u64>>::ref_foo(a)
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
-   |
-   = note: `Foo<'static, u64>` would have to be implemented for the type `&'0 u64`, for any lifetime `'0`...
-   = note: ...but `Foo<'_, u64>` is actually implemented for the type `&'1 u64`, for some specific lifetime `'1`
-
-error: implementation of `Foo` is not general enough
-  --> $DIR/issue-54302-cases.rs:85:5
-   |
-LL |     <i64 as RefFoo<i64>>::ref_foo(a)
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
-   |
-   = note: `Foo<'static, i64>` would have to be implemented for the type `&'0 i64`, for any lifetime `'0`...
-   = note: ...but `Foo<'_, i64>` is actually implemented for the type `&'1 i64`, for some specific lifetime `'1`
-
-error: aborting due to 4 previous errors
-
diff --git a/src/test/ui/issues/issue-54302-cases.rs b/src/test/ui/issues/issue-54302-cases.rs
index f712d9b7718..faa116269ee 100644
--- a/src/test/ui/issues/issue-54302-cases.rs
+++ b/src/test/ui/issues/issue-54302-cases.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Mirror {
     type Image;
     fn coerce(self) -> Self::Image;
diff --git a/src/test/ui/issues/issue-54302-cases.nll.stderr b/src/test/ui/issues/issue-54302-cases.stderr
index 89725d3b03a..6e8b69c4bee 100644
--- a/src/test/ui/issues/issue-54302-cases.nll.stderr
+++ b/src/test/ui/issues/issue-54302-cases.stderr
@@ -1,5 +1,5 @@
 error: implementation of `Foo` is not general enough
-  --> $DIR/issue-54302-cases.rs:67:5
+  --> $DIR/issue-54302-cases.rs:63:5
    |
 LL |     <u32 as RefFoo<u32>>::ref_foo(a)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
@@ -8,7 +8,7 @@ LL |     <u32 as RefFoo<u32>>::ref_foo(a)
    = note: ...but `Foo<'_, u32>` is actually implemented for the type `&'1 u32`, for some specific lifetime `'1`
 
 error: implementation of `Foo` is not general enough
-  --> $DIR/issue-54302-cases.rs:73:5
+  --> $DIR/issue-54302-cases.rs:69:5
    |
 LL |     <i32 as RefFoo<i32>>::ref_foo(a)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
@@ -17,7 +17,7 @@ LL |     <i32 as RefFoo<i32>>::ref_foo(a)
    = note: ...but `Foo<'_, i32>` is actually implemented for the type `&'1 i32`, for some specific lifetime `'1`
 
 error: implementation of `Foo` is not general enough
-  --> $DIR/issue-54302-cases.rs:79:5
+  --> $DIR/issue-54302-cases.rs:75:5
    |
 LL |     <u64 as RefFoo<u64>>::ref_foo(a)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
@@ -26,7 +26,7 @@ LL |     <u64 as RefFoo<u64>>::ref_foo(a)
    = note: ...but `Foo<'_, u64>` is actually implemented for the type `&'1 u64`, for some specific lifetime `'1`
 
 error: implementation of `Foo` is not general enough
-  --> $DIR/issue-54302-cases.rs:85:5
+  --> $DIR/issue-54302-cases.rs:81:5
    |
 LL |     <i64 as RefFoo<i64>>::ref_foo(a)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
diff --git a/src/test/ui/issues/issue-54943.base.stderr b/src/test/ui/issues/issue-54943.base.stderr
deleted file mode 100644
index ebd679996d0..00000000000
--- a/src/test/ui/issues/issue-54943.base.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0477]: the type `&'a u32` does not fulfill the required lifetime
-  --> $DIR/issue-54943.rs:10:13
-   |
-LL |     let x = foo::<&'a u32>();
-   |             ^^^^^^^^^^^^^^
-   |
-note: type must satisfy the static lifetime as required by this binding
-  --> $DIR/issue-54943.rs:5:11
-   |
-LL | fn foo<T: 'static>() { }
-   |           ^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0477`.
diff --git a/src/test/ui/issues/issue-54943.rs b/src/test/ui/issues/issue-54943.rs
index ad463e7a466..85722300bf0 100644
--- a/src/test/ui/issues/issue-54943.rs
+++ b/src/test/ui/issues/issue-54943.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn foo<T: 'static>() { }
 
 fn boo<'a>() {
diff --git a/src/test/ui/issues/issue-54943.nll.stderr b/src/test/ui/issues/issue-54943.stderr
index 2c86a5a3390..59be0f983b9 100644
--- a/src/test/ui/issues/issue-54943.nll.stderr
+++ b/src/test/ui/issues/issue-54943.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-54943.rs:10:13
+  --> $DIR/issue-54943.rs:6:13
    |
 LL | fn boo<'a>() {
    |        -- lifetime `'a` defined here
diff --git a/src/test/ui/issues/issue-55731.base.stderr b/src/test/ui/issues/issue-55731.base.stderr
deleted file mode 100644
index 26b1c9ec468..00000000000
--- a/src/test/ui/issues/issue-55731.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: implementation of `DistributedIteratorMulti` is not general enough
-  --> $DIR/issue-55731.rs:52:5
-   |
-LL |     multi(Map {
-   |     ^^^^^ implementation of `DistributedIteratorMulti` is not general enough
-   |
-   = note: `DistributedIteratorMulti<&'0 ()>` would have to be implemented for the type `Cloned<&()>`, for any lifetime `'0`...
-   = note: ...but `DistributedIteratorMulti<&'1 ()>` is actually implemented for the type `Cloned<&'1 ()>`, for some specific lifetime `'1`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/issues/issue-55731.rs b/src/test/ui/issues/issue-55731.rs
index c6a0ee12589..7b4f4e2cd3b 100644
--- a/src/test/ui/issues/issue-55731.rs
+++ b/src/test/ui/issues/issue-55731.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 use std::marker::PhantomData;
 
 trait DistributedIterator {
diff --git a/src/test/ui/issues/issue-55731.nll.stderr b/src/test/ui/issues/issue-55731.stderr
index 168a2cbccd7..97fd6678c99 100644
--- a/src/test/ui/issues/issue-55731.nll.stderr
+++ b/src/test/ui/issues/issue-55731.stderr
@@ -1,5 +1,5 @@
 error: implementation of `DistributedIteratorMulti` is not general enough
-  --> $DIR/issue-55731.rs:52:5
+  --> $DIR/issue-55731.rs:48:5
    |
 LL | /     multi(Map {
 LL | |         i: Cloned(PhantomData),
diff --git a/src/test/ui/issues/issue-55796.base.stderr b/src/test/ui/issues/issue-55796.base.stderr
deleted file mode 100644
index a4c5d68472d..00000000000
--- a/src/test/ui/issues/issue-55796.base.stderr
+++ /dev/null
@@ -1,53 +0,0 @@
-error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
-  --> $DIR/issue-55796.rs:20:9
-   |
-LL |         Box::new(self.out_edges(u).map(|e| e.target()))
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
-  --> $DIR/issue-55796.rs:9:17
-   |
-LL | pub trait Graph<'a> {
-   |                 ^^
-note: ...so that the type `Map<<Self as Graph<'a>>::EdgesIter, [closure@$DIR/issue-55796.rs:20:40: 20:54]>` will meet its required lifetime bounds
-  --> $DIR/issue-55796.rs:20:9
-   |
-LL |         Box::new(self.out_edges(u).map(|e| e.target()))
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: but, the lifetime must be valid for the static lifetime...
-note: ...so that the types are compatible
-  --> $DIR/issue-55796.rs:20:9
-   |
-LL |         Box::new(self.out_edges(u).map(|e| e.target()))
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: expected `Box<(dyn Iterator<Item = <Self as Graph<'a>>::Node> + 'static)>`
-              found `Box<dyn Iterator<Item = <Self as Graph<'a>>::Node>>`
-
-error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
-  --> $DIR/issue-55796.rs:26:9
-   |
-LL |         Box::new(self.in_edges(u).map(|e| e.target()))
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
-  --> $DIR/issue-55796.rs:9:17
-   |
-LL | pub trait Graph<'a> {
-   |                 ^^
-note: ...so that the type `Map<<Self as Graph<'a>>::EdgesIter, [closure@$DIR/issue-55796.rs:26:39: 26:53]>` will meet its required lifetime bounds
-  --> $DIR/issue-55796.rs:26:9
-   |
-LL |         Box::new(self.in_edges(u).map(|e| e.target()))
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: but, the lifetime must be valid for the static lifetime...
-note: ...so that the types are compatible
-  --> $DIR/issue-55796.rs:26:9
-   |
-LL |         Box::new(self.in_edges(u).map(|e| e.target()))
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: expected `Box<(dyn Iterator<Item = <Self as Graph<'a>>::Node> + 'static)>`
-              found `Box<dyn Iterator<Item = <Self as Graph<'a>>::Node>>`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/issues/issue-55796.rs b/src/test/ui/issues/issue-55796.rs
index a0bc63dd2a7..a7b27a99929 100644
--- a/src/test/ui/issues/issue-55796.rs
+++ b/src/test/ui/issues/issue-55796.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 pub trait EdgeTrait<N> {
     fn target(&self) -> N;
 }
@@ -18,14 +14,12 @@ pub trait Graph<'a> {
 
     fn out_neighbors(&'a self, u: &Self::Node) -> Box<dyn Iterator<Item = Self::Node>> {
         Box::new(self.out_edges(u).map(|e| e.target()))
-        //[base]~^ ERROR cannot infer
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn in_neighbors(&'a self, u: &Self::Node) -> Box<dyn Iterator<Item = Self::Node>> {
         Box::new(self.in_edges(u).map(|e| e.target()))
-        //[base]~^ ERROR cannot infer
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
diff --git a/src/test/ui/issues/issue-55796.nll.stderr b/src/test/ui/issues/issue-55796.stderr
index 2b7d231871a..5809a56cd4b 100644
--- a/src/test/ui/issues/issue-55796.nll.stderr
+++ b/src/test/ui/issues/issue-55796.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-55796.rs:20:9
+  --> $DIR/issue-55796.rs:16:9
    |
 LL | pub trait Graph<'a> {
    |                 -- lifetime `'a` defined here
@@ -8,7 +8,7 @@ LL |         Box::new(self.out_edges(u).map(|e| e.target()))
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/issue-55796.rs:26:9
+  --> $DIR/issue-55796.rs:21:9
    |
 LL | pub trait Graph<'a> {
    |                 -- lifetime `'a` defined here
diff --git a/src/test/ui/issues/issue-57924.rs b/src/test/ui/issues/issue-57924.rs
index dc2942225e3..8846912a8ff 100644
--- a/src/test/ui/issues/issue-57924.rs
+++ b/src/test/ui/issues/issue-57924.rs
@@ -3,7 +3,7 @@ pub struct Gcm<E>(E);
 impl<E> Gcm<E> {
     pub fn crash(e: E) -> Self {
         Self::<E>(e)
-        //~^ ERROR type arguments are not allowed for this type
+        //~^ ERROR type arguments are not allowed on self constructor
     }
 }
 
diff --git a/src/test/ui/issues/issue-57924.stderr b/src/test/ui/issues/issue-57924.stderr
index 2f184b1aae1..211b0dde48c 100644
--- a/src/test/ui/issues/issue-57924.stderr
+++ b/src/test/ui/issues/issue-57924.stderr
@@ -1,8 +1,10 @@
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on self constructor
   --> $DIR/issue-57924.rs:5:16
    |
 LL |         Self::<E>(e)
-   |                ^ type argument not allowed
+   |         ----   ^ type argument not allowed
+   |         |
+   |         not allowed on this
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/issues/issue-60989.rs b/src/test/ui/issues/issue-60989.rs
index 6dae1e1347b..29db3fdb471 100644
--- a/src/test/ui/issues/issue-60989.rs
+++ b/src/test/ui/issues/issue-60989.rs
@@ -10,9 +10,9 @@ impl From<A> for B {
 fn main() {
     let c1 = ();
     c1::<()>;
-    //~^ ERROR type arguments are not allowed for this type
+    //~^ ERROR type arguments are not allowed on local variable
 
     let c1 = A {};
     c1::<dyn Into<B>>;
-    //~^ ERROR type arguments are not allowed for this type
+    //~^ ERROR type arguments are not allowed on local variable
 }
diff --git a/src/test/ui/issues/issue-60989.stderr b/src/test/ui/issues/issue-60989.stderr
index 5d2d9e83c9b..9076f4f9385 100644
--- a/src/test/ui/issues/issue-60989.stderr
+++ b/src/test/ui/issues/issue-60989.stderr
@@ -1,14 +1,18 @@
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on local variable
   --> $DIR/issue-60989.rs:12:10
    |
 LL |     c1::<()>;
-   |          ^^ type argument not allowed
+   |     --   ^^ type argument not allowed
+   |     |
+   |     not allowed on this
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on local variable
   --> $DIR/issue-60989.rs:16:10
    |
 LL |     c1::<dyn Into<B>>;
-   |          ^^^^^^^^^^^ type argument not allowed
+   |     --   ^^^^^^^^^^^ type argument not allowed
+   |     |
+   |     not allowed on this
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/issues/issue-75777.base.stderr b/src/test/ui/issues/issue-75777.base.stderr
deleted file mode 100644
index d2c6738cb59..00000000000
--- a/src/test/ui/issues/issue-75777.base.stderr
+++ /dev/null
@@ -1,30 +0,0 @@
-error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
-  --> $DIR/issue-75777.rs:15:14
-   |
-LL |     Box::new(move |_| fut)
-   |              ^^^^^^^^^^^^
-   |
-note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
-  --> $DIR/issue-75777.rs:13:11
-   |
-LL | fn inject<'a, Env: 'a, A: 'a + Send>(v: A) -> Box<dyn FnOnce(&'a Env) -> BoxFuture<'a, A>> {
-   |           ^^
-note: ...so that the types are compatible
-  --> $DIR/issue-75777.rs:15:14
-   |
-LL |     Box::new(move |_| fut)
-   |              ^^^^^^^^^^^^
-   = note: expected `(Pin<Box<dyn Future<Output = A> + Send>>,)`
-              found `(Pin<Box<(dyn Future<Output = A> + Send + 'a)>>,)`
-   = note: but, the lifetime must be valid for the static lifetime...
-note: ...so that the types are compatible
-  --> $DIR/issue-75777.rs:15:5
-   |
-LL |     Box::new(move |_| fut)
-   |     ^^^^^^^^^^^^^^^^^^^^^^
-   = note: expected `Box<(dyn FnOnce(&'a Env) -> Pin<Box<(dyn Future<Output = A> + Send + 'a)>> + 'static)>`
-              found `Box<dyn FnOnce(&'a Env) -> Pin<Box<(dyn Future<Output = A> + Send + 'a)>>>`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/issues/issue-75777.rs b/src/test/ui/issues/issue-75777.rs
index 930cd7ad37b..a1e438bc617 100644
--- a/src/test/ui/issues/issue-75777.rs
+++ b/src/test/ui/issues/issue-75777.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 // Regression test for #75777.
 // Checks that a boxed future can be properly constructed.
 
@@ -13,8 +9,7 @@ type BoxFuture<'a, T> = Pin<Box<dyn Future<Output = T> + 'a + Send>>;
 fn inject<'a, Env: 'a, A: 'a + Send>(v: A) -> Box<dyn FnOnce(&'a Env) -> BoxFuture<'a, A>> {
     let fut: BoxFuture<'a, A> = Box::pin(future::ready(v));
     Box::new(move |_| fut)
-    //[base]~^ ERROR: cannot infer an appropriate lifetime
-    //[nll]~^^ ERROR: lifetime may not live long enough
+    //~^ ERROR: lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/issues/issue-75777.nll.stderr b/src/test/ui/issues/issue-75777.stderr
index d1f8d388676..370cd72fd55 100644
--- a/src/test/ui/issues/issue-75777.nll.stderr
+++ b/src/test/ui/issues/issue-75777.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-75777.rs:15:5
+  --> $DIR/issue-75777.rs:11:5
    |
 LL | fn inject<'a, Env: 'a, A: 'a + Send>(v: A) -> Box<dyn FnOnce(&'a Env) -> BoxFuture<'a, A>> {
    |           -- lifetime `'a` defined here
diff --git a/src/test/ui/kindck/kindck-impl-type-params.base.stderr b/src/test/ui/kindck/kindck-impl-type-params.base.stderr
deleted file mode 100644
index 2fa8993b71a..00000000000
--- a/src/test/ui/kindck/kindck-impl-type-params.base.stderr
+++ /dev/null
@@ -1,112 +0,0 @@
-error[E0277]: `T` cannot be sent between threads safely
-  --> $DIR/kindck-impl-type-params.rs:20:13
-   |
-LL |     let a = &t as &dyn Gettable<T>;
-   |             ^^ `T` cannot be sent between threads safely
-   |
-note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`
-  --> $DIR/kindck-impl-type-params.rs:16:32
-   |
-LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
-   |                                ^^^^^^^^^^^     ^^^^
-   = note: required for the cast to the object type `dyn Gettable<T>`
-help: consider restricting type parameter `T`
-   |
-LL | fn f<T: std::marker::Send>(val: T) {
-   |       +++++++++++++++++++
-
-error[E0277]: the trait bound `T: Copy` is not satisfied
-  --> $DIR/kindck-impl-type-params.rs:20:13
-   |
-LL |     let a = &t as &dyn Gettable<T>;
-   |             ^^ the trait `Copy` is not implemented for `T`
-   |
-note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`
-  --> $DIR/kindck-impl-type-params.rs:16:32
-   |
-LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
-   |                                ^^^^^^^^^^^     ^^^^
-   = note: required for the cast to the object type `dyn Gettable<T>`
-help: consider restricting type parameter `T`
-   |
-LL | fn f<T: std::marker::Copy>(val: T) {
-   |       +++++++++++++++++++
-
-error[E0277]: `T` cannot be sent between threads safely
-  --> $DIR/kindck-impl-type-params.rs:27:31
-   |
-LL |     let a: &dyn Gettable<T> = &t;
-   |                               ^^ `T` cannot be sent between threads safely
-   |
-note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`
-  --> $DIR/kindck-impl-type-params.rs:16:32
-   |
-LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
-   |                                ^^^^^^^^^^^     ^^^^
-   = note: required for the cast to the object type `dyn Gettable<T>`
-help: consider restricting type parameter `T`
-   |
-LL | fn g<T: std::marker::Send>(val: T) {
-   |       +++++++++++++++++++
-
-error[E0277]: the trait bound `T: Copy` is not satisfied
-  --> $DIR/kindck-impl-type-params.rs:27:31
-   |
-LL |     let a: &dyn Gettable<T> = &t;
-   |                               ^^ the trait `Copy` is not implemented for `T`
-   |
-note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`
-  --> $DIR/kindck-impl-type-params.rs:16:32
-   |
-LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
-   |                                ^^^^^^^^^^^     ^^^^
-   = note: required for the cast to the object type `dyn Gettable<T>`
-help: consider restricting type parameter `T`
-   |
-LL | fn g<T: std::marker::Copy>(val: T) {
-   |       +++++++++++++++++++
-
-error[E0477]: the type `&'a isize` does not fulfill the required lifetime
-  --> $DIR/kindck-impl-type-params.rs:34:13
-   |
-LL |     let a = &t as &dyn Gettable<&'a isize>;
-   |             ^^
-   |
-   = note: type must satisfy the static lifetime
-
-error[E0277]: the trait bound `String: Copy` is not satisfied
-  --> $DIR/kindck-impl-type-params.rs:40:13
-   |
-LL |     let a = t as Box<dyn Gettable<String>>;
-   |             ^ the trait `Copy` is not implemented for `String`
-   |
-   = help: the trait `Gettable<T>` is implemented for `S<T>`
-note: required because of the requirements on the impl of `Gettable<String>` for `S<String>`
-  --> $DIR/kindck-impl-type-params.rs:16:32
-   |
-LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
-   |                                ^^^^^^^^^^^     ^^^^
-   = note: required for the cast to the object type `dyn Gettable<String>`
-
-error[E0277]: the trait bound `Foo: Copy` is not satisfied
-  --> $DIR/kindck-impl-type-params.rs:48:37
-   |
-LL |     let a: Box<dyn Gettable<Foo>> = t;
-   |                                     ^ the trait `Copy` is not implemented for `Foo`
-   |
-   = help: the trait `Gettable<T>` is implemented for `S<T>`
-note: required because of the requirements on the impl of `Gettable<Foo>` for `S<Foo>`
-  --> $DIR/kindck-impl-type-params.rs:16:32
-   |
-LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
-   |                                ^^^^^^^^^^^     ^^^^
-   = note: required for the cast to the object type `dyn Gettable<Foo>`
-help: consider annotating `Foo` with `#[derive(Copy)]`
-   |
-LL |     #[derive(Copy)]
-   |
-
-error: aborting due to 7 previous errors
-
-Some errors have detailed explanations: E0277, E0477.
-For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/kindck/kindck-impl-type-params.rs b/src/test/ui/kindck/kindck-impl-type-params.rs
index 1a563872585..72a6599c326 100644
--- a/src/test/ui/kindck/kindck-impl-type-params.rs
+++ b/src/test/ui/kindck/kindck-impl-type-params.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 // Issue #14061: tests the interaction between generic implementation
 // parameter bounds and trait objects.
 
@@ -32,7 +28,6 @@ fn g<T>(val: T) {
 fn foo<'a>() {
     let t: S<&'a isize> = S(marker::PhantomData);
     let a = &t as &dyn Gettable<&'a isize>;
-    //[base]~^ ERROR does not fulfill
 }
 
 fn foo2<'a>() {
diff --git a/src/test/ui/kindck/kindck-impl-type-params.nll.stderr b/src/test/ui/kindck/kindck-impl-type-params.stderr
index c6f5e17fb69..32759d2fa0e 100644
--- a/src/test/ui/kindck/kindck-impl-type-params.nll.stderr
+++ b/src/test/ui/kindck/kindck-impl-type-params.stderr
@@ -1,11 +1,11 @@
 error[E0277]: `T` cannot be sent between threads safely
-  --> $DIR/kindck-impl-type-params.rs:20:13
+  --> $DIR/kindck-impl-type-params.rs:16:13
    |
 LL |     let a = &t as &dyn Gettable<T>;
    |             ^^ `T` cannot be sent between threads safely
    |
 note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`
-  --> $DIR/kindck-impl-type-params.rs:16:32
+  --> $DIR/kindck-impl-type-params.rs:12:32
    |
 LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
    |                                ^^^^^^^^^^^     ^^^^
@@ -16,13 +16,13 @@ LL | fn f<T: std::marker::Send>(val: T) {
    |       +++++++++++++++++++
 
 error[E0277]: the trait bound `T: Copy` is not satisfied
-  --> $DIR/kindck-impl-type-params.rs:20:13
+  --> $DIR/kindck-impl-type-params.rs:16:13
    |
 LL |     let a = &t as &dyn Gettable<T>;
    |             ^^ the trait `Copy` is not implemented for `T`
    |
 note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`
-  --> $DIR/kindck-impl-type-params.rs:16:32
+  --> $DIR/kindck-impl-type-params.rs:12:32
    |
 LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
    |                                ^^^^^^^^^^^     ^^^^
@@ -33,13 +33,13 @@ LL | fn f<T: std::marker::Copy>(val: T) {
    |       +++++++++++++++++++
 
 error[E0277]: `T` cannot be sent between threads safely
-  --> $DIR/kindck-impl-type-params.rs:27:31
+  --> $DIR/kindck-impl-type-params.rs:23:31
    |
 LL |     let a: &dyn Gettable<T> = &t;
    |                               ^^ `T` cannot be sent between threads safely
    |
 note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`
-  --> $DIR/kindck-impl-type-params.rs:16:32
+  --> $DIR/kindck-impl-type-params.rs:12:32
    |
 LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
    |                                ^^^^^^^^^^^     ^^^^
@@ -50,13 +50,13 @@ LL | fn g<T: std::marker::Send>(val: T) {
    |       +++++++++++++++++++
 
 error[E0277]: the trait bound `T: Copy` is not satisfied
-  --> $DIR/kindck-impl-type-params.rs:27:31
+  --> $DIR/kindck-impl-type-params.rs:23:31
    |
 LL |     let a: &dyn Gettable<T> = &t;
    |                               ^^ the trait `Copy` is not implemented for `T`
    |
 note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`
-  --> $DIR/kindck-impl-type-params.rs:16:32
+  --> $DIR/kindck-impl-type-params.rs:12:32
    |
 LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
    |                                ^^^^^^^^^^^     ^^^^
@@ -67,28 +67,28 @@ LL | fn g<T: std::marker::Copy>(val: T) {
    |       +++++++++++++++++++
 
 error[E0277]: the trait bound `String: Copy` is not satisfied
-  --> $DIR/kindck-impl-type-params.rs:40:13
+  --> $DIR/kindck-impl-type-params.rs:35:13
    |
 LL |     let a = t as Box<dyn Gettable<String>>;
    |             ^ the trait `Copy` is not implemented for `String`
    |
    = help: the trait `Gettable<T>` is implemented for `S<T>`
 note: required because of the requirements on the impl of `Gettable<String>` for `S<String>`
-  --> $DIR/kindck-impl-type-params.rs:16:32
+  --> $DIR/kindck-impl-type-params.rs:12:32
    |
 LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
    |                                ^^^^^^^^^^^     ^^^^
    = note: required for the cast to the object type `dyn Gettable<String>`
 
 error[E0277]: the trait bound `Foo: Copy` is not satisfied
-  --> $DIR/kindck-impl-type-params.rs:48:37
+  --> $DIR/kindck-impl-type-params.rs:43:37
    |
 LL |     let a: Box<dyn Gettable<Foo>> = t;
    |                                     ^ the trait `Copy` is not implemented for `Foo`
    |
    = help: the trait `Gettable<T>` is implemented for `S<T>`
 note: required because of the requirements on the impl of `Gettable<Foo>` for `S<Foo>`
-  --> $DIR/kindck-impl-type-params.rs:16:32
+  --> $DIR/kindck-impl-type-params.rs:12:32
    |
 LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
    |                                ^^^^^^^^^^^     ^^^^
diff --git a/src/test/ui/kindck/kindck-send-object1.base.stderr b/src/test/ui/kindck/kindck-send-object1.base.stderr
deleted file mode 100644
index 5976c7119c7..00000000000
--- a/src/test/ui/kindck/kindck-send-object1.base.stderr
+++ /dev/null
@@ -1,45 +0,0 @@
-error[E0277]: `(dyn Dummy + 'a)` cannot be shared between threads safely
-  --> $DIR/kindck-send-object1.rs:14:5
-   |
-LL |     assert_send::<&'a dyn Dummy>();
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be shared between threads safely
-   |
-   = help: the trait `Sync` is not implemented for `(dyn Dummy + 'a)`
-   = note: required because of the requirements on the impl of `Send` for `&'a (dyn Dummy + 'a)`
-note: required by a bound in `assert_send`
-  --> $DIR/kindck-send-object1.rs:9:18
-   |
-LL | fn assert_send<T:Send+'static>() { }
-   |                  ^^^^ required by this bound in `assert_send`
-
-error[E0477]: the type `&'a (dyn Dummy + Sync + 'a)` does not fulfill the required lifetime
-  --> $DIR/kindck-send-object1.rs:18:5
-   |
-LL |     assert_send::<&'a (dyn Dummy + Sync)>();
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: type must satisfy the static lifetime as required by this binding
-  --> $DIR/kindck-send-object1.rs:9:23
-   |
-LL | fn assert_send<T:Send+'static>() { }
-   |                       ^^^^^^^
-
-error[E0277]: `(dyn Dummy + 'a)` cannot be sent between threads safely
-  --> $DIR/kindck-send-object1.rs:33:5
-   |
-LL |     assert_send::<Box<dyn Dummy + 'a>>();
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be sent between threads safely
-   |
-   = help: the trait `Send` is not implemented for `(dyn Dummy + 'a)`
-   = note: required because of the requirements on the impl of `Send` for `Unique<(dyn Dummy + 'a)>`
-   = note: required because it appears within the type `Box<(dyn Dummy + 'a)>`
-note: required by a bound in `assert_send`
-  --> $DIR/kindck-send-object1.rs:9:18
-   |
-LL | fn assert_send<T:Send+'static>() { }
-   |                  ^^^^ required by this bound in `assert_send`
-
-error: aborting due to 3 previous errors
-
-Some errors have detailed explanations: E0277, E0477.
-For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/kindck/kindck-send-object1.rs b/src/test/ui/kindck/kindck-send-object1.rs
index 26894dc2ce4..787d0f8f6cb 100644
--- a/src/test/ui/kindck/kindck-send-object1.rs
+++ b/src/test/ui/kindck/kindck-send-object1.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 // Test which object types are considered sendable. This test
 // is broken into two parts because some errors occur in distinct
 // phases in the compiler. See kindck-send-object2.rs as well!
@@ -16,7 +12,6 @@ fn test51<'a>() {
 }
 fn test52<'a>() {
     assert_send::<&'a (dyn Dummy + Sync)>();
-    //[base]~^ ERROR does not fulfill the required lifetime
 }
 
 // ...unless they are properly bounded
diff --git a/src/test/ui/kindck/kindck-send-object1.nll.stderr b/src/test/ui/kindck/kindck-send-object1.stderr
index f34374dcc54..1f5e21cbf97 100644
--- a/src/test/ui/kindck/kindck-send-object1.nll.stderr
+++ b/src/test/ui/kindck/kindck-send-object1.stderr
@@ -1,5 +1,5 @@
 error[E0277]: `(dyn Dummy + 'a)` cannot be shared between threads safely
-  --> $DIR/kindck-send-object1.rs:14:5
+  --> $DIR/kindck-send-object1.rs:10:5
    |
 LL |     assert_send::<&'a dyn Dummy>();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be shared between threads safely
@@ -7,13 +7,13 @@ LL |     assert_send::<&'a dyn Dummy>();
    = help: the trait `Sync` is not implemented for `(dyn Dummy + 'a)`
    = note: required because of the requirements on the impl of `Send` for `&'a (dyn Dummy + 'a)`
 note: required by a bound in `assert_send`
-  --> $DIR/kindck-send-object1.rs:9:18
+  --> $DIR/kindck-send-object1.rs:5:18
    |
 LL | fn assert_send<T:Send+'static>() { }
    |                  ^^^^ required by this bound in `assert_send`
 
 error[E0277]: `(dyn Dummy + 'a)` cannot be sent between threads safely
-  --> $DIR/kindck-send-object1.rs:33:5
+  --> $DIR/kindck-send-object1.rs:28:5
    |
 LL |     assert_send::<Box<dyn Dummy + 'a>>();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be sent between threads safely
@@ -22,7 +22,7 @@ LL |     assert_send::<Box<dyn Dummy + 'a>>();
    = note: required because of the requirements on the impl of `Send` for `Unique<(dyn Dummy + 'a)>`
    = note: required because it appears within the type `Box<(dyn Dummy + 'a)>`
 note: required by a bound in `assert_send`
-  --> $DIR/kindck-send-object1.rs:9:18
+  --> $DIR/kindck-send-object1.rs:5:18
    |
 LL | fn assert_send<T:Send+'static>() { }
    |                  ^^^^ required by this bound in `assert_send`
diff --git a/src/test/ui/lifetimes/copy_modulo_regions.rs b/src/test/ui/lifetimes/copy_modulo_regions.rs
index 1d5d90ffcb4..040fc4a0023 100644
--- a/src/test/ui/lifetimes/copy_modulo_regions.rs
+++ b/src/test/ui/lifetimes/copy_modulo_regions.rs
@@ -1,5 +1,3 @@
-#![feature(nll)]
-
 #[derive(Clone)]
 struct Foo<'a>(fn(&'a ()) -> &'a ());
 
diff --git a/src/test/ui/lifetimes/copy_modulo_regions.stderr b/src/test/ui/lifetimes/copy_modulo_regions.stderr
index e027bc45426..87dbb64abd1 100644
--- a/src/test/ui/lifetimes/copy_modulo_regions.stderr
+++ b/src/test/ui/lifetimes/copy_modulo_regions.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/copy_modulo_regions.rs:14:5
+  --> $DIR/copy_modulo_regions.rs:12:5
    |
 LL | fn foo<'a>() -> [Foo<'a>; 100] {
    |        -- lifetime `'a` defined here
diff --git a/src/test/ui/lifetimes/issue-79187-2.base.stderr b/src/test/ui/lifetimes/issue-79187-2.base.stderr
deleted file mode 100644
index 95591412f7e..00000000000
--- a/src/test/ui/lifetimes/issue-79187-2.base.stderr
+++ /dev/null
@@ -1,60 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/issue-79187-2.rs:12:5
-   |
-LL |     take_foo(|a| a);
-   |     ^^^^^^^^ lifetime mismatch
-   |
-   = note: expected type `for<'r> Fn<(&'r i32,)>`
-              found type `Fn<(&i32,)>`
-note: this closure does not fulfill the lifetime requirements
-  --> $DIR/issue-79187-2.rs:12:14
-   |
-LL |     take_foo(|a| a);
-   |              ^^^^^
-note: the lifetime requirement is introduced here
-  --> $DIR/issue-79187-2.rs:9:21
-   |
-LL | fn take_foo(_: impl Foo) {}
-   |                     ^^^
-
-error[E0308]: mismatched types
-  --> $DIR/issue-79187-2.rs:16:5
-   |
-LL |     take_foo(|a: &i32| a);
-   |     ^^^^^^^^ lifetime mismatch
-   |
-   = note: expected reference `&i32`
-              found reference `&i32`
-note: the anonymous lifetime #1 defined here doesn't meet the lifetime requirements
-  --> $DIR/issue-79187-2.rs:16:14
-   |
-LL |     take_foo(|a: &i32| a);
-   |              ^^^^^^^^^^^
-note: the lifetime requirement is introduced here
-  --> $DIR/issue-79187-2.rs:9:21
-   |
-LL | fn take_foo(_: impl Foo) {}
-   |                     ^^^
-
-error[E0308]: mismatched types
-  --> $DIR/issue-79187-2.rs:20:5
-   |
-LL |     take_foo(|a: &i32| -> &i32 { a });
-   |     ^^^^^^^^ lifetime mismatch
-   |
-   = note: expected reference `&i32`
-              found reference `&i32`
-note: the anonymous lifetime #1 defined here doesn't meet the lifetime requirements
-  --> $DIR/issue-79187-2.rs:20:14
-   |
-LL |     take_foo(|a: &i32| -> &i32 { a });
-   |              ^^^^^^^^^^^^^^^^^^^^^^^
-note: the lifetime requirement is introduced here
-  --> $DIR/issue-79187-2.rs:9:21
-   |
-LL | fn take_foo(_: impl Foo) {}
-   |                     ^^^
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/lifetimes/issue-79187-2.rs b/src/test/ui/lifetimes/issue-79187-2.rs
index d122b92f74b..fff92c30b37 100644
--- a/src/test/ui/lifetimes/issue-79187-2.rs
+++ b/src/test/ui/lifetimes/issue-79187-2.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Foo {}
 
 impl<F> Foo for F where F: Fn(&i32) -> &i32 {}
@@ -10,17 +6,14 @@ fn take_foo(_: impl Foo) {}
 
 fn main() {
     take_foo(|a| a);
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR implementation of `FnOnce` is not general enough
-    //[nll]~| ERROR mismatched types
+    //~^ ERROR implementation of `FnOnce` is not general enough
+    //~| ERROR mismatched types
     take_foo(|a: &i32| a);
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
-    //[nll]~| ERROR mismatched types
+    //~^ ERROR lifetime may not live long enough
+    //~| ERROR mismatched types
     take_foo(|a: &i32| -> &i32 { a });
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
-    //[nll]~| ERROR mismatched types
+    //~^ ERROR lifetime may not live long enough
+    //~| ERROR mismatched types
 
     // OK
     take_foo(identity(|a| a));
diff --git a/src/test/ui/lifetimes/issue-79187-2.nll.stderr b/src/test/ui/lifetimes/issue-79187-2.stderr
index 3cbce7600f9..06eac16c88f 100644
--- a/src/test/ui/lifetimes/issue-79187-2.nll.stderr
+++ b/src/test/ui/lifetimes/issue-79187-2.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-79187-2.rs:16:24
+  --> $DIR/issue-79187-2.rs:11:24
    |
 LL |     take_foo(|a: &i32| a);
    |                  -   - ^ returning this value requires that `'1` must outlive `'2`
@@ -8,7 +8,7 @@ LL |     take_foo(|a: &i32| a);
    |                  let's call the lifetime of this reference `'1`
 
 error: lifetime may not live long enough
-  --> $DIR/issue-79187-2.rs:20:34
+  --> $DIR/issue-79187-2.rs:14:34
    |
 LL |     take_foo(|a: &i32| -> &i32 { a });
    |                  -        -      ^ returning this value requires that `'1` must outlive `'2`
@@ -17,7 +17,7 @@ LL |     take_foo(|a: &i32| -> &i32 { a });
    |                  let's call the lifetime of this reference `'1`
 
 error: implementation of `FnOnce` is not general enough
-  --> $DIR/issue-79187-2.rs:12:5
+  --> $DIR/issue-79187-2.rs:8:5
    |
 LL |     take_foo(|a| a);
    |     ^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
@@ -26,7 +26,7 @@ LL |     take_foo(|a| a);
    = note: ...but it actually implements `FnOnce<(&'2 i32,)>`, for some specific lifetime `'2`
 
 error[E0308]: mismatched types
-  --> $DIR/issue-79187-2.rs:12:5
+  --> $DIR/issue-79187-2.rs:8:5
    |
 LL |     take_foo(|a| a);
    |     ^^^^^^^^^^^^^^^ one type is more general than the other
@@ -34,18 +34,18 @@ LL |     take_foo(|a| a);
    = note: expected type `for<'r> Fn<(&'r i32,)>`
               found type `Fn<(&i32,)>`
 note: this closure does not fulfill the lifetime requirements
-  --> $DIR/issue-79187-2.rs:12:14
+  --> $DIR/issue-79187-2.rs:8:14
    |
 LL |     take_foo(|a| a);
    |              ^^^^^
 note: the lifetime requirement is introduced here
-  --> $DIR/issue-79187-2.rs:9:21
+  --> $DIR/issue-79187-2.rs:5:21
    |
 LL | fn take_foo(_: impl Foo) {}
    |                     ^^^
 
 error[E0308]: mismatched types
-  --> $DIR/issue-79187-2.rs:16:5
+  --> $DIR/issue-79187-2.rs:11:5
    |
 LL |     take_foo(|a: &i32| a);
    |     ^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
@@ -53,13 +53,13 @@ LL |     take_foo(|a: &i32| a);
    = note: expected reference `&i32`
               found reference `&i32`
 note: the lifetime requirement is introduced here
-  --> $DIR/issue-79187-2.rs:9:21
+  --> $DIR/issue-79187-2.rs:5:21
    |
 LL | fn take_foo(_: impl Foo) {}
    |                     ^^^
 
 error[E0308]: mismatched types
-  --> $DIR/issue-79187-2.rs:20:5
+  --> $DIR/issue-79187-2.rs:14:5
    |
 LL |     take_foo(|a: &i32| -> &i32 { a });
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
@@ -67,7 +67,7 @@ LL |     take_foo(|a: &i32| -> &i32 { a });
    = note: expected reference `&i32`
               found reference `&i32`
 note: the lifetime requirement is introduced here
-  --> $DIR/issue-79187-2.rs:9:21
+  --> $DIR/issue-79187-2.rs:5:21
    |
 LL | fn take_foo(_: impl Foo) {}
    |                     ^^^
diff --git a/src/test/ui/lifetimes/issue-79187.base.stderr b/src/test/ui/lifetimes/issue-79187.base.stderr
deleted file mode 100644
index c4654ca1517..00000000000
--- a/src/test/ui/lifetimes/issue-79187.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: implementation of `FnOnce` is not general enough
-  --> $DIR/issue-79187.rs:9:5
-   |
-LL |     thing(f);
-   |     ^^^^^ implementation of `FnOnce` is not general enough
-   |
-   = note: closure with signature `fn(&'2 u32)` must implement `FnOnce<(&'1 u32,)>`, for any lifetime `'1`...
-   = note: ...but it actually implements `FnOnce<(&'2 u32,)>`, for some specific lifetime `'2`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/lifetimes/issue-79187.rs b/src/test/ui/lifetimes/issue-79187.rs
index b97890d94e9..8e13045623b 100644
--- a/src/test/ui/lifetimes/issue-79187.rs
+++ b/src/test/ui/lifetimes/issue-79187.rs
@@ -1,12 +1,8 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn thing(x: impl FnOnce(&u32)) {}
 
 fn main() {
     let f = |_| ();
     thing(f);
-    //[nll]~^ ERROR mismatched types
+    //~^ ERROR mismatched types
     //~^^ ERROR implementation of `FnOnce` is not general enough
 }
diff --git a/src/test/ui/lifetimes/issue-79187.nll.stderr b/src/test/ui/lifetimes/issue-79187.stderr
index 54dce9b4bac..3a993e88d8a 100644
--- a/src/test/ui/lifetimes/issue-79187.nll.stderr
+++ b/src/test/ui/lifetimes/issue-79187.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-79187.rs:9:5
+  --> $DIR/issue-79187.rs:5:5
    |
 LL |     thing(f);
    |     ^^^^^^^^ one type is more general than the other
@@ -7,18 +7,18 @@ LL |     thing(f);
    = note: expected type `for<'r> FnOnce<(&'r u32,)>`
               found type `FnOnce<(&u32,)>`
 note: this closure does not fulfill the lifetime requirements
-  --> $DIR/issue-79187.rs:8:13
+  --> $DIR/issue-79187.rs:4:13
    |
 LL |     let f = |_| ();
    |             ^^^^^^
 note: the lifetime requirement is introduced here
-  --> $DIR/issue-79187.rs:5:18
+  --> $DIR/issue-79187.rs:1:18
    |
 LL | fn thing(x: impl FnOnce(&u32)) {}
    |                  ^^^^^^^^^^^^
 
 error: implementation of `FnOnce` is not general enough
-  --> $DIR/issue-79187.rs:9:5
+  --> $DIR/issue-79187.rs:5:5
    |
 LL |     thing(f);
    |     ^^^^^^^^ implementation of `FnOnce` is not general enough
diff --git a/src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.fixed b/src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.fixed
deleted file mode 100644
index 4b417afb038..00000000000
--- a/src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.fixed
+++ /dev/null
@@ -1,15 +0,0 @@
-// FIXME(nll): On NLL stabilization, this should be replace
-// `issue-90170-elision-mismatch.rs`. Compiletest has
-// problems with rustfix and revisions.
-// ignore-compare-mode-nll
-// compile-flags: -Zborrowck=mir
-
-// run-rustfix
-
-pub fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } //~ ERROR lifetime may not live long enough
-
-pub fn foo2<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } //~ ERROR lifetime may not live long enough
-
-pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } //~ ERROR lifetime may not live long enough
-
-fn main() {}
diff --git a/src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.rs b/src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.rs
deleted file mode 100644
index ec50e8e1d9a..00000000000
--- a/src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// FIXME(nll): On NLL stabilization, this should be replace
-// `issue-90170-elision-mismatch.rs`. Compiletest has
-// problems with rustfix and revisions.
-// ignore-compare-mode-nll
-// compile-flags: -Zborrowck=mir
-
-// run-rustfix
-
-pub fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); } //~ ERROR lifetime may not live long enough
-
-pub fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); } //~ ERROR lifetime may not live long enough
-
-pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&u8>, y: &u8) { x.push(y); } //~ ERROR lifetime may not live long enough
-
-fn main() {}
diff --git a/src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.stderr b/src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.stderr
deleted file mode 100644
index 144fe3bf9da..00000000000
--- a/src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.stderr
+++ /dev/null
@@ -1,44 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/issue-90170-elision-mismatch-nll.rs:9:40
-   |
-LL | pub fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); }
-   |                        -        -      ^^^^^^^^^ argument requires that `'1` must outlive `'2`
-   |                        |        |
-   |                        |        let's call the lifetime of this reference `'1`
-   |                        let's call the lifetime of this reference `'2`
-   |
-help: consider introducing a named lifetime parameter
-   |
-LL | pub fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
-   |           ++++              ++          ++
-
-error: lifetime may not live long enough
-  --> $DIR/issue-90170-elision-mismatch-nll.rs:11:44
-   |
-LL | pub fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); }
-   |                         -           -      ^^^^^^^^^ argument requires that `'1` must outlive `'2`
-   |                         |           |
-   |                         |           let's call the lifetime of this reference `'1`
-   |                         let's call the lifetime of this reference `'2`
-   |
-help: consider introducing a named lifetime parameter
-   |
-LL | pub fn foo2<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
-   |            ++++              ~~          ++
-
-error: lifetime may not live long enough
-  --> $DIR/issue-90170-elision-mismatch-nll.rs:13:63
-   |
-LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&u8>, y: &u8) { x.push(y); }
-   |                                               -        -      ^^^^^^^^^ argument requires that `'1` must outlive `'2`
-   |                                               |        |
-   |                                               |        let's call the lifetime of this reference `'1`
-   |                                               let's call the lifetime of this reference `'2`
-   |
-help: consider introducing a named lifetime parameter
-   |
-LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
-   |                                                ++          ++
-
-error: aborting due to 3 previous errors
-
diff --git a/src/test/ui/lifetimes/issue-90170-elision-mismatch.fixed b/src/test/ui/lifetimes/issue-90170-elision-mismatch.fixed
index f05943284f7..bd85da1a763 100644
--- a/src/test/ui/lifetimes/issue-90170-elision-mismatch.fixed
+++ b/src/test/ui/lifetimes/issue-90170-elision-mismatch.fixed
@@ -1,14 +1,9 @@
-// FIXME(nll): On NLL stabilization, this should be replaced by
-// `issue-90170-elision-mismatch-nll.rs`. Compiletest has
-// problems with rustfix and revisions.
-// ignore-compare-mode-nll
-
 // run-rustfix
 
-pub fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } //~ ERROR lifetime mismatch
+pub fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } //~ ERROR lifetime may not live long enough
 
-pub fn foo2<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } //~ ERROR lifetime mismatch
+pub fn foo2<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } //~ ERROR lifetime may not live long enough
 
-pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } //~ ERROR lifetime mismatch
+pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } //~ ERROR lifetime may not live long enough
 
 fn main() {}
diff --git a/src/test/ui/lifetimes/issue-90170-elision-mismatch.rs b/src/test/ui/lifetimes/issue-90170-elision-mismatch.rs
index fee2b461ef9..3c495368bbc 100644
--- a/src/test/ui/lifetimes/issue-90170-elision-mismatch.rs
+++ b/src/test/ui/lifetimes/issue-90170-elision-mismatch.rs
@@ -1,14 +1,9 @@
-// FIXME(nll): On NLL stabilization, this should be replaced by
-// `issue-90170-elision-mismatch-nll.rs`. Compiletest has
-// problems with rustfix and revisions.
-// ignore-compare-mode-nll
-
 // run-rustfix
 
-pub fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); } //~ ERROR lifetime mismatch
+pub fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); } //~ ERROR lifetime may not live long enough
 
-pub fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); } //~ ERROR lifetime mismatch
+pub fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); } //~ ERROR lifetime may not live long enough
 
-pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&u8>, y: &u8) { x.push(y); } //~ ERROR lifetime mismatch
+pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&u8>, y: &u8) { x.push(y); } //~ ERROR lifetime may not live long enough
 
 fn main() {}
diff --git a/src/test/ui/lifetimes/issue-90170-elision-mismatch.stderr b/src/test/ui/lifetimes/issue-90170-elision-mismatch.stderr
index 28f3957041c..48fb3fb4a22 100644
--- a/src/test/ui/lifetimes/issue-90170-elision-mismatch.stderr
+++ b/src/test/ui/lifetimes/issue-90170-elision-mismatch.stderr
@@ -1,40 +1,40 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/issue-90170-elision-mismatch.rs:8:47
+error: lifetime may not live long enough
+  --> $DIR/issue-90170-elision-mismatch.rs:3:40
    |
 LL | pub fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); }
-   |                        ---      ---           ^ ...but data from `y` flows into `x` here
-   |                                 |
-   |                                 these two types are declared with different lifetimes...
+   |                        -        -      ^^^^^^^^^ argument requires that `'1` must outlive `'2`
+   |                        |        |
+   |                        |        let's call the lifetime of this reference `'1`
+   |                        let's call the lifetime of this reference `'2`
    |
-   = note: each elided lifetime in input position becomes a distinct lifetime
 help: consider introducing a named lifetime parameter
    |
 LL | pub fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
    |           ++++              ++          ++
 
-error[E0623]: lifetime mismatch
-  --> $DIR/issue-90170-elision-mismatch.rs:10:51
+error: lifetime may not live long enough
+  --> $DIR/issue-90170-elision-mismatch.rs:5:44
    |
 LL | pub fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); }
-   |                         ------      ---           ^ ...but data from `y` flows into `x` here
-   |                                     |
-   |                                     these two types are declared with different lifetimes...
+   |                         -           -      ^^^^^^^^^ argument requires that `'1` must outlive `'2`
+   |                         |           |
+   |                         |           let's call the lifetime of this reference `'1`
+   |                         let's call the lifetime of this reference `'2`
    |
-   = note: each elided lifetime in input position becomes a distinct lifetime
 help: consider introducing a named lifetime parameter
    |
 LL | pub fn foo2<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
    |            ++++              ~~          ++
 
-error[E0623]: lifetime mismatch
-  --> $DIR/issue-90170-elision-mismatch.rs:12:70
+error: lifetime may not live long enough
+  --> $DIR/issue-90170-elision-mismatch.rs:7:63
    |
 LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&u8>, y: &u8) { x.push(y); }
-   |                                               ---      ---           ^ ...but data from `y` flows into `x` here
-   |                                                        |
-   |                                                        these two types are declared with different lifetimes...
+   |                                               -        -      ^^^^^^^^^ argument requires that `'1` must outlive `'2`
+   |                                               |        |
+   |                                               |        let's call the lifetime of this reference `'1`
+   |                                               let's call the lifetime of this reference `'2`
    |
-   = note: each elided lifetime in input position becomes a distinct lifetime
 help: consider introducing a named lifetime parameter
    |
 LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
@@ -42,4 +42,3 @@ LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&'a u8>, y: &'a u8) { x.push(
 
 error: aborting due to 3 previous errors
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.base.stderr b/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.base.stderr
deleted file mode 100644
index b20ce7b07ff..00000000000
--- a/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.base.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0759]: `foo` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/issue-90600-expected-return-static-indirect.rs:11:32
-   |
-LL | fn inner(mut foo: &[u8]) {
-   |                   ----- this data with an anonymous lifetime `'_`...
-LL |     let refcell = RefCell::new(&mut foo);
-   |                                ^^^^^^^^ ...is used here...
-...
-LL |     read_thing(read);
-   |                ---- ...and is required to live as long as `'static` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0759`.
diff --git a/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.rs b/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.rs
index fa44be9a912..ce4cddc9b39 100644
--- a/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.rs
+++ b/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 use std::cell::RefCell;
 use std::io::Read;
 
@@ -9,10 +5,9 @@ fn main() {}
 
 fn inner(mut foo: &[u8]) {
     let refcell = RefCell::new(&mut foo);
-    //[base]~^ ERROR `foo` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
-    //[nll]~^^ ERROR `foo` does not live long enough
+    //~^ ERROR `foo` does not live long enough
     let read = &refcell as &RefCell<dyn Read>;
-    //[nll]~^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 
     read_thing(read);
 }
diff --git a/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.nll.stderr b/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.stderr
index b35505ac8c5..99e1e7217b4 100644
--- a/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.nll.stderr
+++ b/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.stderr
@@ -1,9 +1,9 @@
 error[E0597]: `foo` does not live long enough
-  --> $DIR/issue-90600-expected-return-static-indirect.rs:11:32
+  --> $DIR/issue-90600-expected-return-static-indirect.rs:7:32
    |
 LL |     let refcell = RefCell::new(&mut foo);
    |                                ^^^^^^^^ borrowed value does not live long enough
-...
+LL |
 LL |     let read = &refcell as &RefCell<dyn Read>;
    |                -------- cast requires that `foo` is borrowed for `'static`
 ...
@@ -11,7 +11,7 @@ LL | }
    | - `foo` dropped here while still borrowed
 
 error: lifetime may not live long enough
-  --> $DIR/issue-90600-expected-return-static-indirect.rs:14:16
+  --> $DIR/issue-90600-expected-return-static-indirect.rs:9:16
    |
 LL | fn inner(mut foo: &[u8]) {
    |                   - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/lifetimes/lifetime-bound-will-change-warning.base.stderr b/src/test/ui/lifetimes/lifetime-bound-will-change-warning.base.stderr
deleted file mode 100644
index 54fa49b47f6..00000000000
--- a/src/test/ui/lifetimes/lifetime-bound-will-change-warning.base.stderr
+++ /dev/null
@@ -1,33 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/lifetime-bound-will-change-warning.rs:38:13
-   |
-LL |     ref_obj(x)
-   |             ^ lifetime mismatch
-   |
-   = note: expected reference `&Box<(dyn Fn() + 'static)>`
-              found reference `&Box<(dyn Fn() + 'a)>`
-note: the lifetime `'a` as defined here...
-  --> $DIR/lifetime-bound-will-change-warning.rs:36:10
-   |
-LL | fn test2<'a>(x: &'a Box<dyn Fn() + 'a>) {
-   |          ^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error[E0308]: mismatched types
-  --> $DIR/lifetime-bound-will-change-warning.rs:45:18
-   |
-LL |     lib::ref_obj(x)
-   |                  ^ lifetime mismatch
-   |
-   = note: expected reference `&Box<(dyn Fn() + 'static)>`
-              found reference `&Box<(dyn Fn() + 'a)>`
-note: the lifetime `'a` as defined here...
-  --> $DIR/lifetime-bound-will-change-warning.rs:43:12
-   |
-LL | fn test2cc<'a>(x: &'a Box<dyn Fn() + 'a>) {
-   |            ^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/lifetimes/lifetime-bound-will-change-warning.rs b/src/test/ui/lifetimes/lifetime-bound-will-change-warning.rs
index 0a082e1bae8..0d030370527 100644
--- a/src/test/ui/lifetimes/lifetime-bound-will-change-warning.rs
+++ b/src/test/ui/lifetimes/lifetime-bound-will-change-warning.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 // aux-build:lifetime_bound_will_change_warning_lib.rs
 
 // Test that various corner cases cause an error. These are tests
@@ -36,15 +32,13 @@ fn test1cc<'a>(x: &'a Box<dyn Fn() + 'a>) {
 fn test2<'a>(x: &'a Box<dyn Fn() + 'a>) {
     // but ref_obj will not, so warn.
     ref_obj(x)
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR borrowed data escapes
+    //~^ ERROR borrowed data escapes
 }
 
 fn test2cc<'a>(x: &'a Box<dyn Fn() + 'a>) {
     // same as test2, but cross crate
     lib::ref_obj(x)
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR borrowed data escapes
+    //~^ ERROR borrowed data escapes
 }
 
 fn test3<'a>(x: &'a Box<dyn Fn() + 'static>) {
diff --git a/src/test/ui/lifetimes/lifetime-bound-will-change-warning.nll.stderr b/src/test/ui/lifetimes/lifetime-bound-will-change-warning.stderr
index 10105c5ccec..c51580f287e 100644
--- a/src/test/ui/lifetimes/lifetime-bound-will-change-warning.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-bound-will-change-warning.stderr
@@ -1,5 +1,5 @@
 error[E0521]: borrowed data escapes outside of function
-  --> $DIR/lifetime-bound-will-change-warning.rs:38:5
+  --> $DIR/lifetime-bound-will-change-warning.rs:34:5
    |
 LL | fn test2<'a>(x: &'a Box<dyn Fn() + 'a>) {
    |          --  - `x` is a reference that is only valid in the function body
@@ -13,7 +13,7 @@ LL |     ref_obj(x)
    |     argument requires that `'a` must outlive `'static`
 
 error[E0521]: borrowed data escapes outside of function
-  --> $DIR/lifetime-bound-will-change-warning.rs:45:5
+  --> $DIR/lifetime-bound-will-change-warning.rs:40:5
    |
 LL | fn test2cc<'a>(x: &'a Box<dyn Fn() + 'a>) {
    |            --  - `x` is a reference that is only valid in the function body
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.base.stderr
deleted file mode 100644
index 60cd3493875..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.base.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex1-return-one-existing-name-if-else-using-impl.rs:15:20
-   |
-LL |     fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
-   |                   ----                 -------
-   |                   |
-   |                   this parameter and the return type are declared with different lifetimes...
-LL | 
-LL |         if x > y { x } else { y }
-   |                    ^ ...but data from `x` is returned here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.rs b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.rs
index fbb523daa1f..f0d73deb3cc 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Foo {
 
     fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32;
@@ -13,8 +9,7 @@ impl Foo for () {
     fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
 
         if x > y { x } else { y }
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
 
     }
 
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.stderr
index f8e275e9b14..4c788211576 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex1-return-one-existing-name-if-else-using-impl.rs:15:20
+  --> $DIR/ex1-return-one-existing-name-if-else-using-impl.rs:11:20
    |
 LL |     fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
    |            --     - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.base.stderr
deleted file mode 100644
index 697950a00fb..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.base.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex1-return-one-existing-name-return-type-is-anon.rs:12:5
-   |
-LL |   fn foo<'a>(&self, x: &'a i32) -> &i32 {
-   |                        -------     ----
-   |                        |
-   |                        this parameter and the return type are declared with different lifetimes...
-LL | 
-LL |     x
-   |     ^ ...but data from `x` is returned here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs
index 704db7dc8b4..49993aca3ca 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Foo {
   field: i32
 }
@@ -10,8 +6,7 @@ impl Foo {
   fn foo<'a>(&self, x: &'a i32) -> &i32 {
 
     x
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 
   }
 
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.stderr
index 97af4b58cbf..11e7fa96d7e 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex1-return-one-existing-name-return-type-is-anon.rs:12:5
+  --> $DIR/ex1-return-one-existing-name-return-type-is-anon.rs:8:5
    |
 LL |   fn foo<'a>(&self, x: &'a i32) -> &i32 {
    |          --  - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.base.stderr
deleted file mode 100644
index 65644d03cdc..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.base.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex1-return-one-existing-name-self-is-anon.rs:12:30
-   |
-LL |     fn foo<'a>(&self, x: &'a Foo) -> &'a Foo {
-   |                -----                 -------
-   |                |
-   |                this parameter and the return type are declared with different lifetimes...
-LL | 
-LL |         if true { x } else { self }
-   |                              ^^^^ ...but data from `self` is returned here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.rs b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.rs
index a846c115c06..63d81a57d5d 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Foo {
     field: i32,
 }
@@ -10,8 +6,7 @@ impl Foo {
     fn foo<'a>(&self, x: &'a Foo) -> &'a Foo {
 
         if true { x } else { self }
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
 
     }
 }
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.stderr
index 00a348de4bc..c41f08e691a 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex1-return-one-existing-name-self-is-anon.rs:12:30
+  --> $DIR/ex1-return-one-existing-name-self-is-anon.rs:8:30
    |
 LL |     fn foo<'a>(&self, x: &'a Foo) -> &'a Foo {
    |            --  - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.base.stderr
deleted file mode 100644
index 9203d6603bd..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0621]: explicit lifetime required in the type of `x`
-  --> $DIR/ex2a-push-one-existing-name-2.rs:10:12
-   |
-LL | fn foo<'a>(x: Ref<i32>, y: &mut Vec<Ref<'a, i32>>) {
-   |               -------- help: add explicit lifetime `'a` to the type of `x`: `Ref<'a, i32>`
-LL |     y.push(x);
-   |            ^ lifetime `'a` required
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0621`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.rs b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.rs
index 7e776baa6a9..998a48ce20c 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Ref<'a, T: 'a> {
     data: &'a T
 }
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.stderr
index 5ab8b449816..90d4754ebab 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.stderr
@@ -1,5 +1,5 @@
 error[E0621]: explicit lifetime required in the type of `x`
-  --> $DIR/ex2a-push-one-existing-name-2.rs:10:5
+  --> $DIR/ex2a-push-one-existing-name-2.rs:6:5
    |
 LL | fn foo<'a>(x: Ref<i32>, y: &mut Vec<Ref<'a, i32>>) {
    |               -------- help: add explicit lifetime `'a` to the type of `x`: `Ref<'a, i32>`
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.base.stderr
deleted file mode 100644
index ec1ab19d5a4..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.base.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0621]: explicit lifetime required in the type of `y`
-  --> $DIR/ex2a-push-one-existing-name-early-bound.rs:12:12
-   |
-LL | fn baz<'a, 'b, T>(x: &mut Vec<&'a T>, y: &T)
-   |                                          -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
-...
-LL |     x.push(y);
-   |            ^ lifetime `'a` required
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0621`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs
index 73613a9bf35..d18b50d0d0c 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Foo<'a> {}
 impl<'a, T> Foo<'a> for T {}
 
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr
index bd5864bae32..a03e16b3b79 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr
@@ -1,5 +1,5 @@
 error[E0621]: explicit lifetime required in the type of `y`
-  --> $DIR/ex2a-push-one-existing-name-early-bound.rs:12:5
+  --> $DIR/ex2a-push-one-existing-name-early-bound.rs:8:5
    |
 LL | fn baz<'a, 'b, T>(x: &mut Vec<&'a T>, y: &T)
    |                                          -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.base.stderr
deleted file mode 100644
index ab0e202a32e..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0621]: explicit lifetime required in the type of `y`
-  --> $DIR/ex2a-push-one-existing-name.rs:10:12
-   |
-LL | fn foo<'a>(x: &mut Vec<Ref<'a, i32>>, y: Ref<i32>) {
-   |                                          -------- help: add explicit lifetime `'a` to the type of `y`: `Ref<'a, i32>`
-LL |     x.push(y);
-   |            ^ lifetime `'a` required
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0621`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.rs b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.rs
index 5773e13304c..5188ea1cc9c 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Ref<'a, T: 'a> {
     data: &'a T
 }
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.stderr
index 01b7f45d81b..487b34e3d18 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.stderr
@@ -1,5 +1,5 @@
 error[E0621]: explicit lifetime required in the type of `y`
-  --> $DIR/ex2a-push-one-existing-name.rs:10:5
+  --> $DIR/ex2a-push-one-existing-name.rs:6:5
    |
 LL | fn foo<'a>(x: &mut Vec<Ref<'a, i32>>, y: Ref<i32>) {
    |                                          -------- help: add explicit lifetime `'a` to the type of `y`: `Ref<'a, i32>`
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.base.stderr
deleted file mode 100644
index 58a2088df5e..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex2b-push-no-existing-names.rs:10:12
-   |
-LL | fn foo(x: &mut Vec<Ref<i32>>, y: Ref<i32>) {
-   |                    --------      -------- these two types are declared with different lifetimes...
-LL |     x.push(y);
-   |            ^ ...but data from `y` flows into `x` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.rs b/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.rs
index 8d830343b08..27424d79bc0 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.rs
@@ -1,15 +1,10 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Ref<'a, T: 'a> {
     data: &'a T
 }
 
 fn foo(x: &mut Vec<Ref<i32>>, y: Ref<i32>) {
     x.push(y);
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.stderr
index afe413bcca5..1622ce42290 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex2b-push-no-existing-names.rs:10:5
+  --> $DIR/ex2b-push-no-existing-names.rs:6:5
    |
 LL | fn foo(x: &mut Vec<Ref<i32>>, y: Ref<i32>) {
    |        -                      - has type `Ref<'1, i32>`
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.base.stderr
deleted file mode 100644
index 63033b8d16e..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.base.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex2c-push-inference-variable.rs:11:12
-   |
-LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
-   |                                   ------------      ------------ these two types are declared with different lifetimes...
-LL |     let z = Ref { data: y.data };
-LL |     x.push(z);
-   |            ^ ...but data from `y` flows into `x` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.rs b/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.rs
index f676eb403a8..2236d78ef4b 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Ref<'a, T: 'a> {
     data: &'a T
 }
@@ -9,8 +5,7 @@ struct Ref<'a, T: 'a> {
 fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
     let z = Ref { data: y.data };
     x.push(z);
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.stderr
index 63a0f2409d9..99fab4631a2 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex2c-push-inference-variable.rs:11:5
+  --> $DIR/ex2c-push-inference-variable.rs:7:5
    |
 LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
    |            --  -- lifetime `'c` defined here
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.base.stderr
deleted file mode 100644
index a50985ca704..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex2d-push-inference-variable-2.rs:10:33
-   |
-LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
-   |                                   ------------      ------------ these two types are declared with different lifetimes...
-LL |     let a: &mut Vec<Ref<i32>> = x;
-   |                                 ^ ...but data from `y` flows into `x` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.rs b/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.rs
index e65638fb0df..f573230293e 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.rs
@@ -1,17 +1,12 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Ref<'a, T: 'a> {
     data: &'a T
 }
 
 fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
     let a: &mut Vec<Ref<i32>> = x;
-    //[base]~^ ERROR lifetime mismatch
     let b = Ref { data: y.data };
     a.push(b);
-    //[nll]~^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.stderr
index 0d7461fa682..52c5752f6ea 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex2d-push-inference-variable-2.rs:13:5
+  --> $DIR/ex2d-push-inference-variable-2.rs:8:5
    |
 LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
    |            --  -- lifetime `'c` defined here
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.base.stderr
deleted file mode 100644
index dbe965a340c..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex2e-push-inference-variable-3.rs:10:33
-   |
-LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
-   |                                   ------------      ------------ these two types are declared with different lifetimes...
-LL |     let a: &mut Vec<Ref<i32>> = x;
-   |                                 ^ ...but data from `y` flows into `x` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.rs b/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.rs
index 036afe09be6..4a934bbf080 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.rs
@@ -1,17 +1,12 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Ref<'a, T: 'a> {
     data: &'a T
 }
 
 fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
     let a: &mut Vec<Ref<i32>> = x;
-    //[base]~^ ERROR lifetime mismatch
     let b = Ref { data: y.data };
     Vec::push(a, b);
-    //[nll]~^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.stderr
index 74b2739b2c3..e90c81ee3e1 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex2e-push-inference-variable-3.rs:13:5
+  --> $DIR/ex2e-push-inference-variable-3.rs:8:5
    |
 LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
    |            --  -- lifetime `'c` defined here
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.base.stderr
deleted file mode 100644
index 459f18dcc3d..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.base.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex3-both-anon-regions-2.rs:6:10
-   |
-LL | fn foo(&mut (ref mut v, w): &mut (&u8, &u8), x: &u8) {
-   |                                   ---           --- these two types are declared with different lifetimes...
-LL |     *v = x;
-   |          ^ ...but data from `x` flows here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter
-   |
-LL | fn foo<'a>(&mut (ref mut v, w): &mut (&'a u8, &u8), x: &'a u8) {
-   |       ++++                             ++               ++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.rs
index 668cadd614b..09ee9accccd 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.rs
@@ -1,11 +1,6 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn foo(&mut (ref mut v, w): &mut (&u8, &u8), x: &u8) {
     *v = x;
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.stderr
index b072c12ea3b..5a23f1e0e9d 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex3-both-anon-regions-2.rs:6:5
+  --> $DIR/ex3-both-anon-regions-2.rs:2:5
    |
 LL | fn foo(&mut (ref mut v, w): &mut (&u8, &u8), x: &u8) {
    |                                   -             - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.base.stderr
deleted file mode 100644
index 28df5f18369..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.base.stderr
+++ /dev/null
@@ -1,31 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex3-both-anon-regions-3.rs:6:13
-   |
-LL | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
-   |                     ---                 --- these two types are declared with different lifetimes...
-LL |     z.push((x,y));
-   |             ^ ...but data flows into `z` here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter
-   |
-LL | fn foo<'a>(z: &mut Vec<(&'a u8,&u8)>, (x, y): (&'a u8, &u8)) {
-   |       ++++               ++                     ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ex3-both-anon-regions-3.rs:6:15
-   |
-LL | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
-   |                         ---                  --- these two types are declared with different lifetimes...
-LL |     z.push((x,y));
-   |               ^ ...but data flows into `z` here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter
-   |
-LL | fn foo<'a>(z: &mut Vec<(&u8,&'a u8)>, (x, y): (&u8, &'a u8)) {
-   |       ++++                   ++                      ++
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.rs
index 4d7fd63e5b9..b3106db776f 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.rs
@@ -1,13 +1,7 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
     z.push((x,y));
-    //[base]~^ ERROR lifetime mismatch
-    //[base]~| ERROR lifetime mismatch
-    //[nll]~^^^ ERROR lifetime may not live long enough
-    //[nll]~| ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
+    //~| ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.stderr
index c1d809abad5..6ba130308a3 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex3-both-anon-regions-3.rs:6:5
+  --> $DIR/ex3-both-anon-regions-3.rs:2:5
    |
 LL | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
    |                     -                   - let's call the lifetime of this reference `'1`
@@ -14,7 +14,7 @@ LL | fn foo<'a>(z: &mut Vec<(&'a u8,&u8)>, (x, y): (&'a u8, &u8)) {
    |       ++++               ++                     ++
 
 error: lifetime may not live long enough
-  --> $DIR/ex3-both-anon-regions-3.rs:6:5
+  --> $DIR/ex3-both-anon-regions-3.rs:2:5
    |
 LL | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
    |                         -                    - let's call the lifetime of this reference `'3`
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.base.stderr
deleted file mode 100644
index 32263cd56ee..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex3-both-anon-regions-both-are-structs-2.rs:11:11
-   |
-LL | fn foo(mut x: Ref, y: Ref) {
-   |               ---     --- these two types are declared with different lifetimes...
-LL |     x.b = y.b;
-   |           ^^^ ...but data from `y` flows into `x` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.rs
index 30764e2ad17..5d0367783b8 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Ref<'a, 'b> {
     a: &'a u32,
     b: &'b u32,
@@ -9,8 +5,7 @@ struct Ref<'a, 'b> {
 
 fn foo(mut x: Ref, y: Ref) {
     x.b = y.b;
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.stderr
index bfde4025194..4c0ffe5c090 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex3-both-anon-regions-both-are-structs-2.rs:11:5
+  --> $DIR/ex3-both-anon-regions-both-are-structs-2.rs:7:5
    |
 LL | fn foo(mut x: Ref, y: Ref) {
    |        -----       - has type `Ref<'_, '1>`
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.base.stderr
deleted file mode 100644
index fb4a2f8f6fe..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex3-both-anon-regions-both-are-structs-3.rs:11:11
-   |
-LL | fn foo(mut x: Ref) {
-   |               --- this type is declared with multiple lifetimes...
-LL |     x.a = x.b;
-   |           ^^^ ...but data with one lifetime flows into the other here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.rs
index 665be2aa2c8..4a479f19c72 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Ref<'a, 'b> {
     a: &'a u32,
     b: &'b u32,
@@ -9,8 +5,7 @@ struct Ref<'a, 'b> {
 
 fn foo(mut x: Ref) {
     x.a = x.b;
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.stderr
index 9ba2c38d6fe..97c665347f6 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex3-both-anon-regions-both-are-structs-3.rs:11:5
+  --> $DIR/ex3-both-anon-regions-both-are-structs-3.rs:7:5
    |
 LL | fn foo(mut x: Ref) {
    |        -----
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.base.stderr
deleted file mode 100644
index 66a993e0340..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.base.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs:13:12
-   |
-LL | fn foo<'a, 'b>(mut x: Vec<Ref<'a>>, y: Ref<'b>)
-   |                           -------      ------- these two types are declared with different lifetimes...
-...
-LL |     x.push(y);
-   |            ^ ...but data from `y` flows into `x` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs
index 6e151879f4d..9b8cfe670e6 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Ref<'a> {
     x: &'a u32,
 }
@@ -11,8 +7,7 @@ fn foo<'a, 'b>(mut x: Vec<Ref<'a>>, y: Ref<'b>)
           &'b u32: Sized
 {
     x.push(y);
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.stderr
index ddf878ba9f9..b3d0bc2b882 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs:13:5
+  --> $DIR/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs:9:5
    |
 LL | fn foo<'a, 'b>(mut x: Vec<Ref<'a>>, y: Ref<'b>)
    |        --  -- lifetime `'b` defined here
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.base.stderr
deleted file mode 100644
index 5453dbb08f1..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex3-both-anon-regions-both-are-structs-latebound-regions.rs:10:12
-   |
-LL | fn foo<'a, 'b>(mut x: Vec<Ref<'a>>, y: Ref<'b>) {
-   |                           -------      ------- these two types are declared with different lifetimes...
-LL |     x.push(y);
-   |            ^ ...but data from `y` flows into `x` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.rs
index ecc04fbc8ad..db934a0bede 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.rs
@@ -1,15 +1,10 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Ref<'a> {
     x: &'a u32,
 }
 
 fn foo<'a, 'b>(mut x: Vec<Ref<'a>>, y: Ref<'b>) {
     x.push(y);
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.stderr
index cfd3186c809..fbe98a4263e 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex3-both-anon-regions-both-are-structs-latebound-regions.rs:10:5
+  --> $DIR/ex3-both-anon-regions-both-are-structs-latebound-regions.rs:6:5
    |
 LL | fn foo<'a, 'b>(mut x: Vec<Ref<'a>>, y: Ref<'b>) {
    |        --  -- lifetime `'b` defined here
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.base.stderr
deleted file mode 100644
index 23e752e4a0e..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex3-both-anon-regions-both-are-structs.rs:10:12
-   |
-LL | fn foo(mut x: Vec<Ref>, y: Ref) {
-   |                   ---      --- these two types are declared with different lifetimes...
-LL |     x.push(y);
-   |            ^ ...but data from `y` flows into `x` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.rs
index f002dfc208f..4bf5db41f4e 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.rs
@@ -1,15 +1,10 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Ref<'a> {
     x: &'a u32,
 }
 
 fn foo(mut x: Vec<Ref>, y: Ref) {
     x.push(y);
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.stderr
index fa906a90ccc..9630729d0ee 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex3-both-anon-regions-both-are-structs.rs:10:5
+  --> $DIR/ex3-both-anon-regions-both-are-structs.rs:6:5
    |
 LL | fn foo(mut x: Vec<Ref>, y: Ref) {
    |        -----            - has type `Ref<'1>`
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.base.stderr
deleted file mode 100644
index b5fbc091ebc..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex3-both-anon-regions-latebound-regions.rs:6:12
-   |
-LL | fn foo<'a,'b>(x: &mut Vec<&'a u8>, y: &'b u8) {
-   |                           ------      ------ these two types are declared with different lifetimes...
-LL |     x.push(y);
-   |            ^ ...but data from `y` flows into `x` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.rs
index f0a81eba412..8dcb814b28b 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.rs
@@ -1,11 +1,6 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn foo<'a,'b>(x: &mut Vec<&'a u8>, y: &'b u8) {
     x.push(y);
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.stderr
index d59bee08748..1e24032fc1c 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex3-both-anon-regions-latebound-regions.rs:6:5
+  --> $DIR/ex3-both-anon-regions-latebound-regions.rs:2:5
    |
 LL | fn foo<'a,'b>(x: &mut Vec<&'a u8>, y: &'b u8) {
    |        -- -- lifetime `'b` defined here
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.base.stderr
deleted file mode 100644
index 3d9138f02c6..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.base.stderr
+++ /dev/null
@@ -1,13 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:8:9
-   |
-LL | fn foo(mut x: Ref, y: &u32) {
-   |               ---     ----
-   |               |
-   |               these two types are declared with different lifetimes...
-LL |     y = x.b;
-   |         ^^^ ...but data from `x` flows into `y` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.rs
index 31ef28e726d..e4df870bc00 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.rs
@@ -1,14 +1,9 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Ref<'a, 'b> { a: &'a u32, b: &'b u32 }
 
 fn foo(mut x: Ref, y: &u32) {
     y = x.b;
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
-    //[nll]~| ERROR cannot assign to immutable argument
+    //~^ ERROR lifetime may not live long enough
+    //~| ERROR cannot assign to immutable argument
 }
 
 fn main() { }
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.stderr
index cac2a9470a8..bbd62902d9f 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:8:5
+  --> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:4:5
    |
 LL | fn foo(mut x: Ref, y: &u32) {
    |        -----          - let's call the lifetime of this reference `'2`
@@ -9,7 +9,7 @@ LL |     y = x.b;
    |     ^^^^^^^ assignment requires that `'1` must outlive `'2`
 
 error[E0384]: cannot assign to immutable argument `y`
-  --> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:8:5
+  --> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:4:5
    |
 LL | fn foo(mut x: Ref, y: &u32) {
    |                    - help: consider making this binding mutable: `mut y`
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.base.stderr
deleted file mode 100644
index 77e035562a8..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex3-both-anon-regions-one-is-struct-3.rs:8:11
-   |
-LL | fn foo(mut y: Ref, x: &u32) {
-   |               ---     ---- these two types are declared with different lifetimes...
-LL |     y.b = x;
-   |           ^ ...but data from `x` flows into `y` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.rs
index 9a5ac0a9769..00de48278b2 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.rs
@@ -1,13 +1,8 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Ref<'a, 'b> { a: &'a u32, b: &'b u32 }
 
 fn foo(mut y: Ref, x: &u32) {
     y.b = x;
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.stderr
index ba41cc3e908..79e7e8e157d 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex3-both-anon-regions-one-is-struct-3.rs:8:5
+  --> $DIR/ex3-both-anon-regions-one-is-struct-3.rs:4:5
    |
 LL | fn foo(mut y: Ref, x: &u32) {
    |        -----          - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.base.stderr
deleted file mode 100644
index 6cbbabb150a..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex3-both-anon-regions-one-is-struct-4.rs:8:11
-   |
-LL | fn foo(mut y: Ref, x: &u32) {
-   |               ---     ---- these two types are declared with different lifetimes...
-LL |     y.b = x;
-   |           ^ ...but data from `x` flows into `y` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs
index 9a5ac0a9769..00de48278b2 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs
@@ -1,13 +1,8 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Ref<'a, 'b> { a: &'a u32, b: &'b u32 }
 
 fn foo(mut y: Ref, x: &u32) {
     y.b = x;
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.stderr
index c9570aa7206..53615fd1aba 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex3-both-anon-regions-one-is-struct-4.rs:8:5
+  --> $DIR/ex3-both-anon-regions-one-is-struct-4.rs:4:5
    |
 LL | fn foo(mut y: Ref, x: &u32) {
    |        -----          - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.base.stderr
deleted file mode 100644
index 7caf19e8935..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex3-both-anon-regions-one-is-struct.rs:11:11
-   |
-LL | fn foo(mut x: Ref, y: &u32) {
-   |               ---     ---- these two types are declared with different lifetimes...
-LL |     x.b = y;
-   |           ^ ...but data from `y` flows into `x` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.rs
index 0b4ee5adacc..5bb0e28d46f 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Ref<'a, 'b> {
     a: &'a u32,
     b: &'b u32,
@@ -9,8 +5,7 @@ struct Ref<'a, 'b> {
 
 fn foo(mut x: Ref, y: &u32) {
     x.b = y;
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.stderr
index 9b295248fc9..6ff44116737 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex3-both-anon-regions-one-is-struct.rs:11:5
+  --> $DIR/ex3-both-anon-regions-one-is-struct.rs:7:5
    |
 LL | fn foo(mut x: Ref, y: &u32) {
    |        -----          - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.base.stderr
deleted file mode 100644
index add05a11193..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.base.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex3-both-anon-regions-return-type-is-anon.rs:11:5
-   |
-LL |   fn foo<'a>(&self, x: &i32) -> &i32 {
-   |                        ----     ----
-   |                        |
-   |                        this parameter and the return type are declared with different lifetimes...
-LL |     x
-   |     ^ ...but data from `x` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |   fn foo<'a>(&'a self, x: &'a i32) -> &i32 {
-   |               ++           ++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs
index a4f838c0747..3ffd7be4e73 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Foo {
   field: i32
 }
@@ -9,8 +5,7 @@ struct Foo {
 impl Foo {
   fn foo<'a>(&self, x: &i32) -> &i32 {
     x
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
   }
 }
 
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.stderr
index 188ff4d77e0..5601335d275 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex3-both-anon-regions-return-type-is-anon.rs:11:5
+  --> $DIR/ex3-both-anon-regions-return-type-is-anon.rs:7:5
    |
 LL |   fn foo<'a>(&self, x: &i32) -> &i32 {
    |              -         - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.base.stderr
deleted file mode 100644
index 365a0ab3b10..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.base.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex3-both-anon-regions-self-is-anon.rs:11:19
-   |
-LL |     fn foo<'a>(&self, x: &Foo) -> &Foo {
-   |                          ----     ----
-   |                          |
-   |                          this parameter and the return type are declared with different lifetimes...
-LL |         if true { x } else { self }
-   |                   ^ ...but data from `x` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn foo<'a>(&'a self, x: &'a Foo) -> &Foo {
-   |                 ++           ++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs
index c5854537a5f..9b67a774264 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Foo {
     field: i32,
 }
@@ -9,8 +5,7 @@ struct Foo {
 impl Foo {
     fn foo<'a>(&self, x: &Foo) -> &Foo {
         if true { x } else { self }
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.stderr
index ed9b81f7d01..e221902c4a9 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex3-both-anon-regions-self-is-anon.rs:11:19
+  --> $DIR/ex3-both-anon-regions-self-is-anon.rs:7:19
    |
 LL |     fn foo<'a>(&self, x: &Foo) -> &Foo {
    |                -         - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.base.stderr
deleted file mode 100644
index 755e9798170..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.base.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex3-both-anon-regions-using-fn-items.rs:6:10
-   |
-LL | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) {
-   |                               ---      --- these two types are declared with different lifetimes...
-LL |   y.push(z);
-   |          ^ ...but data from `z` flows into `y` here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter
-   |
-LL | fn foo<'a>(x:fn(&u8, &u8), y: Vec<&'a u8>, z: &'a u8) {
-   |       ++++                         ++          ++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.rs
index 4b2280b66f2..2f67750d89b 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.rs
@@ -1,12 +1,7 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) {
   y.push(z);
-  //[base]~^ ERROR lifetime mismatch
-  //[nll]~^^ ERROR lifetime may not live long enough
-  //[nll]~| ERROR cannot borrow
+  //~^ ERROR lifetime may not live long enough
+  //~| ERROR cannot borrow
 }
 
 fn main() { }
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.stderr
index 904a09610fc..a909c5fa823 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex3-both-anon-regions-using-fn-items.rs:6:3
+  --> $DIR/ex3-both-anon-regions-using-fn-items.rs:2:3
    |
 LL | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) {
    |                               -        - let's call the lifetime of this reference `'1`
@@ -14,7 +14,7 @@ LL | fn foo<'a>(x:fn(&u8, &u8), y: Vec<&'a u8>, z: &'a u8) {
    |       ++++                         ++          ++
 
 error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
-  --> $DIR/ex3-both-anon-regions-using-fn-items.rs:6:3
+  --> $DIR/ex3-both-anon-regions-using-fn-items.rs:2:3
    |
 LL | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) {
    |                        - help: consider changing this to be mutable: `mut y`
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.base.stderr
deleted file mode 100644
index 6a8b07dbec8..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.base.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex3-both-anon-regions-using-impl-items.rs:10:16
-   |
-LL |     fn foo(x: &mut Vec<&u8>, y: &u8) {
-   |                        ---      --- these two types are declared with different lifetimes...
-LL |         x.push(y);
-   |                ^ ...but data from `y` flows into `x` here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) {
-   |           ++++              ++          ++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.rs
index 242a2d6fd4f..73e1789f225 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.rs
@@ -1,15 +1,10 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Foo {
     fn foo<'a>(x: &mut Vec<&u8>, y: &u8);
 }
 impl Foo for () {
     fn foo(x: &mut Vec<&u8>, y: &u8) {
         x.push(y);
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 fn main() {}
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.stderr
index 46b9e98907d..9661f1e5144 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex3-both-anon-regions-using-impl-items.rs:10:9
+  --> $DIR/ex3-both-anon-regions-using-impl-items.rs:6:9
    |
 LL |     fn foo(x: &mut Vec<&u8>, y: &u8) {
    |                        -        - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.base.stderr
deleted file mode 100644
index e38dd0fc6ee..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.base.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:6:10
-   |
-LL | fn foo(x:Box<dyn Fn(&u8, &u8)> , y: Vec<&u8>, z: &u8) {
-   |                     ---  --- these two types are declared with different lifetimes...
-LL |   y.push(z);
-   |          ^ ...but data from `z` flows into `y` here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter
-   |
-LL | fn foo<'a>(x:Box<dyn Fn(&'a u8, &'a u8)> , y: Vec<&u8>, z: &u8) {
-   |       ++++               ++      ++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs
index b93d75b156d..97fa9ef914f 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs
@@ -1,12 +1,7 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn foo(x:Box<dyn Fn(&u8, &u8)> , y: Vec<&u8>, z: &u8) {
   y.push(z);
-  //[base]~^ ERROR lifetime mismatch
-  //[nll]~^^ ERROR lifetime may not live long enough
-  //[nll]~| ERROR cannot borrow
+  //~^ ERROR lifetime may not live long enough
+  //~| ERROR cannot borrow
 }
 
 fn main() { }
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.stderr
index 54172a845d7..cce0a31bfbb 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:6:3
+  --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:2:3
    |
 LL | fn foo(x:Box<dyn Fn(&u8, &u8)> , y: Vec<&u8>, z: &u8) {
    |                                         -        - let's call the lifetime of this reference `'1`
@@ -14,7 +14,7 @@ LL | fn foo<'a>(x:Box<dyn Fn(&'a u8, &'a u8)> , y: Vec<&u8>, z: &u8) {
    |       ++++               ++      ++
 
 error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
-  --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:6:3
+  --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:2:3
    |
 LL | fn foo(x:Box<dyn Fn(&u8, &u8)> , y: Vec<&u8>, z: &u8) {
    |                                  - help: consider changing this to be mutable: `mut y`
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.base.stderr
deleted file mode 100644
index dd96c6eef68..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.base.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ex3-both-anon-regions.rs:6:12
-   |
-LL | fn foo(x: &mut Vec<&u8>, y: &u8) {
-   |                    ---      --- these two types are declared with different lifetimes...
-LL |     x.push(y);
-   |            ^ ...but data from `y` flows into `x` here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter
-   |
-LL | fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) {
-   |       ++++              ++          ++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.rs
index b1d30e83b62..ca0feaba851 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.rs
@@ -1,11 +1,6 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn foo(x: &mut Vec<&u8>, y: &u8) {
     x.push(y);
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.stderr
index 48e09e37241..ec9fac0c288 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ex3-both-anon-regions.rs:6:5
+  --> $DIR/ex3-both-anon-regions.rs:2:5
    |
 LL | fn foo(x: &mut Vec<&u8>, y: &u8) {
    |                    -        - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/lifetimes/lifetime-errors/issue_74400.base.stderr b/src/test/ui/lifetimes/lifetime-errors/issue_74400.base.stderr
deleted file mode 100644
index ba672f29718..00000000000
--- a/src/test/ui/lifetimes/lifetime-errors/issue_74400.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: implementation of `FnOnce` is not general enough
-  --> $DIR/issue_74400.rs:16:5
-   |
-LL |     f(data, identity)
-   |     ^ implementation of `FnOnce` is not general enough
-   |
-   = note: `fn(&'2 T) -> &'2 T {identity::<&'2 T>}` must implement `FnOnce<(&'1 T,)>`, for any lifetime `'1`...
-   = note: ...but it actually implements `FnOnce<(&'2 T,)>`, for some specific lifetime `'2`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/lifetimes/lifetime-errors/issue_74400.rs b/src/test/ui/lifetimes/lifetime-errors/issue_74400.rs
index fdaf2f8a591..ddb8bacce8f 100644
--- a/src/test/ui/lifetimes/lifetime-errors/issue_74400.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/issue_74400.rs
@@ -1,10 +1,6 @@
 //! Regression test for #74400: Type mismatch in function arguments E0631, E0271 are falsely
 //! recognized as E0308 mismatched types.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 use std::convert::identity;
 
 fn main() {}
@@ -14,8 +10,7 @@ fn f<T, S>(data: &[T], key: impl Fn(&T) -> S) {
 
 fn g<T>(data: &[T]) {
     f(data, identity)
-    //[base]~^ ERROR implementation of `FnOnce` is not general
-    //[nll]~^^ ERROR the parameter type
-    //[nll]~| ERROR mismatched types
-    //[nll]~| ERROR implementation of `FnOnce` is not general
+    //~^ ERROR the parameter type
+    //~| ERROR mismatched types
+    //~| ERROR implementation of `FnOnce` is not general
 }
diff --git a/src/test/ui/lifetimes/lifetime-errors/issue_74400.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/issue_74400.stderr
index 645d14cd54b..2906c05864b 100644
--- a/src/test/ui/lifetimes/lifetime-errors/issue_74400.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/issue_74400.stderr
@@ -1,5 +1,5 @@
 error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/issue_74400.rs:16:5
+  --> $DIR/issue_74400.rs:12:5
    |
 LL |     f(data, identity)
    |     ^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
@@ -10,7 +10,7 @@ LL | fn g<T: 'static>(data: &[T]) {
    |       +++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/issue_74400.rs:16:5
+  --> $DIR/issue_74400.rs:12:5
    |
 LL |     f(data, identity)
    |     ^^^^^^^^^^^^^^^^^ one type is more general than the other
@@ -18,13 +18,13 @@ LL |     f(data, identity)
    = note: expected type `for<'r> Fn<(&'r T,)>`
               found type `Fn<(&T,)>`
 note: the lifetime requirement is introduced here
-  --> $DIR/issue_74400.rs:12:34
+  --> $DIR/issue_74400.rs:8:34
    |
 LL | fn f<T, S>(data: &[T], key: impl Fn(&T) -> S) {
    |                                  ^^^^^^^^^^^
 
 error: implementation of `FnOnce` is not general enough
-  --> $DIR/issue_74400.rs:16:5
+  --> $DIR/issue_74400.rs:12:5
    |
 LL |     f(data, identity)
    |     ^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
diff --git a/src/test/ui/lifetimes/re-empty-in-error.base.stderr b/src/test/ui/lifetimes/re-empty-in-error.base.stderr
deleted file mode 100644
index 7dfe23f4f01..00000000000
--- a/src/test/ui/lifetimes/re-empty-in-error.base.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0477]: the type `&'b ()` does not fulfill the required lifetime
-  --> $DIR/re-empty-in-error.rs:12:5
-   |
-LL |     foo(&10);
-   |     ^^^
-   |
-note: type must outlive the empty lifetime as required by this binding
-  --> $DIR/re-empty-in-error.rs:7:47
-   |
-LL | fn foo<'a>(_a: &'a u32) where for<'b> &'b (): 'a {
-   |                                               ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0477`.
diff --git a/src/test/ui/lifetimes/re-empty-in-error.rs b/src/test/ui/lifetimes/re-empty-in-error.rs
index fdb0a3002c4..554028a9669 100644
--- a/src/test/ui/lifetimes/re-empty-in-error.rs
+++ b/src/test/ui/lifetimes/re-empty-in-error.rs
@@ -1,16 +1,10 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 // We didn't have a single test mentioning
 // `ReEmpty` and this test changes that.
 fn foo<'a>(_a: &'a u32) where for<'b> &'b (): 'a {
-    //[base]~^ NOTE type must outlive the empty lifetime as required by this binding
 }
 
 fn main() {
     foo(&10);
-    //[base]~^ ERROR the type `&'b ()` does not fulfill the required lifetime
-    //[nll]~^^ ERROR higher-ranked lifetime error
-    //[nll]~| NOTE could not prove
+    //~^ ERROR higher-ranked lifetime error
+    //~| NOTE could not prove
 }
diff --git a/src/test/ui/lifetimes/re-empty-in-error.nll.stderr b/src/test/ui/lifetimes/re-empty-in-error.stderr
index cddb5732f98..3a5ab62ab96 100644
--- a/src/test/ui/lifetimes/re-empty-in-error.nll.stderr
+++ b/src/test/ui/lifetimes/re-empty-in-error.stderr
@@ -1,5 +1,5 @@
 error: higher-ranked lifetime error
-  --> $DIR/re-empty-in-error.rs:12:5
+  --> $DIR/re-empty-in-error.rs:7:5
    |
 LL |     foo(&10);
    |     ^^^^^^^^
diff --git a/src/test/ui/lint/lint-unsafe-code.rs b/src/test/ui/lint/lint-unsafe-code.rs
index c30f21bbf8f..b72e4c3a9e7 100644
--- a/src/test/ui/lint/lint-unsafe-code.rs
+++ b/src/test/ui/lint/lint-unsafe-code.rs
@@ -48,6 +48,9 @@ impl AssocFnTrait for AssocFnFoo {
 #[export_name = "bar"] fn bar() {} //~ ERROR: declaration of a function with `export_name`
 #[export_name = "BAR"] static BAR: u32 = 5; //~ ERROR: declaration of a static with `export_name`
 
+#[link_section = ".example_section"] fn uwu() {} //~ ERROR: declaration of a function with `link_section`
+#[link_section = ".example_section"] static UWU: u32 = 5; //~ ERROR: declaration of a static with `link_section`
+
 struct AssocFnBar;
 
 impl AssocFnBar {
diff --git a/src/test/ui/lint/lint-unsafe-code.stderr b/src/test/ui/lint/lint-unsafe-code.stderr
index b6895ac8da8..8dde05fc4de 100644
--- a/src/test/ui/lint/lint-unsafe-code.stderr
+++ b/src/test/ui/lint/lint-unsafe-code.stderr
@@ -51,8 +51,24 @@ LL | #[export_name = "BAR"] static BAR: u32 = 5;
    |
    = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
 
+error: declaration of a function with `link_section`
+  --> $DIR/lint-unsafe-code.rs:51:1
+   |
+LL | #[link_section = ".example_section"] fn uwu() {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: the program's behavior with overridden link sections on items is unpredictable and Rust cannot provide guarantees when you manually override them
+
+error: declaration of a static with `link_section`
+  --> $DIR/lint-unsafe-code.rs:52:1
+   |
+LL | #[link_section = ".example_section"] static UWU: u32 = 5;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: the program's behavior with overridden link sections on items is unpredictable and Rust cannot provide guarantees when you manually override them
+
 error: declaration of a method with `export_name`
-  --> $DIR/lint-unsafe-code.rs:54:5
+  --> $DIR/lint-unsafe-code.rs:57:5
    |
 LL |     #[export_name = "bar"] fn bar() {}
    |     ^^^^^^^^^^^^^^^^^^^^^^
@@ -60,7 +76,7 @@ LL |     #[export_name = "bar"] fn bar() {}
    = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
 
 error: declaration of a method with `export_name`
-  --> $DIR/lint-unsafe-code.rs:58:5
+  --> $DIR/lint-unsafe-code.rs:61:5
    |
 LL |     #[export_name = "bar"] fn foo() {}
    |     ^^^^^^^^^^^^^^^^^^^^^^
@@ -68,79 +84,79 @@ LL |     #[export_name = "bar"] fn foo() {}
    = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
 
 error: declaration of an `unsafe` function
-  --> $DIR/lint-unsafe-code.rs:61:1
+  --> $DIR/lint-unsafe-code.rs:64:1
    |
 LL | unsafe fn baz() {}
    | ^^^^^^^^^^^^^^^^^^
 
 error: declaration of an `unsafe` trait
-  --> $DIR/lint-unsafe-code.rs:62:1
+  --> $DIR/lint-unsafe-code.rs:65:1
    |
 LL | unsafe trait Foo {}
    | ^^^^^^^^^^^^^^^^^^^
 
 error: implementation of an `unsafe` trait
-  --> $DIR/lint-unsafe-code.rs:63:1
+  --> $DIR/lint-unsafe-code.rs:66:1
    |
 LL | unsafe impl Foo for Bar {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: declaration of an `unsafe` method
-  --> $DIR/lint-unsafe-code.rs:66:5
+  --> $DIR/lint-unsafe-code.rs:69:5
    |
 LL |     unsafe fn baz(&self);
    |     ^^^^^^^^^^^^^^^^^^^^^
 
 error: implementation of an `unsafe` method
-  --> $DIR/lint-unsafe-code.rs:67:5
+  --> $DIR/lint-unsafe-code.rs:70:5
    |
 LL |     unsafe fn provided(&self) {}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: implementation of an `unsafe` method
-  --> $DIR/lint-unsafe-code.rs:68:5
+  --> $DIR/lint-unsafe-code.rs:71:5
    |
 LL |     unsafe fn provided_override(&self) {}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: implementation of an `unsafe` method
-  --> $DIR/lint-unsafe-code.rs:72:5
+  --> $DIR/lint-unsafe-code.rs:75:5
    |
 LL |     unsafe fn baz(&self) {}
    |     ^^^^^^^^^^^^^^^^^^^^^^^
 
 error: implementation of an `unsafe` method
-  --> $DIR/lint-unsafe-code.rs:73:5
+  --> $DIR/lint-unsafe-code.rs:76:5
    |
 LL |     unsafe fn provided_override(&self) {}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: implementation of an `unsafe` method
-  --> $DIR/lint-unsafe-code.rs:92:5
+  --> $DIR/lint-unsafe-code.rs:95:5
    |
 LL |     unsafe fn provided_override(&self) {}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: implementation of an `unsafe` method
-  --> $DIR/lint-unsafe-code.rs:103:5
+  --> $DIR/lint-unsafe-code.rs:106:5
    |
 LL |     unsafe fn provided(&self) {}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: implementation of an `unsafe` method
-  --> $DIR/lint-unsafe-code.rs:109:5
+  --> $DIR/lint-unsafe-code.rs:112:5
    |
 LL |     unsafe fn provided(&self) {}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: implementation of an `unsafe` method
-  --> $DIR/lint-unsafe-code.rs:113:5
+  --> $DIR/lint-unsafe-code.rs:116:5
    |
 LL |     unsafe fn baz(&self) {}
    |     ^^^^^^^^^^^^^^^^^^^^^^^
 
 error: usage of an `unsafe` block
-  --> $DIR/lint-unsafe-code.rs:124:5
+  --> $DIR/lint-unsafe-code.rs:127:5
    |
 LL |     unsafe {}
    |     ^^^^^^^^^
@@ -204,5 +220,5 @@ LL |     unsafe_in_macro!()
    |
    = note: this error originates in the macro `unsafe_in_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error: aborting due to 26 previous errors
+error: aborting due to 28 previous errors
 
diff --git a/src/test/ui/lint/no-coverage.rs b/src/test/ui/lint/no-coverage.rs
new file mode 100644
index 00000000000..ff24c12b2bc
--- /dev/null
+++ b/src/test/ui/lint/no-coverage.rs
@@ -0,0 +1,55 @@
+#![feature(extern_types)]
+#![feature(no_coverage)]
+#![feature(type_alias_impl_trait)]
+#![warn(unused_attributes)]
+#![no_coverage]
+//~^ WARN: `#[no_coverage]` does not propagate into items and must be applied to the contained functions directly
+
+#[no_coverage]
+//~^ WARN: `#[no_coverage]` does not propagate into items and must be applied to the contained functions directly
+trait Trait {
+    #[no_coverage] //~ ERROR `#[no_coverage]` must be applied to coverable code
+    const X: u32;
+
+    #[no_coverage] //~ ERROR `#[no_coverage]` must be applied to coverable code
+    type T;
+
+    type U;
+}
+
+#[no_coverage]
+//~^ WARN: `#[no_coverage]` does not propagate into items and must be applied to the contained functions directly
+impl Trait for () {
+    const X: u32 = 0;
+
+    #[no_coverage] //~ ERROR `#[no_coverage]` must be applied to coverable code
+    type T = Self;
+
+    #[no_coverage] //~ ERROR `#[no_coverage]` must be applied to coverable code
+    type U = impl Trait; //~ ERROR unconstrained opaque type
+}
+
+extern "C" {
+    #[no_coverage] //~ ERROR `#[no_coverage]` must be applied to coverable code
+    static X: u32;
+
+    #[no_coverage] //~ ERROR `#[no_coverage]` must be applied to coverable code
+    type T;
+}
+
+#[no_coverage]
+fn main() {
+    #[no_coverage]
+    //~^ WARN `#[no_coverage]` may only be applied to function definitions
+    let _ = ();
+
+    match () {
+        #[no_coverage]
+        //~^ WARN `#[no_coverage]` may only be applied to function definitions
+        () => (),
+    }
+
+    #[no_coverage]
+    //~^ WARN `#[no_coverage]` may only be applied to function definitions
+    return ();
+}
diff --git a/src/test/ui/lint/no-coverage.stderr b/src/test/ui/lint/no-coverage.stderr
new file mode 100644
index 00000000000..8452ccc7a03
--- /dev/null
+++ b/src/test/ui/lint/no-coverage.stderr
@@ -0,0 +1,101 @@
+warning: `#[no_coverage]` does not propagate into items and must be applied to the contained functions directly
+  --> $DIR/no-coverage.rs:8:1
+   |
+LL | #[no_coverage]
+   | ^^^^^^^^^^^^^^
+   |
+note: the lint level is defined here
+  --> $DIR/no-coverage.rs:4:9
+   |
+LL | #![warn(unused_attributes)]
+   |         ^^^^^^^^^^^^^^^^^
+
+warning: `#[no_coverage]` does not propagate into items and must be applied to the contained functions directly
+  --> $DIR/no-coverage.rs:20:1
+   |
+LL | #[no_coverage]
+   | ^^^^^^^^^^^^^^
+
+warning: `#[no_coverage]` may only be applied to function definitions
+  --> $DIR/no-coverage.rs:42:5
+   |
+LL |     #[no_coverage]
+   |     ^^^^^^^^^^^^^^
+
+warning: `#[no_coverage]` may only be applied to function definitions
+  --> $DIR/no-coverage.rs:47:9
+   |
+LL |         #[no_coverage]
+   |         ^^^^^^^^^^^^^^
+
+warning: `#[no_coverage]` may only be applied to function definitions
+  --> $DIR/no-coverage.rs:52:5
+   |
+LL |     #[no_coverage]
+   |     ^^^^^^^^^^^^^^
+
+error[E0788]: `#[no_coverage]` must be applied to coverable code
+  --> $DIR/no-coverage.rs:11:5
+   |
+LL |     #[no_coverage]
+   |     ^^^^^^^^^^^^^^
+LL |     const X: u32;
+   |     ------------- not coverable code
+
+error[E0788]: `#[no_coverage]` must be applied to coverable code
+  --> $DIR/no-coverage.rs:14:5
+   |
+LL |     #[no_coverage]
+   |     ^^^^^^^^^^^^^^
+LL |     type T;
+   |     ------- not coverable code
+
+error[E0788]: `#[no_coverage]` must be applied to coverable code
+  --> $DIR/no-coverage.rs:25:5
+   |
+LL |     #[no_coverage]
+   |     ^^^^^^^^^^^^^^
+LL |     type T = Self;
+   |     -------------- not coverable code
+
+error[E0788]: `#[no_coverage]` must be applied to coverable code
+  --> $DIR/no-coverage.rs:28:5
+   |
+LL |     #[no_coverage]
+   |     ^^^^^^^^^^^^^^
+LL |     type U = impl Trait;
+   |     -------------------- not coverable code
+
+error[E0788]: `#[no_coverage]` must be applied to coverable code
+  --> $DIR/no-coverage.rs:33:5
+   |
+LL |     #[no_coverage]
+   |     ^^^^^^^^^^^^^^
+LL |     static X: u32;
+   |     -------------- not coverable code
+
+error[E0788]: `#[no_coverage]` must be applied to coverable code
+  --> $DIR/no-coverage.rs:36:5
+   |
+LL |     #[no_coverage]
+   |     ^^^^^^^^^^^^^^
+LL |     type T;
+   |     ------- not coverable code
+
+warning: `#[no_coverage]` does not propagate into items and must be applied to the contained functions directly
+  --> $DIR/no-coverage.rs:5:1
+   |
+LL | #![no_coverage]
+   | ^^^^^^^^^^^^^^^
+
+error: unconstrained opaque type
+  --> $DIR/no-coverage.rs:29:14
+   |
+LL |     type U = impl Trait;
+   |              ^^^^^^^^^^
+   |
+   = note: `U` must be used in combination with a concrete type within the same module
+
+error: aborting due to 7 previous errors; 6 warnings emitted
+
+For more information about this error, try `rustc --explain E0788`.
diff --git a/src/test/ui/lint/rfc-2383-lint-reason/expect_on_fn_params.rs b/src/test/ui/lint/rfc-2383-lint-reason/expect_on_fn_params.rs
new file mode 100644
index 00000000000..5fdb710416f
--- /dev/null
+++ b/src/test/ui/lint/rfc-2383-lint-reason/expect_on_fn_params.rs
@@ -0,0 +1,15 @@
+// check-pass
+#![feature(lint_reasons)]
+
+#[warn(unused_variables)]
+
+/// This should catch the unused_variables lint and not emit anything
+fn check_fulfilled_expectation(#[expect(unused_variables)] unused_value: u32) {}
+
+fn check_unfulfilled_expectation(#[expect(unused_variables)] used_value: u32) {
+    //~^ WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
+    //~| NOTE `#[warn(unfulfilled_lint_expectations)]` on by default
+    println!("I use the value {used_value}");
+}
+
+fn main() {}
diff --git a/src/test/ui/lint/rfc-2383-lint-reason/expect_on_fn_params.stderr b/src/test/ui/lint/rfc-2383-lint-reason/expect_on_fn_params.stderr
new file mode 100644
index 00000000000..69f7cda08ef
--- /dev/null
+++ b/src/test/ui/lint/rfc-2383-lint-reason/expect_on_fn_params.stderr
@@ -0,0 +1,10 @@
+warning: this lint expectation is unfulfilled
+  --> $DIR/expect_on_fn_params.rs:9:43
+   |
+LL | fn check_unfulfilled_expectation(#[expect(unused_variables)] used_value: u32) {
+   |                                           ^^^^^^^^^^^^^^^^
+   |
+   = note: `#[warn(unfulfilled_lint_expectations)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.basenoleak.stderr b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.basenoleak.stderr
index 4448f9326cb..0d61311350e 100644
--- a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.basenoleak.stderr
+++ b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.basenoleak.stderr
@@ -1,17 +1,8 @@
-error[E0308]: `match` arms have incompatible types
+error[E0308]: mismatched types
   --> $DIR/old-lub-glb-hr-noteq1.rs:17:14
    |
-LL |       let z = match 22 {
-   |  _____________-
-LL | |         0 => x,
-   | |              - this is found to be of type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`
-LL | |         _ => y,
-   | |              ^ one type is more general than the other
-LL | |
-...  |
-LL | |
-LL | |     };
-   | |_____- `match` arms have incompatible types
+LL |         _ => y,
+   |              ^ one type is more general than the other
    |
    = note: expected fn pointer `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`
               found fn pointer `for<'a> fn(&'a u8, &'a u8) -> &'a u8`
diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.basenoleak.stderr b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.leak.stderr
index 1c9ce115e96..dd0fdf3a12a 100644
--- a/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.basenoleak.stderr
+++ b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.leak.stderr
@@ -1,20 +1,19 @@
 error[E0308]: `match` arms have incompatible types
-  --> $DIR/old-lub-glb-hr-noteq2.rs:28:14
+  --> $DIR/old-lub-glb-hr-noteq1.rs:14:14
    |
 LL |       let z = match 22 {
    |  _____________-
-LL | |         0 => y,
-   | |              - this is found to be of type `for<'a> fn(&'a u8, &'a u8) -> &'a u8`
-LL | |         _ => x,
+LL | |         0 => x,
+   | |              - this is found to be of type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`
+LL | |         _ => y,
    | |              ^ one type is more general than the other
 LL | |
 LL | |
-LL | |
 LL | |     };
    | |_____- `match` arms have incompatible types
    |
-   = note: expected fn pointer `for<'a> fn(&'a u8, &'a u8) -> &'a u8`
-              found fn pointer `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`
+   = note: expected fn pointer `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`
+              found fn pointer `for<'a> fn(&'a u8, &'a u8) -> &'a u8`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllleak.stderr b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllleak.stderr
index 4448f9326cb..217392aa35b 100644
--- a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllleak.stderr
+++ b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllleak.stderr
@@ -1,21 +1,2 @@
-error[E0308]: `match` arms have incompatible types
-  --> $DIR/old-lub-glb-hr-noteq1.rs:17:14
-   |
-LL |       let z = match 22 {
-   |  _____________-
-LL | |         0 => x,
-   | |              - this is found to be of type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`
-LL | |         _ => y,
-   | |              ^ one type is more general than the other
-LL | |
-...  |
-LL | |
-LL | |     };
-   | |_____- `match` arms have incompatible types
-   |
-   = note: expected fn pointer `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`
-              found fn pointer `for<'a> fn(&'a u8, &'a u8) -> &'a u8`
+error: unknown debugging option: `borrowck`
 
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllnoleak.stderr b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllnoleak.stderr
index 0d61311350e..217392aa35b 100644
--- a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllnoleak.stderr
+++ b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllnoleak.stderr
@@ -1,12 +1,2 @@
-error[E0308]: mismatched types
-  --> $DIR/old-lub-glb-hr-noteq1.rs:17:14
-   |
-LL |         _ => y,
-   |              ^ one type is more general than the other
-   |
-   = note: expected fn pointer `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`
-              found fn pointer `for<'a> fn(&'a u8, &'a u8) -> &'a u8`
+error: unknown debugging option: `borrowck`
 
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.noleak.stderr b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.noleak.stderr
new file mode 100644
index 00000000000..cb046d0b0ac
--- /dev/null
+++ b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.noleak.stderr
@@ -0,0 +1,12 @@
+error[E0308]: mismatched types
+  --> $DIR/old-lub-glb-hr-noteq1.rs:14:14
+   |
+LL |         _ => y,
+   |              ^ one type is more general than the other
+   |
+   = note: expected fn pointer `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`
+              found fn pointer `for<'a> fn(&'a u8, &'a u8) -> &'a u8`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.rs b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.rs
index 2cf123cce7f..589119abb9b 100644
--- a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.rs
+++ b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.rs
@@ -2,11 +2,8 @@
 // general than the other. Test the case where the more general type (`x`) is the first
 // match arm specifically.
 
-// revisions: baseleak basenoleak nllleak nllnoleak
-// ignore-compare-mode-nll
-//[nllleak] compile-flags: -Zborrowck=mir
-//[nllnoleak] compile-flags: -Zborrowck=mir -Zno-leak-check
-//[basenoleak] compile-flags:-Zno-leak-check
+// revisions: leak noleak
+//[noleak] compile-flags:-Zno-leak-check
 
 fn foo(x: for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8, y: for<'a> fn(&'a u8, &'a u8) -> &'a u8) {
     // The two types above are not equivalent. With the older LUB/GLB
@@ -15,10 +12,8 @@ fn foo(x: for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8, y: for<'a> fn(&'a u8, &'a u8
     let z = match 22 {
         0 => x,
         _ => y,
-        //[baseleak]~^ ERROR `match` arms have incompatible types
-        //[nllleak]~^^ ERROR `match` arms have incompatible types
-        //[basenoleak]~^^^ ERROR `match` arms have incompatible types
-        //[nllnoleak]~^^^^ ERROR mismatched types
+        //[leak]~^ ERROR `match` arms have incompatible types
+        //[noleak]~^^ ERROR mismatched types
     };
 }
 
diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.baseleak.stderr b/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.leak.stderr
index 1c9ce115e96..e54fcf068d8 100644
--- a/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.baseleak.stderr
+++ b/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.leak.stderr
@@ -1,5 +1,5 @@
 error[E0308]: `match` arms have incompatible types
-  --> $DIR/old-lub-glb-hr-noteq2.rs:28:14
+  --> $DIR/old-lub-glb-hr-noteq2.rs:25:14
    |
 LL |       let z = match 22 {
    |  _____________-
@@ -8,8 +8,6 @@ LL | |         0 => y,
 LL | |         _ => x,
    | |              ^ one type is more general than the other
 LL | |
-LL | |
-LL | |
 LL | |     };
    | |_____- `match` arms have incompatible types
    |
diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.nllleak.stderr b/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.nllleak.stderr
deleted file mode 100644
index 1c9ce115e96..00000000000
--- a/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.nllleak.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error[E0308]: `match` arms have incompatible types
-  --> $DIR/old-lub-glb-hr-noteq2.rs:28:14
-   |
-LL |       let z = match 22 {
-   |  _____________-
-LL | |         0 => y,
-   | |              - this is found to be of type `for<'a> fn(&'a u8, &'a u8) -> &'a u8`
-LL | |         _ => x,
-   | |              ^ one type is more general than the other
-LL | |
-LL | |
-LL | |
-LL | |     };
-   | |_____- `match` arms have incompatible types
-   |
-   = note: expected fn pointer `for<'a> fn(&'a u8, &'a u8) -> &'a u8`
-              found fn pointer `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.rs b/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.rs
index d49b85ce05e..9940c40da81 100644
--- a/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.rs
+++ b/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.rs
@@ -11,13 +11,10 @@
 // choose to make this always in error in the future - we perform the leak check
 // after coercing a function pointer.
 
-// revisions: baseleak basenoleak nllleak nllnoleak
-// ignore-compare-mode-nll
-//[nllleak] compile-flags: -Zborrowck=mir
-//[nllnoleak] compile-flags: -Zborrowck=mir -Zno-leak-check
-//[basenoleak] compile-flags:-Zno-leak-check
+// revisions: leak noleak
+//[noleak] compile-flags: -Zno-leak-check
 
-//[nllnoleak] check-pass
+//[noleak] check-pass
 
 fn foo(x: for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8, y: for<'a> fn(&'a u8, &'a u8) -> &'a u8) {
     // The two types above are not equivalent. With the older LUB/GLB
@@ -26,9 +23,7 @@ fn foo(x: for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8, y: for<'a> fn(&'a u8, &'a u8
     let z = match 22 {
         0 => y,
         _ => x,
-        //[baseleak]~^ ERROR `match` arms have incompatible types
-        //[nllleak]~^^ ERROR `match` arms have incompatible types
-        //[basenoleak]~^^^ ERROR `match` arms have incompatible types
+        //[leak]~^ ERROR `match` arms have incompatible types
     };
 }
 
diff --git a/src/test/ui/lub-glb/old-lub-glb-object.base.stderr b/src/test/ui/lub-glb/old-lub-glb-object.base.stderr
deleted file mode 100644
index da98483906f..00000000000
--- a/src/test/ui/lub-glb/old-lub-glb-object.base.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/old-lub-glb-object.rs:11:13
-   |
-LL |       let z = match 22 {
-   |  _____________^
-LL | |
-LL | |         0 => x,
-LL | |         _ => y,
-LL | |
-LL | |
-LL | |     };
-   | |_____^ one type is more general than the other
-   |
-   = note: expected trait object `dyn for<'a, 'b> Foo<&'a u8, &'b u8>`
-              found trait object `dyn for<'a> Foo<&'a u8, &'a u8>`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/lub-glb/old-lub-glb-object.rs b/src/test/ui/lub-glb/old-lub-glb-object.rs
index b4dbb0caae6..b6ead9c68c5 100644
--- a/src/test/ui/lub-glb/old-lub-glb-object.rs
+++ b/src/test/ui/lub-glb/old-lub-glb-object.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 // Test that we give a note when the old LUB/GLB algorithm would have
 // succeeded but the new code (which is stricter) gives an error.
 
@@ -9,11 +5,10 @@ trait Foo<T, U> {}
 
 fn foo(x: &dyn for<'a, 'b> Foo<&'a u8, &'b u8>, y: &dyn for<'a> Foo<&'a u8, &'a u8>) {
     let z = match 22 {
-        //[base]~^ ERROR mismatched types
         0 => x,
         _ => y,
-        //[nll]~^ ERROR mismatched types
-        //[nll]~| ERROR mismatched types
+        //~^ ERROR mismatched types
+        //~| ERROR mismatched types
     };
 }
 
diff --git a/src/test/ui/lub-glb/old-lub-glb-object.nll.stderr b/src/test/ui/lub-glb/old-lub-glb-object.stderr
index 8f19133be44..3d0c171e013 100644
--- a/src/test/ui/lub-glb/old-lub-glb-object.nll.stderr
+++ b/src/test/ui/lub-glb/old-lub-glb-object.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/old-lub-glb-object.rs:14:14
+  --> $DIR/old-lub-glb-object.rs:9:14
    |
 LL |         _ => y,
    |              ^ one type is more general than the other
@@ -8,7 +8,7 @@ LL |         _ => y,
               found trait object `dyn for<'a> Foo<&'a u8, &'a u8>`
 
 error[E0308]: mismatched types
-  --> $DIR/old-lub-glb-object.rs:14:14
+  --> $DIR/old-lub-glb-object.rs:9:14
    |
 LL |         _ => y,
    |              ^ one type is more general than the other
diff --git a/src/test/ui/match/match-ref-mut-invariance.base.stderr b/src/test/ui/match/match-ref-mut-invariance.base.stderr
deleted file mode 100644
index 060c8237974..00000000000
--- a/src/test/ui/match/match-ref-mut-invariance.base.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/match-ref-mut-invariance.rs:14:37
-   |
-LL |         match self.0 { ref mut x => x }
-   |                                     ^ lifetime mismatch
-   |
-   = note: expected mutable reference `&'a mut &'a i32`
-              found mutable reference `&'a mut &'b i32`
-note: the lifetime `'a` as defined here...
-  --> $DIR/match-ref-mut-invariance.rs:13:12
-   |
-LL |     fn bar<'a>(&'a mut self) -> &'a mut &'a i32 {
-   |            ^^
-note: ...does not necessarily outlive the lifetime `'b` as defined here
-  --> $DIR/match-ref-mut-invariance.rs:12:6
-   |
-LL | impl<'b> S<'b> {
-   |      ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/match/match-ref-mut-invariance.rs b/src/test/ui/match/match-ref-mut-invariance.rs
index f876a4e2498..4250696c674 100644
--- a/src/test/ui/match/match-ref-mut-invariance.rs
+++ b/src/test/ui/match/match-ref-mut-invariance.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 // Check that when making a ref mut binding with type `&mut T`, the
 // type `T` must match precisely the type `U` of the value being
 // matched, and in particular cannot be some supertype of `U`. Issue
@@ -12,8 +8,7 @@ struct S<'b>(&'b i32);
 impl<'b> S<'b> {
     fn bar<'a>(&'a mut self) -> &'a mut &'a i32 {
         match self.0 { ref mut x => x }
-        //[base]~^ ERROR mismatched types
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
diff --git a/src/test/ui/match/match-ref-mut-invariance.nll.stderr b/src/test/ui/match/match-ref-mut-invariance.stderr
index b98539d91b6..3b7e53cd527 100644
--- a/src/test/ui/match/match-ref-mut-invariance.nll.stderr
+++ b/src/test/ui/match/match-ref-mut-invariance.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/match-ref-mut-invariance.rs:14:9
+  --> $DIR/match-ref-mut-invariance.rs:10:9
    |
 LL | impl<'b> S<'b> {
    |      -- lifetime `'b` defined here
diff --git a/src/test/ui/match/match-ref-mut-let-invariance.base.stderr b/src/test/ui/match/match-ref-mut-let-invariance.base.stderr
deleted file mode 100644
index 7b6dd5af539..00000000000
--- a/src/test/ui/match/match-ref-mut-let-invariance.base.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/match-ref-mut-let-invariance.rs:15:9
-   |
-LL |         x
-   |         ^ lifetime mismatch
-   |
-   = note: expected mutable reference `&'a mut &'a i32`
-              found mutable reference `&'a mut &'b i32`
-note: the lifetime `'a` as defined here...
-  --> $DIR/match-ref-mut-let-invariance.rs:13:12
-   |
-LL |     fn bar<'a>(&'a mut self) -> &'a mut &'a i32 {
-   |            ^^
-note: ...does not necessarily outlive the lifetime `'b` as defined here
-  --> $DIR/match-ref-mut-let-invariance.rs:12:6
-   |
-LL | impl<'b> S<'b> {
-   |      ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/match/match-ref-mut-let-invariance.rs b/src/test/ui/match/match-ref-mut-let-invariance.rs
index 0a8daed569f..a33be09ac8b 100644
--- a/src/test/ui/match/match-ref-mut-let-invariance.rs
+++ b/src/test/ui/match/match-ref-mut-let-invariance.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 // Check that when making a ref mut binding with type `&mut T`, the
 // type `T` must match precisely the type `U` of the value being
 // matched, and in particular cannot be some supertype of `U`. Issue
@@ -13,8 +9,7 @@ impl<'b> S<'b> {
     fn bar<'a>(&'a mut self) -> &'a mut &'a i32 {
         let ref mut x = self.0;
         x
-        //[base]~^ ERROR mismatched types
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
diff --git a/src/test/ui/match/match-ref-mut-let-invariance.nll.stderr b/src/test/ui/match/match-ref-mut-let-invariance.stderr
index 4b8bdd157c2..f4d1cea670b 100644
--- a/src/test/ui/match/match-ref-mut-let-invariance.nll.stderr
+++ b/src/test/ui/match/match-ref-mut-let-invariance.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/match-ref-mut-let-invariance.rs:15:9
+  --> $DIR/match-ref-mut-let-invariance.rs:11:9
    |
 LL | impl<'b> S<'b> {
    |      -- lifetime `'b` defined here
diff --git a/src/test/ui/meta/meta-expected-error-wrong-rev.a.stderr b/src/test/ui/meta/meta-expected-error-wrong-rev.a.stderr
index 012071df2bb..87330155eac 100644
--- a/src/test/ui/meta/meta-expected-error-wrong-rev.a.stderr
+++ b/src/test/ui/meta/meta-expected-error-wrong-rev.a.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/meta-expected-error-wrong-rev.rs:14:18
+  --> $DIR/meta-expected-error-wrong-rev.rs:13:18
    |
 LL |     let x: u32 = 22_usize;
    |            ---   ^^^^^^^^ expected `u32`, found `usize`
diff --git a/src/test/ui/meta/meta-expected-error-wrong-rev.rs b/src/test/ui/meta/meta-expected-error-wrong-rev.rs
index 80af527a697..c30d4fe0a13 100644
--- a/src/test/ui/meta/meta-expected-error-wrong-rev.rs
+++ b/src/test/ui/meta/meta-expected-error-wrong-rev.rs
@@ -1,4 +1,3 @@
-// ignore-compare-mode-nll
 // ignore-compare-mode-polonius
 
 // revisions: a
diff --git a/src/test/ui/mismatched_types/closure-arg-type-mismatch.base.stderr b/src/test/ui/mismatched_types/closure-arg-type-mismatch.base.stderr
deleted file mode 100644
index dfc6ef567f0..00000000000
--- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.base.stderr
+++ /dev/null
@@ -1,102 +0,0 @@
-error[E0631]: type mismatch in closure arguments
-  --> $DIR/closure-arg-type-mismatch.rs:7:14
-   |
-LL |     a.iter().map(|_: (u32, u32)| 45);
-   |              ^^^ ------------------ found signature of `fn((u32, u32)) -> _`
-   |              |
-   |              expected signature of `fn(&(u32, u32)) -> _`
-   |
-note: required by a bound in `map`
-  --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
-   |
-LL |         F: FnMut(Self::Item) -> B,
-   |            ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
-
-error[E0631]: type mismatch in closure arguments
-  --> $DIR/closure-arg-type-mismatch.rs:8:14
-   |
-LL |     a.iter().map(|_: &(u16, u16)| 45);
-   |              ^^^ ------------------- found signature of `for<'r> fn(&'r (u16, u16)) -> _`
-   |              |
-   |              expected signature of `fn(&(u32, u32)) -> _`
-   |
-note: required by a bound in `map`
-  --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
-   |
-LL |         F: FnMut(Self::Item) -> B,
-   |            ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
-
-error[E0631]: type mismatch in closure arguments
-  --> $DIR/closure-arg-type-mismatch.rs:9:14
-   |
-LL |     a.iter().map(|_: (u16, u16)| 45);
-   |              ^^^ ------------------ found signature of `fn((u16, u16)) -> _`
-   |              |
-   |              expected signature of `fn(&(u32, u32)) -> _`
-   |
-note: required by a bound in `map`
-  --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
-   |
-LL |         F: FnMut(Self::Item) -> B,
-   |            ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
-
-error[E0308]: mismatched types
-  --> $DIR/closure-arg-type-mismatch.rs:14:5
-   |
-LL |     baz(f);
-   |     ^^^ lifetime mismatch
-   |
-   = note: expected type `for<'r> Fn<(*mut &'r u32,)>`
-              found type `Fn<(*mut &'a u32,)>`
-note: the required lifetime does not necessarily outlive the lifetime `'a` as defined here
-  --> $DIR/closure-arg-type-mismatch.rs:13:10
-   |
-LL | fn _test<'a>(f: fn(*mut &'a u32)) {
-   |          ^^
-note: the lifetime requirement is introduced here
-  --> $DIR/closure-arg-type-mismatch.rs:12:11
-   |
-LL | fn baz<F: Fn(*mut &u32)>(_: F) {}
-   |           ^^^^^^^^^^^^^
-
-error: implementation of `FnOnce` is not general enough
-  --> $DIR/closure-arg-type-mismatch.rs:14:5
-   |
-LL |     baz(f);
-   |     ^^^ implementation of `FnOnce` is not general enough
-   |
-   = note: `fn(*mut &'a u32)` must implement `FnOnce<(*mut &'0 u32,)>`, for any lifetime `'0`...
-   = note: ...but it actually implements `FnOnce<(*mut &'a u32,)>`
-
-error[E0308]: mismatched types
-  --> $DIR/closure-arg-type-mismatch.rs:14:5
-   |
-LL |     baz(f);
-   |     ^^^ lifetime mismatch
-   |
-   = note: expected type `for<'r> Fn<(*mut &'r u32,)>`
-              found type `Fn<(*mut &'a u32,)>`
-note: the lifetime `'a` as defined here doesn't meet the lifetime requirements
-  --> $DIR/closure-arg-type-mismatch.rs:13:10
-   |
-LL | fn _test<'a>(f: fn(*mut &'a u32)) {
-   |          ^^
-note: the lifetime requirement is introduced here
-  --> $DIR/closure-arg-type-mismatch.rs:12:11
-   |
-LL | fn baz<F: Fn(*mut &u32)>(_: F) {}
-   |           ^^^^^^^^^^^^^
-
-error: implementation of `FnOnce` is not general enough
-  --> $DIR/closure-arg-type-mismatch.rs:14:5
-   |
-LL |     baz(f);
-   |     ^^^ implementation of `FnOnce` is not general enough
-   |
-   = note: `fn(*mut &'a u32)` must implement `FnOnce<(*mut &'0 u32,)>`, for any lifetime `'0`...
-   = note: ...but it actually implements `FnOnce<(*mut &'a u32,)>`
-
-error: aborting due to 7 previous errors
-
-Some errors have detailed explanations: E0308, E0631.
-For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs b/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs
index da8011cc92b..98abb0ba979 100644
--- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs
+++ b/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn main() {
     let a = [(1u32, 2u32)];
     a.iter().map(|_: (u32, u32)| 45); //~ ERROR type mismatch
@@ -12,8 +8,4 @@ fn main() {
 fn baz<F: Fn(*mut &u32)>(_: F) {}
 fn _test<'a>(f: fn(*mut &'a u32)) {
     baz(f);
-    //[base]~^ ERROR implementation of `FnOnce` is not general enough
-    //[base]~| ERROR implementation of `FnOnce` is not general enough
-    //[base]~| ERROR mismatched types
-    //[base]~| ERROR mismatched types
 }
diff --git a/src/test/ui/mismatched_types/closure-arg-type-mismatch.nll.stderr b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr
index 314000e8848..1f46229cb5a 100644
--- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.nll.stderr
+++ b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr
@@ -1,5 +1,5 @@
 error[E0631]: type mismatch in closure arguments
-  --> $DIR/closure-arg-type-mismatch.rs:7:14
+  --> $DIR/closure-arg-type-mismatch.rs:3:14
    |
 LL |     a.iter().map(|_: (u32, u32)| 45);
    |              ^^^ ------------------ found signature of `fn((u32, u32)) -> _`
@@ -13,7 +13,7 @@ LL |         F: FnMut(Self::Item) -> B,
    |            ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
 
 error[E0631]: type mismatch in closure arguments
-  --> $DIR/closure-arg-type-mismatch.rs:8:14
+  --> $DIR/closure-arg-type-mismatch.rs:4:14
    |
 LL |     a.iter().map(|_: &(u16, u16)| 45);
    |              ^^^ ------------------- found signature of `for<'r> fn(&'r (u16, u16)) -> _`
@@ -27,7 +27,7 @@ LL |         F: FnMut(Self::Item) -> B,
    |            ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
 
 error[E0631]: type mismatch in closure arguments
-  --> $DIR/closure-arg-type-mismatch.rs:9:14
+  --> $DIR/closure-arg-type-mismatch.rs:5:14
    |
 LL |     a.iter().map(|_: (u16, u16)| 45);
    |              ^^^ ------------------ found signature of `fn((u16, u16)) -> _`
diff --git a/src/test/ui/mismatched_types/closure-mismatch.base.stderr b/src/test/ui/mismatched_types/closure-mismatch.base.stderr
deleted file mode 100644
index 7c81ebdf490..00000000000
--- a/src/test/ui/mismatched_types/closure-mismatch.base.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/closure-mismatch.rs:12:5
-   |
-LL |     baz(|_| ());
-   |     ^^^ lifetime mismatch
-   |
-   = note: expected type `for<'r> Fn<(&'r (),)>`
-              found type `Fn<(&(),)>`
-note: this closure does not fulfill the lifetime requirements
-  --> $DIR/closure-mismatch.rs:12:9
-   |
-LL |     baz(|_| ());
-   |         ^^^^^^
-note: the lifetime requirement is introduced here
-  --> $DIR/closure-mismatch.rs:9:11
-   |
-LL | fn baz<T: Foo>(_: T) {}
-   |           ^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/mismatched_types/closure-mismatch.rs b/src/test/ui/mismatched_types/closure-mismatch.rs
index 5bf3aef9bb0..b0644e79611 100644
--- a/src/test/ui/mismatched_types/closure-mismatch.rs
+++ b/src/test/ui/mismatched_types/closure-mismatch.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Foo {}
 
 impl<T: Fn(&())> Foo for T {}
@@ -10,7 +6,6 @@ fn baz<T: Foo>(_: T) {}
 
 fn main() {
     baz(|_| ());
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR implementation of `FnOnce` is not general enough
-    //[nll]~| ERROR mismatched types
+    //~^ ERROR implementation of `FnOnce` is not general enough
+    //~| ERROR mismatched types
 }
diff --git a/src/test/ui/mismatched_types/closure-mismatch.nll.stderr b/src/test/ui/mismatched_types/closure-mismatch.stderr
index 9508fc8a9be..bd36fab9288 100644
--- a/src/test/ui/mismatched_types/closure-mismatch.nll.stderr
+++ b/src/test/ui/mismatched_types/closure-mismatch.stderr
@@ -1,5 +1,5 @@
 error: implementation of `FnOnce` is not general enough
-  --> $DIR/closure-mismatch.rs:12:5
+  --> $DIR/closure-mismatch.rs:8:5
    |
 LL |     baz(|_| ());
    |     ^^^^^^^^^^^ implementation of `FnOnce` is not general enough
@@ -8,7 +8,7 @@ LL |     baz(|_| ());
    = note: ...but it actually implements `FnOnce<(&'2 (),)>`, for some specific lifetime `'2`
 
 error[E0308]: mismatched types
-  --> $DIR/closure-mismatch.rs:12:5
+  --> $DIR/closure-mismatch.rs:8:5
    |
 LL |     baz(|_| ());
    |     ^^^^^^^^^^^ one type is more general than the other
@@ -16,12 +16,12 @@ LL |     baz(|_| ());
    = note: expected type `for<'r> Fn<(&'r (),)>`
               found type `Fn<(&(),)>`
 note: this closure does not fulfill the lifetime requirements
-  --> $DIR/closure-mismatch.rs:12:9
+  --> $DIR/closure-mismatch.rs:8:9
    |
 LL |     baz(|_| ());
    |         ^^^^^^
 note: the lifetime requirement is introduced here
-  --> $DIR/closure-mismatch.rs:9:11
+  --> $DIR/closure-mismatch.rs:5:11
    |
 LL | fn baz<T: Foo>(_: T) {}
    |           ^^^
diff --git a/src/test/ui/mod-subitem-as-enum-variant.rs b/src/test/ui/mod-subitem-as-enum-variant.rs
index 9328d1a9045..959024c46f4 100644
--- a/src/test/ui/mod-subitem-as-enum-variant.rs
+++ b/src/test/ui/mod-subitem-as-enum-variant.rs
@@ -5,5 +5,5 @@ mod Mod {
 fn main() {
     Mod::FakeVariant::<i32>(0);
     Mod::<i32>::FakeVariant(0);
-    //~^ ERROR type arguments are not allowed for this type [E0109]
+    //~^ ERROR type arguments are not allowed on module `Mod` [E0109]
 }
diff --git a/src/test/ui/mod-subitem-as-enum-variant.stderr b/src/test/ui/mod-subitem-as-enum-variant.stderr
index d6815c91e5e..15da1d155a3 100644
--- a/src/test/ui/mod-subitem-as-enum-variant.stderr
+++ b/src/test/ui/mod-subitem-as-enum-variant.stderr
@@ -1,8 +1,10 @@
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on module `Mod`
   --> $DIR/mod-subitem-as-enum-variant.rs:7:11
    |
 LL |     Mod::<i32>::FakeVariant(0);
-   |           ^^^ type argument not allowed
+   |     ---   ^^^ type argument not allowed
+   |     |
+   |     not allowed on this
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/nll/closure-requirements/escape-argument-callee.rs b/src/test/ui/nll/closure-requirements/escape-argument-callee.rs
index 9b3a49b7b7e..3aea511b056 100644
--- a/src/test/ui/nll/closure-requirements/escape-argument-callee.rs
+++ b/src/test/ui/nll/closure-requirements/escape-argument-callee.rs
@@ -12,7 +12,7 @@
 // that appear free in its type (hence, we see it before the closure's
 // "external requirements" report).
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![feature(rustc_attrs)]
 
diff --git a/src/test/ui/nll/closure-requirements/escape-argument.rs b/src/test/ui/nll/closure-requirements/escape-argument.rs
index 6269659c453..066cd436016 100644
--- a/src/test/ui/nll/closure-requirements/escape-argument.rs
+++ b/src/test/ui/nll/closure-requirements/escape-argument.rs
@@ -12,7 +12,7 @@
 // basically checking that the MIR type checker correctly enforces the
 // closure signature.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![feature(rustc_attrs)]
 
diff --git a/src/test/ui/nll/closure-requirements/escape-upvar-nested.rs b/src/test/ui/nll/closure-requirements/escape-upvar-nested.rs
index b94b3d607c9..765a3cf961c 100644
--- a/src/test/ui/nll/closure-requirements/escape-upvar-nested.rs
+++ b/src/test/ui/nll/closure-requirements/escape-upvar-nested.rs
@@ -5,7 +5,7 @@
 //
 // except that the closure does so via a second closure.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![feature(rustc_attrs)]
 
diff --git a/src/test/ui/nll/closure-requirements/escape-upvar-ref.rs b/src/test/ui/nll/closure-requirements/escape-upvar-ref.rs
index a916ccd6c21..0a562a0a1bc 100644
--- a/src/test/ui/nll/closure-requirements/escape-upvar-ref.rs
+++ b/src/test/ui/nll/closure-requirements/escape-upvar-ref.rs
@@ -9,7 +9,7 @@
 // `'b`.  This relationship is propagated to the closure creator,
 // which reports an error.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![feature(rustc_attrs)]
 
diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs b/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs
index 95355323cdc..35a864b8851 100644
--- a/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs
+++ b/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs
@@ -1,7 +1,7 @@
 // Test where we fail to approximate due to demanding a postdom
 // relationship between our upper bounds.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![feature(rustc_attrs)]
 
diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs
index 1c409a14b72..7291c6e9749 100644
--- a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs
+++ b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs
@@ -12,7 +12,7 @@
 // Note: the use of `Cell` here is to introduce invariance. One less
 // variable.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![feature(rustc_attrs)]
 
diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs
index ab0bfb956f4..afe6f10a52f 100644
--- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs
+++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs
@@ -2,7 +2,7 @@
 // where `'x` is bound in closure type but `'a` is free. This forces
 // us to approximate `'x` one way or the other.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![feature(rustc_attrs)]
 
diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs
index 779c3671ff5..3722090754b 100644
--- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs
+++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs
@@ -3,7 +3,7 @@
 // because `'y` is higher-ranked but we know of no relations to other
 // regions. Note that `'static` shows up in the stderr output as `'0`.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![feature(rustc_attrs)]
 
diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs
index fbf4be75504..9898777c727 100644
--- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs
+++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs
@@ -4,7 +4,7 @@
 // relations to other regions. Note that `'static` shows up in the
 // stderr output as `'0`.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![feature(rustc_attrs)]
 
diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs b/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs
index 233a5dcab08..5bb5eea991b 100644
--- a/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs
+++ b/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs
@@ -5,7 +5,7 @@
 // relationships. In the 'main' variant, there are a number of
 // anonymous regions as well.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![feature(rustc_attrs)]
 
diff --git a/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.rs b/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.rs
index ac182be1556..704a026d29b 100644
--- a/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.rs
+++ b/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.rs
@@ -3,7 +3,7 @@
 // need to propagate; but in fact we do because identity of free
 // regions is erased.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 // check-pass
 
 #![feature(rustc_attrs)]
diff --git a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs
index 37d47135285..dcd05d7fa2c 100644
--- a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs
+++ b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs
@@ -7,7 +7,7 @@
 // as it knows of no relationships between `'x` and any
 // non-higher-ranked regions.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![feature(rustc_attrs)]
 
diff --git a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs
index c1467fcc9b6..98be92d1cd6 100644
--- a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs
+++ b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs
@@ -7,7 +7,7 @@
 // as it only knows of regions that `'x` is outlived by, and none that
 // `'x` outlives.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![feature(rustc_attrs)]
 
diff --git a/src/test/ui/nll/closure-requirements/propagate-from-trait-match.rs b/src/test/ui/nll/closure-requirements/propagate-from-trait-match.rs
index a578e959148..3bdb5433948 100644
--- a/src/test/ui/nll/closure-requirements/propagate-from-trait-match.rs
+++ b/src/test/ui/nll/closure-requirements/propagate-from-trait-match.rs
@@ -4,7 +4,7 @@
 // the same `'a` for which it implements `Trait`, which can only be the `'a`
 // from the function definition.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
diff --git a/src/test/ui/nll/closure-requirements/region-lbr-anon-does-not-outlive-static.rs b/src/test/ui/nll/closure-requirements/region-lbr-anon-does-not-outlive-static.rs
index c8f226f5238..8147da09d43 100644
--- a/src/test/ui/nll/closure-requirements/region-lbr-anon-does-not-outlive-static.rs
+++ b/src/test/ui/nll/closure-requirements/region-lbr-anon-does-not-outlive-static.rs
@@ -3,7 +3,7 @@
 // a variety of errors from the older, AST-based machinery (notably
 // borrowck), and then we get the NLL error at the end.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 fn foo(x: &u32) -> &'static u32 {
     &*x
diff --git a/src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.rs b/src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.rs
index ce75e0700b0..4acd2fc92f3 100644
--- a/src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.rs
+++ b/src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.rs
@@ -3,7 +3,7 @@
 // a variety of errors from the older, AST-based machinery (notably
 // borrowck), and then we get the NLL error at the end.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 fn foo<'a>(x: &'a u32) -> &'static u32 {
     &*x
diff --git a/src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.rs b/src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.rs
index 4d864c6e588..06e96be80d5 100644
--- a/src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.rs
+++ b/src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.rs
@@ -3,7 +3,7 @@
 // a variety of errors from the older, AST-based machinery (notably
 // borrowck), and then we get the NLL error at the end.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 {
     &*x
diff --git a/src/test/ui/nll/closure-requirements/region-lbr1-does-outlive-lbr2-because-implied-bound.rs b/src/test/ui/nll/closure-requirements/region-lbr1-does-outlive-lbr2-because-implied-bound.rs
index a558e8a1813..014959fdbd4 100644
--- a/src/test/ui/nll/closure-requirements/region-lbr1-does-outlive-lbr2-because-implied-bound.rs
+++ b/src/test/ui/nll/closure-requirements/region-lbr1-does-outlive-lbr2-because-implied-bound.rs
@@ -2,7 +2,7 @@
 // report an error because of the (implied) bound that `'b: 'a`.
 
 // check-pass
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 fn foo<'a, 'b>(x: &'a &'b u32) -> &'a u32 {
     &**x
diff --git a/src/test/ui/nll/closure-requirements/return-wrong-bound-region.rs b/src/test/ui/nll/closure-requirements/return-wrong-bound-region.rs
index 5ac00638ec1..e34a3f6f2cb 100644
--- a/src/test/ui/nll/closure-requirements/return-wrong-bound-region.rs
+++ b/src/test/ui/nll/closure-requirements/return-wrong-bound-region.rs
@@ -2,7 +2,7 @@
 // the first, but actually returns the second. This should fail within
 // the closure.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![feature(rustc_attrs)]
 
diff --git a/src/test/ui/nll/constant.rs b/src/test/ui/nll/constant.rs
index 039b6aaaf0a..47f0eadf99c 100644
--- a/src/test/ui/nll/constant.rs
+++ b/src/test/ui/nll/constant.rs
@@ -1,7 +1,6 @@
 // Test that MIR borrowck and NLL analysis can handle constants of
 // arbitrary types without ICEs.
 
-// compile-flags:-Zborrowck=mir
 // check-pass
 
 const HI: &str = "hi";
diff --git a/src/test/ui/nll/continue-after-missing-main.base.stderr b/src/test/ui/nll/continue-after-missing-main.base.stderr
deleted file mode 100644
index 9d1fa66813d..00000000000
--- a/src/test/ui/nll/continue-after-missing-main.base.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0601]: `main` function not found in crate `continue_after_missing_main`
-  --> $DIR/continue-after-missing-main.rs:34:2
-   |
-LL | }
-   |  ^ consider adding a `main` function to `$DIR/continue-after-missing-main.rs`
-
-error[E0623]: lifetime mismatch
-  --> $DIR/continue-after-missing-main.rs:32:56
-   |
-LL |     tableau: Tableau<'data_provider, AdaptedMatrixProvider<'original_data, MP>>,
-   |              ------------------------------------------------------------------ these two types are declared with different lifetimes...
-LL | ) {
-LL |     let _: AdaptedMatrixProvider<'original_data, MP> = tableau.provider().clone_with_extra_bound();
-   |                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...but data from `tableau` flows into `tableau` here
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0601, E0623.
-For more information about an error, try `rustc --explain E0601`.
diff --git a/src/test/ui/nll/continue-after-missing-main.rs b/src/test/ui/nll/continue-after-missing-main.rs
index ddead7dc233..778639158d7 100644
--- a/src/test/ui/nll/continue-after-missing-main.rs
+++ b/src/test/ui/nll/continue-after-missing-main.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 #![allow(dead_code)]
 
 struct Tableau<'a, MP> {
@@ -30,5 +26,4 @@ fn create_and_solve_subproblems<'data_provider, 'original_data, MP>(
     tableau: Tableau<'data_provider, AdaptedMatrixProvider<'original_data, MP>>,
 ) {
     let _: AdaptedMatrixProvider<'original_data, MP> = tableau.provider().clone_with_extra_bound();
-    //[base]~^ ERROR lifetime mismatch
 } //~ ERROR `main` function not found in crate
diff --git a/src/test/ui/nll/continue-after-missing-main.nll.stderr b/src/test/ui/nll/continue-after-missing-main.stderr
index 2bad3be8b4e..0df8d8d703e 100644
--- a/src/test/ui/nll/continue-after-missing-main.nll.stderr
+++ b/src/test/ui/nll/continue-after-missing-main.stderr
@@ -1,5 +1,5 @@
 error[E0601]: `main` function not found in crate `continue_after_missing_main`
-  --> $DIR/continue-after-missing-main.rs:34:2
+  --> $DIR/continue-after-missing-main.rs:29:2
    |
 LL | }
    |  ^ consider adding a `main` function to `$DIR/continue-after-missing-main.rs`
diff --git a/src/test/ui/nll/drop-may-dangle.rs b/src/test/ui/nll/drop-may-dangle.rs
index 1897589bd58..b5531c29b98 100644
--- a/src/test/ui/nll/drop-may-dangle.rs
+++ b/src/test/ui/nll/drop-may-dangle.rs
@@ -2,7 +2,6 @@
 // in the type of `p` includes the points after `&v[0]` up to (but not
 // including) the call to `use_x`. The `else` branch is not included.
 
-// compile-flags:-Zborrowck=mir
 // check-pass
 
 #![allow(warnings)]
diff --git a/src/test/ui/nll/drop-no-may-dangle.rs b/src/test/ui/nll/drop-no-may-dangle.rs
index 23f7f6c265e..a0ff0c3989c 100644
--- a/src/test/ui/nll/drop-no-may-dangle.rs
+++ b/src/test/ui/nll/drop-no-may-dangle.rs
@@ -3,8 +3,6 @@
 // because of destructor. (Note that the stderr also identifies this
 // destructor in the error message.)
 
-// compile-flags:-Zborrowck=mir
-
 #![allow(warnings)]
 #![feature(dropck_eyepatch)]
 
diff --git a/src/test/ui/nll/drop-no-may-dangle.stderr b/src/test/ui/nll/drop-no-may-dangle.stderr
index e1d2b038ec8..cb280880950 100644
--- a/src/test/ui/nll/drop-no-may-dangle.stderr
+++ b/src/test/ui/nll/drop-no-may-dangle.stderr
@@ -1,5 +1,5 @@
 error[E0506]: cannot assign to `v[_]` because it is borrowed
-  --> $DIR/drop-no-may-dangle.rs:20:9
+  --> $DIR/drop-no-may-dangle.rs:18:9
    |
 LL |     let p: WrapMayNotDangle<&usize> = WrapMayNotDangle { value: &v[0] };
    |                                                                 ----- borrow of `v[_]` occurs here
@@ -11,7 +11,7 @@ LL | }
    | - borrow might be used here, when `p` is dropped and runs the `Drop` code for type `WrapMayNotDangle`
 
 error[E0506]: cannot assign to `v[_]` because it is borrowed
-  --> $DIR/drop-no-may-dangle.rs:23:5
+  --> $DIR/drop-no-may-dangle.rs:21:5
    |
 LL |     let p: WrapMayNotDangle<&usize> = WrapMayNotDangle { value: &v[0] };
    |                                                                 ----- borrow of `v[_]` occurs here
diff --git a/src/test/ui/nll/extra-unused-mut.rs b/src/test/ui/nll/extra-unused-mut.rs
index db056a22855..340f2952acc 100644
--- a/src/test/ui/nll/extra-unused-mut.rs
+++ b/src/test/ui/nll/extra-unused-mut.rs
@@ -2,7 +2,7 @@
 
 // check-pass
 
-#![feature(generators, nll)]
+#![feature(generators)]
 #![deny(unused_mut)]
 
 fn ref_argument(ref _y: i32) {}
diff --git a/src/test/ui/nll/generator-distinct-lifetime.rs b/src/test/ui/nll/generator-distinct-lifetime.rs
index 3102562cd0a..90fe6b56960 100644
--- a/src/test/ui/nll/generator-distinct-lifetime.rs
+++ b/src/test/ui/nll/generator-distinct-lifetime.rs
@@ -1,4 +1,4 @@
-#![feature(generators, nll)]
+#![feature(generators)]
 
 // Test for issue #47189. Here, both `s` and `t` are live for the
 // generator's lifetime, but within the generator they have distinct
diff --git a/src/test/ui/nll/generator-upvar-mutability.rs b/src/test/ui/nll/generator-upvar-mutability.rs
index fe4bc6bce1b..c49ea15b824 100644
--- a/src/test/ui/nll/generator-upvar-mutability.rs
+++ b/src/test/ui/nll/generator-upvar-mutability.rs
@@ -1,6 +1,6 @@
 // Check that generators respect the muatability of their upvars.
 
-#![feature(generators, nll)]
+#![feature(generators)]
 
 fn mutate_upvar() {
     let x = 0;
diff --git a/src/test/ui/nll/guarantor-issue-46974.rs b/src/test/ui/nll/guarantor-issue-46974.rs
index 87ed0e642e9..96af4bf5c36 100644
--- a/src/test/ui/nll/guarantor-issue-46974.rs
+++ b/src/test/ui/nll/guarantor-issue-46974.rs
@@ -1,8 +1,6 @@
 // Test that NLL analysis propagates lifetimes correctly through
 // field accesses, Box accesses, etc.
 
-#![feature(nll)]
-
 fn foo(s: &mut (i32,)) -> i32 {
     let t = &mut *s; // this borrow should last for the entire function
     let x = &t.0;
diff --git a/src/test/ui/nll/guarantor-issue-46974.stderr b/src/test/ui/nll/guarantor-issue-46974.stderr
index 8245aadf826..8854dd8d68c 100644
--- a/src/test/ui/nll/guarantor-issue-46974.stderr
+++ b/src/test/ui/nll/guarantor-issue-46974.stderr
@@ -1,5 +1,5 @@
 error[E0506]: cannot assign to `*s` because it is borrowed
-  --> $DIR/guarantor-issue-46974.rs:9:5
+  --> $DIR/guarantor-issue-46974.rs:7:5
    |
 LL |     let t = &mut *s; // this borrow should last for the entire function
    |             ------- borrow of `*s` occurs here
@@ -10,7 +10,7 @@ LL |     *x
    |     -- borrow later used here
 
 error: lifetime may not live long enough
-  --> $DIR/guarantor-issue-46974.rs:15:5
+  --> $DIR/guarantor-issue-46974.rs:13:5
    |
 LL | fn bar(s: &Box<(i32,)>) -> &'static i32 {
    |           - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.rs b/src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.rs
index f45370e5c2e..0ec0179e846 100644
--- a/src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.rs
+++ b/src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.rs
@@ -2,8 +2,6 @@
 // switch below) produces superior diagnostics to the NLL-migrate
 // mode.
 
-#![feature(nll)]
-
 fn doit(data: &'static mut ()) {
     || doit(data);
     //~^ ERROR lifetime may not live long enough
diff --git a/src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.stderr b/src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.stderr
index 4c70a8475f2..f7a525ee9b0 100644
--- a/src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.stderr
+++ b/src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-42574-diagnostic-in-nested-closure.rs:8:8
+  --> $DIR/issue-42574-diagnostic-in-nested-closure.rs:6:8
    |
 LL |     || doit(data);
    |     -- ^^^^^^^^^^ argument requires that `'1` must outlive `'static`
@@ -9,7 +9,7 @@ LL |     || doit(data);
    = note: closure implements `FnMut`, so references to captured variables can't escape the closure
 
 error[E0597]: `data` does not live long enough
-  --> $DIR/issue-42574-diagnostic-in-nested-closure.rs:8:13
+  --> $DIR/issue-42574-diagnostic-in-nested-closure.rs:6:13
    |
 LL |     || doit(data);
    |     -- -----^^^^-
diff --git a/src/test/ui/nll/issue-45696-no-variant-box-recur.rs b/src/test/ui/nll/issue-45696-no-variant-box-recur.rs
index c688261fa1c..39f1607a36b 100644
--- a/src/test/ui/nll/issue-45696-no-variant-box-recur.rs
+++ b/src/test/ui/nll/issue-45696-no-variant-box-recur.rs
@@ -2,9 +2,6 @@
 // you declare a variable of type `struct A(Box<A>, ...);` (which is impossible
 // to construct but *is* possible to declare; see also issues #4287, #44933,
 // and #52852).
-//
-// We will explicitly test NLL, and migration modes; thus we will also skip the
-// automated compare-mode=nll.
 
 // run-pass
 
diff --git a/src/test/ui/nll/issue-48070.rs b/src/test/ui/nll/issue-48070.rs
index 47426cdfa57..a9fe3521d5a 100644
--- a/src/test/ui/nll/issue-48070.rs
+++ b/src/test/ui/nll/issue-48070.rs
@@ -1,5 +1,4 @@
 // run-pass
-// revisions: lxl nll
 
 struct Foo {
     x: u32
diff --git a/src/test/ui/nll/issue-50716.base.stderr b/src/test/ui/nll/issue-50716.base.stderr
deleted file mode 100644
index 0dcf0648142..00000000000
--- a/src/test/ui/nll/issue-50716.base.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/issue-50716.rs:18:9
-   |
-LL |     let _x = *s;
-   |         ^^ lifetime mismatch
-   |
-   = note: expected type `<<&'a T as A>::X as Sized>`
-              found type `<<&'static T as A>::X as Sized>`
-note: the lifetime `'a` as defined here...
-  --> $DIR/issue-50716.rs:13:8
-   |
-LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>)
-   |        ^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/nll/issue-50716.rs b/src/test/ui/nll/issue-50716.rs
index bd44d3eff9f..c2fc345fa2b 100644
--- a/src/test/ui/nll/issue-50716.rs
+++ b/src/test/ui/nll/issue-50716.rs
@@ -2,10 +2,6 @@
 // Regression test for the issue #50716: NLL ignores lifetimes bounds
 // derived from `Sized` requirements
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait A {
     type X: ?Sized;
 }
diff --git a/src/test/ui/nll/issue-50716.nll.stderr b/src/test/ui/nll/issue-50716.stderr
index a8f4d694ba7..38dd1b5f6fe 100644
--- a/src/test/ui/nll/issue-50716.nll.stderr
+++ b/src/test/ui/nll/issue-50716.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-50716.rs:18:14
+  --> $DIR/issue-50716.rs:14:14
    |
 LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>)
    |        -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/issue-51770.rs b/src/test/ui/nll/issue-51770.rs
index bcb37a5f4ff..3d6bc82f115 100644
--- a/src/test/ui/nll/issue-51770.rs
+++ b/src/test/ui/nll/issue-51770.rs
@@ -3,7 +3,6 @@
 #![crate_type = "lib"]
 
 // In an older version, when NLL was still a feature, the following previously did not compile
-// #![feature(nll)]
 
 use std::ops::Index;
 
diff --git a/src/test/ui/nll/issue-52113.rs b/src/test/ui/nll/issue-52113.rs
index 2f4cbf8322b..ffaef272a56 100644
--- a/src/test/ui/nll/issue-52113.rs
+++ b/src/test/ui/nll/issue-52113.rs
@@ -1,5 +1,3 @@
-#![feature(nll)]
-
 trait Bazinga {}
 impl<F> Bazinga for F {}
 
diff --git a/src/test/ui/nll/issue-52113.stderr b/src/test/ui/nll/issue-52113.stderr
index 42ff1866893..84d4eb266f1 100644
--- a/src/test/ui/nll/issue-52113.stderr
+++ b/src/test/ui/nll/issue-52113.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-52113.rs:32:9
+  --> $DIR/issue-52113.rs:30:9
    |
 LL | fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> impl Bazinga + 'b {
    |                --  -- lifetime `'b` defined here
diff --git a/src/test/ui/nll/issue-52213.base.stderr b/src/test/ui/nll/issue-52213.base.stderr
deleted file mode 100644
index fb758ca17a8..00000000000
--- a/src/test/ui/nll/issue-52213.base.stderr
+++ /dev/null
@@ -1,32 +0,0 @@
-error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
-  --> $DIR/issue-52213.rs:6:11
-   |
-LL |     match (&t,) {
-   |           ^^^^^
-   |
-note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
-  --> $DIR/issue-52213.rs:5:23
-   |
-LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
-   |                       ^^
-note: ...so that the types are compatible
-  --> $DIR/issue-52213.rs:6:11
-   |
-LL |     match (&t,) {
-   |           ^^^^^
-   = note: expected `(&&(T,),)`
-              found `(&&'a (T,),)`
-note: but, the lifetime must be valid for the lifetime `'b` as defined here...
-  --> $DIR/issue-52213.rs:5:27
-   |
-LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
-   |                           ^^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/issue-52213.rs:8:20
-   |
-LL |         ((u,),) => u,
-   |                    ^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/nll/issue-52213.rs b/src/test/ui/nll/issue-52213.rs
index c5918b47f57..a016924a869 100644
--- a/src/test/ui/nll/issue-52213.rs
+++ b/src/test/ui/nll/issue-52213.rs
@@ -1,12 +1,7 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
     match (&t,) {
-        //[base]~^ ERROR cannot infer an appropriate lifetime
         ((u,),) => u,
-        //[nll]~^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
diff --git a/src/test/ui/nll/issue-52213.nll.stderr b/src/test/ui/nll/issue-52213.stderr
index a7553de6910..da31bcd5475 100644
--- a/src/test/ui/nll/issue-52213.nll.stderr
+++ b/src/test/ui/nll/issue-52213.stderr
@@ -1,11 +1,11 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-52213.rs:8:20
+  --> $DIR/issue-52213.rs:3:20
    |
 LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
    |                       --  -- lifetime `'b` defined here
    |                       |
    |                       lifetime `'a` defined here
-...
+LL |     match (&t,) {
 LL |         ((u,),) => u,
    |                    ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
    |
diff --git a/src/test/ui/nll/issue-52533-1.base.stderr b/src/test/ui/nll/issue-52533-1.base.stderr
deleted file mode 100644
index ddcb01b8f46..00000000000
--- a/src/test/ui/nll/issue-52533-1.base.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/issue-52533-1.rs:13:18
-   |
-LL |     gimme(|x, y| y)
-   |                  ^ lifetime mismatch
-   |
-   = note: expected reference `&Foo<'_, '_, u32>`
-              found reference `&Foo<'_, '_, u32>`
-note: the anonymous lifetime #3 defined here...
-  --> $DIR/issue-52533-1.rs:13:11
-   |
-LL |     gimme(|x, y| y)
-   |           ^^^^^^^^
-note: ...does not necessarily outlive the anonymous lifetime #2 defined here
-  --> $DIR/issue-52533-1.rs:13:11
-   |
-LL |     gimme(|x, y| y)
-   |           ^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/nll/issue-52533-1.rs b/src/test/ui/nll/issue-52533-1.rs
index 3ee7dd556a5..d15daeddcc4 100644
--- a/src/test/ui/nll/issue-52533-1.rs
+++ b/src/test/ui/nll/issue-52533-1.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 #![allow(warnings)]
 
 struct Foo<'a, 'b, T: 'a + 'b> { x: &'a T, y: &'b T }
@@ -11,6 +7,5 @@ fn gimme(_: impl for<'a, 'b, 'c> FnOnce(&'a Foo<'a, 'b, u32>,
 
 fn main() {
     gimme(|x, y| y)
-    //[base]~^ ERROR mismatched types [E0308]
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
diff --git a/src/test/ui/nll/issue-52533-1.nll.stderr b/src/test/ui/nll/issue-52533-1.stderr
index 5554339eb7c..20f19b25967 100644
--- a/src/test/ui/nll/issue-52533-1.nll.stderr
+++ b/src/test/ui/nll/issue-52533-1.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-52533-1.rs:13:18
+  --> $DIR/issue-52533-1.rs:9:18
    |
 LL |     gimme(|x, y| y)
    |            -  -  ^ closure was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
diff --git a/src/test/ui/nll/issue-52742.base.stderr b/src/test/ui/nll/issue-52742.base.stderr
deleted file mode 100644
index 7b1fac082e4..00000000000
--- a/src/test/ui/nll/issue-52742.base.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0312]: lifetime of reference outlives lifetime of borrowed content...
-  --> $DIR/issue-52742.rs:17:18
-   |
-LL |         self.y = b.z
-   |                  ^^^
-   |
-note: ...the reference is valid for the anonymous lifetime as defined here...
-  --> $DIR/issue-52742.rs:15:10
-   |
-LL | impl Foo<'_, '_> {
-   |          ^^
-note: ...but the borrowed content is only valid for the anonymous lifetime defined here
-  --> $DIR/issue-52742.rs:16:31
-   |
-LL |     fn take_bar(&mut self, b: Bar<'_>) {
-   |                               ^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0312`.
diff --git a/src/test/ui/nll/issue-52742.rs b/src/test/ui/nll/issue-52742.rs
index 5ec5770c5c2..d3e201b8ae8 100644
--- a/src/test/ui/nll/issue-52742.rs
+++ b/src/test/ui/nll/issue-52742.rs
@@ -1,8 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
-
 struct Foo<'a, 'b> {
     x: &'a u32,
     y: &'b u32,
diff --git a/src/test/ui/nll/issue-52742.nll.stderr b/src/test/ui/nll/issue-52742.stderr
index 1a2165e0a9d..a7973829656 100644
--- a/src/test/ui/nll/issue-52742.nll.stderr
+++ b/src/test/ui/nll/issue-52742.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-52742.rs:17:9
+  --> $DIR/issue-52742.rs:12:9
    |
 LL |     fn take_bar(&mut self, b: Bar<'_>) {
    |                 ---------  - has type `Bar<'1>`
diff --git a/src/test/ui/nll/issue-54779-anon-static-lifetime.rs b/src/test/ui/nll/issue-54779-anon-static-lifetime.rs
index 4bb983dd358..260b6b109ca 100644
--- a/src/test/ui/nll/issue-54779-anon-static-lifetime.rs
+++ b/src/test/ui/nll/issue-54779-anon-static-lifetime.rs
@@ -1,7 +1,5 @@
 // Regression test for #54779, checks if the diagnostics are confusing.
 
-#![feature(nll)]
-
 trait DebugWith<Cx: ?Sized> {
     fn debug_with<'me>(&'me self, cx: &'me Cx) -> DebugCxPair<'me, Self, Cx> {
         DebugCxPair { value: self, cx }
diff --git a/src/test/ui/nll/issue-54779-anon-static-lifetime.stderr b/src/test/ui/nll/issue-54779-anon-static-lifetime.stderr
index 9dc9bdbab8d..64ad7a21a3c 100644
--- a/src/test/ui/nll/issue-54779-anon-static-lifetime.stderr
+++ b/src/test/ui/nll/issue-54779-anon-static-lifetime.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-54779-anon-static-lifetime.rs:34:24
+  --> $DIR/issue-54779-anon-static-lifetime.rs:32:24
    |
 LL |         cx: &dyn DebugContext,
    |             - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/nll/issue-54943-3.rs b/src/test/ui/nll/issue-54943-3.rs
index e6c2611b683..077eb156316 100644
--- a/src/test/ui/nll/issue-54943-3.rs
+++ b/src/test/ui/nll/issue-54943-3.rs
@@ -4,7 +4,6 @@
 // out the value of that `_` requires type-checking the surrounding code, but that code is dead,
 // so our NLL region checker doesn't have access to it. This test should actually fail to compile.
 
-#![feature(nll)]
 #![allow(warnings)]
 
 use std::fmt::Debug;
diff --git a/src/test/ui/nll/issue-55394.base.stderr b/src/test/ui/nll/issue-55394.base.stderr
deleted file mode 100644
index 2ec6a7af3f2..00000000000
--- a/src/test/ui/nll/issue-55394.base.stderr
+++ /dev/null
@@ -1,32 +0,0 @@
-error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'s` due to conflicting requirements
-  --> $DIR/issue-55394.rs:13:9
-   |
-LL |         Foo { bar }
-   |         ^^^
-   |
-note: first, the lifetime cannot outlive the anonymous lifetime defined here...
-  --> $DIR/issue-55394.rs:12:17
-   |
-LL |     fn new(bar: &mut Bar) -> Self {
-   |                 ^^^^^^^^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/issue-55394.rs:13:15
-   |
-LL |         Foo { bar }
-   |               ^^^
-note: but, the lifetime must be valid for the anonymous lifetime as defined here...
-  --> $DIR/issue-55394.rs:11:10
-   |
-LL | impl Foo<'_> {
-   |          ^^
-note: ...so that the types are compatible
-  --> $DIR/issue-55394.rs:13:9
-   |
-LL |         Foo { bar }
-   |         ^^^^^^^^^^^
-   = note: expected `Foo<'_>`
-              found `Foo<'_>`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/nll/issue-55394.rs b/src/test/ui/nll/issue-55394.rs
index 9c4fcdf6419..f813d1c915c 100644
--- a/src/test/ui/nll/issue-55394.rs
+++ b/src/test/ui/nll/issue-55394.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Bar;
 
 struct Foo<'s> {
diff --git a/src/test/ui/nll/issue-55394.nll.stderr b/src/test/ui/nll/issue-55394.stderr
index c166c458c50..24b8c84b4a9 100644
--- a/src/test/ui/nll/issue-55394.nll.stderr
+++ b/src/test/ui/nll/issue-55394.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-55394.rs:13:9
+  --> $DIR/issue-55394.rs:9:9
    |
 LL |     fn new(bar: &mut Bar) -> Self {
    |                 -            ---- return type is Foo<'2>
diff --git a/src/test/ui/nll/issue-55401.base.stderr b/src/test/ui/nll/issue-55401.base.stderr
deleted file mode 100644
index d4e9f2b4154..00000000000
--- a/src/test/ui/nll/issue-55401.base.stderr
+++ /dev/null
@@ -1,16 +0,0 @@
-error[E0312]: lifetime of reference outlives lifetime of borrowed content...
-  --> $DIR/issue-55401.rs:7:5
-   |
-LL |     *y
-   |     ^^
-   |
-   = note: ...the reference is valid for the static lifetime...
-note: ...but the borrowed content is only valid for the lifetime `'a` as defined here
-  --> $DIR/issue-55401.rs:5:47
-   |
-LL | fn static_to_a_to_static_through_ref_in_tuple<'a>(x: &'a u32) -> &'static u32 {
-   |                                               ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0312`.
diff --git a/src/test/ui/nll/issue-55401.rs b/src/test/ui/nll/issue-55401.rs
index 10f38c53dfd..fc45824e903 100644
--- a/src/test/ui/nll/issue-55401.rs
+++ b/src/test/ui/nll/issue-55401.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn static_to_a_to_static_through_ref_in_tuple<'a>(x: &'a u32) -> &'static u32 {
     let (ref y, _z): (&'a u32, u32) = (&22, 44);
     *y //~ ERROR
diff --git a/src/test/ui/nll/issue-55401.nll.stderr b/src/test/ui/nll/issue-55401.stderr
index 1318dc67657..4f797f26a1a 100644
--- a/src/test/ui/nll/issue-55401.nll.stderr
+++ b/src/test/ui/nll/issue-55401.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-55401.rs:7:5
+  --> $DIR/issue-55401.rs:3:5
    |
 LL | fn static_to_a_to_static_through_ref_in_tuple<'a>(x: &'a u32) -> &'static u32 {
    |                                               -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/issue-55825-const-fn.rs b/src/test/ui/nll/issue-55825-const-fn.rs
index 17c4a0496b6..8aaa1981360 100644
--- a/src/test/ui/nll/issue-55825-const-fn.rs
+++ b/src/test/ui/nll/issue-55825-const-fn.rs
@@ -3,8 +3,6 @@
 
 // check-pass
 
-#![feature(nll)]
-
 const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
 
 fn main() { }
diff --git a/src/test/ui/nll/issue-57642-higher-ranked-subtype.rs b/src/test/ui/nll/issue-57642-higher-ranked-subtype.rs
index b222b90e4af..eba859cde22 100644
--- a/src/test/ui/nll/issue-57642-higher-ranked-subtype.rs
+++ b/src/test/ui/nll/issue-57642-higher-ranked-subtype.rs
@@ -1,8 +1,5 @@
 // Regression test for issue #57642
 // Tests that we reject a bad higher-ranked subtype
-// with `#![feature(nll)]`
-
-#![feature(nll)]
 
 trait X {
     type G;
diff --git a/src/test/ui/nll/issue-57642-higher-ranked-subtype.stderr b/src/test/ui/nll/issue-57642-higher-ranked-subtype.stderr
index 95811ea05b8..0ae6b7c1d7f 100644
--- a/src/test/ui/nll/issue-57642-higher-ranked-subtype.stderr
+++ b/src/test/ui/nll/issue-57642-higher-ranked-subtype.stderr
@@ -1,5 +1,5 @@
 error[E0599]: the function or associated item `make_g` exists for fn pointer `for<'r> fn(&'r ())`, but its trait bounds were not satisfied
-  --> $DIR/issue-57642-higher-ranked-subtype.rs:34:25
+  --> $DIR/issue-57642-higher-ranked-subtype.rs:31:25
    |
 LL |     let x = <fn (&())>::make_g();
    |                         ^^^^^^ function or associated item cannot be called on `for<'r> fn(&'r ())` due to unsatisfied trait bounds
@@ -8,20 +8,20 @@ LL |     let x = <fn (&())>::make_g();
            `for<'r> fn(&'r ()): X`
    = help: items from traits can only be used if the trait is implemented and in scope
 note: `X` defines an item `make_g`, perhaps you need to implement it
-  --> $DIR/issue-57642-higher-ranked-subtype.rs:7:1
+  --> $DIR/issue-57642-higher-ranked-subtype.rs:4:1
    |
 LL | trait X {
    | ^^^^^^^
 
 error[E0599]: no function or associated item named `make_f` found for fn pointer `for<'r> fn(&'r ())` in the current scope
-  --> $DIR/issue-57642-higher-ranked-subtype.rs:38:25
+  --> $DIR/issue-57642-higher-ranked-subtype.rs:35:25
    |
 LL |     let x = <fn (&())>::make_f();
    |                         ^^^^^^ function or associated item not found in `for<'r> fn(&'r ())`
    |
    = help: items from traits can only be used if the trait is implemented and in scope
 note: `Y` defines an item `make_f`, perhaps you need to implement it
-  --> $DIR/issue-57642-higher-ranked-subtype.rs:20:1
+  --> $DIR/issue-57642-higher-ranked-subtype.rs:17:1
    |
 LL | trait Y {
    | ^^^^^^^
diff --git a/src/test/ui/nll/issue-58053.rs b/src/test/ui/nll/issue-58053.rs
index 0992e3a85ae..d5a2fa1a3fa 100644
--- a/src/test/ui/nll/issue-58053.rs
+++ b/src/test/ui/nll/issue-58053.rs
@@ -1,5 +1,3 @@
-#![feature(nll)]
-
 fn main() {
     let i = &3;
 
diff --git a/src/test/ui/nll/issue-58053.stderr b/src/test/ui/nll/issue-58053.stderr
index e41ee8a8970..bf7416e1ab0 100644
--- a/src/test/ui/nll/issue-58053.stderr
+++ b/src/test/ui/nll/issue-58053.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-58053.rs:6:33
+  --> $DIR/issue-58053.rs:4:33
    |
 LL |     let f = |x: &i32| -> &i32 { x };
    |                 -        -      ^ returning this value requires that `'1` must outlive `'2`
@@ -8,7 +8,7 @@ LL |     let f = |x: &i32| -> &i32 { x };
    |                 let's call the lifetime of this reference `'1`
 
 error: lifetime may not live long enough
-  --> $DIR/issue-58053.rs:10:25
+  --> $DIR/issue-58053.rs:8:25
    |
 LL |     let g = |x: &i32| { x };
    |                 -   -   ^ returning this value requires that `'1` must outlive `'2`
diff --git a/src/test/ui/nll/issue-58299.rs b/src/test/ui/nll/issue-58299.rs
index 3277a9db8ec..0587fe8b43b 100644
--- a/src/test/ui/nll/issue-58299.rs
+++ b/src/test/ui/nll/issue-58299.rs
@@ -1,5 +1,3 @@
-#![feature(nll)]
-
 struct A<'a>(&'a ());
 
 trait Y {
diff --git a/src/test/ui/nll/issue-58299.stderr b/src/test/ui/nll/issue-58299.stderr
index aba07542d02..509ba67bd10 100644
--- a/src/test/ui/nll/issue-58299.stderr
+++ b/src/test/ui/nll/issue-58299.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-58299.rs:16:9
+  --> $DIR/issue-58299.rs:14:9
    |
 LL | fn foo<'a>(x: i32) {
    |        -- lifetime `'a` defined here
@@ -8,7 +8,7 @@ LL |         A::<'a>::X..=A::<'static>::X => (),
    |         ^^^^^^^^^^ requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/issue-58299.rs:24:27
+  --> $DIR/issue-58299.rs:22:27
    |
 LL | fn bar<'a>(x: i32) {
    |        -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/issue-67007-escaping-data.rs b/src/test/ui/nll/issue-67007-escaping-data.rs
index 99b6d512261..49ea2e5964f 100644
--- a/src/test/ui/nll/issue-67007-escaping-data.rs
+++ b/src/test/ui/nll/issue-67007-escaping-data.rs
@@ -1,8 +1,6 @@
 // Regression test for issue #67007
 // Ensures that we show information about the specific regions involved
 
-#![feature(nll)]
-
 // Covariant over 'a, invariant over 'tcx
 struct FnCtxt<'a, 'tcx: 'a>(&'a (), *mut &'tcx ());
 
diff --git a/src/test/ui/nll/issue-67007-escaping-data.stderr b/src/test/ui/nll/issue-67007-escaping-data.stderr
index ce067e23aa3..ac9c59bf7f2 100644
--- a/src/test/ui/nll/issue-67007-escaping-data.stderr
+++ b/src/test/ui/nll/issue-67007-escaping-data.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-67007-escaping-data.rs:17:21
+  --> $DIR/issue-67007-escaping-data.rs:15:21
    |
 LL | impl<'tcx> Consumer<'tcx> {
    |      ---- lifetime `'tcx` defined here
diff --git a/src/test/ui/nll/issue-73159-rpit-static.rs b/src/test/ui/nll/issue-73159-rpit-static.rs
index 97dc016068b..3002408b07d 100644
--- a/src/test/ui/nll/issue-73159-rpit-static.rs
+++ b/src/test/ui/nll/issue-73159-rpit-static.rs
@@ -1,8 +1,6 @@
 // Regression test for issue #73159
 // Tests thar we don't suggest replacing 'a with 'static'
 
-#![feature(nll)]
-
 struct Foo<'a>(&'a [u8]);
 
 impl<'a> Foo<'a> {
diff --git a/src/test/ui/nll/issue-73159-rpit-static.stderr b/src/test/ui/nll/issue-73159-rpit-static.stderr
index a3e9c0b44c2..ab0dfe5fca4 100644
--- a/src/test/ui/nll/issue-73159-rpit-static.stderr
+++ b/src/test/ui/nll/issue-73159-rpit-static.stderr
@@ -1,5 +1,5 @@
 error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
-  --> $DIR/issue-73159-rpit-static.rs:10:9
+  --> $DIR/issue-73159-rpit-static.rs:8:9
    |
 LL | impl<'a> Foo<'a> {
    |      -- hidden type `Copied<std::slice::Iter<'a, u8>>` captures the lifetime `'a` as defined here
diff --git a/src/test/ui/nll/issue-95272.rs b/src/test/ui/nll/issue-95272.rs
index 5b5308fb8c2..958cbde3788 100644
--- a/src/test/ui/nll/issue-95272.rs
+++ b/src/test/ui/nll/issue-95272.rs
@@ -1,5 +1,3 @@
-#![feature(nll)]
-
 use std::cell::Cell;
 
 fn check<'a, 'b>(x: Cell<&'a ()>, y: Cell<&'b ()>)
diff --git a/src/test/ui/nll/issue-95272.stderr b/src/test/ui/nll/issue-95272.stderr
index 41346a4c699..03edbc3a670 100644
--- a/src/test/ui/nll/issue-95272.stderr
+++ b/src/test/ui/nll/issue-95272.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-95272.rs:12:13
+  --> $DIR/issue-95272.rs:10:13
    |
 LL | fn test<'a, 'b>(x: Cell<&'a ()>, y: Cell<&'b ()>) {
    |         --  -- lifetime `'b` defined here
diff --git a/src/test/ui/nll/lub-if.base.stderr b/src/test/ui/nll/lub-if.base.stderr
deleted file mode 100644
index ea9f5d4b2b1..00000000000
--- a/src/test/ui/nll/lub-if.base.stderr
+++ /dev/null
@@ -1,29 +0,0 @@
-error[E0312]: lifetime of reference outlives lifetime of borrowed content...
-  --> $DIR/lub-if.rs:32:9
-   |
-LL |         s
-   |         ^
-   |
-   = note: ...the reference is valid for the static lifetime...
-note: ...but the borrowed content is only valid for the lifetime `'a` as defined here
-  --> $DIR/lub-if.rs:27:17
-   |
-LL | pub fn opt_str2<'a>(maybestr: &'a Option<String>) -> &'static str {
-   |                 ^^
-
-error[E0312]: lifetime of reference outlives lifetime of borrowed content...
-  --> $DIR/lub-if.rs:41:9
-   |
-LL |         s
-   |         ^
-   |
-   = note: ...the reference is valid for the static lifetime...
-note: ...but the borrowed content is only valid for the lifetime `'a` as defined here
-  --> $DIR/lub-if.rs:38:17
-   |
-LL | pub fn opt_str3<'a>(maybestr: &'a Option<String>) -> &'static str {
-   |                 ^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0312`.
diff --git a/src/test/ui/nll/lub-if.rs b/src/test/ui/nll/lub-if.rs
index 18561d63935..50225a783f2 100644
--- a/src/test/ui/nll/lub-if.rs
+++ b/src/test/ui/nll/lub-if.rs
@@ -2,10 +2,6 @@
 // of the various arms, particularly in the case where regions are
 // involved.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 pub fn opt_str0<'a>(maybestr: &'a Option<String>) -> &'a str {
     if maybestr.is_none() {
         "(none)"
@@ -30,8 +26,7 @@ pub fn opt_str2<'a>(maybestr: &'a Option<String>) -> &'static str {
     } else {
         let s: &'a str = maybestr.as_ref().unwrap();
         s
-        //[base]~^ ERROR E0312
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
@@ -39,8 +34,7 @@ pub fn opt_str3<'a>(maybestr: &'a Option<String>) -> &'static str {
     if maybestr.is_some() {
         let s: &'a str = maybestr.as_ref().unwrap();
         s
-        //[base]~^ ERROR E0312
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     } else {
         "(none)"
     }
diff --git a/src/test/ui/nll/lub-if.nll.stderr b/src/test/ui/nll/lub-if.stderr
index 2fd6e69628d..03f7f920468 100644
--- a/src/test/ui/nll/lub-if.nll.stderr
+++ b/src/test/ui/nll/lub-if.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/lub-if.rs:32:9
+  --> $DIR/lub-if.rs:28:9
    |
 LL | pub fn opt_str2<'a>(maybestr: &'a Option<String>) -> &'static str {
    |                 -- lifetime `'a` defined here
@@ -8,7 +8,7 @@ LL |         s
    |         ^ returning this value requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/lub-if.rs:41:9
+  --> $DIR/lub-if.rs:36:9
    |
 LL | pub fn opt_str3<'a>(maybestr: &'a Option<String>) -> &'static str {
    |                 -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/lub-match.base.stderr b/src/test/ui/nll/lub-match.base.stderr
deleted file mode 100644
index 38952133160..00000000000
--- a/src/test/ui/nll/lub-match.base.stderr
+++ /dev/null
@@ -1,29 +0,0 @@
-error[E0312]: lifetime of reference outlives lifetime of borrowed content...
-  --> $DIR/lub-match.rs:34:13
-   |
-LL |             s
-   |             ^
-   |
-   = note: ...the reference is valid for the static lifetime...
-note: ...but the borrowed content is only valid for the lifetime `'a` as defined here
-  --> $DIR/lub-match.rs:29:17
-   |
-LL | pub fn opt_str2<'a>(maybestr: &'a Option<String>) -> &'static str {
-   |                 ^^
-
-error[E0312]: lifetime of reference outlives lifetime of borrowed content...
-  --> $DIR/lub-match.rs:45:13
-   |
-LL |             s
-   |             ^
-   |
-   = note: ...the reference is valid for the static lifetime...
-note: ...but the borrowed content is only valid for the lifetime `'a` as defined here
-  --> $DIR/lub-match.rs:41:17
-   |
-LL | pub fn opt_str3<'a>(maybestr: &'a Option<String>) -> &'static str {
-   |                 ^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0312`.
diff --git a/src/test/ui/nll/lub-match.rs b/src/test/ui/nll/lub-match.rs
index 084d8b95f58..454dd1fc605 100644
--- a/src/test/ui/nll/lub-match.rs
+++ b/src/test/ui/nll/lub-match.rs
@@ -2,10 +2,6 @@
 // of the various arms, particularly in the case where regions are
 // involved.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 pub fn opt_str0<'a>(maybestr: &'a Option<String>) -> &'a str {
     match *maybestr {
         Some(ref s) => {
@@ -32,8 +28,7 @@ pub fn opt_str2<'a>(maybestr: &'a Option<String>) -> &'static str {
         Some(ref s) => {
             let s: &'a str = s;
             s
-            //[base]~^ ERROR E0312
-            //[nll]~^^ ERROR lifetime may not live long enough
+            //~^ ERROR lifetime may not live long enough
         }
     }
 }
@@ -43,8 +38,7 @@ pub fn opt_str3<'a>(maybestr: &'a Option<String>) -> &'static str {
         Some(ref s) => {
             let s: &'a str = s;
             s
-            //[base]~^ ERROR E0312
-            //[nll]~^^ ERROR lifetime may not live long enough
+            //~^ ERROR lifetime may not live long enough
         }
         None => "(none)",
     }
diff --git a/src/test/ui/nll/lub-match.nll.stderr b/src/test/ui/nll/lub-match.stderr
index c78d0cb641d..208ec07a1a1 100644
--- a/src/test/ui/nll/lub-match.nll.stderr
+++ b/src/test/ui/nll/lub-match.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/lub-match.rs:34:13
+  --> $DIR/lub-match.rs:30:13
    |
 LL | pub fn opt_str2<'a>(maybestr: &'a Option<String>) -> &'static str {
    |                 -- lifetime `'a` defined here
@@ -8,7 +8,7 @@ LL |             s
    |             ^ returning this value requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/lub-match.rs:45:13
+  --> $DIR/lub-match.rs:40:13
    |
 LL | pub fn opt_str3<'a>(maybestr: &'a Option<String>) -> &'static str {
    |                 -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/match-cfg-fake-edges2.rs b/src/test/ui/nll/match-cfg-fake-edges2.rs
index e61db71220e..48f95e03b78 100644
--- a/src/test/ui/nll/match-cfg-fake-edges2.rs
+++ b/src/test/ui/nll/match-cfg-fake-edges2.rs
@@ -1,8 +1,6 @@
 // Test that we have enough false edges to avoid exposing the exact matching
 // algorithm in borrow checking.
 
-#![feature(nll)]
-
 fn all_previous_tests_may_be_done(y: &mut (bool, bool)) {
     let r = &mut y.1;
     // We don't actually test y.1 to select the second arm, but we don't want
diff --git a/src/test/ui/nll/match-cfg-fake-edges2.stderr b/src/test/ui/nll/match-cfg-fake-edges2.stderr
index 0ce83849b9f..c6d15a936d8 100644
--- a/src/test/ui/nll/match-cfg-fake-edges2.stderr
+++ b/src/test/ui/nll/match-cfg-fake-edges2.stderr
@@ -1,5 +1,5 @@
 error[E0503]: cannot use `y.1` because it was mutably borrowed
-  --> $DIR/match-cfg-fake-edges2.rs:10:5
+  --> $DIR/match-cfg-fake-edges2.rs:8:5
    |
 LL |     let r = &mut y.1;
    |             -------- borrow of `y.1` occurs here
diff --git a/src/test/ui/nll/maybe-initialized-drop-uninitialized.rs b/src/test/ui/nll/maybe-initialized-drop-uninitialized.rs
index e81479495c4..32e07cd148f 100644
--- a/src/test/ui/nll/maybe-initialized-drop-uninitialized.rs
+++ b/src/test/ui/nll/maybe-initialized-drop-uninitialized.rs
@@ -1,4 +1,3 @@
-// compile-flags: -Zborrowck=mir
 // check-pass
 
 #![allow(warnings)]
diff --git a/src/test/ui/nll/maybe-initialized-drop-with-fragment.rs b/src/test/ui/nll/maybe-initialized-drop-with-fragment.rs
index d6cea55c1e0..778212918d2 100644
--- a/src/test/ui/nll/maybe-initialized-drop-with-fragment.rs
+++ b/src/test/ui/nll/maybe-initialized-drop-with-fragment.rs
@@ -1,5 +1,3 @@
-//compile-flags: -Zborrowck=mir
-
 #![allow(warnings)]
 
 struct Wrap<'p> { p: &'p mut i32 }
diff --git a/src/test/ui/nll/maybe-initialized-drop-with-fragment.stderr b/src/test/ui/nll/maybe-initialized-drop-with-fragment.stderr
index e4efd98253c..14074472eaf 100644
--- a/src/test/ui/nll/maybe-initialized-drop-with-fragment.stderr
+++ b/src/test/ui/nll/maybe-initialized-drop-with-fragment.stderr
@@ -1,5 +1,5 @@
 error[E0506]: cannot assign to `x` because it is borrowed
-  --> $DIR/maybe-initialized-drop-with-fragment.rs:21:5
+  --> $DIR/maybe-initialized-drop-with-fragment.rs:19:5
    |
 LL |     let wrap = Wrap { p: &mut x };
    |                          ------ borrow of `x` occurs here
diff --git a/src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.rs b/src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.rs
index d2d1b98c41c..b0d6e27a3d5 100644
--- a/src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.rs
+++ b/src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.rs
@@ -1,5 +1,3 @@
-//compile-flags: -Zborrowck=mir
-
 #![allow(warnings)]
 
 struct Wrap<'p> { p: &'p mut i32 }
diff --git a/src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.stderr b/src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.stderr
index 0e2be68c6d3..91c0afc1dba 100644
--- a/src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.stderr
+++ b/src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.stderr
@@ -1,5 +1,5 @@
 error[E0506]: cannot assign to `x` because it is borrowed
-  --> $DIR/maybe-initialized-drop-with-uninitialized-fragments.rs:22:5
+  --> $DIR/maybe-initialized-drop-with-uninitialized-fragments.rs:20:5
    |
 LL |     let wrap = Wrap { p: &mut x };
    |                          ------ borrow of `x` occurs here
diff --git a/src/test/ui/nll/maybe-initialized-drop.rs b/src/test/ui/nll/maybe-initialized-drop.rs
index cd12e93d555..44a7ede788f 100644
--- a/src/test/ui/nll/maybe-initialized-drop.rs
+++ b/src/test/ui/nll/maybe-initialized-drop.rs
@@ -1,5 +1,3 @@
-//compile-flags: -Zborrowck=mir
-
 #![allow(warnings)]
 
 struct Wrap<'p> { p: &'p mut i32 }
diff --git a/src/test/ui/nll/maybe-initialized-drop.stderr b/src/test/ui/nll/maybe-initialized-drop.stderr
index 10b9a6dcf5a..9825ba4611b 100644
--- a/src/test/ui/nll/maybe-initialized-drop.stderr
+++ b/src/test/ui/nll/maybe-initialized-drop.stderr
@@ -1,5 +1,5 @@
 error[E0506]: cannot assign to `x` because it is borrowed
-  --> $DIR/maybe-initialized-drop.rs:16:5
+  --> $DIR/maybe-initialized-drop.rs:14:5
    |
 LL |     let wrap = Wrap { p: &mut x };
    |                          ------ borrow of `x` occurs here
diff --git a/src/test/ui/nll/mir_check_cast_closure.rs b/src/test/ui/nll/mir_check_cast_closure.rs
index 0619ff37d97..4aebcfdb4f6 100644
--- a/src/test/ui/nll/mir_check_cast_closure.rs
+++ b/src/test/ui/nll/mir_check_cast_closure.rs
@@ -1,5 +1,3 @@
-// compile-flags: -Z borrowck=mir
-
 #![allow(dead_code)]
 
 fn bar<'a, 'b>() -> fn(&'a u32, &'b u32) -> &'a u32 {
diff --git a/src/test/ui/nll/mir_check_cast_closure.stderr b/src/test/ui/nll/mir_check_cast_closure.stderr
index f34cafe308d..72d99aad99e 100644
--- a/src/test/ui/nll/mir_check_cast_closure.stderr
+++ b/src/test/ui/nll/mir_check_cast_closure.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/mir_check_cast_closure.rs:7:5
+  --> $DIR/mir_check_cast_closure.rs:5:5
    |
 LL | fn bar<'a, 'b>() -> fn(&'a u32, &'b u32) -> &'a u32 {
    |        --  -- lifetime `'b` defined here
diff --git a/src/test/ui/nll/mir_check_cast_reify.rs b/src/test/ui/nll/mir_check_cast_reify.rs
index be12e313b42..951459911e7 100644
--- a/src/test/ui/nll/mir_check_cast_reify.rs
+++ b/src/test/ui/nll/mir_check_cast_reify.rs
@@ -1,5 +1,3 @@
-// compile-flags: -Zborrowck=mir
-
 #![allow(dead_code)]
 
 // Test that we relate the type of the fn type to the type of the fn
diff --git a/src/test/ui/nll/mir_check_cast_reify.stderr b/src/test/ui/nll/mir_check_cast_reify.stderr
index 4e8eec330a5..9be2670fec7 100644
--- a/src/test/ui/nll/mir_check_cast_reify.stderr
+++ b/src/test/ui/nll/mir_check_cast_reify.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/mir_check_cast_reify.rs:37:5
+  --> $DIR/mir_check_cast_reify.rs:35:5
    |
 LL | fn bar<'a>(x: &'a u32) -> &'static u32 {
    |        -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/mir_check_cast_unsafe_fn.rs b/src/test/ui/nll/mir_check_cast_unsafe_fn.rs
index 9df9c057489..8f55bedfb4a 100644
--- a/src/test/ui/nll/mir_check_cast_unsafe_fn.rs
+++ b/src/test/ui/nll/mir_check_cast_unsafe_fn.rs
@@ -1,5 +1,3 @@
-// compile-flags: -Zborrowck=mir
-
 #![allow(dead_code)]
 
 fn bar<'a>(input: &'a u32, f: fn(&'a u32) -> &'a u32) -> &'static u32 {
diff --git a/src/test/ui/nll/mir_check_cast_unsafe_fn.stderr b/src/test/ui/nll/mir_check_cast_unsafe_fn.stderr
index 52959850a33..321d17ba6b1 100644
--- a/src/test/ui/nll/mir_check_cast_unsafe_fn.stderr
+++ b/src/test/ui/nll/mir_check_cast_unsafe_fn.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/mir_check_cast_unsafe_fn.rs:9:14
+  --> $DIR/mir_check_cast_unsafe_fn.rs:7:14
    |
 LL | fn bar<'a>(input: &'a u32, f: fn(&'a u32) -> &'a u32) -> &'static u32 {
    |        -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/mir_check_cast_unsize.rs b/src/test/ui/nll/mir_check_cast_unsize.rs
index d15c4e4f467..f6c100ab6d4 100644
--- a/src/test/ui/nll/mir_check_cast_unsize.rs
+++ b/src/test/ui/nll/mir_check_cast_unsize.rs
@@ -1,5 +1,3 @@
-// compile-flags: -Z borrowck=mir
-
 #![allow(dead_code)]
 
 use std::fmt::Debug;
diff --git a/src/test/ui/nll/mir_check_cast_unsize.stderr b/src/test/ui/nll/mir_check_cast_unsize.stderr
index 8d02ef71d1b..1cd2579e4c4 100644
--- a/src/test/ui/nll/mir_check_cast_unsize.stderr
+++ b/src/test/ui/nll/mir_check_cast_unsize.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/mir_check_cast_unsize.rs:8:5
+  --> $DIR/mir_check_cast_unsize.rs:6:5
    |
 LL | fn bar<'a>(x: &'a u32) -> &'static dyn Debug {
    |        -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/outlives-suggestion-more.rs b/src/test/ui/nll/outlives-suggestion-more.rs
index 4d80b78ac65..2e1359fe5d4 100644
--- a/src/test/ui/nll/outlives-suggestion-more.rs
+++ b/src/test/ui/nll/outlives-suggestion-more.rs
@@ -1,7 +1,5 @@
 // Test the more elaborate outlives suggestions.
 
-#![feature(nll)]
-
 // Should suggest: 'a: 'c, 'b: 'd
 fn foo1<'a, 'b, 'c, 'd>(x: &'a usize, y: &'b usize) -> (&'c usize, &'d usize) {
     (x, y) //~ERROR lifetime may not live long enough
diff --git a/src/test/ui/nll/outlives-suggestion-more.stderr b/src/test/ui/nll/outlives-suggestion-more.stderr
index 7f98aa5801d..c8c604b5b4c 100644
--- a/src/test/ui/nll/outlives-suggestion-more.stderr
+++ b/src/test/ui/nll/outlives-suggestion-more.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/outlives-suggestion-more.rs:7:5
+  --> $DIR/outlives-suggestion-more.rs:5:5
    |
 LL | fn foo1<'a, 'b, 'c, 'd>(x: &'a usize, y: &'b usize) -> (&'c usize, &'d usize) {
    |         --      -- lifetime `'c` defined here
@@ -11,7 +11,7 @@ LL |     (x, y)
    = help: consider adding the following bound: `'a: 'c`
 
 error: lifetime may not live long enough
-  --> $DIR/outlives-suggestion-more.rs:7:5
+  --> $DIR/outlives-suggestion-more.rs:5:5
    |
 LL | fn foo1<'a, 'b, 'c, 'd>(x: &'a usize, y: &'b usize) -> (&'c usize, &'d usize) {
    |             --      -- lifetime `'d` defined here
@@ -28,7 +28,7 @@ help: the following changes may resolve your lifetime errors
    = help: add bound `'b: 'd`
 
 error: lifetime may not live long enough
-  --> $DIR/outlives-suggestion-more.rs:13:5
+  --> $DIR/outlives-suggestion-more.rs:11:5
    |
 LL | fn foo2<'a, 'b, 'c>(x: &'a usize, y: &'b usize) -> (&'c usize, &'static usize) {
    |         --      -- lifetime `'c` defined here
@@ -40,7 +40,7 @@ LL |     (x, y)
    = help: consider adding the following bound: `'a: 'c`
 
 error: lifetime may not live long enough
-  --> $DIR/outlives-suggestion-more.rs:13:5
+  --> $DIR/outlives-suggestion-more.rs:11:5
    |
 LL | fn foo2<'a, 'b, 'c>(x: &'a usize, y: &'b usize) -> (&'c usize, &'static usize) {
    |             -- lifetime `'b` defined here
@@ -53,7 +53,7 @@ help: the following changes may resolve your lifetime errors
    = help: replace `'b` with `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/outlives-suggestion-more.rs:23:5
+  --> $DIR/outlives-suggestion-more.rs:21:5
    |
 LL | fn foo3<'a, 'b, 'c, 'd, 'e>(
    |         --  -- lifetime `'b` defined here
@@ -66,7 +66,7 @@ LL |     (x, y, z)
    = help: consider adding the following bound: `'a: 'b`
 
 error: lifetime may not live long enough
-  --> $DIR/outlives-suggestion-more.rs:23:5
+  --> $DIR/outlives-suggestion-more.rs:21:5
    |
 LL | fn foo3<'a, 'b, 'c, 'd, 'e>(
    |         --  -- lifetime `'b` defined here
@@ -79,7 +79,7 @@ LL |     (x, y, z)
    = help: consider adding the following bound: `'b: 'a`
 
 error: lifetime may not live long enough
-  --> $DIR/outlives-suggestion-more.rs:23:5
+  --> $DIR/outlives-suggestion-more.rs:21:5
    |
 LL | fn foo3<'a, 'b, 'c, 'd, 'e>(
    |                 -- lifetime `'c` defined here
diff --git a/src/test/ui/nll/outlives-suggestion-simple.rs b/src/test/ui/nll/outlives-suggestion-simple.rs
index 496cf92400c..2a5c31e3a64 100644
--- a/src/test/ui/nll/outlives-suggestion-simple.rs
+++ b/src/test/ui/nll/outlives-suggestion-simple.rs
@@ -1,7 +1,5 @@
 // Test the simplest of outlives suggestions.
 
-#![feature(nll)]
-
 fn foo1<'a, 'b>(x: &'a usize) -> &'b usize {
     x //~ERROR lifetime may not live long enough
 }
diff --git a/src/test/ui/nll/outlives-suggestion-simple.stderr b/src/test/ui/nll/outlives-suggestion-simple.stderr
index 8e6e4f1a476..a8368c494ed 100644
--- a/src/test/ui/nll/outlives-suggestion-simple.stderr
+++ b/src/test/ui/nll/outlives-suggestion-simple.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/outlives-suggestion-simple.rs:6:5
+  --> $DIR/outlives-suggestion-simple.rs:4:5
    |
 LL | fn foo1<'a, 'b>(x: &'a usize) -> &'b usize {
    |         --  -- lifetime `'b` defined here
@@ -11,7 +11,7 @@ LL |     x
    = help: consider adding the following bound: `'a: 'b`
 
 error: lifetime may not live long enough
-  --> $DIR/outlives-suggestion-simple.rs:10:5
+  --> $DIR/outlives-suggestion-simple.rs:8:5
    |
 LL | fn foo2<'a>(x: &'a usize) -> &'static usize {
    |         -- lifetime `'a` defined here
@@ -19,7 +19,7 @@ LL |     x
    |     ^ returning this value requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/outlives-suggestion-simple.rs:14:5
+  --> $DIR/outlives-suggestion-simple.rs:12:5
    |
 LL | fn foo3<'a, 'b>(x: &'a usize, y: &'b usize) -> (&'b usize, &'a usize) {
    |         --  -- lifetime `'b` defined here
@@ -31,7 +31,7 @@ LL |     (x, y)
    = help: consider adding the following bound: `'a: 'b`
 
 error: lifetime may not live long enough
-  --> $DIR/outlives-suggestion-simple.rs:14:5
+  --> $DIR/outlives-suggestion-simple.rs:12:5
    |
 LL | fn foo3<'a, 'b>(x: &'a usize, y: &'b usize) -> (&'b usize, &'a usize) {
    |         --  -- lifetime `'b` defined here
@@ -45,7 +45,7 @@ LL |     (x, y)
 help: `'a` and `'b` must be the same: replace one with the other
 
 error: lifetime may not live long enough
-  --> $DIR/outlives-suggestion-simple.rs:22:5
+  --> $DIR/outlives-suggestion-simple.rs:20:5
    |
 LL | fn foo4<'a, 'b, 'c>(x: &'a usize) -> (&'b usize, &'c usize) {
    |         --  -- lifetime `'b` defined here
@@ -58,7 +58,7 @@ LL |     (x, x)
    = help: consider adding the following bound: `'a: 'b`
 
 error: lifetime may not live long enough
-  --> $DIR/outlives-suggestion-simple.rs:31:9
+  --> $DIR/outlives-suggestion-simple.rs:29:9
    |
 LL |     pub fn foo<'a>(x: &'a usize) -> Self {
    |                -- lifetime `'a` defined here
@@ -66,7 +66,7 @@ LL |         Foo { x }
    |         ^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/outlives-suggestion-simple.rs:41:9
+  --> $DIR/outlives-suggestion-simple.rs:39:9
    |
 LL | impl<'a> Bar<'a> {
    |      -- lifetime `'a` defined here
@@ -78,7 +78,7 @@ LL |         self.x
    = help: consider adding the following bound: `'a: 'b`
 
 error: lifetime may not live long enough
-  --> $DIR/outlives-suggestion-simple.rs:52:9
+  --> $DIR/outlives-suggestion-simple.rs:50:9
    |
 LL | impl<'a> Baz<'a> {
    |      -- lifetime `'a` defined here
@@ -90,7 +90,7 @@ LL |         self.x
    = help: consider adding the following bound: `'b: 'a`
 
 error: lifetime may not live long enough
-  --> $DIR/outlives-suggestion-simple.rs:73:9
+  --> $DIR/outlives-suggestion-simple.rs:71:9
    |
 LL | impl<'a> Foo2<'a> {
    |      -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/polonius/assignment-kills-loans.rs b/src/test/ui/nll/polonius/assignment-kills-loans.rs
index a80c62d19d5..c4cf20389ac 100644
--- a/src/test/ui/nll/polonius/assignment-kills-loans.rs
+++ b/src/test/ui/nll/polonius/assignment-kills-loans.rs
@@ -5,8 +5,7 @@
 // for code accepted by NLL. They are all variations from example code in the NLL RFC.
 
 // check-pass
-// compile-flags: -Z borrowck=mir -Z polonius
-// ignore-compare-mode-nll
+// compile-flags: -Z polonius
 
 struct List<T> {
     value: T,
diff --git a/src/test/ui/nll/polonius/assignment-to-differing-field.rs b/src/test/ui/nll/polonius/assignment-to-differing-field.rs
index c0ba1b983fc..7ec3b9049fd 100644
--- a/src/test/ui/nll/polonius/assignment-to-differing-field.rs
+++ b/src/test/ui/nll/polonius/assignment-to-differing-field.rs
@@ -4,8 +4,7 @@
 // that we do not kill too many borrows. Assignments to the `.1`
 // field projections should leave the borrows on `.0` intact.
 
-// compile-flags: -Z borrowck=mir -Z polonius
-// ignore-compare-mode-nll
+// compile-flags: -Z polonius
 
 struct List<T> {
     value: T,
diff --git a/src/test/ui/nll/polonius/assignment-to-differing-field.stderr b/src/test/ui/nll/polonius/assignment-to-differing-field.stderr
index fd5e4531b2e..afa1b934439 100644
--- a/src/test/ui/nll/polonius/assignment-to-differing-field.stderr
+++ b/src/test/ui/nll/polonius/assignment-to-differing-field.stderr
@@ -1,5 +1,5 @@
 error[E0499]: cannot borrow `list.0.value` as mutable more than once at a time
-  --> $DIR/assignment-to-differing-field.rs:21:21
+  --> $DIR/assignment-to-differing-field.rs:20:21
    |
 LL | fn assignment_to_field_projection<'a, T>(
    |                                   -- lifetime `'a` defined here
@@ -11,7 +11,7 @@ LL |             return result;
    |                    ------ returning this value requires that `list.0.value` is borrowed for `'a`
 
 error[E0499]: cannot borrow `list.0.next` as mutable more than once at a time
-  --> $DIR/assignment-to-differing-field.rs:24:26
+  --> $DIR/assignment-to-differing-field.rs:23:26
    |
 LL | fn assignment_to_field_projection<'a, T>(
    |                                   -- lifetime `'a` defined here
@@ -23,7 +23,7 @@ LL |         if let Some(n) = (list.0).next.as_mut() {
    |                          argument requires that `list.0.next` is borrowed for `'a`
 
 error[E0499]: cannot borrow `list.0.0.0.0.0.value` as mutable more than once at a time
-  --> $DIR/assignment-to-differing-field.rs:38:21
+  --> $DIR/assignment-to-differing-field.rs:37:21
    |
 LL | fn assignment_through_projection_chain<'a, T>(
    |                                        -- lifetime `'a` defined here
@@ -35,7 +35,7 @@ LL |             return result;
    |                    ------ returning this value requires that `list.0.0.0.0.0.value` is borrowed for `'a`
 
 error[E0499]: cannot borrow `list.0.0.0.0.0.next` as mutable more than once at a time
-  --> $DIR/assignment-to-differing-field.rs:41:26
+  --> $DIR/assignment-to-differing-field.rs:40:26
    |
 LL | fn assignment_through_projection_chain<'a, T>(
    |                                        -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/polonius/call-kills-loans.rs b/src/test/ui/nll/polonius/call-kills-loans.rs
index 57dc1401102..f430e9211e7 100644
--- a/src/test/ui/nll/polonius/call-kills-loans.rs
+++ b/src/test/ui/nll/polonius/call-kills-loans.rs
@@ -5,8 +5,7 @@
 // missing `killed` facts.
 
 // check-pass
-// compile-flags: -Z borrowck=mir -Z polonius
-// ignore-compare-mode-nll
+// compile-flags: -Z polonius
 
 struct Thing;
 
diff --git a/src/test/ui/nll/polonius/issue-46589.rs b/src/test/ui/nll/polonius/issue-46589.rs
index b5792587ff0..648280a1dcd 100644
--- a/src/test/ui/nll/polonius/issue-46589.rs
+++ b/src/test/ui/nll/polonius/issue-46589.rs
@@ -3,8 +3,7 @@
 // revision/compile-flags. We ensure here that it passes in Polonius mode.
 
 // check-pass
-// compile-flags: -Z borrowck=mir -Z polonius
-// ignore-compare-mode-nll
+// compile-flags: -Z polonius
 
 struct Foo;
 
diff --git a/src/test/ui/nll/polonius/polonius-smoke-test.rs b/src/test/ui/nll/polonius/polonius-smoke-test.rs
index bea5e455998..c4344af7175 100644
--- a/src/test/ui/nll/polonius/polonius-smoke-test.rs
+++ b/src/test/ui/nll/polonius/polonius-smoke-test.rs
@@ -1,6 +1,5 @@
 // Check that Polonius borrow check works for simple cases.
-// ignore-compare-mode-nll
-// compile-flags: -Z borrowck=mir -Zpolonius
+// compile-flags: -Z polonius
 
 pub fn return_ref_to_local() -> &'static i32 {
     let x = 0;
diff --git a/src/test/ui/nll/polonius/polonius-smoke-test.stderr b/src/test/ui/nll/polonius/polonius-smoke-test.stderr
index 1faf8e2212a..fa1a6a9c957 100644
--- a/src/test/ui/nll/polonius/polonius-smoke-test.stderr
+++ b/src/test/ui/nll/polonius/polonius-smoke-test.stderr
@@ -1,11 +1,11 @@
 error[E0515]: cannot return reference to local variable `x`
-  --> $DIR/polonius-smoke-test.rs:7:5
+  --> $DIR/polonius-smoke-test.rs:6:5
    |
 LL |     &x
    |     ^^ returns a reference to data owned by the current function
 
 error[E0503]: cannot use `x` because it was mutably borrowed
-  --> $DIR/polonius-smoke-test.rs:13:13
+  --> $DIR/polonius-smoke-test.rs:12:13
    |
 LL |     let y = &mut x;
    |             ------ borrow of `x` occurs here
@@ -15,7 +15,7 @@ LL |     let w = y;
    |             - borrow later used here
 
 error[E0505]: cannot move out of `x` because it is borrowed
-  --> $DIR/polonius-smoke-test.rs:19:13
+  --> $DIR/polonius-smoke-test.rs:18:13
    |
 LL | pub fn use_while_mut_fr(x: &mut i32) -> &mut i32 {
    |                            - let's call the lifetime of this reference `'1`
@@ -27,7 +27,7 @@ LL |     y
    |     - returning this value requires that `*x` is borrowed for `'1`
 
 error[E0505]: cannot move out of `s` because it is borrowed
-  --> $DIR/polonius-smoke-test.rs:43:5
+  --> $DIR/polonius-smoke-test.rs:42:5
    |
 LL |     let r = &mut *s;
    |             ------- borrow of `*s` occurs here
diff --git a/src/test/ui/nll/polonius/storagedead-kills-loans.rs b/src/test/ui/nll/polonius/storagedead-kills-loans.rs
index ff801cbf9f3..669e077dea4 100644
--- a/src/test/ui/nll/polonius/storagedead-kills-loans.rs
+++ b/src/test/ui/nll/polonius/storagedead-kills-loans.rs
@@ -4,8 +4,7 @@
 // Polonius because of these missing `killed` facts.
 
 // check-pass
-// compile-flags: -Z borrowck=mir -Z polonius
-// ignore-compare-mode-nll
+// compile-flags: -Z polonius
 
 use std::{io, mem};
 use std::io::Read;
diff --git a/src/test/ui/nll/polonius/subset-relations.rs b/src/test/ui/nll/polonius/subset-relations.rs
index 3f6f67ebf40..f223ab177b5 100644
--- a/src/test/ui/nll/polonius/subset-relations.rs
+++ b/src/test/ui/nll/polonius/subset-relations.rs
@@ -3,8 +3,7 @@
 // two free regions outlive each other, without any evidence that this
 // relation holds.
 
-// ignore-compare-mode-nll
-// compile-flags: -Z borrowck=mir -Zpolonius
+// compile-flags: -Z polonius
 
 // returning `y` requires that `'b: 'a`, but it's not known to be true
 fn missing_subset<'a, 'b>(x: &'a u32, y: &'b u32) -> &'a u32 {
diff --git a/src/test/ui/nll/polonius/subset-relations.stderr b/src/test/ui/nll/polonius/subset-relations.stderr
index 63645106f82..6df5563eabb 100644
--- a/src/test/ui/nll/polonius/subset-relations.stderr
+++ b/src/test/ui/nll/polonius/subset-relations.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/subset-relations.rs:11:5
+  --> $DIR/subset-relations.rs:10:5
    |
 LL | fn missing_subset<'a, 'b>(x: &'a u32, y: &'b u32) -> &'a u32 {
    |                   --  -- lifetime `'b` defined here
diff --git a/src/test/ui/nll/projection-return.rs b/src/test/ui/nll/projection-return.rs
index 017f53d1457..be141339a3f 100644
--- a/src/test/ui/nll/projection-return.rs
+++ b/src/test/ui/nll/projection-return.rs
@@ -1,4 +1,3 @@
-// compile-flags:-Zborrowck=mir
 // check-pass
 
 #![feature(rustc_attrs)]
diff --git a/src/test/ui/nll/relate_tys/fn-subtype.rs b/src/test/ui/nll/relate_tys/fn-subtype.rs
index 0730dcc9e49..ba89fa19ca6 100644
--- a/src/test/ui/nll/relate_tys/fn-subtype.rs
+++ b/src/test/ui/nll/relate_tys/fn-subtype.rs
@@ -2,8 +2,6 @@
 //
 // compile-flags:-Zno-leak-check
 
-#![feature(nll)]
-
 fn main() {
     let x: fn(&'static ()) = |_| {};
     let y: for<'a> fn(&'a ()) = x; //~ ERROR mismatched types [E0308]
diff --git a/src/test/ui/nll/relate_tys/fn-subtype.stderr b/src/test/ui/nll/relate_tys/fn-subtype.stderr
index 6256c4a01d3..21073647ea7 100644
--- a/src/test/ui/nll/relate_tys/fn-subtype.stderr
+++ b/src/test/ui/nll/relate_tys/fn-subtype.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/fn-subtype.rs:9:33
+  --> $DIR/fn-subtype.rs:7:33
    |
 LL |     let y: for<'a> fn(&'a ()) = x;
    |                                 ^ one type is more general than the other
diff --git a/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.rs b/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.rs
index a6d6ffa0ce3..7891bab092b 100644
--- a/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.rs
+++ b/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.rs
@@ -4,8 +4,6 @@
 //
 // compile-flags:-Zno-leak-check
 
-#![feature(nll)]
-
 fn make_it() -> for<'a> fn(&'a u32, &'a u32) -> &'a u32 {
     panic!()
 }
diff --git a/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.stderr b/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.stderr
index b839015f97f..7d76c916d6d 100644
--- a/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.stderr
+++ b/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/hr-fn-aaa-as-aba.rs:14:58
+  --> $DIR/hr-fn-aaa-as-aba.rs:12:58
    |
 LL |     let a: for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32 = make_it();
    |                                                          ^^^^^^^^^ one type is more general than the other
@@ -8,7 +8,7 @@ LL |     let a: for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32 = make_it();
               found fn pointer `for<'a> fn(&'a u32, &'a u32) -> &'a u32`
 
 error[E0308]: mismatched types
-  --> $DIR/hr-fn-aaa-as-aba.rs:22:12
+  --> $DIR/hr-fn-aaa-as-aba.rs:20:12
    |
 LL |     let _: for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32 = make_it();
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
diff --git a/src/test/ui/nll/relate_tys/hr-fn-aau-eq-abu.rs b/src/test/ui/nll/relate_tys/hr-fn-aau-eq-abu.rs
index 527cca13395..92730341c11 100644
--- a/src/test/ui/nll/relate_tys/hr-fn-aau-eq-abu.rs
+++ b/src/test/ui/nll/relate_tys/hr-fn-aau-eq-abu.rs
@@ -9,8 +9,6 @@
 // check-pass
 // compile-flags:-Zno-leak-check
 
-#![feature(nll)]
-
 use std::cell::Cell;
 
 fn make_cell_aa() -> Cell<for<'a> fn(&'a u32, &'a u32)> {
diff --git a/src/test/ui/nll/relate_tys/hr-fn-aba-as-aaa.rs b/src/test/ui/nll/relate_tys/hr-fn-aba-as-aaa.rs
index 3a46188d119..7cc0acf45f2 100644
--- a/src/test/ui/nll/relate_tys/hr-fn-aba-as-aaa.rs
+++ b/src/test/ui/nll/relate_tys/hr-fn-aba-as-aaa.rs
@@ -5,8 +5,6 @@
 // check-pass
 // compile-flags:-Zno-leak-check
 
-#![feature(nll)]
-
 fn make_it() -> for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32 {
     panic!()
 }
diff --git a/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.rs b/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.rs
index 37a01f28946..c4db6fc97dc 100644
--- a/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.rs
+++ b/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.rs
@@ -6,15 +6,13 @@
 // contravariance, this effectively requires a `T = &'b ()` where
 // `forall<'a> { 'a: 'b }`. Therefore, we get an error.
 //
-// Note the use of `-Zno-leak-check` and `feature(nll)` here. These
-// are presently required in order to skip the leak-check errors.
+// Note the use of `-Zno-leak-check` here. This is presently required in order
+// to skip the leak-check errors.
 //
 // c.f. Issue #57642.
 //
 // compile-flags:-Zno-leak-check
 
-#![feature(nll)]
-
 trait Y {
     type F;
     fn make_f() -> Self::F;
diff --git a/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.stderr b/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.stderr
index ed79c7df25e..51adfca3e79 100644
--- a/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.stderr
+++ b/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.stderr
@@ -1,5 +1,5 @@
 error: implementation of `Y` is not general enough
-  --> $DIR/impl-fn-ignore-binder-via-bottom.rs:32:14
+  --> $DIR/impl-fn-ignore-binder-via-bottom.rs:30:14
    |
 LL |     let _x = <fn(&())>::make_f();
    |              ^^^^^^^^^^^^^^^^^^^ implementation of `Y` is not general enough
@@ -8,7 +8,7 @@ LL |     let _x = <fn(&())>::make_f();
    = note: ...but `Y` is actually implemented for the type `fn(&'0 ())`, for some specific lifetime `'0`
 
 error: implementation of `Y` is not general enough
-  --> $DIR/impl-fn-ignore-binder-via-bottom.rs:32:14
+  --> $DIR/impl-fn-ignore-binder-via-bottom.rs:30:14
    |
 LL |     let _x = <fn(&())>::make_f();
    |              ^^^^^^^^^^^^^^^^^^^ implementation of `Y` is not general enough
diff --git a/src/test/ui/nll/relate_tys/opaque-hrtb.rs b/src/test/ui/nll/relate_tys/opaque-hrtb.rs
index 0fbe6a63c0b..2613725235c 100644
--- a/src/test/ui/nll/relate_tys/opaque-hrtb.rs
+++ b/src/test/ui/nll/relate_tys/opaque-hrtb.rs
@@ -1,5 +1,3 @@
-#![feature(nll)]
-
 trait MyTrait<T> {}
 
 struct Foo;
diff --git a/src/test/ui/nll/relate_tys/opaque-hrtb.stderr b/src/test/ui/nll/relate_tys/opaque-hrtb.stderr
index 4c8b66f21ab..d75ec2b57d4 100644
--- a/src/test/ui/nll/relate_tys/opaque-hrtb.stderr
+++ b/src/test/ui/nll/relate_tys/opaque-hrtb.stderr
@@ -1,5 +1,5 @@
 error: implementation of `MyTrait` is not general enough
-  --> $DIR/opaque-hrtb.rs:13:5
+  --> $DIR/opaque-hrtb.rs:11:5
    |
 LL |     bar()
    |     ^^^^^ implementation of `MyTrait` is not general enough
diff --git a/src/test/ui/nll/relate_tys/trait-hrtb.rs b/src/test/ui/nll/relate_tys/trait-hrtb.rs
index 2e94fc5c12d..7f40e93cd87 100644
--- a/src/test/ui/nll/relate_tys/trait-hrtb.rs
+++ b/src/test/ui/nll/relate_tys/trait-hrtb.rs
@@ -2,8 +2,6 @@
 //
 // compile-flags:-Zno-leak-check
 
-#![feature(nll)]
-
 trait Foo<'a> {}
 
 fn make_foo<'a>() -> Box<dyn Foo<'a>> {
diff --git a/src/test/ui/nll/relate_tys/trait-hrtb.stderr b/src/test/ui/nll/relate_tys/trait-hrtb.stderr
index 6d144a4be6e..aa1927711b3 100644
--- a/src/test/ui/nll/relate_tys/trait-hrtb.stderr
+++ b/src/test/ui/nll/relate_tys/trait-hrtb.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/trait-hrtb.rs:15:39
+  --> $DIR/trait-hrtb.rs:13:39
    |
 LL |     let y: Box<dyn for<'a> Foo<'a>> = x;
    |                                       ^ one type is more general than the other
diff --git a/src/test/ui/nll/relate_tys/universe-violation.rs b/src/test/ui/nll/relate_tys/universe-violation.rs
index 8389c8e8377..c5f9d4406e2 100644
--- a/src/test/ui/nll/relate_tys/universe-violation.rs
+++ b/src/test/ui/nll/relate_tys/universe-violation.rs
@@ -4,8 +4,6 @@
 //
 // compile-flags:-Zno-leak-check
 
-#![feature(nll)]
-
 fn make_it() -> fn(&'static u32) -> &'static u32 {
     panic!()
 }
diff --git a/src/test/ui/nll/relate_tys/universe-violation.stderr b/src/test/ui/nll/relate_tys/universe-violation.stderr
index ff4c7abc250..6f38154e379 100644
--- a/src/test/ui/nll/relate_tys/universe-violation.stderr
+++ b/src/test/ui/nll/relate_tys/universe-violation.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/universe-violation.rs:15:31
+  --> $DIR/universe-violation.rs:13:31
    |
 LL |     let b: fn(&u32) -> &u32 = a;
    |                               ^ one type is more general than the other
diff --git a/src/test/ui/nll/ty-outlives/impl-trait-captures.rs b/src/test/ui/nll/ty-outlives/impl-trait-captures.rs
index c04185d0814..67b31b8bcd4 100644
--- a/src/test/ui/nll/ty-outlives/impl-trait-captures.rs
+++ b/src/test/ui/nll/ty-outlives/impl-trait-captures.rs
@@ -1,4 +1,4 @@
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![allow(warnings)]
 
diff --git a/src/test/ui/nll/ty-outlives/impl-trait-outlives.rs b/src/test/ui/nll/ty-outlives/impl-trait-outlives.rs
index 3548ad03a7d..68ccb51fcd0 100644
--- a/src/test/ui/nll/ty-outlives/impl-trait-outlives.rs
+++ b/src/test/ui/nll/ty-outlives/impl-trait-outlives.rs
@@ -1,4 +1,4 @@
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![allow(warnings)]
 
diff --git a/src/test/ui/nll/ty-outlives/projection-implied-bounds.rs b/src/test/ui/nll/ty-outlives/projection-implied-bounds.rs
index fb50dce1af6..e1dac082409 100644
--- a/src/test/ui/nll/ty-outlives/projection-implied-bounds.rs
+++ b/src/test/ui/nll/ty-outlives/projection-implied-bounds.rs
@@ -1,7 +1,7 @@
 // Test that we can deduce when projections like `T::Item` outlive the
 // function body. Test that this does not imply that `T: 'a` holds.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 use std::cell::Cell;
 
diff --git a/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs b/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs
index 28010e198d6..2d9c008c759 100644
--- a/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs
+++ b/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs
@@ -1,4 +1,4 @@
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 // Tests closures that propagate an outlives relationship to their
 // creator where the subject is a projection with no regions (`<T as
diff --git a/src/test/ui/nll/ty-outlives/projection-no-regions-fn.rs b/src/test/ui/nll/ty-outlives/projection-no-regions-fn.rs
index c9989fb426b..a10a0366ae8 100644
--- a/src/test/ui/nll/ty-outlives/projection-no-regions-fn.rs
+++ b/src/test/ui/nll/ty-outlives/projection-no-regions-fn.rs
@@ -1,4 +1,4 @@
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![allow(warnings)]
 
diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs b/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs
index 17d5f2e1aea..af361e990e5 100644
--- a/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs
+++ b/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs
@@ -12,7 +12,7 @@
 //
 // Ensuring that both `T: 'a` and `'b: 'a` holds does work (`elements_outlive`).
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![allow(warnings)]
 #![feature(rustc_attrs)]
diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.rs b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.rs
index 8df0700c58c..6f8513491df 100644
--- a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.rs
+++ b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.rs
@@ -4,7 +4,7 @@
 // case, the best way to satisfy the trait bound is to show that `'b:
 // 'a`, which can be done in various ways.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![allow(warnings)]
 #![feature(rustc_attrs)]
diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.rs b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.rs
index be1b653c384..7c0a3bc72c3 100644
--- a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.rs
+++ b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.rs
@@ -2,7 +2,7 @@
 // outlive `'static`. In this case, we don't get any errors, and in fact
 // we don't even propagate constraints from the closures to the callers.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 // check-pass
 
 #![allow(warnings)]
diff --git a/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs b/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs
index 2f18f600b75..7b4a3c03a62 100644
--- a/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs
+++ b/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs
@@ -5,7 +5,7 @@
 // the trait bound, and hence we propagate it to the caller as a type
 // test.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![allow(warnings)]
 #![feature(rustc_attrs)]
diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.base.stderr b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.base.stderr
deleted file mode 100644
index c7710146ea4..00000000000
--- a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.base.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0309]: the associated type `<T as MyTrait<'a>>::Output` may not live long enough
-  --> $DIR/projection-where-clause-env-wrong-bound.rs:19:5
-   |
-LL |     bar::<T::Output>()
-   |     ^^^^^^^^^^^^^^^^
-   |
-   = help: consider adding an explicit lifetime bound `<T as MyTrait<'a>>::Output: 'a`...
-   = note: ...so that the type `<T as MyTrait<'a>>::Output` will meet its required lifetime bounds...
-note: ...that is required by this bound
-  --> $DIR/projection-where-clause-env-wrong-bound.rs:33:8
-   |
-LL |     T: 'a,
-   |        ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0309`.
diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.rs b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.rs
index 22edb22a536..dce88b88c75 100644
--- a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.rs
+++ b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 // Test that we are able to establish that `<T as
 // MyTrait<'a>>::Output` outlives `'b` here. We need to prove however
 // that `<T as MyTrait<'a>>::Output` outlives `'a`, so we also have to
diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.nll.stderr b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.stderr
index d235dee6444..b4435fe06bc 100644
--- a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.nll.stderr
+++ b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.stderr
@@ -1,5 +1,5 @@
 error[E0309]: the associated type `<T as MyTrait<'_>>::Output` may not live long enough
-  --> $DIR/projection-where-clause-env-wrong-bound.rs:19:5
+  --> $DIR/projection-where-clause-env-wrong-bound.rs:15:5
    |
 LL |     bar::<T::Output>()
    |     ^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.base.stderr b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.base.stderr
deleted file mode 100644
index c3e2301bd66..00000000000
--- a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.base.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0309]: the associated type `<T as MyTrait<'a>>::Output` may not live long enough
-  --> $DIR/projection-where-clause-env-wrong-lifetime.rs:18:5
-   |
-LL |     bar::<<T as MyTrait<'a>>::Output>()
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = help: consider adding an explicit lifetime bound `<T as MyTrait<'a>>::Output: 'a`...
-   = note: ...so that the type `<T as MyTrait<'a>>::Output` will meet its required lifetime bounds...
-note: ...that is required by this bound
-  --> $DIR/projection-where-clause-env-wrong-lifetime.rs:25:8
-   |
-LL |     T: 'a,
-   |        ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0309`.
diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.rs b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.rs
index d89b065673b..987148dcefb 100644
--- a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.rs
+++ b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 // Test that if we need to prove that `<T as MyTrait<'a>>::Output:
 // 'a`, but we only know that `<T as MyTrait<'b>>::Output: 'a`, that
 // doesn't suffice.
@@ -16,8 +12,7 @@ where
     <T as MyTrait<'b>>::Output: 'a,
 {
     bar::<<T as MyTrait<'a>>::Output>()
-    //[base]~^ ERROR the associated type `<T as MyTrait<'a>>::Output` may not live long enough
-    //[nll]~^^ ERROR the associated type `<T as MyTrait<'_>>::Output` may not live long enough
+    //~^ ERROR the associated type `<T as MyTrait<'_>>::Output` may not live long enough
 }
 
 fn bar<'a, T>() -> &'a ()
diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.nll.stderr b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.stderr
index 82fe2fad9f7..ddeaf3c1f9e 100644
--- a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.nll.stderr
+++ b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.stderr
@@ -1,5 +1,5 @@
 error[E0309]: the associated type `<T as MyTrait<'_>>::Output` may not live long enough
-  --> $DIR/projection-where-clause-env-wrong-lifetime.rs:18:5
+  --> $DIR/projection-where-clause-env-wrong-lifetime.rs:14:5
    |
 LL |     bar::<<T as MyTrait<'a>>::Output>()
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-none.rs b/src/test/ui/nll/ty-outlives/projection-where-clause-none.rs
index f0f72f5d27f..bb201e5c075 100644
--- a/src/test/ui/nll/ty-outlives/projection-where-clause-none.rs
+++ b/src/test/ui/nll/ty-outlives/projection-where-clause-none.rs
@@ -1,5 +1,3 @@
-#![feature(nll)]
-
 // Test that we are NOT able to establish that `<T as
 // MyTrait<'a>>::Output: 'a` outlives `'a` here -- we have only one
 // recourse, which is to prove that `T: 'a` and `'a: 'a`, but we don't
diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-none.stderr b/src/test/ui/nll/ty-outlives/projection-where-clause-none.stderr
index e28b89580bc..0df44644d6a 100644
--- a/src/test/ui/nll/ty-outlives/projection-where-clause-none.stderr
+++ b/src/test/ui/nll/ty-outlives/projection-where-clause-none.stderr
@@ -1,5 +1,5 @@
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/projection-where-clause-none.rs:16:5
+  --> $DIR/projection-where-clause-none.rs:14:5
    |
 LL |     bar::<T::Output>()
    |     ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-trait.rs b/src/test/ui/nll/ty-outlives/projection-where-clause-trait.rs
index 8d0c10a639e..1a40d3b4c2f 100644
--- a/src/test/ui/nll/ty-outlives/projection-where-clause-trait.rs
+++ b/src/test/ui/nll/ty-outlives/projection-where-clause-trait.rs
@@ -1,5 +1,3 @@
-#![feature(nll)]
-
 // Test that we are able to establish that `<T as
 // MyTrait<'a>>::Output: 'a` outlives `'a` (because the trait says
 // so).
diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs
index fd36e7573ff..4d83805993a 100644
--- a/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs
+++ b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs
@@ -1,4 +1,4 @@
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![allow(warnings)]
 #![feature(rustc_attrs)]
diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs
index 7fce771fc8b..4343c3aee53 100644
--- a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs
+++ b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs
@@ -1,4 +1,4 @@
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![allow(warnings)]
 #![feature(rustc_attrs)]
diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs
index c93172885bf..d7702def32c 100644
--- a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs
+++ b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs
@@ -2,7 +2,7 @@
 // `correct_region` for an explanation of how this test is setup; it's
 // somewhat intricate.
 
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 
 #![allow(warnings)]
 #![feature(rustc_attrs)]
diff --git a/src/test/ui/nll/ty-outlives/ty-param-fn-body.rs b/src/test/ui/nll/ty-outlives/ty-param-fn-body.rs
index ec94258af4a..98239f41609 100644
--- a/src/test/ui/nll/ty-outlives/ty-param-fn-body.rs
+++ b/src/test/ui/nll/ty-outlives/ty-param-fn-body.rs
@@ -1,5 +1,3 @@
-// compile-flags:-Zborrowck=mir
-
 // Test that we assume that universal types like `T` outlive the
 // function body.
 
diff --git a/src/test/ui/nll/ty-outlives/ty-param-fn-body.stderr b/src/test/ui/nll/ty-outlives/ty-param-fn-body.stderr
index ba79137d18d..5fb69255dba 100644
--- a/src/test/ui/nll/ty-outlives/ty-param-fn-body.stderr
+++ b/src/test/ui/nll/ty-outlives/ty-param-fn-body.stderr
@@ -1,5 +1,5 @@
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/ty-param-fn-body.rs:19:5
+  --> $DIR/ty-param-fn-body.rs:17:5
    |
 LL |     outlives(cell, t)
    |     ^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
diff --git a/src/test/ui/nll/ty-outlives/ty-param-fn.rs b/src/test/ui/nll/ty-outlives/ty-param-fn.rs
index a8d229fee51..4393a3b4169 100644
--- a/src/test/ui/nll/ty-outlives/ty-param-fn.rs
+++ b/src/test/ui/nll/ty-outlives/ty-param-fn.rs
@@ -1,5 +1,3 @@
-// compile-flags:-Zborrowck=mir
-
 #![allow(warnings)]
 
 use std::fmt::Debug;
diff --git a/src/test/ui/nll/ty-outlives/ty-param-fn.stderr b/src/test/ui/nll/ty-outlives/ty-param-fn.stderr
index 729f14d84ad..825b26d2f77 100644
--- a/src/test/ui/nll/ty-outlives/ty-param-fn.stderr
+++ b/src/test/ui/nll/ty-outlives/ty-param-fn.stderr
@@ -1,5 +1,5 @@
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/ty-param-fn.rs:11:5
+  --> $DIR/ty-param-fn.rs:9:5
    |
 LL |     x
    |     ^ ...so that the type `T` will meet its required lifetime bounds
@@ -10,7 +10,7 @@ LL |     T: Debug + 'a,
    |              ++++
 
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/ty-param-fn.rs:26:5
+  --> $DIR/ty-param-fn.rs:24:5
    |
 LL |     x
    |     ^ ...so that the type `T` will meet its required lifetime bounds
diff --git a/src/test/ui/nll/ty-outlives/ty-param-implied-bounds.rs b/src/test/ui/nll/ty-outlives/ty-param-implied-bounds.rs
index 6547ae39817..9042844e848 100644
--- a/src/test/ui/nll/ty-outlives/ty-param-implied-bounds.rs
+++ b/src/test/ui/nll/ty-outlives/ty-param-implied-bounds.rs
@@ -1,4 +1,4 @@
-// compile-flags:-Zborrowck=mir -Zverbose
+// compile-flags:-Zverbose
 // check-pass
 
 // Test that we assume that universal types like `T` outlive the
diff --git a/src/test/ui/nll/ty-outlives/wf-unreachable.rs b/src/test/ui/nll/ty-outlives/wf-unreachable.rs
index a2e3ab41614..c6f4c4afa3d 100644
--- a/src/test/ui/nll/ty-outlives/wf-unreachable.rs
+++ b/src/test/ui/nll/ty-outlives/wf-unreachable.rs
@@ -1,8 +1,6 @@
 // Test that we check that user type annotations are well-formed, even in dead
 // code.
 
-#![feature(nll)]
-
 fn uninit<'a>() {
     return;
     let x: &'static &'a ();                         //~ ERROR lifetime may not live long enough
diff --git a/src/test/ui/nll/ty-outlives/wf-unreachable.stderr b/src/test/ui/nll/ty-outlives/wf-unreachable.stderr
index 9128fd16479..a62157f44f5 100644
--- a/src/test/ui/nll/ty-outlives/wf-unreachable.stderr
+++ b/src/test/ui/nll/ty-outlives/wf-unreachable.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/wf-unreachable.rs:8:12
+  --> $DIR/wf-unreachable.rs:6:12
    |
 LL | fn uninit<'a>() {
    |           -- lifetime `'a` defined here
@@ -8,7 +8,7 @@ LL |     let x: &'static &'a ();
    |            ^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/wf-unreachable.rs:13:12
+  --> $DIR/wf-unreachable.rs:11:12
    |
 LL | fn var_type<'a>() {
    |             -- lifetime `'a` defined here
@@ -17,7 +17,7 @@ LL |     let x: &'static &'a () = &&();
    |            ^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/wf-unreachable.rs:17:12
+  --> $DIR/wf-unreachable.rs:15:12
    |
 LL | fn uninit_infer<'a>() {
    |                 -- lifetime `'a` defined here
@@ -25,7 +25,7 @@ LL |     let x: &'static &'a _;
    |            ^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/wf-unreachable.rs:23:12
+  --> $DIR/wf-unreachable.rs:21:12
    |
 LL | fn infer<'a>() {
    |          -- lifetime `'a` defined here
@@ -34,7 +34,7 @@ LL |     let x: &'static &'a _ = &&();
    |            ^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/wf-unreachable.rs:28:12
+  --> $DIR/wf-unreachable.rs:26:12
    |
 LL | fn uninit_no_var<'a>() {
    |                  -- lifetime `'a` defined here
@@ -43,7 +43,7 @@ LL |     let _: &'static &'a ();
    |            ^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/wf-unreachable.rs:33:12
+  --> $DIR/wf-unreachable.rs:31:12
    |
 LL | fn no_var<'a>() {
    |           -- lifetime `'a` defined here
@@ -52,7 +52,7 @@ LL |     let _: &'static &'a () = &&();
    |            ^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/wf-unreachable.rs:38:12
+  --> $DIR/wf-unreachable.rs:36:12
    |
 LL | fn infer_no_var<'a>() {
    |                 -- lifetime `'a` defined here
@@ -61,7 +61,7 @@ LL |     let _: &'static &'a _ = &&();
    |            ^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/wf-unreachable.rs:51:12
+  --> $DIR/wf-unreachable.rs:49:12
    |
 LL | fn required_substs<'a>() {
    |                    -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/type-alias-free-regions.base.stderr b/src/test/ui/nll/type-alias-free-regions.base.stderr
deleted file mode 100644
index 010535fec6d..00000000000
--- a/src/test/ui/nll/type-alias-free-regions.base.stderr
+++ /dev/null
@@ -1,65 +0,0 @@
-error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
-  --> $DIR/type-alias-free-regions.rs:21:9
-   |
-LL |         C { f: b }
-   |         ^
-   |
-note: first, the lifetime cannot outlive the anonymous lifetime defined here...
-  --> $DIR/type-alias-free-regions.rs:20:24
-   |
-LL |     fn from_box(b: Box<B>) -> Self {
-   |                        ^
-note: ...so that the expression is assignable
-  --> $DIR/type-alias-free-regions.rs:21:16
-   |
-LL |         C { f: b }
-   |                ^
-   = note: expected `Box<Box<&isize>>`
-              found `Box<Box<&isize>>`
-note: but, the lifetime must be valid for the lifetime `'a` as defined here...
-  --> $DIR/type-alias-free-regions.rs:19:6
-   |
-LL | impl<'a> FromBox<'a> for C<'a> {
-   |      ^^
-note: ...so that the types are compatible
-  --> $DIR/type-alias-free-regions.rs:21:9
-   |
-LL |         C { f: b }
-   |         ^^^^^^^^^^
-   = note: expected `C<'a>`
-              found `C<'_>`
-
-error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
-  --> $DIR/type-alias-free-regions.rs:31:16
-   |
-LL |         C { f: Box::new(b.0) }
-   |                ^^^^^^^^^^^^^
-   |
-note: first, the lifetime cannot outlive the anonymous lifetime defined here...
-  --> $DIR/type-alias-free-regions.rs:30:23
-   |
-LL |     fn from_tuple(b: (B,)) -> Self {
-   |                       ^
-note: ...so that the expression is assignable
-  --> $DIR/type-alias-free-regions.rs:31:25
-   |
-LL |         C { f: Box::new(b.0) }
-   |                         ^^^
-   = note: expected `Box<&isize>`
-              found `Box<&isize>`
-note: but, the lifetime must be valid for the lifetime `'a` as defined here...
-  --> $DIR/type-alias-free-regions.rs:29:6
-   |
-LL | impl<'a> FromTuple<'a> for C<'a> {
-   |      ^^
-note: ...so that the types are compatible
-  --> $DIR/type-alias-free-regions.rs:31:9
-   |
-LL |         C { f: Box::new(b.0) }
-   |         ^^^^^^^^^^^^^^^^^^^^^^
-   = note: expected `C<'a>`
-              found `C<'_>`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/nll/type-alias-free-regions.rs b/src/test/ui/nll/type-alias-free-regions.rs
index 59ef0344937..fd5566f35d5 100644
--- a/src/test/ui/nll/type-alias-free-regions.rs
+++ b/src/test/ui/nll/type-alias-free-regions.rs
@@ -1,10 +1,6 @@
 // Test that we don't assume that type aliases have the same type parameters
 // as the type they alias and then panic when we see this.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 type A<'a> = &'a isize;
 type B<'a> = Box<A<'a>>;
 
diff --git a/src/test/ui/nll/type-alias-free-regions.nll.stderr b/src/test/ui/nll/type-alias-free-regions.stderr
index 6b746602d7f..45fd5a2f1d6 100644
--- a/src/test/ui/nll/type-alias-free-regions.nll.stderr
+++ b/src/test/ui/nll/type-alias-free-regions.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/type-alias-free-regions.rs:21:9
+  --> $DIR/type-alias-free-regions.rs:17:9
    |
 LL | impl<'a> FromBox<'a> for C<'a> {
    |      -- lifetime `'a` defined here
@@ -9,7 +9,7 @@ LL |         C { f: b }
    |         ^^^^^^^^^^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
 
 error: lifetime may not live long enough
-  --> $DIR/type-alias-free-regions.rs:31:9
+  --> $DIR/type-alias-free-regions.rs:27:9
    |
 LL | impl<'a> FromTuple<'a> for C<'a> {
    |      -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/type-check-pointer-coercions.rs b/src/test/ui/nll/type-check-pointer-coercions.rs
index b6a25eddb86..66da57248f9 100644
--- a/src/test/ui/nll/type-check-pointer-coercions.rs
+++ b/src/test/ui/nll/type-check-pointer-coercions.rs
@@ -1,5 +1,3 @@
-#![feature(nll)]
-
 fn shared_to_const<'a, 'b>(x: &&'a i32) -> *const &'b i32 {
     x   //~ ERROR
 }
diff --git a/src/test/ui/nll/type-check-pointer-coercions.stderr b/src/test/ui/nll/type-check-pointer-coercions.stderr
index 24b07cabbac..ef2d928786f 100644
--- a/src/test/ui/nll/type-check-pointer-coercions.stderr
+++ b/src/test/ui/nll/type-check-pointer-coercions.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/type-check-pointer-coercions.rs:4:5
+  --> $DIR/type-check-pointer-coercions.rs:2:5
    |
 LL | fn shared_to_const<'a, 'b>(x: &&'a i32) -> *const &'b i32 {
    |                    --  -- lifetime `'b` defined here
@@ -11,7 +11,7 @@ LL |     x
    = help: consider adding the following bound: `'a: 'b`
 
 error: lifetime may not live long enough
-  --> $DIR/type-check-pointer-coercions.rs:8:5
+  --> $DIR/type-check-pointer-coercions.rs:6:5
    |
 LL | fn unique_to_const<'a, 'b>(x: &mut &'a i32) -> *const &'b i32 {
    |                    --  -- lifetime `'b` defined here
@@ -23,7 +23,7 @@ LL |     x
    = help: consider adding the following bound: `'a: 'b`
 
 error: lifetime may not live long enough
-  --> $DIR/type-check-pointer-coercions.rs:13:5
+  --> $DIR/type-check-pointer-coercions.rs:11:5
    |
 LL | fn unique_to_mut<'a, 'b>(x: &mut &'a i32) -> *mut &'b i32 {
    |                  --  -- lifetime `'b` defined here
@@ -39,7 +39,7 @@ LL |     x
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/type-check-pointer-coercions.rs:13:5
+  --> $DIR/type-check-pointer-coercions.rs:11:5
    |
 LL | fn unique_to_mut<'a, 'b>(x: &mut &'a i32) -> *mut &'b i32 {
    |                  --  -- lifetime `'b` defined here
@@ -57,7 +57,7 @@ LL |     x
 help: `'b` and `'a` must be the same: replace one with the other
 
 error: lifetime may not live long enough
-  --> $DIR/type-check-pointer-coercions.rs:18:5
+  --> $DIR/type-check-pointer-coercions.rs:16:5
    |
 LL | fn mut_to_const<'a, 'b>(x: *mut &'a i32) -> *const &'b i32 {
    |                 --  -- lifetime `'b` defined here
@@ -69,7 +69,7 @@ LL |     x
    = help: consider adding the following bound: `'a: 'b`
 
 error: lifetime may not live long enough
-  --> $DIR/type-check-pointer-coercions.rs:24:5
+  --> $DIR/type-check-pointer-coercions.rs:22:5
    |
 LL | fn array_elem<'a, 'b>(x: &'a i32) -> *const &'b i32 {
    |               --  -- lifetime `'b` defined here
@@ -82,7 +82,7 @@ LL |     y
    = help: consider adding the following bound: `'a: 'b`
 
 error: lifetime may not live long enough
-  --> $DIR/type-check-pointer-coercions.rs:30:5
+  --> $DIR/type-check-pointer-coercions.rs:28:5
    |
 LL | fn array_coerce<'a, 'b>(x: &'a i32) -> *const [&'b i32; 3] {
    |                 --  -- lifetime `'b` defined here
@@ -95,7 +95,7 @@ LL |     y
    = help: consider adding the following bound: `'a: 'b`
 
 error: lifetime may not live long enough
-  --> $DIR/type-check-pointer-coercions.rs:36:5
+  --> $DIR/type-check-pointer-coercions.rs:34:5
    |
 LL | fn nested_array<'a, 'b>(x: &'a i32) -> *const [&'b i32; 2] {
    |                 --  -- lifetime `'b` defined here
diff --git a/src/test/ui/nll/type-check-pointer-comparisons.rs b/src/test/ui/nll/type-check-pointer-comparisons.rs
index 3c900356fab..7b0ffeaef0e 100644
--- a/src/test/ui/nll/type-check-pointer-comparisons.rs
+++ b/src/test/ui/nll/type-check-pointer-comparisons.rs
@@ -1,5 +1,3 @@
-#![feature(nll)]
-
 // Check that we assert that pointers have a common subtype for comparisons
 
 fn compare_const<'a, 'b>(x: *const &mut &'a i32, y: *const &mut &'b i32) {
diff --git a/src/test/ui/nll/type-check-pointer-comparisons.stderr b/src/test/ui/nll/type-check-pointer-comparisons.stderr
index 8c88b229039..0d8480a42c1 100644
--- a/src/test/ui/nll/type-check-pointer-comparisons.stderr
+++ b/src/test/ui/nll/type-check-pointer-comparisons.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/type-check-pointer-comparisons.rs:6:5
+  --> $DIR/type-check-pointer-comparisons.rs:4:5
    |
 LL | fn compare_const<'a, 'b>(x: *const &mut &'a i32, y: *const &mut &'b i32) {
    |                  --  -- lifetime `'b` defined here
@@ -14,7 +14,7 @@ LL |     x == y;
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/type-check-pointer-comparisons.rs:6:10
+  --> $DIR/type-check-pointer-comparisons.rs:4:10
    |
 LL | fn compare_const<'a, 'b>(x: *const &mut &'a i32, y: *const &mut &'b i32) {
    |                  --  -- lifetime `'b` defined here
@@ -31,7 +31,7 @@ LL |     x == y;
 help: `'a` and `'b` must be the same: replace one with the other
 
 error: lifetime may not live long enough
-  --> $DIR/type-check-pointer-comparisons.rs:12:5
+  --> $DIR/type-check-pointer-comparisons.rs:10:5
    |
 LL | fn compare_mut<'a, 'b>(x: *mut &'a i32, y: *mut &'b i32) {
    |                --  -- lifetime `'b` defined here
@@ -46,7 +46,7 @@ LL |     x == y;
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/type-check-pointer-comparisons.rs:12:10
+  --> $DIR/type-check-pointer-comparisons.rs:10:10
    |
 LL | fn compare_mut<'a, 'b>(x: *mut &'a i32, y: *mut &'b i32) {
    |                --  -- lifetime `'b` defined here
@@ -63,7 +63,7 @@ LL |     x == y;
 help: `'a` and `'b` must be the same: replace one with the other
 
 error: lifetime may not live long enough
-  --> $DIR/type-check-pointer-comparisons.rs:18:5
+  --> $DIR/type-check-pointer-comparisons.rs:16:5
    |
 LL | fn compare_fn_ptr<'a, 'b, 'c>(f: fn(&'c mut &'a i32), g: fn(&'c mut &'b i32)) {
    |                   --  -- lifetime `'b` defined here
@@ -78,7 +78,7 @@ LL |     f == g;
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/type-check-pointer-comparisons.rs:18:10
+  --> $DIR/type-check-pointer-comparisons.rs:16:10
    |
 LL | fn compare_fn_ptr<'a, 'b, 'c>(f: fn(&'c mut &'a i32), g: fn(&'c mut &'b i32)) {
    |                   --  -- lifetime `'b` defined here
diff --git a/src/test/ui/nll/user-annotations/closure-substs.rs b/src/test/ui/nll/user-annotations/closure-substs.rs
index cafdd9257fd..f7af54e8df4 100644
--- a/src/test/ui/nll/user-annotations/closure-substs.rs
+++ b/src/test/ui/nll/user-annotations/closure-substs.rs
@@ -1,5 +1,3 @@
-#![feature(nll)]
-
 // Test that we enforce user-provided type annotations on closures.
 
 fn foo<'a>() {
diff --git a/src/test/ui/nll/user-annotations/closure-substs.stderr b/src/test/ui/nll/user-annotations/closure-substs.stderr
index 20002e4591d..1e8de4ba905 100644
--- a/src/test/ui/nll/user-annotations/closure-substs.stderr
+++ b/src/test/ui/nll/user-annotations/closure-substs.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/closure-substs.rs:8:16
+  --> $DIR/closure-substs.rs:6:16
    |
 LL | fn foo<'a>() {
    |        -- lifetime `'a` defined here
@@ -8,7 +8,7 @@ LL |         return x;
    |                ^ returning this value requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/closure-substs.rs:15:16
+  --> $DIR/closure-substs.rs:13:16
    |
 LL |     |x: &i32| -> &'static i32 {
    |         - let's call the lifetime of this reference `'1`
@@ -16,7 +16,7 @@ LL |         return x;
    |                ^ returning this value requires that `'1` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/closure-substs.rs:22:9
+  --> $DIR/closure-substs.rs:20:9
    |
 LL | fn bar<'a>() {
    |        -- lifetime `'a` defined here
@@ -25,7 +25,7 @@ LL |         b(x);
    |         ^^^^ argument requires that `'a` must outlive `'static`
 
 error[E0521]: borrowed data escapes outside of closure
-  --> $DIR/closure-substs.rs:29:9
+  --> $DIR/closure-substs.rs:27:9
    |
 LL |     |x: &i32, b: fn(&'static i32)| {
    |      -  - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.base.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.base.stderr
deleted file mode 100644
index ba17994b437..00000000000
--- a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0759]: `fn` parameter has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/constant-in-expr-inherent-1.rs:12:5
-   |
-LL | fn foo<'a>(_: &'a u32) -> &'static u32 {
-   |               ------- this data with lifetime `'a`...
-LL |     <Foo<'a>>::C
-   |     ^^^^^^^^^^^^ ...is used and required to live as long as `'static` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0759`.
diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.rs b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.rs
index 0bd316aa84c..e3a8a5f58df 100644
--- a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.rs
+++ b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Foo<'a> { x: &'a u32 }
 
 impl<'a> Foo<'a> {
diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr
index 0399d5f893d..c39301588ac 100644
--- a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.nll.stderr
+++ b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/constant-in-expr-inherent-1.rs:12:5
+  --> $DIR/constant-in-expr-inherent-1.rs:8:5
    |
 LL | fn foo<'a>(_: &'a u32) -> &'static u32 {
    |        -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.base.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.base.stderr
deleted file mode 100644
index 61efa879fc0..00000000000
--- a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.base.stderr
+++ /dev/null
@@ -1,16 +0,0 @@
-error[E0312]: lifetime of reference outlives lifetime of borrowed content...
-  --> $DIR/constant-in-expr-normalize.rs:22:5
-   |
-LL |     <() as Foo<'a>>::C
-   |     ^^^^^^^^^^^^^^^^^^
-   |
-   = note: ...the reference is valid for the static lifetime...
-note: ...but the borrowed content is only valid for the lifetime `'a` as defined here
-  --> $DIR/constant-in-expr-normalize.rs:21:8
-   |
-LL | fn foo<'a>(_: &'a u32) -> &'static u32 {
-   |        ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0312`.
diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.rs b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.rs
index 262f0ae318f..b7095430d8b 100644
--- a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.rs
+++ b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Mirror {
     type Me;
 }
diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.stderr
index 4c1e6bee2aa..541a2cfaf29 100644
--- a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.nll.stderr
+++ b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/constant-in-expr-normalize.rs:22:5
+  --> $DIR/constant-in-expr-normalize.rs:18:5
    |
 LL | fn foo<'a>(_: &'a u32) -> &'static u32 {
    |        -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.base.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.base.stderr
deleted file mode 100644
index 93f7156e557..00000000000
--- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.base.stderr
+++ /dev/null
@@ -1,16 +0,0 @@
-error[E0312]: lifetime of reference outlives lifetime of borrowed content...
-  --> $DIR/constant-in-expr-trait-item-1.rs:14:5
-   |
-LL |     <() as Foo<'a>>::C
-   |     ^^^^^^^^^^^^^^^^^^
-   |
-   = note: ...the reference is valid for the static lifetime...
-note: ...but the borrowed content is only valid for the lifetime `'a` as defined here
-  --> $DIR/constant-in-expr-trait-item-1.rs:13:8
-   |
-LL | fn foo<'a>(_: &'a u32) -> &'static u32 {
-   |        ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0312`.
diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.rs b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.rs
index 512edb501c4..e0400b2cc02 100644
--- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.rs
+++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Foo<'a> {
     const C: &'a u32;
 }
diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.stderr
index 990d0ae385f..ea0fcb6d634 100644
--- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.nll.stderr
+++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/constant-in-expr-trait-item-1.rs:14:5
+  --> $DIR/constant-in-expr-trait-item-1.rs:10:5
    |
 LL | fn foo<'a>(_: &'a u32) -> &'static u32 {
    |        -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.base.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.base.stderr
deleted file mode 100644
index f43ade38937..00000000000
--- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.base.stderr
+++ /dev/null
@@ -1,16 +0,0 @@
-error[E0312]: lifetime of reference outlives lifetime of borrowed content...
-  --> $DIR/constant-in-expr-trait-item-2.rs:14:5
-   |
-LL |     <T as Foo<'a>>::C
-   |     ^^^^^^^^^^^^^^^^^
-   |
-   = note: ...the reference is valid for the static lifetime...
-note: ...but the borrowed content is only valid for the lifetime `'a` as defined here
-  --> $DIR/constant-in-expr-trait-item-2.rs:13:8
-   |
-LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 {
-   |        ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0312`.
diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs
index b3dfbd984eb..73c4e577b05 100644
--- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs
+++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Foo<'a> {
     const C: &'a u32;
 }
diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.stderr
index 8c0430f1e09..ff549f1d88b 100644
--- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.nll.stderr
+++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/constant-in-expr-trait-item-2.rs:14:5
+  --> $DIR/constant-in-expr-trait-item-2.rs:10:5
    |
 LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 {
    |        -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.base.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.base.stderr
deleted file mode 100644
index e9393aa05ab..00000000000
--- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.base.stderr
+++ /dev/null
@@ -1,28 +0,0 @@
-error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
-  --> $DIR/constant-in-expr-trait-item-3.rs:14:5
-   |
-LL |     T::C
-   |     ^^^^
-   |
-note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
-  --> $DIR/constant-in-expr-trait-item-3.rs:13:8
-   |
-LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 {
-   |        ^^
-note: ...so that the types are compatible
-  --> $DIR/constant-in-expr-trait-item-3.rs:14:5
-   |
-LL |     T::C
-   |     ^^^^
-   = note: expected `Foo<'_>`
-              found `Foo<'a>`
-   = note: but, the lifetime must be valid for the static lifetime...
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/constant-in-expr-trait-item-3.rs:14:5
-   |
-LL |     T::C
-   |     ^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.rs b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.rs
index 6e78d94c2f6..567e31ef936 100644
--- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.rs
+++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Foo<'a> {
     const C: &'a u32;
 }
diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr
index cbcaf042f05..7f160d8e398 100644
--- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.nll.stderr
+++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/constant-in-expr-trait-item-3.rs:14:5
+  --> $DIR/constant-in-expr-trait-item-3.rs:10:5
    |
 LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 {
    |        -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/user-annotations/dump-adt-brace-struct.rs b/src/test/ui/nll/user-annotations/dump-adt-brace-struct.rs
index 45f56836d18..ccda9129dab 100644
--- a/src/test/ui/nll/user-annotations/dump-adt-brace-struct.rs
+++ b/src/test/ui/nll/user-annotations/dump-adt-brace-struct.rs
@@ -4,7 +4,6 @@
 // compile-flags:-Zverbose
 
 #![allow(warnings)]
-#![feature(nll)]
 #![feature(rustc_attrs)]
 
 struct SomeStruct<T> { t: T }
diff --git a/src/test/ui/nll/user-annotations/dump-adt-brace-struct.stderr b/src/test/ui/nll/user-annotations/dump-adt-brace-struct.stderr
index ae123b8ab54..5860621909c 100644
--- a/src/test/ui/nll/user-annotations/dump-adt-brace-struct.stderr
+++ b/src/test/ui/nll/user-annotations/dump-adt-brace-struct.stderr
@@ -1,5 +1,5 @@
 error: user substs: UserSubsts { substs: [&ReStatic u32], user_self_ty: None }
-  --> $DIR/dump-adt-brace-struct.rs:20:5
+  --> $DIR/dump-adt-brace-struct.rs:19:5
    |
 LL |     SomeStruct::<&'static u32> { t: &22 };
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/nll/user-annotations/dump-fn-method.rs b/src/test/ui/nll/user-annotations/dump-fn-method.rs
index b689f18c225..148d63d848f 100644
--- a/src/test/ui/nll/user-annotations/dump-fn-method.rs
+++ b/src/test/ui/nll/user-annotations/dump-fn-method.rs
@@ -3,7 +3,6 @@
 
 // compile-flags:-Zverbose
 
-#![feature(nll)]
 #![feature(rustc_attrs)]
 
 // Note: we reference the names T and U in the comments below.
diff --git a/src/test/ui/nll/user-annotations/dump-fn-method.stderr b/src/test/ui/nll/user-annotations/dump-fn-method.stderr
index 631bcde4ee8..d139efa888f 100644
--- a/src/test/ui/nll/user-annotations/dump-fn-method.stderr
+++ b/src/test/ui/nll/user-annotations/dump-fn-method.stderr
@@ -1,23 +1,23 @@
 error: user substs: UserSubsts { substs: [&ReStatic u32], user_self_ty: None }
-  --> $DIR/dump-fn-method.rs:30:13
+  --> $DIR/dump-fn-method.rs:29:13
    |
 LL |     let x = foo::<&'static u32>;
    |             ^^^^^^^^^^^^^^^^^^^
 
 error: user substs: UserSubsts { substs: [^0, u32, ^1], user_self_ty: None }
-  --> $DIR/dump-fn-method.rs:36:13
+  --> $DIR/dump-fn-method.rs:35:13
    |
 LL |     let x = <_ as Bazoom<u32>>::method::<_>;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: user substs: UserSubsts { substs: [u8, &ReStatic u16, u32], user_self_ty: None }
-  --> $DIR/dump-fn-method.rs:45:13
+  --> $DIR/dump-fn-method.rs:44:13
    |
 LL |     let x = <u8 as Bazoom<&'static u16>>::method::<u32>;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: user substs: UserSubsts { substs: [^0, ^1, u32], user_self_ty: None }
-  --> $DIR/dump-fn-method.rs:53:5
+  --> $DIR/dump-fn-method.rs:52:5
    |
 LL |     y.method::<u32>(44, 66);
    |     ^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/nll/user-annotations/inherent-associated-constants.rs b/src/test/ui/nll/user-annotations/inherent-associated-constants.rs
index 2490187605a..fe2641fd63b 100644
--- a/src/test/ui/nll/user-annotations/inherent-associated-constants.rs
+++ b/src/test/ui/nll/user-annotations/inherent-associated-constants.rs
@@ -1,5 +1,3 @@
-#![feature(nll)]
-
 struct A<'a>(&'a ());
 
 impl A<'static> {
diff --git a/src/test/ui/nll/user-annotations/inherent-associated-constants.stderr b/src/test/ui/nll/user-annotations/inherent-associated-constants.stderr
index 76845469898..ffbfc40f537 100644
--- a/src/test/ui/nll/user-annotations/inherent-associated-constants.stderr
+++ b/src/test/ui/nll/user-annotations/inherent-associated-constants.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/inherent-associated-constants.rs:10:5
+  --> $DIR/inherent-associated-constants.rs:8:5
    |
 LL | fn non_wf_associated_const<'a>(x: i32) {
    |                            -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/user-annotations/issue-54124.rs b/src/test/ui/nll/user-annotations/issue-54124.rs
index e1de67aa938..5ae03c89406 100644
--- a/src/test/ui/nll/user-annotations/issue-54124.rs
+++ b/src/test/ui/nll/user-annotations/issue-54124.rs
@@ -1,5 +1,3 @@
-#![feature(nll)]
-
 fn test<'a>() {
     let _:fn(&()) = |_:&'a ()| {}; //~ ERROR lifetime may not live long enough
     //~^ ERROR lifetime may not live long enough
diff --git a/src/test/ui/nll/user-annotations/issue-54124.stderr b/src/test/ui/nll/user-annotations/issue-54124.stderr
index 6cfccf7cb69..2556af2dd7d 100644
--- a/src/test/ui/nll/user-annotations/issue-54124.stderr
+++ b/src/test/ui/nll/user-annotations/issue-54124.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-54124.rs:4:22
+  --> $DIR/issue-54124.rs:2:22
    |
 LL | fn test<'a>() {
    |         -- lifetime `'a` defined here
@@ -9,7 +9,7 @@ LL |     let _:fn(&()) = |_:&'a ()| {};
    |                      requires that `'1` must outlive `'a`
 
 error: lifetime may not live long enough
-  --> $DIR/issue-54124.rs:4:22
+  --> $DIR/issue-54124.rs:2:22
    |
 LL | fn test<'a>() {
    |         -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.rs b/src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.rs
index 3d042d442d5..c71937a5021 100644
--- a/src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.rs
+++ b/src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.rs
@@ -7,8 +7,6 @@
 // 2. the bindings (if any) nested within the pattern on the left-hand
 //    side (and here, the type-constraint is *invariant*).
 
-#![feature(nll)]
-
 #![allow(dead_code, unused_mut)]
 type PairUncoupled<'a, 'b, T> = (&'a T, &'b T);
 type PairCoupledRegions<'a, T> = (&'a T, &'a T);
diff --git a/src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.stderr b/src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.stderr
index 5929707e41e..8399ef04e83 100644
--- a/src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.stderr
+++ b/src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-55748-pat-types-constrain-bindings.rs:35:5
+  --> $DIR/issue-55748-pat-types-constrain-bindings.rs:33:5
    |
 LL | fn coupled_regions_lhs<'a>(_x: &'a u32, s: &'static u32) -> &'static u32 {
    |                        -- lifetime `'a` defined here
@@ -8,7 +8,7 @@ LL |     y
    |     ^ returning this value requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/issue-55748-pat-types-constrain-bindings.rs:49:5
+  --> $DIR/issue-55748-pat-types-constrain-bindings.rs:47:5
    |
 LL | fn coupled_types_lhs<'a>(_x: &'a u32, s: &'static u32) -> &'static u32 {
    |                      -- lifetime `'a` defined here
@@ -17,7 +17,7 @@ LL |     y
    |     ^ returning this value requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/issue-55748-pat-types-constrain-bindings.rs:62:5
+  --> $DIR/issue-55748-pat-types-constrain-bindings.rs:60:5
    |
 LL | fn coupled_wilds_lhs<'a>(_x: &'a u32, s: &'static u32) -> &'static u32 {
    |                      -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/user-annotations/issue-57731-ascibed-coupled-types.rs b/src/test/ui/nll/user-annotations/issue-57731-ascibed-coupled-types.rs
index f4969bb4067..9b3ec702c75 100644
--- a/src/test/ui/nll/user-annotations/issue-57731-ascibed-coupled-types.rs
+++ b/src/test/ui/nll/user-annotations/issue-57731-ascibed-coupled-types.rs
@@ -1,7 +1,7 @@
 // Check that repeated type variables are correctly handled
 
 #![allow(unused)]
-#![feature(nll, type_ascription)]
+#![feature(type_ascription)]
 
 type PairUncoupled<'a, 'b, T> = (&'a T, &'b T);
 type PairCoupledTypes<T> = (T, T);
diff --git a/src/test/ui/nll/user-annotations/method-ufcs-inherent-1.rs b/src/test/ui/nll/user-annotations/method-ufcs-inherent-1.rs
index b7292c0acbe..7bfed61d40a 100644
--- a/src/test/ui/nll/user-annotations/method-ufcs-inherent-1.rs
+++ b/src/test/ui/nll/user-annotations/method-ufcs-inherent-1.rs
@@ -1,5 +1,3 @@
-#![feature(nll)]
-
 // Check that substitutions given on the self type (here, `A`) carry
 // through to NLL.
 
diff --git a/src/test/ui/nll/user-annotations/method-ufcs-inherent-1.stderr b/src/test/ui/nll/user-annotations/method-ufcs-inherent-1.stderr
index 70e1cda004b..94861babd6f 100644
--- a/src/test/ui/nll/user-annotations/method-ufcs-inherent-1.stderr
+++ b/src/test/ui/nll/user-annotations/method-ufcs-inherent-1.stderr
@@ -1,5 +1,5 @@
 error[E0597]: `v` does not live long enough
-  --> $DIR/method-ufcs-inherent-1.rs:16:26
+  --> $DIR/method-ufcs-inherent-1.rs:14:26
    |
 LL | fn foo<'a>() {
    |        -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/user-annotations/method-ufcs-inherent-3.rs b/src/test/ui/nll/user-annotations/method-ufcs-inherent-3.rs
index 24d83c468f4..7ddb1336082 100644
--- a/src/test/ui/nll/user-annotations/method-ufcs-inherent-3.rs
+++ b/src/test/ui/nll/user-annotations/method-ufcs-inherent-3.rs
@@ -1,5 +1,3 @@
-#![feature(nll)]
-
 // Check that inherent methods invoked with `<T>::new` style
 // carry their annotations through to NLL.
 
diff --git a/src/test/ui/nll/user-annotations/method-ufcs-inherent-3.stderr b/src/test/ui/nll/user-annotations/method-ufcs-inherent-3.stderr
index 50e4fb25991..4ad61dc81c4 100644
--- a/src/test/ui/nll/user-annotations/method-ufcs-inherent-3.stderr
+++ b/src/test/ui/nll/user-annotations/method-ufcs-inherent-3.stderr
@@ -1,5 +1,5 @@
 error[E0597]: `v` does not live long enough
-  --> $DIR/method-ufcs-inherent-3.rs:16:26
+  --> $DIR/method-ufcs-inherent-3.rs:14:26
    |
 LL | fn foo<'a>() {
    |        -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/user-annotations/patterns.rs b/src/test/ui/nll/user-annotations/patterns.rs
index 8c8e61cd6fb..1f635d7f50c 100644
--- a/src/test/ui/nll/user-annotations/patterns.rs
+++ b/src/test/ui/nll/user-annotations/patterns.rs
@@ -1,7 +1,5 @@
 // Test that various patterns also enforce types.
 
-#![feature(nll)]
-
 fn variable_no_initializer() {
     let x = 22;
     let y: &'static u32;
diff --git a/src/test/ui/nll/user-annotations/patterns.stderr b/src/test/ui/nll/user-annotations/patterns.stderr
index 7ebd0ae227a..60d6e6db363 100644
--- a/src/test/ui/nll/user-annotations/patterns.stderr
+++ b/src/test/ui/nll/user-annotations/patterns.stderr
@@ -1,5 +1,5 @@
 error[E0597]: `x` does not live long enough
-  --> $DIR/patterns.rs:8:9
+  --> $DIR/patterns.rs:6:9
    |
 LL |     let y: &'static u32;
    |            ------------ type annotation requires that `x` is borrowed for `'static`
@@ -9,7 +9,7 @@ LL | }
    | - `x` dropped here while still borrowed
 
 error[E0597]: `x` does not live long enough
-  --> $DIR/patterns.rs:16:9
+  --> $DIR/patterns.rs:14:9
    |
 LL |     let (y, z): (&'static u32, &'static u32);
    |                 ---------------------------- type annotation requires that `x` is borrowed for `'static`
@@ -19,7 +19,7 @@ LL | }
    | - `x` dropped here while still borrowed
 
 error[E0597]: `x` does not live long enough
-  --> $DIR/patterns.rs:22:13
+  --> $DIR/patterns.rs:20:13
    |
 LL |     let y = &x;
    |             ^^ borrowed value does not live long enough
@@ -30,7 +30,7 @@ LL | }
    | - `x` dropped here while still borrowed
 
 error[E0597]: `x` does not live long enough
-  --> $DIR/patterns.rs:41:9
+  --> $DIR/patterns.rs:39:9
    |
 LL |     let Single { value: y }: Single<&'static u32>;
    |                              -------------------- type annotation requires that `x` is borrowed for `'static`
@@ -40,7 +40,7 @@ LL | }
    | - `x` dropped here while still borrowed
 
 error[E0597]: `x` does not live long enough
-  --> $DIR/patterns.rs:53:10
+  --> $DIR/patterns.rs:51:10
    |
 LL |     let Single2 { value: mut _y }: Single2<StaticU32>;
    |                                    ------------------ type annotation requires that `x` is borrowed for `'static`
@@ -50,7 +50,7 @@ LL | }
    | - `x` dropped here while still borrowed
 
 error[E0597]: `x` does not live long enough
-  --> $DIR/patterns.rs:58:27
+  --> $DIR/patterns.rs:56:27
    |
 LL |     let y: &'static u32 = &x;
    |            ------------   ^^ borrowed value does not live long enough
@@ -60,7 +60,7 @@ LL | }
    | - `x` dropped here while still borrowed
 
 error[E0597]: `x` does not live long enough
-  --> $DIR/patterns.rs:63:27
+  --> $DIR/patterns.rs:61:27
    |
 LL |     let _: &'static u32 = &x;
    |            ------------   ^^ borrowed value does not live long enough
@@ -71,7 +71,7 @@ LL | }
    | - `x` dropped here while still borrowed
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/patterns.rs:65:41
+  --> $DIR/patterns.rs:63:41
    |
 LL |     let _: Vec<&'static String> = vec![&String::new()];
    |            --------------------         ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement
@@ -80,7 +80,7 @@ LL |     let _: Vec<&'static String> = vec![&String::new()];
    |            type annotation requires that borrow lasts for `'static`
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/patterns.rs:68:52
+  --> $DIR/patterns.rs:66:52
    |
 LL |     let (_, a): (Vec<&'static String>, _) = (vec![&String::new()], 44);
    |                 -------------------------          ^^^^^^^^^^^^^      - temporary value is freed at the end of this statement
@@ -89,7 +89,7 @@ LL |     let (_, a): (Vec<&'static String>, _) = (vec![&String::new()], 44);
    |                 type annotation requires that borrow lasts for `'static`
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/patterns.rs:71:53
+  --> $DIR/patterns.rs:69:53
    |
 LL |     let (_a, b): (Vec<&'static String>, _) = (vec![&String::new()], 44);
    |                  -------------------------          ^^^^^^^^^^^^^      - temporary value is freed at the end of this statement
@@ -98,7 +98,7 @@ LL |     let (_a, b): (Vec<&'static String>, _) = (vec![&String::new()], 44);
    |                  type annotation requires that borrow lasts for `'static`
 
 error[E0597]: `x` does not live long enough
-  --> $DIR/patterns.rs:77:40
+  --> $DIR/patterns.rs:75:40
    |
 LL |     let (_, _): (&'static u32, u32) = (&x, 44);
    |                 -------------------    ^^ borrowed value does not live long enough
@@ -108,7 +108,7 @@ LL | }
    | - `x` dropped here while still borrowed
 
 error[E0597]: `x` does not live long enough
-  --> $DIR/patterns.rs:82:40
+  --> $DIR/patterns.rs:80:40
    |
 LL |     let (y, _): (&'static u32, u32) = (&x, 44);
    |                 -------------------    ^^ borrowed value does not live long enough
@@ -118,7 +118,7 @@ LL | }
    | - `x` dropped here while still borrowed
 
 error[E0597]: `x` does not live long enough
-  --> $DIR/patterns.rs:87:69
+  --> $DIR/patterns.rs:85:69
    |
 LL |     let Single { value: y }: Single<&'static u32> = Single { value: &x };
    |                              --------------------                   ^^ borrowed value does not live long enough
@@ -128,7 +128,7 @@ LL | }
    | - `x` dropped here while still borrowed
 
 error[E0597]: `x` does not live long enough
-  --> $DIR/patterns.rs:92:69
+  --> $DIR/patterns.rs:90:69
    |
 LL |     let Single { value: _ }: Single<&'static u32> = Single { value: &x };
    |                              --------------------                   ^^ borrowed value does not live long enough
@@ -138,7 +138,7 @@ LL | }
    | - `x` dropped here while still borrowed
 
 error[E0597]: `x` does not live long enough
-  --> $DIR/patterns.rs:100:17
+  --> $DIR/patterns.rs:98:17
    |
 LL |     let Double { value1: _, value2: _ }: Double<&'static u32> = Double {
    |                                          -------------------- type annotation requires that `x` is borrowed for `'static`
@@ -149,7 +149,7 @@ LL | }
    | - `x` dropped here while still borrowed
 
 error: lifetime may not live long enough
-  --> $DIR/patterns.rs:113:5
+  --> $DIR/patterns.rs:111:5
    |
 LL | fn static_to_a_to_static_through_variable<'a>(x: &'a u32) -> &'static u32 {
    |                                           -- lifetime `'a` defined here
@@ -158,7 +158,7 @@ LL |     y
    |     ^ returning this value requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/patterns.rs:125:5
+  --> $DIR/patterns.rs:123:5
    |
 LL | fn static_to_a_to_static_through_tuple<'a>(x: &'a u32) -> &'static u32 {
    |                                        -- lifetime `'a` defined here
@@ -167,7 +167,7 @@ LL |     y
    |     ^ returning this value requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/patterns.rs:130:5
+  --> $DIR/patterns.rs:128:5
    |
 LL | fn static_to_a_to_static_through_struct<'a>(_x: &'a u32) -> &'static u32 {
    |                                         -- lifetime `'a` defined here
@@ -176,7 +176,7 @@ LL |     y
    |     ^ returning this value requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/patterns.rs:134:18
+  --> $DIR/patterns.rs:132:18
    |
 LL | fn a_to_static_then_static<'a>(x: &'a u32) -> &'static u32 {
    |                            -- lifetime `'a` defined here
diff --git a/src/test/ui/nll/user-annotations/wf-self-type.rs b/src/test/ui/nll/user-annotations/wf-self-type.rs
index d8caf4693b5..539226aabd7 100644
--- a/src/test/ui/nll/user-annotations/wf-self-type.rs
+++ b/src/test/ui/nll/user-annotations/wf-self-type.rs
@@ -1,5 +1,3 @@
-#![feature(nll)]
-
 struct Foo<'a, 'b: 'a>(&'a &'b ());
 
 impl<'a, 'b> Foo<'a, 'b> {
diff --git a/src/test/ui/nll/user-annotations/wf-self-type.stderr b/src/test/ui/nll/user-annotations/wf-self-type.stderr
index 902b4c68755..1d3ae7cfbd7 100644
--- a/src/test/ui/nll/user-annotations/wf-self-type.stderr
+++ b/src/test/ui/nll/user-annotations/wf-self-type.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/wf-self-type.rs:12:5
+  --> $DIR/wf-self-type.rs:10:5
    |
 LL | pub fn foo<'a, 'b>(u: &'b ()) -> &'a () {
    |            --  -- lifetime `'b` defined here
diff --git a/src/test/ui/nll/where_clauses_in_functions.rs b/src/test/ui/nll/where_clauses_in_functions.rs
index 0d35c09b8ef..826065d0290 100644
--- a/src/test/ui/nll/where_clauses_in_functions.rs
+++ b/src/test/ui/nll/where_clauses_in_functions.rs
@@ -1,5 +1,3 @@
-// compile-flags: -Zborrowck=mir
-
 #![allow(dead_code)]
 
 fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32)
diff --git a/src/test/ui/nll/where_clauses_in_functions.stderr b/src/test/ui/nll/where_clauses_in_functions.stderr
index 1badb7d753b..afb25e3bc69 100644
--- a/src/test/ui/nll/where_clauses_in_functions.stderr
+++ b/src/test/ui/nll/where_clauses_in_functions.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/where_clauses_in_functions.rs:13:5
+  --> $DIR/where_clauses_in_functions.rs:11:5
    |
 LL | fn bar<'a, 'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
    |        --  -- lifetime `'b` defined here
diff --git a/src/test/ui/nll/where_clauses_in_structs.rs b/src/test/ui/nll/where_clauses_in_structs.rs
index 8bc6b2e4a4f..fae5d3811ec 100644
--- a/src/test/ui/nll/where_clauses_in_structs.rs
+++ b/src/test/ui/nll/where_clauses_in_structs.rs
@@ -1,5 +1,3 @@
-// compile-flags: -Z borrowck=mir
-
 #![allow(dead_code)]
 
 use std::cell::Cell;
diff --git a/src/test/ui/nll/where_clauses_in_structs.stderr b/src/test/ui/nll/where_clauses_in_structs.stderr
index b88c90e8f54..c46cfcb4134 100644
--- a/src/test/ui/nll/where_clauses_in_structs.stderr
+++ b/src/test/ui/nll/where_clauses_in_structs.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/where_clauses_in_structs.rs:13:11
+  --> $DIR/where_clauses_in_structs.rs:11:11
    |
 LL | fn bar<'a, 'b>(x: Cell<&'a u32>, y: Cell<&'b u32>) {
    |        --  -- lifetime `'b` defined here
diff --git a/src/test/ui/object-lifetime/object-lifetime-default-elision.base.stderr b/src/test/ui/object-lifetime/object-lifetime-default-elision.base.stderr
deleted file mode 100644
index c402d1fefad..00000000000
--- a/src/test/ui/object-lifetime/object-lifetime-default-elision.base.stderr
+++ /dev/null
@@ -1,61 +0,0 @@
-error[E0495]: cannot infer an appropriate lifetime for automatic coercion due to conflicting requirements
-  --> $DIR/object-lifetime-default-elision.rs:75:5
-   |
-LL |     ss
-   |     ^^
-   |
-note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
-  --> $DIR/object-lifetime-default-elision.rs:58:10
-   |
-LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait {
-   |          ^^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/object-lifetime-default-elision.rs:75:5
-   |
-LL |     ss
-   |     ^^
-note: but, the lifetime must be valid for the lifetime `'b` as defined here...
-  --> $DIR/object-lifetime-default-elision.rs:58:13
-   |
-LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait {
-   |             ^^
-note: ...so that the types are compatible
-  --> $DIR/object-lifetime-default-elision.rs:75:5
-   |
-LL |     ss
-   |     ^^
-   = note: expected `&'b (dyn SomeTrait + 'b)`
-              found `&dyn SomeTrait`
-
-error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
-  --> $DIR/object-lifetime-default-elision.rs:75:5
-   |
-LL |     ss
-   |     ^^
-   |
-note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
-  --> $DIR/object-lifetime-default-elision.rs:58:10
-   |
-LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait {
-   |          ^^
-note: ...so that the declared lifetime parameter bounds are satisfied
-  --> $DIR/object-lifetime-default-elision.rs:75:5
-   |
-LL |     ss
-   |     ^^
-note: but, the lifetime must be valid for the lifetime `'b` as defined here...
-  --> $DIR/object-lifetime-default-elision.rs:58:13
-   |
-LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait {
-   |             ^^
-note: ...so that the types are compatible
-  --> $DIR/object-lifetime-default-elision.rs:75:5
-   |
-LL |     ss
-   |     ^^
-   = note: expected `&'b (dyn SomeTrait + 'b)`
-              found `&dyn SomeTrait`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/object-lifetime/object-lifetime-default-elision.rs b/src/test/ui/object-lifetime/object-lifetime-default-elision.rs
index 16b4df7bad5..f7c0261cfbb 100644
--- a/src/test/ui/object-lifetime/object-lifetime-default-elision.rs
+++ b/src/test/ui/object-lifetime/object-lifetime-default-elision.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 // Test various cases where the old rules under lifetime elision
 // yield slightly different results than the new rules.
 
@@ -73,9 +69,7 @@ fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait {
     // which fails to type check.
 
     ss
-        //[base]~^ ERROR cannot infer
-        //[base]~| ERROR cannot infer
-        //[nll]~^^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/object-lifetime/object-lifetime-default-elision.nll.stderr b/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr
index 49bbadf7224..61e96f59fed 100644
--- a/src/test/ui/object-lifetime/object-lifetime-default-elision.nll.stderr
+++ b/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/object-lifetime-default-elision.rs:75:5
+  --> $DIR/object-lifetime-default-elision.rs:71:5
    |
 LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait {
    |          -- -- lifetime `'b` defined here
diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.base.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.base.stderr
deleted file mode 100644
index 5a8cba175e9..00000000000
--- a/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.base.stderr
+++ /dev/null
@@ -1,35 +0,0 @@
-error[E0759]: `ss` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/object-lifetime-default-from-box-error.rs:22:5
-   |
-LL | fn load(ss: &mut SomeStruct) -> Box<dyn SomeTrait> {
-   |             --------------- this data with an anonymous lifetime `'_`...
-...
-LL |     ss.r
-   |     ^^^^ ...is used and required to live as long as `'static` here
-   |
-note: `'static` lifetime requirement introduced by the return type
-  --> $DIR/object-lifetime-default-from-box-error.rs:18:37
-   |
-LL | fn load(ss: &mut SomeStruct) -> Box<dyn SomeTrait> {
-   |                                     ^^^^^^^^^^^^^ `'static` requirement introduced here
-...
-LL |     ss.r
-   |     ---- because of this returned expression
-help: to declare that the trait object captures data from argument `ss`, you can add an explicit `'_` lifetime bound
-   |
-LL | fn load(ss: &mut SomeStruct) -> Box<dyn SomeTrait + '_> {
-   |                                                   ++++
-
-error[E0621]: explicit lifetime required in the type of `ss`
-  --> $DIR/object-lifetime-default-from-box-error.rs:38:12
-   |
-LL | fn store1<'b>(ss: &mut SomeStruct, b: Box<dyn SomeTrait+'b>) {
-   |                   --------------- help: add explicit lifetime `'b` to the type of `ss`: `&mut SomeStruct<'b>`
-...
-LL |     ss.r = b;
-   |            ^ lifetime `'b` required
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0621, E0759.
-For more information about an error, try `rustc --explain E0621`.
diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.rs b/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.rs
index 1cb9834913c..f9b3e2238d3 100644
--- a/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.rs
+++ b/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 // Test various cases where the defaults should lead to errors being
 // reported.
 
@@ -20,9 +16,8 @@ fn load(ss: &mut SomeStruct) -> Box<dyn SomeTrait> {
     // is illegal.
 
     ss.r
-    //[base]~^ ERROR E0759
-    //[nll]~^^ ERROR lifetime may not live long enough
-    //[nll]~| ERROR cannot move out of
+    //~^ ERROR lifetime may not live long enough
+    //~| ERROR cannot move out of
 }
 
 fn store(ss: &mut SomeStruct, b: Box<dyn SomeTrait>) {
diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.nll.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.stderr
index 7907813f267..15b36925c47 100644
--- a/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.nll.stderr
+++ b/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/object-lifetime-default-from-box-error.rs:22:5
+  --> $DIR/object-lifetime-default-from-box-error.rs:18:5
    |
 LL | fn load(ss: &mut SomeStruct) -> Box<dyn SomeTrait> {
    |         -- has type `&mut SomeStruct<'1>`
@@ -13,13 +13,13 @@ LL | fn load(ss: &mut SomeStruct) -> Box<dyn SomeTrait + '_> {
    |                                                   ++++
 
 error[E0507]: cannot move out of `ss.r` which is behind a mutable reference
-  --> $DIR/object-lifetime-default-from-box-error.rs:22:5
+  --> $DIR/object-lifetime-default-from-box-error.rs:18:5
    |
 LL |     ss.r
    |     ^^^^ move occurs because `ss.r` has type `Box<dyn SomeTrait>`, which does not implement the `Copy` trait
 
 error[E0621]: explicit lifetime required in the type of `ss`
-  --> $DIR/object-lifetime-default-from-box-error.rs:38:5
+  --> $DIR/object-lifetime-default-from-box-error.rs:33:5
    |
 LL | fn store1<'b>(ss: &mut SomeStruct, b: Box<dyn SomeTrait+'b>) {
    |                   --------------- help: add explicit lifetime `'b` to the type of `ss`: `&mut SomeStruct<'b>`
diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.base.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.base.stderr
deleted file mode 100644
index 7e88aa32357..00000000000
--- a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.base.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/object-lifetime-default-from-rptr-box-error.rs:19:12
-   |
-LL |     ss.t = t;
-   |            ^ lifetime mismatch
-   |
-   = note: expected reference `&'a Box<(dyn Test + 'static)>`
-              found reference `&'a Box<(dyn Test + 'a)>`
-note: the lifetime `'a` as defined here...
-  --> $DIR/object-lifetime-default-from-rptr-box-error.rs:18:6
-   |
-LL | fn c<'a>(t: &'a Box<dyn Test+'a>, mut ss: SomeStruct<'a>) {
-   |      ^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.rs b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.rs
index 8cdd64be193..de79eee6a7d 100644
--- a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.rs
+++ b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 // Test that the lifetime from the enclosing `&` is "inherited"
 // through the `Box` struct.
 
@@ -17,8 +13,7 @@ struct SomeStruct<'a> {
 
 fn c<'a>(t: &'a Box<dyn Test+'a>, mut ss: SomeStruct<'a>) {
     ss.t = t;
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.nll.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.stderr
index a07cc0718f1..7d6f9f39d13 100644
--- a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.nll.stderr
+++ b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/object-lifetime-default-from-rptr-box-error.rs:19:5
+  --> $DIR/object-lifetime-default-from-rptr-box-error.rs:15:5
    |
 LL | fn c<'a>(t: &'a Box<dyn Test+'a>, mut ss: SomeStruct<'a>) {
    |      -- lifetime `'a` defined here
diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.base.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.base.stderr
deleted file mode 100644
index b97a7d22549..00000000000
--- a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.base.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/object-lifetime-default-from-rptr-struct-error.rs:24:12
-   |
-LL |     ss.t = t;
-   |            ^ lifetime mismatch
-   |
-   = note: expected reference `&'a MyBox<(dyn Test + 'static)>`
-              found reference `&'a MyBox<(dyn Test + 'a)>`
-note: the lifetime `'a` as defined here...
-  --> $DIR/object-lifetime-default-from-rptr-struct-error.rs:23:6
-   |
-LL | fn c<'a>(t: &'a MyBox<dyn Test+'a>, mut ss: SomeStruct<'a>) {
-   |      ^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.rs b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.rs
index 2d9a148a389..877486e1557 100644
--- a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.rs
+++ b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 // Test that the lifetime from the enclosing `&` is "inherited"
 // through the `MyBox` struct.
 
@@ -22,8 +18,7 @@ struct MyBox<T:?Sized> {
 
 fn c<'a>(t: &'a MyBox<dyn Test+'a>, mut ss: SomeStruct<'a>) {
     ss.t = t;
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.nll.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.stderr
index 63d51b5c28c..2bc8e097859 100644
--- a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.nll.stderr
+++ b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/object-lifetime-default-from-rptr-struct-error.rs:24:5
+  --> $DIR/object-lifetime-default-from-rptr-struct-error.rs:20:5
    |
 LL | fn c<'a>(t: &'a MyBox<dyn Test+'a>, mut ss: SomeStruct<'a>) {
    |      -- lifetime `'a` defined here
diff --git a/src/test/ui/object-lifetime/object-lifetime-default-mybox.base.stderr b/src/test/ui/object-lifetime/object-lifetime-default-mybox.base.stderr
deleted file mode 100644
index 6a72fab307b..00000000000
--- a/src/test/ui/object-lifetime/object-lifetime-default-mybox.base.stderr
+++ /dev/null
@@ -1,31 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/object-lifetime-default-mybox.rs:31:5
-   |
-LL | fn load1<'a,'b>(a: &'a MyBox<dyn SomeTrait>,
-   |                    ------------------------ this parameter and the return type are declared with different lifetimes...
-LL |                 b: &'b MyBox<dyn SomeTrait>)
-LL |                 -> &'b MyBox<dyn SomeTrait>
-   |                    ------------------------
-LL | {
-LL |     a
-   |     ^ ...but data from `a` is returned here
-
-error[E0308]: mismatched types
-  --> $DIR/object-lifetime-default-mybox.rs:37:11
-   |
-LL |     load0(ss)
-   |           ^^ lifetime mismatch
-   |
-   = note: expected reference `&MyBox<(dyn SomeTrait + 'static)>`
-              found reference `&MyBox<(dyn SomeTrait + 'a)>`
-note: the lifetime `'a` as defined here...
-  --> $DIR/object-lifetime-default-mybox.rs:36:10
-   |
-LL | fn load2<'a>(ss: &MyBox<dyn SomeTrait + 'a>) -> MyBox<dyn SomeTrait + 'a> {
-   |          ^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0308, E0623.
-For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/object-lifetime/object-lifetime-default-mybox.rs b/src/test/ui/object-lifetime/object-lifetime-default-mybox.rs
index 874556dafeb..5e6e5e2c063 100644
--- a/src/test/ui/object-lifetime/object-lifetime-default-mybox.rs
+++ b/src/test/ui/object-lifetime/object-lifetime-default-mybox.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 // Test a "pass-through" object-lifetime-default that produces errors.
 
 #![allow(dead_code)]
@@ -29,14 +25,12 @@ fn load1<'a,'b>(a: &'a MyBox<dyn SomeTrait>,
                 -> &'b MyBox<dyn SomeTrait>
 {
     a
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn load2<'a>(ss: &MyBox<dyn SomeTrait + 'a>) -> MyBox<dyn SomeTrait + 'a> {
     load0(ss)
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR borrowed data escapes outside of function
+    //~^ ERROR borrowed data escapes outside of function
 }
 
 fn main() {
diff --git a/src/test/ui/object-lifetime/object-lifetime-default-mybox.nll.stderr b/src/test/ui/object-lifetime/object-lifetime-default-mybox.stderr
index aa454cb9931..a1ef0243e3a 100644
--- a/src/test/ui/object-lifetime/object-lifetime-default-mybox.nll.stderr
+++ b/src/test/ui/object-lifetime/object-lifetime-default-mybox.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/object-lifetime-default-mybox.rs:31:5
+  --> $DIR/object-lifetime-default-mybox.rs:27:5
    |
 LL | fn load1<'a,'b>(a: &'a MyBox<dyn SomeTrait>,
    |          -- -- lifetime `'b` defined here
@@ -12,7 +12,7 @@ LL |     a
    = help: consider adding the following bound: `'a: 'b`
 
 error[E0521]: borrowed data escapes outside of function
-  --> $DIR/object-lifetime-default-mybox.rs:37:5
+  --> $DIR/object-lifetime-default-mybox.rs:32:5
    |
 LL | fn load2<'a>(ss: &MyBox<dyn SomeTrait + 'a>) -> MyBox<dyn SomeTrait + 'a> {
    |          --  -- `ss` is a reference that is only valid in the function body
diff --git a/src/test/ui/object-lifetime/object-lifetime-default.rs b/src/test/ui/object-lifetime/object-lifetime-default.rs
index 379b92e6dc7..60b6629e694 100644
--- a/src/test/ui/object-lifetime/object-lifetime-default.rs
+++ b/src/test/ui/object-lifetime/object-lifetime-default.rs
@@ -1,5 +1,3 @@
-// ignore-compare-mode-nll
-
 #![feature(rustc_attrs)]
 
 #[rustc_object_lifetime_default]
diff --git a/src/test/ui/object-lifetime/object-lifetime-default.stderr b/src/test/ui/object-lifetime/object-lifetime-default.stderr
index f71c8cd0e0c..60cb98c8fd3 100644
--- a/src/test/ui/object-lifetime/object-lifetime-default.stderr
+++ b/src/test/ui/object-lifetime/object-lifetime-default.stderr
@@ -1,41 +1,41 @@
 error: BaseDefault
-  --> $DIR/object-lifetime-default.rs:6:1
+  --> $DIR/object-lifetime-default.rs:4:1
    |
 LL | struct A<T>(T);
    | ^^^^^^^^^^^^^^^
 
 error: BaseDefault
-  --> $DIR/object-lifetime-default.rs:9:1
+  --> $DIR/object-lifetime-default.rs:7:1
    |
 LL | struct B<'a,T>(&'a (), T);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: 'a
-  --> $DIR/object-lifetime-default.rs:12:1
+  --> $DIR/object-lifetime-default.rs:10:1
    |
 LL | struct C<'a,T:'a>(&'a T);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: Ambiguous
-  --> $DIR/object-lifetime-default.rs:15:1
+  --> $DIR/object-lifetime-default.rs:13:1
    |
 LL | struct D<'a,'b,T:'a+'b>(&'a T, &'b T);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: 'b
-  --> $DIR/object-lifetime-default.rs:18:1
+  --> $DIR/object-lifetime-default.rs:16:1
    |
 LL | struct E<'a,'b:'a,T:'b>(&'a T, &'b T);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: 'a,'b
-  --> $DIR/object-lifetime-default.rs:21:1
+  --> $DIR/object-lifetime-default.rs:19:1
    |
 LL | struct F<'a,'b,T:'a,U:'b>(&'a T, &'b U);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: 'a,Ambiguous
-  --> $DIR/object-lifetime-default.rs:24:1
+  --> $DIR/object-lifetime-default.rs:22:1
    |
 LL | struct G<'a,'b,T:'a,U:'a+'b>(&'a T, &'b U);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/parser/issues/issue-14303-fncall.full.stderr b/src/test/ui/parser/issues/issue-14303-fncall.full.stderr
index 02af61e8539..0c152516abc 100644
--- a/src/test/ui/parser/issues/issue-14303-fncall.full.stderr
+++ b/src/test/ui/parser/issues/issue-14303-fncall.full.stderr
@@ -1,5 +1,5 @@
 error[E0747]: type provided when a lifetime was expected
-  --> $DIR/issue-14303-fncall.rs:16:26
+  --> $DIR/issue-14303-fncall.rs:15:26
    |
 LL |         .collect::<Vec<S<_, 'a>>>();
    |                          ^
diff --git a/src/test/ui/parser/issues/issue-14303-fncall.generic_arg.stderr b/src/test/ui/parser/issues/issue-14303-fncall.generic_arg.stderr
index 9f3359b3f68..57181577600 100644
--- a/src/test/ui/parser/issues/issue-14303-fncall.generic_arg.stderr
+++ b/src/test/ui/parser/issues/issue-14303-fncall.generic_arg.stderr
@@ -1,5 +1,5 @@
 error[E0747]: inferred provided when a lifetime was expected
-  --> $DIR/issue-14303-fncall.rs:16:26
+  --> $DIR/issue-14303-fncall.rs:15:26
    |
 LL |         .collect::<Vec<S<_, 'a>>>();
    |                          ^
diff --git a/src/test/ui/parser/issues/issue-14303-fncall.rs b/src/test/ui/parser/issues/issue-14303-fncall.rs
index 976a79a59b1..afc4959f175 100644
--- a/src/test/ui/parser/issues/issue-14303-fncall.rs
+++ b/src/test/ui/parser/issues/issue-14303-fncall.rs
@@ -1,5 +1,4 @@
 // revisions: full generic_arg
-// compile-flags: -Zborrowck=mir
 // can't run rustfix because it doesn't handle multipart suggestions correctly
 // we need the above to avoid ast borrowck failure in recovered code
 #![cfg_attr(generic_arg, feature(generic_arg_infer))]
diff --git a/src/test/ui/parser/labeled-no-colon-expr.stderr b/src/test/ui/parser/labeled-no-colon-expr.stderr
index 26884dc5d74..5c9597c440c 100644
--- a/src/test/ui/parser/labeled-no-colon-expr.stderr
+++ b/src/test/ui/parser/labeled-no-colon-expr.stderr
@@ -47,6 +47,12 @@ error: expected `while`, `for`, `loop` or `{` after a label
    |
 LL |     'l4 0;
    |         ^ expected `while`, `for`, `loop` or `{` after a label
+   |
+help: consider removing the label
+   |
+LL -     'l4 0;
+LL +     0;
+   | 
 
 error: labeled expression must be followed by `:`
   --> $DIR/labeled-no-colon-expr.rs:8:9
diff --git a/src/test/ui/parser/recover-labeled-non-block-expr.fixed b/src/test/ui/parser/recover-labeled-non-block-expr.fixed
new file mode 100644
index 00000000000..fe546a71971
--- /dev/null
+++ b/src/test/ui/parser/recover-labeled-non-block-expr.fixed
@@ -0,0 +1,27 @@
+// run-rustfix
+#![feature(label_break_value)]
+fn main() {
+    let _ = 1 + 1; //~ ERROR expected `while`, `for`, `loop` or `{` after a label
+
+    match () { () => {}, }; //~ ERROR expected `while`, `for`, `loop` or `{` after a label
+    'label: { match () { () => break 'label, } }; //~ ERROR expected `while`, `for`, `loop` or `{` after a label
+    #[allow(unused_labels)]
+    'label: { match () { () => 'lp: loop { break 'lp 0 }, } }; //~ ERROR expected `while`, `for`, `loop` or `{` after a label
+
+    let x = 1;
+    let _i = 'label: { match x { //~ ERROR expected `while`, `for`, `loop` or `{` after a label
+        0 => 42,
+        1 if false => break 'label 17,
+        1 => {
+            if true {
+                break 'label 13
+            } else {
+                break 'label 0;
+            }
+        }
+        _ => 1,
+    } };
+
+    let other = 3;
+    let _val = 'label: { (1, if other == 3 { break 'label (2, 3) } else { other }) }; //~ ERROR expected `while`, `for`, `loop` or `{` after a label
+}
diff --git a/src/test/ui/parser/recover-labeled-non-block-expr.rs b/src/test/ui/parser/recover-labeled-non-block-expr.rs
index be92170acf0..35862e2eef9 100644
--- a/src/test/ui/parser/recover-labeled-non-block-expr.rs
+++ b/src/test/ui/parser/recover-labeled-non-block-expr.rs
@@ -1,5 +1,27 @@
+// run-rustfix
+#![feature(label_break_value)]
 fn main() {
-    'label: 1 + 1; //~ ERROR expected `while`, `for`, `loop` or `{` after a label
+    let _ = 'label: 1 + 1; //~ ERROR expected `while`, `for`, `loop` or `{` after a label
 
-    let _recovery_witness: () = 0; //~ ERROR mismatched types
+    'label: match () { () => {}, }; //~ ERROR expected `while`, `for`, `loop` or `{` after a label
+    'label: match () { () => break 'label, }; //~ ERROR expected `while`, `for`, `loop` or `{` after a label
+    #[allow(unused_labels)]
+    'label: match () { () => 'lp: loop { break 'lp 0 }, }; //~ ERROR expected `while`, `for`, `loop` or `{` after a label
+
+    let x = 1;
+    let _i = 'label: match x { //~ ERROR expected `while`, `for`, `loop` or `{` after a label
+        0 => 42,
+        1 if false => break 'label 17,
+        1 => {
+            if true {
+                break 'label 13
+            } else {
+                break 'label 0;
+            }
+        }
+        _ => 1,
+    };
+
+    let other = 3;
+    let _val = 'label: (1, if other == 3 { break 'label (2, 3) } else { other }); //~ ERROR expected `while`, `for`, `loop` or `{` after a label
 }
diff --git a/src/test/ui/parser/recover-labeled-non-block-expr.stderr b/src/test/ui/parser/recover-labeled-non-block-expr.stderr
index 771a915288c..767389c4808 100644
--- a/src/test/ui/parser/recover-labeled-non-block-expr.stderr
+++ b/src/test/ui/parser/recover-labeled-non-block-expr.stderr
@@ -1,17 +1,75 @@
 error: expected `while`, `for`, `loop` or `{` after a label
-  --> $DIR/recover-labeled-non-block-expr.rs:2:13
+  --> $DIR/recover-labeled-non-block-expr.rs:4:21
    |
-LL |     'label: 1 + 1;
-   |             ^ expected `while`, `for`, `loop` or `{` after a label
+LL |     let _ = 'label: 1 + 1;
+   |                     ^ expected `while`, `for`, `loop` or `{` after a label
+   |
+help: consider removing the label
+   |
+LL -     let _ = 'label: 1 + 1;
+LL +     let _ = 1 + 1;
+   | 
+
+error: expected `while`, `for`, `loop` or `{` after a label
+  --> $DIR/recover-labeled-non-block-expr.rs:6:13
+   |
+LL |     'label: match () { () => {}, };
+   |             ^^^^^ expected `while`, `for`, `loop` or `{` after a label
+   |
+help: consider removing the label
+   |
+LL -     'label: match () { () => {}, };
+LL +     match () { () => {}, };
+   | 
 
-error[E0308]: mismatched types
-  --> $DIR/recover-labeled-non-block-expr.rs:4:33
+error: expected `while`, `for`, `loop` or `{` after a label
+  --> $DIR/recover-labeled-non-block-expr.rs:7:13
+   |
+LL |     'label: match () { () => break 'label, };
+   |             ^^^^^ expected `while`, `for`, `loop` or `{` after a label
+   |
+help: consider enclosing expression in a block
+   |
+LL |     'label: { match () { () => break 'label, } };
+   |             +                                  +
+
+error: expected `while`, `for`, `loop` or `{` after a label
+  --> $DIR/recover-labeled-non-block-expr.rs:9:13
+   |
+LL |     'label: match () { () => 'lp: loop { break 'lp 0 }, };
+   |             ^^^^^ expected `while`, `for`, `loop` or `{` after a label
+   |
+help: consider enclosing expression in a block
+   |
+LL |     'label: { match () { () => 'lp: loop { break 'lp 0 }, } };
+   |             +                                               +
+
+error: expected `while`, `for`, `loop` or `{` after a label
+  --> $DIR/recover-labeled-non-block-expr.rs:12:22
+   |
+LL |     let _i = 'label: match x {
+   |                      ^^^^^ expected `while`, `for`, `loop` or `{` after a label
+   |
+help: consider enclosing expression in a block
+   |
+LL ~     let _i = 'label: { match x {
+LL |         0 => 42,
+LL |         1 if false => break 'label 17,
+LL |         1 => {
+LL |             if true {
+LL |                 break 'label 13
+ ...
+
+error: expected `while`, `for`, `loop` or `{` after a label
+  --> $DIR/recover-labeled-non-block-expr.rs:26:24
+   |
+LL |     let _val = 'label: (1, if other == 3 { break 'label (2, 3) } else { other });
+   |                        ^ expected `while`, `for`, `loop` or `{` after a label
+   |
+help: consider enclosing expression in a block
    |
-LL |     let _recovery_witness: () = 0;
-   |                            --   ^ expected `()`, found integer
-   |                            |
-   |                            expected due to this
+LL |     let _val = 'label: { (1, if other == 3 { break 'label (2, 3) } else { other }) };
+   |                        +                                                           +
 
-error: aborting due to 2 previous errors
+error: aborting due to 6 previous errors
 
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/issue-28848.base.stderr b/src/test/ui/regions/issue-28848.base.stderr
deleted file mode 100644
index f10b19738c4..00000000000
--- a/src/test/ui/regions/issue-28848.base.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0478]: lifetime bound not satisfied
-  --> $DIR/issue-28848.rs:14:5
-   |
-LL |     Foo::<'a, 'b>::xmute(u)
-   |     ^^^^^^^^^^^^^
-   |
-note: lifetime parameter instantiated with the lifetime `'b` as defined here
-  --> $DIR/issue-28848.rs:13:16
-   |
-LL | pub fn foo<'a, 'b>(u: &'b ()) -> &'a () {
-   |                ^^
-note: but lifetime parameter must outlive the lifetime `'a` as defined here
-  --> $DIR/issue-28848.rs:13:12
-   |
-LL | pub fn foo<'a, 'b>(u: &'b ()) -> &'a () {
-   |            ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0478`.
diff --git a/src/test/ui/regions/issue-28848.rs b/src/test/ui/regions/issue-28848.rs
index d8ab42a08d4..0eb3d89c590 100644
--- a/src/test/ui/regions/issue-28848.rs
+++ b/src/test/ui/regions/issue-28848.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Foo<'a, 'b: 'a>(&'a &'b ());
 
 impl<'a, 'b> Foo<'a, 'b> {
@@ -12,8 +8,7 @@ impl<'a, 'b> Foo<'a, 'b> {
 
 pub fn foo<'a, 'b>(u: &'b ()) -> &'a () {
     Foo::<'a, 'b>::xmute(u)
-    //[base]~^ ERROR lifetime bound not satisfied
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/regions/issue-28848.nll.stderr b/src/test/ui/regions/issue-28848.stderr
index f9de8948272..a29dac4c9c8 100644
--- a/src/test/ui/regions/issue-28848.nll.stderr
+++ b/src/test/ui/regions/issue-28848.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/issue-28848.rs:14:5
+  --> $DIR/issue-28848.rs:10:5
    |
 LL | pub fn foo<'a, 'b>(u: &'b ()) -> &'a () {
    |            --  -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/issue-78262.nll.stderr b/src/test/ui/regions/issue-78262.base.stderr
index 721dafac0be..7f232e4a7b2 100644
--- a/src/test/ui/regions/issue-78262.nll.stderr
+++ b/src/test/ui/regions/issue-78262.base.stderr
@@ -1,5 +1,5 @@
 error[E0521]: borrowed data escapes outside of closure
-  --> $DIR/issue-78262.rs:14:26
+  --> $DIR/issue-78262.rs:12:26
    |
 LL |     let f = |x: &dyn TT| x.func();
    |              -  -        ^^^^^^^^
diff --git a/src/test/ui/regions/issue-78262.default.stderr b/src/test/ui/regions/issue-78262.default.stderr
deleted file mode 100644
index dcb67e6a654..00000000000
--- a/src/test/ui/regions/issue-78262.default.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/issue-78262.rs:14:28
-   |
-LL |     let f = |x: &dyn TT| x.func();
-   |                            ^^^^ lifetime mismatch
-   |
-   = note: expected reference `&(dyn TT + 'static)`
-              found reference `&dyn TT`
-note: the anonymous lifetime #1 defined here...
-  --> $DIR/issue-78262.rs:14:13
-   |
-LL |     let f = |x: &dyn TT| x.func();
-   |             ^^^^^^^^^^^^^^^^^^^^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/issue-78262.polonius.stderr b/src/test/ui/regions/issue-78262.polonius.stderr
index 721dafac0be..7f232e4a7b2 100644
--- a/src/test/ui/regions/issue-78262.polonius.stderr
+++ b/src/test/ui/regions/issue-78262.polonius.stderr
@@ -1,5 +1,5 @@
 error[E0521]: borrowed data escapes outside of closure
-  --> $DIR/issue-78262.rs:14:26
+  --> $DIR/issue-78262.rs:12:26
    |
 LL |     let f = |x: &dyn TT| x.func();
    |              -  -        ^^^^^^^^
diff --git a/src/test/ui/regions/issue-78262.rs b/src/test/ui/regions/issue-78262.rs
index b88ad678ee6..642dbd7f821 100644
--- a/src/test/ui/regions/issue-78262.rs
+++ b/src/test/ui/regions/issue-78262.rs
@@ -1,8 +1,6 @@
-// revisions: default nll polonius
-// ignore-compare-mode-nll
+// revisions: base polonius
 // ignore-compare-mode-polonius
-// [nll] compile-flags: -Z borrowck=mir
-// [polonius] compile-flags: -Z borrowck=mir -Z polonius
+// [polonius] compile-flags: -Z polonius
 
 trait TT {}
 
@@ -11,7 +9,7 @@ impl dyn TT {
 }
 
 fn main() {
-    let f = |x: &dyn TT| x.func(); //[default]~ ERROR: mismatched types
-    //[nll]~^ ERROR: borrowed data escapes outside of closure
+    let f = |x: &dyn TT| x.func();
+    //[base]~^ ERROR: borrowed data escapes outside of closure
     //[polonius]~^^ ERROR: borrowed data escapes outside of closure
 }
diff --git a/src/test/ui/regions/region-invariant-static-error-reporting.base.stderr b/src/test/ui/regions/region-invariant-static-error-reporting.base.stderr
deleted file mode 100644
index ce21751a95a..00000000000
--- a/src/test/ui/regions/region-invariant-static-error-reporting.base.stderr
+++ /dev/null
@@ -1,25 +0,0 @@
-error[E0308]: `if` and `else` have incompatible types
-  --> $DIR/region-invariant-static-error-reporting.rs:21:9
-   |
-LL |       let bad = if x.is_some() {
-   |  _______________-
-LL | |         x.unwrap()
-   | |         ---------- expected because of this
-LL | |     } else {
-LL | |         mk_static()
-   | |         ^^^^^^^^^^^ lifetime mismatch
-LL | |     };
-   | |_____- `if` and `else` have incompatible types
-   |
-   = note: expected struct `Invariant<'a>`
-              found struct `Invariant<'static>`
-note: the lifetime `'a` as defined here...
-  --> $DIR/region-invariant-static-error-reporting.rs:17:10
-   |
-LL | fn unify<'a>(x: Option<Invariant<'a>>, f: fn(Invariant<'a>)) {
-   |          ^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/region-invariant-static-error-reporting.rs b/src/test/ui/regions/region-invariant-static-error-reporting.rs
index b81022ca4b4..c8288b5923c 100644
--- a/src/test/ui/regions/region-invariant-static-error-reporting.rs
+++ b/src/test/ui/regions/region-invariant-static-error-reporting.rs
@@ -3,12 +3,7 @@
 // over time, but this test used to exhibit some pretty bogus messages
 // that were not remotely helpful.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[base] error-pattern:the lifetime `'a`
-//[base] error-pattern:the static lifetime
-//[nll] compile-flags: -Z borrowck=mir
-//[nll] error-pattern:argument requires that `'a` must outlive `'static`
+// error-pattern:argument requires that `'a` must outlive `'static`
 
 struct Invariant<'a>(Option<&'a mut &'a mut ()>);
 
@@ -16,9 +11,9 @@ fn mk_static() -> Invariant<'static> { Invariant(None) }
 
 fn unify<'a>(x: Option<Invariant<'a>>, f: fn(Invariant<'a>)) {
     let bad = if x.is_some() {
-        x.unwrap() //[nll]~ ERROR borrowed data escapes outside of function [E0521]
+        x.unwrap() //~ ERROR borrowed data escapes outside of function [E0521]
     } else {
-        mk_static() //[base]~ ERROR `if` and `else` have incompatible types [E0308]
+        mk_static()
     };
     f(bad);
 }
diff --git a/src/test/ui/regions/region-invariant-static-error-reporting.nll.stderr b/src/test/ui/regions/region-invariant-static-error-reporting.stderr
index 6905fd008c5..2ad39b00071 100644
--- a/src/test/ui/regions/region-invariant-static-error-reporting.nll.stderr
+++ b/src/test/ui/regions/region-invariant-static-error-reporting.stderr
@@ -1,5 +1,5 @@
 error[E0521]: borrowed data escapes outside of function
-  --> $DIR/region-invariant-static-error-reporting.rs:19:9
+  --> $DIR/region-invariant-static-error-reporting.rs:14:9
    |
 LL | fn unify<'a>(x: Option<Invariant<'a>>, f: fn(Invariant<'a>)) {
    |          --  - `x` is a reference that is only valid in the function body
diff --git a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.base.stderr b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.base.stderr
deleted file mode 100644
index b8b9de627af..00000000000
--- a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.base.stderr
+++ /dev/null
@@ -1,31 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:12:10
-   |
-LL | fn b<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) {
-   |                      ---------          --------- these two types are declared with different lifetimes...
-LL |     // Illegal now because there is no `'b:'a` declaration.
-LL |     *x = *y;
-   |          ^^ ...but data from `y` flows into `x` here
-
-error[E0623]: lifetime mismatch
-  --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:19:7
-   |
-LL | fn c<'a,'b>(x: &mut &'a isize, y: &mut &'b isize) {
-   |                     ---------          --------- these two types are declared with different lifetimes...
-...
-LL |     a(x, y);
-   |       ^ ...but data from `y` flows into `x` here
-
-error[E0308]: mismatched types
-  --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:26:43
-   |
-LL |     let _: fn(&mut &isize, &mut &isize) = a;
-   |                                           ^ one type is more general than the other
-   |
-   = note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)`
-                 found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}`
-
-error: aborting due to 3 previous errors
-
-Some errors have detailed explanations: E0308, E0623.
-For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.rs b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.rs
index 61ae1cc3fad..d364c467714 100644
--- a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.rs
+++ b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn a<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) where 'b: 'a {
     // Note: this is legal because of the `'b:'a` declaration.
     *x = *y;
@@ -10,14 +6,12 @@ fn a<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) where 'b: 'a {
 fn b<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) {
     // Illegal now because there is no `'b:'a` declaration.
     *x = *y;
-    //[base]~^ ERROR E0623
 }
 
 fn c<'a,'b>(x: &mut &'a isize, y: &mut &'b isize) {
     // Here we try to call `foo` but do not know that `'a` and `'b` are
     // related as required.
     a(x, y);
-    //[base]~^ ERROR lifetime mismatch [E0623]
 }
 
 fn d() {
diff --git a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.nll.stderr b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr
index 8a4b3132646..48f2e1a2fa2 100644
--- a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.nll.stderr
+++ b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:26:43
+  --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:20:43
    |
 LL |     let _: fn(&mut &isize, &mut &isize) = a;
    |                                           ^ one type is more general than the other
diff --git a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.base.stderr b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.base.stderr
deleted file mode 100644
index 062411e6f68..00000000000
--- a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.base.stderr
+++ /dev/null
@@ -1,42 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:13:10
-   |
-LL | fn b<'a, 'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) {
-   |                          ---------          --------- these two types are declared with different lifetimes...
-LL |     // Illegal now because there is no `'b:'a` declaration.
-LL |     *x = *y;
-   |          ^^ ...but data from `y` flows into `x` here
-
-error[E0623]: lifetime mismatch
-  --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:15:10
-   |
-LL | fn b<'a, 'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) {
-   |                                             ---------          ---------
-   |                                             |
-   |                                             these two types are declared with different lifetimes...
-...
-LL |     *z = *y;
-   |          ^^ ...but data from `y` flows into `z` here
-
-error[E0623]: lifetime mismatch
-  --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:21:7
-   |
-LL | fn c<'a,'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) {
-   |                         ---------          --------- these two types are declared with different lifetimes...
-...
-LL |     a(x, y, z);
-   |       ^ ...but data from `y` flows into `x` here
-
-error[E0308]: mismatched types
-  --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:28:56
-   |
-LL |     let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
-   |                                                        ^ one type is more general than the other
-   |
-   = note: expected fn pointer `for<'r, 's, 't0, 't1, 't2, 't3> fn(&'r mut &'s isize, &'t0 mut &'t1 isize, &'t2 mut &'t3 isize)`
-                 found fn item `for<'r, 's, 't0> fn(&'r mut &isize, &'s mut &isize, &'t0 mut &isize) {a::<'_, '_, '_>}`
-
-error: aborting due to 4 previous errors
-
-Some errors have detailed explanations: E0308, E0623.
-For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs
index da225d842d9..60dafdd528c 100644
--- a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs
+++ b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn a<'a, 'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) where 'b: 'a + 'c {
     // Note: this is legal because of the `'b:'a` declaration.
     *x = *y;
@@ -11,15 +7,13 @@ fn a<'a, 'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) where
 fn b<'a, 'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) {
     // Illegal now because there is no `'b:'a` declaration.
     *x = *y;
-    //[base]~^ ERROR E0623
-    *z = *y; //[base]~ ERROR E0623
+    *z = *y;
 }
 
 fn c<'a,'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) {
     // Here we try to call `foo` but do not know that `'a` and `'b` are
     // related as required.
     a(x, y, z);
-    //[base]~^ ERROR lifetime mismatch [E0623]
 }
 
 fn d() {
diff --git a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr
index f304c69d44b..36f40cd9a0f 100644
--- a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr
+++ b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:28:56
+  --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:56
    |
 LL |     let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
    |                                                        ^ one type is more general than the other
diff --git a/src/test/ui/regions/region-object-lifetime-2.base.stderr b/src/test/ui/regions/region-object-lifetime-2.base.stderr
deleted file mode 100644
index 118fe476500..00000000000
--- a/src/test/ui/regions/region-object-lifetime-2.base.stderr
+++ /dev/null
@@ -1,30 +0,0 @@
-error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
-  --> $DIR/region-object-lifetime-2.rs:14:7
-   |
-LL |     x.borrowed()
-   |       ^^^^^^^^
-   |
-note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
-  --> $DIR/region-object-lifetime-2.rs:13:42
-   |
-LL | fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a dyn Foo) -> &'b () {
-   |                                          ^^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/region-object-lifetime-2.rs:14:5
-   |
-LL |     x.borrowed()
-   |     ^
-note: but, the lifetime must be valid for the lifetime `'b` as defined here...
-  --> $DIR/region-object-lifetime-2.rs:13:45
-   |
-LL | fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a dyn Foo) -> &'b () {
-   |                                             ^^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/region-object-lifetime-2.rs:14:5
-   |
-LL |     x.borrowed()
-   |     ^^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/regions/region-object-lifetime-2.rs b/src/test/ui/regions/region-object-lifetime-2.rs
index e12b9822f60..cfdb8fefed3 100644
--- a/src/test/ui/regions/region-object-lifetime-2.rs
+++ b/src/test/ui/regions/region-object-lifetime-2.rs
@@ -1,10 +1,6 @@
 // Various tests related to testing how region inference works
 // with respect to the object receivers.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Foo {
     fn borrowed<'a>(&'a self) -> &'a ();
 }
@@ -12,8 +8,7 @@ trait Foo {
 // Borrowed receiver but two distinct lifetimes, we get an error.
 fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a dyn Foo) -> &'b () {
     x.borrowed()
-    //[base]~^ ERROR cannot infer
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/regions/region-object-lifetime-2.nll.stderr b/src/test/ui/regions/region-object-lifetime-2.stderr
index c0b09ebb6f5..d95289f3f9d 100644
--- a/src/test/ui/regions/region-object-lifetime-2.nll.stderr
+++ b/src/test/ui/regions/region-object-lifetime-2.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/region-object-lifetime-2.rs:14:5
+  --> $DIR/region-object-lifetime-2.rs:10:5
    |
 LL | fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a dyn Foo) -> &'b () {
    |                                          -- -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/region-object-lifetime-4.base.stderr b/src/test/ui/regions/region-object-lifetime-4.base.stderr
deleted file mode 100644
index 3765076a9c5..00000000000
--- a/src/test/ui/regions/region-object-lifetime-4.base.stderr
+++ /dev/null
@@ -1,30 +0,0 @@
-error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
-  --> $DIR/region-object-lifetime-4.rs:16:7
-   |
-LL |     x.borrowed()
-   |       ^^^^^^^^
-   |
-note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
-  --> $DIR/region-object-lifetime-4.rs:15:41
-   |
-LL | fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a (dyn Foo + 'b)) -> &'b () {
-   |                                         ^^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/region-object-lifetime-4.rs:16:5
-   |
-LL |     x.borrowed()
-   |     ^
-note: but, the lifetime must be valid for the lifetime `'b` as defined here...
-  --> $DIR/region-object-lifetime-4.rs:15:44
-   |
-LL | fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a (dyn Foo + 'b)) -> &'b () {
-   |                                            ^^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/region-object-lifetime-4.rs:16:5
-   |
-LL |     x.borrowed()
-   |     ^^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/regions/region-object-lifetime-4.rs b/src/test/ui/regions/region-object-lifetime-4.rs
index aad9c2c9521..8f42df831e3 100644
--- a/src/test/ui/regions/region-object-lifetime-4.rs
+++ b/src/test/ui/regions/region-object-lifetime-4.rs
@@ -1,10 +1,6 @@
 // Various tests related to testing how region inference works
 // with respect to the object receivers.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Foo {
     fn borrowed<'a>(&'a self) -> &'a ();
 }
@@ -14,8 +10,7 @@ trait Foo {
 // that it lives as long as the shorter lifetime. Therefore, error.
 fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a (dyn Foo + 'b)) -> &'b () {
     x.borrowed()
-    //[base]~^ ERROR cannot infer
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/regions/region-object-lifetime-4.nll.stderr b/src/test/ui/regions/region-object-lifetime-4.stderr
index a2a958f90b2..fda66a2412c 100644
--- a/src/test/ui/regions/region-object-lifetime-4.nll.stderr
+++ b/src/test/ui/regions/region-object-lifetime-4.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/region-object-lifetime-4.rs:16:5
+  --> $DIR/region-object-lifetime-4.rs:12:5
    |
 LL | fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a (dyn Foo + 'b)) -> &'b () {
    |                                         -- -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/region-object-lifetime-in-coercion.base.stderr b/src/test/ui/regions/region-object-lifetime-in-coercion.base.stderr
deleted file mode 100644
index 85bfa16b3d3..00000000000
--- a/src/test/ui/regions/region-object-lifetime-in-coercion.base.stderr
+++ /dev/null
@@ -1,98 +0,0 @@
-error[E0759]: `v` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/region-object-lifetime-in-coercion.rs:12:46
-   |
-LL | fn a(v: &[u8]) -> Box<dyn Foo + 'static> {
-   |         ----- this data with an anonymous lifetime `'_`...
-LL |     let x: Box<dyn Foo + 'static> = Box::new(v);
-   |                                              ^ ...is used and required to live as long as `'static` here
-   |
-help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v`
-   |
-LL | fn a(v: &[u8]) -> Box<dyn Foo + '_> {
-   |                                 ~~
-help: alternatively, add an explicit `'static` bound to this reference
-   |
-LL | fn a(v: &'static [u8]) -> Box<dyn Foo + 'static> {
-   |         ~~~~~~~~~~~~~
-
-error[E0759]: `v` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/region-object-lifetime-in-coercion.rs:19:14
-   |
-LL | fn b(v: &[u8]) -> Box<dyn Foo + 'static> {
-   |         ----- this data with an anonymous lifetime `'_`...
-LL |     Box::new(v)
-   |              ^ ...is used and required to live as long as `'static` here
-   |
-note: `'static` lifetime requirement introduced by the return type
-  --> $DIR/region-object-lifetime-in-coercion.rs:18:33
-   |
-LL | fn b(v: &[u8]) -> Box<dyn Foo + 'static> {
-   |                                 ^^^^^^^ `'static` requirement introduced here
-LL |     Box::new(v)
-   |     ----------- because of this returned expression
-help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v`
-   |
-LL | fn b(v: &[u8]) -> Box<dyn Foo + '_> {
-   |                                 ~~
-help: alternatively, add an explicit `'static` bound to this reference
-   |
-LL | fn b(v: &'static [u8]) -> Box<dyn Foo + 'static> {
-   |         ~~~~~~~~~~~~~
-
-error[E0759]: `v` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/region-object-lifetime-in-coercion.rs:27:14
-   |
-LL | fn c(v: &[u8]) -> Box<dyn Foo> {
-   |         ----- this data with an anonymous lifetime `'_`...
-...
-LL |     Box::new(v)
-   |              ^ ...is used and required to live as long as `'static` here
-   |
-note: `'static` lifetime requirement introduced by the return type
-  --> $DIR/region-object-lifetime-in-coercion.rs:24:23
-   |
-LL | fn c(v: &[u8]) -> Box<dyn Foo> {
-   |                       ^^^^^^^ `'static` requirement introduced here
-...
-LL |     Box::new(v)
-   |     ----------- because of this returned expression
-help: to declare that the trait object captures data from argument `v`, you can add an explicit `'_` lifetime bound
-   |
-LL | fn c(v: &[u8]) -> Box<dyn Foo + '_> {
-   |                               ++++
-
-error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
-  --> $DIR/region-object-lifetime-in-coercion.rs:33:14
-   |
-LL |     Box::new(v)
-   |              ^
-   |
-note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
-  --> $DIR/region-object-lifetime-in-coercion.rs:32:6
-   |
-LL | fn d<'a,'b>(v: &'a [u8]) -> Box<dyn Foo+'b> {
-   |      ^^
-note: ...so that the expression is assignable
-  --> $DIR/region-object-lifetime-in-coercion.rs:33:14
-   |
-LL |     Box::new(v)
-   |              ^
-   = note: expected `&[u8]`
-              found `&'a [u8]`
-note: but, the lifetime must be valid for the lifetime `'b` as defined here...
-  --> $DIR/region-object-lifetime-in-coercion.rs:32:9
-   |
-LL | fn d<'a,'b>(v: &'a [u8]) -> Box<dyn Foo+'b> {
-   |         ^^
-note: ...so that the types are compatible
-  --> $DIR/region-object-lifetime-in-coercion.rs:33:5
-   |
-LL |     Box::new(v)
-   |     ^^^^^^^^^^^
-   = note: expected `Box<(dyn Foo + 'b)>`
-              found `Box<dyn Foo>`
-
-error: aborting due to 4 previous errors
-
-Some errors have detailed explanations: E0495, E0759.
-For more information about an error, try `rustc --explain E0495`.
diff --git a/src/test/ui/regions/region-object-lifetime-in-coercion.rs b/src/test/ui/regions/region-object-lifetime-in-coercion.rs
index ed28d6c0ff1..95708de04d2 100644
--- a/src/test/ui/regions/region-object-lifetime-in-coercion.rs
+++ b/src/test/ui/regions/region-object-lifetime-in-coercion.rs
@@ -1,38 +1,30 @@
 // Test that attempts to implicitly coerce a value into an
 // object respect the lifetime bound on the object type.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Foo {}
 impl<'a> Foo for &'a [u8] {}
 
 fn a(v: &[u8]) -> Box<dyn Foo + 'static> {
     let x: Box<dyn Foo + 'static> = Box::new(v);
-    //[base]~^ ERROR E0759
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
     x
 }
 
 fn b(v: &[u8]) -> Box<dyn Foo + 'static> {
     Box::new(v)
-    //[base]~^ ERROR E0759
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn c(v: &[u8]) -> Box<dyn Foo> {
     // same as previous case due to RFC 599
 
     Box::new(v)
-    //[base]~^ ERROR E0759
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn d<'a,'b>(v: &'a [u8]) -> Box<dyn Foo+'b> {
     Box::new(v)
-    //[base]~^ ERROR cannot infer an appropriate lifetime due to conflicting
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn e<'a:'b,'b>(v: &'a [u8]) -> Box<dyn Foo+'b> {
diff --git a/src/test/ui/regions/region-object-lifetime-in-coercion.nll.stderr b/src/test/ui/regions/region-object-lifetime-in-coercion.stderr
index 724b06ce8b1..b5bb08c73c8 100644
--- a/src/test/ui/regions/region-object-lifetime-in-coercion.nll.stderr
+++ b/src/test/ui/regions/region-object-lifetime-in-coercion.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/region-object-lifetime-in-coercion.rs:12:12
+  --> $DIR/region-object-lifetime-in-coercion.rs:8:12
    |
 LL | fn a(v: &[u8]) -> Box<dyn Foo + 'static> {
    |         - let's call the lifetime of this reference `'1`
@@ -16,7 +16,7 @@ LL | fn a(v: &'static [u8]) -> Box<dyn Foo + 'static> {
    |         ~~~~~~~~~~~~~
 
 error: lifetime may not live long enough
-  --> $DIR/region-object-lifetime-in-coercion.rs:19:5
+  --> $DIR/region-object-lifetime-in-coercion.rs:14:5
    |
 LL | fn b(v: &[u8]) -> Box<dyn Foo + 'static> {
    |         - let's call the lifetime of this reference `'1`
@@ -33,7 +33,7 @@ LL | fn b(v: &'static [u8]) -> Box<dyn Foo + 'static> {
    |         ~~~~~~~~~~~~~
 
 error: lifetime may not live long enough
-  --> $DIR/region-object-lifetime-in-coercion.rs:27:5
+  --> $DIR/region-object-lifetime-in-coercion.rs:21:5
    |
 LL | fn c(v: &[u8]) -> Box<dyn Foo> {
    |         - let's call the lifetime of this reference `'1`
@@ -47,7 +47,7 @@ LL | fn c(v: &[u8]) -> Box<dyn Foo + '_> {
    |                               ++++
 
 error: lifetime may not live long enough
-  --> $DIR/region-object-lifetime-in-coercion.rs:33:5
+  --> $DIR/region-object-lifetime-in-coercion.rs:26:5
    |
 LL | fn d<'a,'b>(v: &'a [u8]) -> Box<dyn Foo+'b> {
    |      -- -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/regions-addr-of-self.base.stderr b/src/test/ui/regions/regions-addr-of-self.base.stderr
deleted file mode 100644
index 3167c2f2107..00000000000
--- a/src/test/ui/regions/regions-addr-of-self.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0759]: `self` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/regions-addr-of-self.rs:11:37
-   |
-LL |     pub fn chase_cat(&mut self) {
-   |                      --------- this data with an anonymous lifetime `'_`...
-LL |         let p: &'static mut usize = &mut self.cats_chased;
-   |                                     ^^^^^^^^^^^^^^^^^^^^^ ...is used and required to live as long as `'static` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0759`.
diff --git a/src/test/ui/regions/regions-addr-of-self.rs b/src/test/ui/regions/regions-addr-of-self.rs
index 698433c71b3..23647182fcf 100644
--- a/src/test/ui/regions/regions-addr-of-self.rs
+++ b/src/test/ui/regions/regions-addr-of-self.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Dog {
     cats_chased: usize,
 }
@@ -9,8 +5,7 @@ struct Dog {
 impl Dog {
     pub fn chase_cat(&mut self) {
         let p: &'static mut usize = &mut self.cats_chased;
-        //[base]~^ ERROR E0759
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
         *p += 1;
     }
 
diff --git a/src/test/ui/regions/regions-addr-of-self.nll.stderr b/src/test/ui/regions/regions-addr-of-self.stderr
index 1f720520f6b..3d7aac74bd4 100644
--- a/src/test/ui/regions/regions-addr-of-self.nll.stderr
+++ b/src/test/ui/regions/regions-addr-of-self.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-addr-of-self.rs:11:16
+  --> $DIR/regions-addr-of-self.rs:7:16
    |
 LL |     pub fn chase_cat(&mut self) {
    |                      - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/regions/regions-addr-of-upvar-self.base.stderr b/src/test/ui/regions/regions-addr-of-upvar-self.base.stderr
deleted file mode 100644
index 42d0638e8b7..00000000000
--- a/src/test/ui/regions/regions-addr-of-upvar-self.base.stderr
+++ /dev/null
@@ -1,26 +0,0 @@
-error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements
-  --> $DIR/regions-addr-of-upvar-self.rs:12:41
-   |
-LL |             let p: &'static mut usize = &mut self.food;
-   |                                         ^^^^^^^^^^^^^^
-   |
-note: first, the lifetime cannot outlive the lifetime `'_` as defined here...
-  --> $DIR/regions-addr-of-upvar-self.rs:11:18
-   |
-LL |         let _f = || {
-   |                  ^^
-note: ...so that closure can access `self`
-  --> $DIR/regions-addr-of-upvar-self.rs:12:41
-   |
-LL |             let p: &'static mut usize = &mut self.food;
-   |                                         ^^^^^^^^^^^^^^
-   = note: but, the lifetime must be valid for the static lifetime...
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/regions-addr-of-upvar-self.rs:12:41
-   |
-LL |             let p: &'static mut usize = &mut self.food;
-   |                                         ^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/regions/regions-addr-of-upvar-self.rs b/src/test/ui/regions/regions-addr-of-upvar-self.rs
index 36cc592d47c..171eca32e29 100644
--- a/src/test/ui/regions/regions-addr-of-upvar-self.rs
+++ b/src/test/ui/regions/regions-addr-of-upvar-self.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Dog {
     food: usize,
 }
@@ -10,10 +6,9 @@ impl Dog {
     pub fn chase_cat(&mut self) {
         let _f = || {
             let p: &'static mut usize = &mut self.food;
-            //[base]~^ ERROR cannot infer
-            //[nll]~^^ ERROR lifetime may not live long enough
-            //[nll]~^^^ ERROR lifetime may not live long enough
-            //[nll]~^^^^ ERROR E0597
+            //~^ ERROR lifetime may not live long enough
+            //~^^ ERROR lifetime may not live long enough
+            //~^^^ ERROR E0597
             *p = 3;
         };
     }
diff --git a/src/test/ui/regions/regions-addr-of-upvar-self.nll.stderr b/src/test/ui/regions/regions-addr-of-upvar-self.stderr
index b8e37e92316..c16a6f8585b 100644
--- a/src/test/ui/regions/regions-addr-of-upvar-self.nll.stderr
+++ b/src/test/ui/regions/regions-addr-of-upvar-self.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-addr-of-upvar-self.rs:12:20
+  --> $DIR/regions-addr-of-upvar-self.rs:8:20
    |
 LL |         let _f = || {
    |                  -- lifetime `'1` represents this closure's body
@@ -9,7 +9,7 @@ LL |             let p: &'static mut usize = &mut self.food;
    = note: closure implements `FnMut`, so references to captured variables can't escape the closure
 
 error: lifetime may not live long enough
-  --> $DIR/regions-addr-of-upvar-self.rs:12:20
+  --> $DIR/regions-addr-of-upvar-self.rs:8:20
    |
 LL |     pub fn chase_cat(&mut self) {
    |                      - let's call the lifetime of this reference `'1`
@@ -18,7 +18,7 @@ LL |             let p: &'static mut usize = &mut self.food;
    |                    ^^^^^^^^^^^^^^^^^^ type annotation requires that `'1` must outlive `'static`
 
 error[E0597]: `self` does not live long enough
-  --> $DIR/regions-addr-of-upvar-self.rs:12:46
+  --> $DIR/regions-addr-of-upvar-self.rs:8:46
    |
 LL |         let _f = || {
    |                  -- value captured here
diff --git a/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.migrate.stderr b/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.migrate.stderr
deleted file mode 100644
index d9fd1aebf27..00000000000
--- a/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.migrate.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0491]: in type `&'a WithAssoc<TheType<'b>>`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-assoc-type-in-supertrait-outlives-container.rs:44:12
-   |
-LL |     let _: &'a WithAssoc<TheType<'b>> = loop { };
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime `'a` as defined here
-  --> $DIR/regions-assoc-type-in-supertrait-outlives-container.rs:38:15
-   |
-LL | fn with_assoc<'a,'b>() {
-   |               ^^
-note: but the referenced data is only valid for the lifetime `'b` as defined here
-  --> $DIR/regions-assoc-type-in-supertrait-outlives-container.rs:38:18
-   |
-LL | fn with_assoc<'a,'b>() {
-   |                  ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.rs b/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.rs
index 08bc64926fa..eb6e66818fc 100644
--- a/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.rs
+++ b/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.rs
@@ -3,14 +3,6 @@
 // outlive the location in which the type appears, even when the
 // associted type is in a supertype. Issue #22246.
 
-// revisions: migrate nll
-//[nll]compile-flags: -Z borrowck=mir
-
-// Since we are testing nll (and migration) explicitly as a separate
-// revisions, don't worry about the --compare-mode=nll on this test.
-
-// ignore-compare-mode-nll
-
 #![allow(dead_code)]
 
 pub trait TheTrait {
@@ -42,8 +34,7 @@ fn with_assoc<'a,'b>() {
     // which is &'b (), must outlive 'a.
 
     let _: &'a WithAssoc<TheType<'b>> = loop { };
-    //[migrate]~^ ERROR reference has a longer lifetime
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.nll.stderr b/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.stderr
index ba7572ebe31..87e33e1ccff 100644
--- a/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.nll.stderr
+++ b/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-assoc-type-in-supertrait-outlives-container.rs:44:12
+  --> $DIR/regions-assoc-type-in-supertrait-outlives-container.rs:36:12
    |
 LL | fn with_assoc<'a,'b>() {
    |               -- -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/regions-bounded-by-trait-requiring-static.base.stderr b/src/test/ui/regions/regions-bounded-by-trait-requiring-static.base.stderr
deleted file mode 100644
index 9b45dcfd95a..00000000000
--- a/src/test/ui/regions/regions-bounded-by-trait-requiring-static.base.stderr
+++ /dev/null
@@ -1,75 +0,0 @@
-error[E0477]: the type `&'a isize` does not fulfill the required lifetime
-  --> $DIR/regions-bounded-by-trait-requiring-static.rs:26:5
-   |
-LL |     assert_send::<&'a isize>();
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: type must satisfy the static lifetime as required by this binding
-  --> $DIR/regions-bounded-by-trait-requiring-static.rs:10:18
-   |
-LL | fn assert_send<T:'static>() { }
-   |                  ^^^^^^^
-
-error[E0477]: the type `&'a str` does not fulfill the required lifetime
-  --> $DIR/regions-bounded-by-trait-requiring-static.rs:32:5
-   |
-LL |     assert_send::<&'a str>();
-   |     ^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: type must satisfy the static lifetime as required by this binding
-  --> $DIR/regions-bounded-by-trait-requiring-static.rs:10:18
-   |
-LL | fn assert_send<T:'static>() { }
-   |                  ^^^^^^^
-
-error[E0477]: the type `&'a [isize]` does not fulfill the required lifetime
-  --> $DIR/regions-bounded-by-trait-requiring-static.rs:38:5
-   |
-LL |     assert_send::<&'a [isize]>();
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: type must satisfy the static lifetime as required by this binding
-  --> $DIR/regions-bounded-by-trait-requiring-static.rs:10:18
-   |
-LL | fn assert_send<T:'static>() { }
-   |                  ^^^^^^^
-
-error[E0477]: the type `Box<&'a isize>` does not fulfill the required lifetime
-  --> $DIR/regions-bounded-by-trait-requiring-static.rs:54:5
-   |
-LL |     assert_send::<Box<&'a isize>>();
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: type must satisfy the static lifetime as required by this binding
-  --> $DIR/regions-bounded-by-trait-requiring-static.rs:10:18
-   |
-LL | fn assert_send<T:'static>() { }
-   |                  ^^^^^^^
-
-error[E0477]: the type `*const &'a isize` does not fulfill the required lifetime
-  --> $DIR/regions-bounded-by-trait-requiring-static.rs:67:5
-   |
-LL |     assert_send::<*const &'a isize>();
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: type must satisfy the static lifetime as required by this binding
-  --> $DIR/regions-bounded-by-trait-requiring-static.rs:10:18
-   |
-LL | fn assert_send<T:'static>() { }
-   |                  ^^^^^^^
-
-error[E0477]: the type `*mut &'a isize` does not fulfill the required lifetime
-  --> $DIR/regions-bounded-by-trait-requiring-static.rs:73:5
-   |
-LL |     assert_send::<*mut &'a isize>();
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: type must satisfy the static lifetime as required by this binding
-  --> $DIR/regions-bounded-by-trait-requiring-static.rs:10:18
-   |
-LL | fn assert_send<T:'static>() { }
-   |                  ^^^^^^^
-
-error: aborting due to 6 previous errors
-
-For more information about this error, try `rustc --explain E0477`.
diff --git a/src/test/ui/regions/regions-bounded-by-trait-requiring-static.rs b/src/test/ui/regions/regions-bounded-by-trait-requiring-static.rs
index 37dc1300d39..7d02a46193e 100644
--- a/src/test/ui/regions/regions-bounded-by-trait-requiring-static.rs
+++ b/src/test/ui/regions/regions-bounded-by-trait-requiring-static.rs
@@ -2,10 +2,6 @@
 // in this file all test region bound and lifetime violations that are
 // detected during type check.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Dummy : 'static { }
 fn assert_send<T:'static>() { }
 
@@ -24,20 +20,17 @@ fn static_lifime_ok<'a,T,U:Send>(_: &'a isize) {
 
 fn param_not_ok<'a>(x: &'a isize) {
     assert_send::<&'a isize>();
-    //[base]~^ ERROR does not fulfill the required lifetime
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn param_not_ok1<'a>(_: &'a isize) {
     assert_send::<&'a str>();
-    //[base]~^ ERROR does not fulfill the required lifetime
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn param_not_ok2<'a>(_: &'a isize) {
     assert_send::<&'a [isize]>();
-    //[base]~^ ERROR does not fulfill the required lifetime
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 // boxes are ok
@@ -52,8 +45,7 @@ fn box_ok() {
 
 fn box_with_region_not_ok<'a>() {
     assert_send::<Box<&'a isize>>();
-    //[base]~^ ERROR does not fulfill the required lifetime
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 // raw pointers are ok unless they point at unsendable things
@@ -65,14 +57,12 @@ fn unsafe_ok1<'a>(_: &'a isize) {
 
 fn unsafe_ok2<'a>(_: &'a isize) {
     assert_send::<*const &'a isize>();
-    //[base]~^ ERROR does not fulfill the required lifetime
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn unsafe_ok3<'a>(_: &'a isize) {
     assert_send::<*mut &'a isize>();
-    //[base]~^ ERROR does not fulfill the required lifetime
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/regions/regions-bounded-by-trait-requiring-static.nll.stderr b/src/test/ui/regions/regions-bounded-by-trait-requiring-static.stderr
index 558a77516bb..eea68cc8f1c 100644
--- a/src/test/ui/regions/regions-bounded-by-trait-requiring-static.nll.stderr
+++ b/src/test/ui/regions/regions-bounded-by-trait-requiring-static.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-bounded-by-trait-requiring-static.rs:26:5
+  --> $DIR/regions-bounded-by-trait-requiring-static.rs:22:5
    |
 LL | fn param_not_ok<'a>(x: &'a isize) {
    |                 -- lifetime `'a` defined here
@@ -7,7 +7,7 @@ LL |     assert_send::<&'a isize>();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/regions-bounded-by-trait-requiring-static.rs:32:5
+  --> $DIR/regions-bounded-by-trait-requiring-static.rs:27:5
    |
 LL | fn param_not_ok1<'a>(_: &'a isize) {
    |                  -- lifetime `'a` defined here
@@ -15,7 +15,7 @@ LL |     assert_send::<&'a str>();
    |     ^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/regions-bounded-by-trait-requiring-static.rs:38:5
+  --> $DIR/regions-bounded-by-trait-requiring-static.rs:32:5
    |
 LL | fn param_not_ok2<'a>(_: &'a isize) {
    |                  -- lifetime `'a` defined here
@@ -23,7 +23,7 @@ LL |     assert_send::<&'a [isize]>();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/regions-bounded-by-trait-requiring-static.rs:54:5
+  --> $DIR/regions-bounded-by-trait-requiring-static.rs:47:5
    |
 LL | fn box_with_region_not_ok<'a>() {
    |                           -- lifetime `'a` defined here
@@ -31,7 +31,7 @@ LL |     assert_send::<Box<&'a isize>>();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/regions-bounded-by-trait-requiring-static.rs:67:5
+  --> $DIR/regions-bounded-by-trait-requiring-static.rs:59:5
    |
 LL | fn unsafe_ok2<'a>(_: &'a isize) {
    |               -- lifetime `'a` defined here
@@ -39,7 +39,7 @@ LL |     assert_send::<*const &'a isize>();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/regions-bounded-by-trait-requiring-static.rs:73:5
+  --> $DIR/regions-bounded-by-trait-requiring-static.rs:64:5
    |
 LL | fn unsafe_ok3<'a>(_: &'a isize) {
    |               -- lifetime `'a` defined here
diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.base.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.base.stderr
deleted file mode 100644
index e031f0db412..00000000000
--- a/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.base.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/regions-bounded-method-type-parameters-cross-crate.rs:23:7
-   |
-LL | fn call_bigger_region<'x, 'y>(a: Inv<'x>, b: Inv<'y>) {
-   |                                  -------     ------- these two types are declared with different lifetimes...
-LL |     // Here the value provided for 'y is 'y, and hence 'y:'x does not hold.
-LL |     a.bigger_region(b)
-   |       ^^^^^^^^^^^^^ ...but data from `b` flows into `a` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.rs b/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.rs
index e0965613f1d..c014b2ccf1e 100644
--- a/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.rs
+++ b/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.rs
@@ -1,7 +1,4 @@
 // aux-build:rbmtp_cross_crate_lib.rs
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
 
 // Check explicit region bounds on methods in the cross crate case.
 
@@ -21,8 +18,7 @@ fn call_into_maybe_owned<'x,F:IntoMaybeOwned<'x>>(f: F) {
 fn call_bigger_region<'x, 'y>(a: Inv<'x>, b: Inv<'y>) {
     // Here the value provided for 'y is 'y, and hence 'y:'x does not hold.
     a.bigger_region(b)
-    //[base]~^ ERROR lifetime mismatch [E0623]
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.nll.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.stderr
index 4f5d747be71..6193bf02f6d 100644
--- a/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.nll.stderr
+++ b/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-bounded-method-type-parameters-cross-crate.rs:23:5
+  --> $DIR/regions-bounded-method-type-parameters-cross-crate.rs:20:5
    |
 LL | fn call_bigger_region<'x, 'y>(a: Inv<'x>, b: Inv<'y>) {
    |                       --  -- lifetime `'y` defined here
diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.base.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.base.stderr
deleted file mode 100644
index 0a213e3f779..00000000000
--- a/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.base.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/regions-bounded-method-type-parameters-trait-bound.rs:24:7
-   |
-LL | fn caller2<'a,'b,F:Foo<'a>>(a: Inv<'a>, b: Inv<'b>, f: F) {
-   |                                -------     ------- these two types are declared with different lifetimes...
-LL |     // Here the value provided for 'y is 'b, and hence 'b:'a does not hold.
-LL |     f.method(b);
-   |       ^^^^^^ ...but data from `b` flows into `a` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.rs b/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.rs
index 8a52a1549ab..5548cb915d8 100644
--- a/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.rs
+++ b/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.rs
@@ -2,10 +2,6 @@
 // nominal types (but not on other types) and that they are type
 // checked.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Inv<'a> { // invariant w/r/t 'a
     x: &'a mut &'a isize
 }
@@ -22,8 +18,7 @@ fn caller1<'a,'b,F:Foo<'a>>(a: Inv<'a>, b: Inv<'b>, f: F) {
 fn caller2<'a,'b,F:Foo<'a>>(a: Inv<'a>, b: Inv<'b>, f: F) {
     // Here the value provided for 'y is 'b, and hence 'b:'a does not hold.
     f.method(b);
-    //[base]~^ ERROR lifetime mismatch [E0623]
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn caller3<'a,'b:'a,F:Foo<'a>>(a: Inv<'a>, b: Inv<'b>, f: F) {
diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.nll.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.stderr
index 1c2f46a5fc1..0e0086be9ea 100644
--- a/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.nll.stderr
+++ b/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-bounded-method-type-parameters-trait-bound.rs:24:5
+  --> $DIR/regions-bounded-method-type-parameters-trait-bound.rs:20:5
    |
 LL | fn caller2<'a,'b,F:Foo<'a>>(a: Inv<'a>, b: Inv<'b>, f: F) {
    |            -- -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters.base.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters.base.stderr
deleted file mode 100644
index 3d37a1ba47b..00000000000
--- a/src/test/ui/regions/regions-bounded-method-type-parameters.base.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0477]: the type `&'a isize` does not fulfill the required lifetime
-  --> $DIR/regions-bounded-method-type-parameters.rs:16:9
-   |
-LL |     Foo.some_method::<&'a isize>();
-   |         ^^^^^^^^^^^
-   |
-note: type must satisfy the static lifetime as required by this binding
-  --> $DIR/regions-bounded-method-type-parameters.rs:12:22
-   |
-LL |     fn some_method<A:'static>(self) { }
-   |                      ^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0477`.
diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters.rs b/src/test/ui/regions/regions-bounded-method-type-parameters.rs
index 06bc1544a38..56e750003da 100644
--- a/src/test/ui/regions/regions-bounded-method-type-parameters.rs
+++ b/src/test/ui/regions/regions-bounded-method-type-parameters.rs
@@ -2,10 +2,6 @@
 // nominal types (but not on other types) and that they are type
 // checked.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Foo;
 
 impl Foo {
@@ -14,8 +10,7 @@ impl Foo {
 
 fn caller<'a>(x: &isize) {
     Foo.some_method::<&'a isize>();
-    //[base]~^ ERROR does not fulfill the required lifetime
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters.nll.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters.stderr
index 05c3fa58ea3..b6d7b8aac5f 100644
--- a/src/test/ui/regions/regions-bounded-method-type-parameters.nll.stderr
+++ b/src/test/ui/regions/regions-bounded-method-type-parameters.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-bounded-method-type-parameters.rs:16:9
+  --> $DIR/regions-bounded-method-type-parameters.rs:12:9
    |
 LL | fn caller<'a>(x: &isize) {
    |           -- lifetime `'a` defined here
diff --git a/src/test/ui/regions/regions-bounds.base.stderr b/src/test/ui/regions/regions-bounds.base.stderr
deleted file mode 100644
index d853cdde336..00000000000
--- a/src/test/ui/regions/regions-bounds.base.stderr
+++ /dev/null
@@ -1,41 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/regions-bounds.rs:13:12
-   |
-LL |     return e;
-   |            ^ lifetime mismatch
-   |
-   = note: expected struct `TupleStruct<'b>`
-              found struct `TupleStruct<'a>`
-note: the lifetime `'a` as defined here...
-  --> $DIR/regions-bounds.rs:12:10
-   |
-LL | fn a_fn1<'a,'b>(e: TupleStruct<'a>) -> TupleStruct<'b> {
-   |          ^^
-note: ...does not necessarily outlive the lifetime `'b` as defined here
-  --> $DIR/regions-bounds.rs:12:13
-   |
-LL | fn a_fn1<'a,'b>(e: TupleStruct<'a>) -> TupleStruct<'b> {
-   |             ^^
-
-error[E0308]: mismatched types
-  --> $DIR/regions-bounds.rs:19:12
-   |
-LL |     return e;
-   |            ^ lifetime mismatch
-   |
-   = note: expected struct `Struct<'b>`
-              found struct `Struct<'a>`
-note: the lifetime `'a` as defined here...
-  --> $DIR/regions-bounds.rs:18:10
-   |
-LL | fn a_fn3<'a,'b>(e: Struct<'a>) -> Struct<'b> {
-   |          ^^
-note: ...does not necessarily outlive the lifetime `'b` as defined here
-  --> $DIR/regions-bounds.rs:18:13
-   |
-LL | fn a_fn3<'a,'b>(e: Struct<'a>) -> Struct<'b> {
-   |             ^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/regions-bounds.rs b/src/test/ui/regions/regions-bounds.rs
index b13dac49f8c..fd4d75ab6b8 100644
--- a/src/test/ui/regions/regions-bounds.rs
+++ b/src/test/ui/regions/regions-bounds.rs
@@ -2,23 +2,17 @@
 // nominal types (but not on other types) and that they are type
 // checked.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct TupleStruct<'a>(&'a isize);
 struct Struct<'a> { x:&'a isize }
 
 fn a_fn1<'a,'b>(e: TupleStruct<'a>) -> TupleStruct<'b> {
     return e;
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn a_fn3<'a,'b>(e: Struct<'a>) -> Struct<'b> {
     return e;
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/regions/regions-bounds.nll.stderr b/src/test/ui/regions/regions-bounds.stderr
index 7109220165f..430909e54a6 100644
--- a/src/test/ui/regions/regions-bounds.nll.stderr
+++ b/src/test/ui/regions/regions-bounds.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-bounds.rs:13:12
+  --> $DIR/regions-bounds.rs:9:12
    |
 LL | fn a_fn1<'a,'b>(e: TupleStruct<'a>) -> TupleStruct<'b> {
    |          -- -- lifetime `'b` defined here
@@ -11,7 +11,7 @@ LL |     return e;
    = help: consider adding the following bound: `'a: 'b`
 
 error: lifetime may not live long enough
-  --> $DIR/regions-bounds.rs:19:12
+  --> $DIR/regions-bounds.rs:14:12
    |
 LL | fn a_fn3<'a,'b>(e: Struct<'a>) -> Struct<'b> {
    |          -- -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/regions-close-associated-type-into-object.base.stderr b/src/test/ui/regions/regions-close-associated-type-into-object.base.stderr
deleted file mode 100644
index fbbb5980401..00000000000
--- a/src/test/ui/regions/regions-close-associated-type-into-object.base.stderr
+++ /dev/null
@@ -1,40 +0,0 @@
-error[E0310]: the associated type `<T as Iter>::Item` may not live long enough
-  --> $DIR/regions-close-associated-type-into-object.rs:19:5
-   |
-LL |     Box::new(item)
-   |     ^^^^^^^^^^^^^^
-   |
-   = help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'static`...
-   = note: ...so that the type `<T as Iter>::Item` will meet its required lifetime bounds
-
-error[E0310]: the associated type `<T as Iter>::Item` may not live long enough
-  --> $DIR/regions-close-associated-type-into-object.rs:26:5
-   |
-LL |     Box::new(item)
-   |     ^^^^^^^^^^^^^^
-   |
-   = help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'static`...
-   = note: ...so that the type `Box<<T as Iter>::Item>` will meet its required lifetime bounds
-
-error[E0309]: the associated type `<T as Iter>::Item` may not live long enough
-  --> $DIR/regions-close-associated-type-into-object.rs:32:5
-   |
-LL |     Box::new(item)
-   |     ^^^^^^^^^^^^^^
-   |
-   = help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'a`...
-   = note: ...so that the type `<T as Iter>::Item` will meet its required lifetime bounds
-
-error[E0309]: the associated type `<T as Iter>::Item` may not live long enough
-  --> $DIR/regions-close-associated-type-into-object.rs:39:5
-   |
-LL |     Box::new(item)
-   |     ^^^^^^^^^^^^^^
-   |
-   = help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'a`...
-   = note: ...so that the type `Box<<T as Iter>::Item>` will meet its required lifetime bounds
-
-error: aborting due to 4 previous errors
-
-Some errors have detailed explanations: E0309, E0310.
-For more information about an error, try `rustc --explain E0309`.
diff --git a/src/test/ui/regions/regions-close-associated-type-into-object.rs b/src/test/ui/regions/regions-close-associated-type-into-object.rs
index 94199f56212..428477e2489 100644
--- a/src/test/ui/regions/regions-close-associated-type-into-object.rs
+++ b/src/test/ui/regions/regions-close-associated-type-into-object.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait X {}
 
 
diff --git a/src/test/ui/regions/regions-close-associated-type-into-object.nll.stderr b/src/test/ui/regions/regions-close-associated-type-into-object.stderr
index dd4b97aa562..f7dcaa9d97e 100644
--- a/src/test/ui/regions/regions-close-associated-type-into-object.nll.stderr
+++ b/src/test/ui/regions/regions-close-associated-type-into-object.stderr
@@ -1,5 +1,5 @@
 error[E0310]: the associated type `<T as Iter>::Item` may not live long enough
-  --> $DIR/regions-close-associated-type-into-object.rs:19:5
+  --> $DIR/regions-close-associated-type-into-object.rs:15:5
    |
 LL |     Box::new(item)
    |     ^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL |     Box::new(item)
    = note: ...so that the type `<T as Iter>::Item` will meet its required lifetime bounds
 
 error[E0310]: the associated type `<T as Iter>::Item` may not live long enough
-  --> $DIR/regions-close-associated-type-into-object.rs:26:5
+  --> $DIR/regions-close-associated-type-into-object.rs:22:5
    |
 LL |     Box::new(item)
    |     ^^^^^^^^^^^^^^
@@ -17,7 +17,7 @@ LL |     Box::new(item)
    = note: ...so that the type `<T as Iter>::Item` will meet its required lifetime bounds
 
 error[E0309]: the associated type `<T as Iter>::Item` may not live long enough
-  --> $DIR/regions-close-associated-type-into-object.rs:32:5
+  --> $DIR/regions-close-associated-type-into-object.rs:28:5
    |
 LL |     Box::new(item)
    |     ^^^^^^^^^^^^^^
@@ -26,7 +26,7 @@ LL |     Box::new(item)
    = note: ...so that the type `<T as Iter>::Item` will meet its required lifetime bounds
 
 error[E0309]: the associated type `<T as Iter>::Item` may not live long enough
-  --> $DIR/regions-close-associated-type-into-object.rs:39:5
+  --> $DIR/regions-close-associated-type-into-object.rs:35:5
    |
 LL |     Box::new(item)
    |     ^^^^^^^^^^^^^^
diff --git a/src/test/ui/regions/regions-close-object-into-object-2.base.stderr b/src/test/ui/regions/regions-close-object-into-object-2.base.stderr
deleted file mode 100644
index ddf168ffd10..00000000000
--- a/src/test/ui/regions/regions-close-object-into-object-2.base.stderr
+++ /dev/null
@@ -1,27 +0,0 @@
-error[E0759]: `v` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/regions-close-object-into-object-2.rs:13:16
-   |
-LL | fn g<'a, T: 'static>(v: Box<dyn A<T> + 'a>) -> Box<dyn X + 'static> {
-   |                         ------------------ this data with lifetime `'a`...
-LL |     Box::new(B(&*v)) as Box<dyn X>
-   |                ^^^ ...is used and required to live as long as `'static` here
-   |
-note: `'static` lifetime requirement introduced by the return type
-  --> $DIR/regions-close-object-into-object-2.rs:12:60
-   |
-LL | fn g<'a, T: 'static>(v: Box<dyn A<T> + 'a>) -> Box<dyn X + 'static> {
-   |                                                            ^^^^^^^ `'static` requirement introduced here
-LL |     Box::new(B(&*v)) as Box<dyn X>
-   |     ------------------------------ because of this returned expression
-help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v`
-   |
-LL | fn g<'a, T: 'static>(v: Box<dyn A<T> + 'a>) -> Box<dyn X + 'a> {
-   |                                                            ~~
-help: alternatively, add an explicit `'static` bound to this reference
-   |
-LL | fn g<'a, T: 'static>(v: Box<(dyn A<T> + 'static)>) -> Box<dyn X + 'static> {
-   |                         ~~~~~~~~~~~~~~~~~~~~~~~~~
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0759`.
diff --git a/src/test/ui/regions/regions-close-object-into-object-2.rs b/src/test/ui/regions/regions-close-object-into-object-2.rs
index 33ea03f061e..6960af72c76 100644
--- a/src/test/ui/regions/regions-close-object-into-object-2.rs
+++ b/src/test/ui/regions/regions-close-object-into-object-2.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait A<T> { }
 
 struct B<'a, T:'a>(&'a (dyn A<T> + 'a));
@@ -11,9 +7,8 @@ impl<'a, T> X for B<'a, T> {}
 
 fn g<'a, T: 'static>(v: Box<dyn A<T> + 'a>) -> Box<dyn X + 'static> {
     Box::new(B(&*v)) as Box<dyn X>
-    //[base]~^ ERROR E0759
-    //[nll]~^^ ERROR lifetime may not live long enough
-    //[nll]~| ERROR cannot return value referencing local data `*v` [E0515]
+    //~^ ERROR lifetime may not live long enough
+    //~| ERROR cannot return value referencing local data `*v` [E0515]
 }
 
 fn main() { }
diff --git a/src/test/ui/regions/regions-close-object-into-object-2.nll.stderr b/src/test/ui/regions/regions-close-object-into-object-2.stderr
index 473c99b672f..aacb5ea4e87 100644
--- a/src/test/ui/regions/regions-close-object-into-object-2.nll.stderr
+++ b/src/test/ui/regions/regions-close-object-into-object-2.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-close-object-into-object-2.rs:13:5
+  --> $DIR/regions-close-object-into-object-2.rs:9:5
    |
 LL | fn g<'a, T: 'static>(v: Box<dyn A<T> + 'a>) -> Box<dyn X + 'static> {
    |      -- lifetime `'a` defined here
@@ -16,7 +16,7 @@ LL | fn g<'a, T: 'static>(v: Box<(dyn A<T> + 'static)>) -> Box<dyn X + 'static>
    |                         ~~~~~~~~~~~~~~~~~~~~~~~~~
 
 error[E0515]: cannot return value referencing local data `*v`
-  --> $DIR/regions-close-object-into-object-2.rs:13:5
+  --> $DIR/regions-close-object-into-object-2.rs:9:5
    |
 LL |     Box::new(B(&*v)) as Box<dyn X>
    |     ^^^^^^^^^^^---^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/regions/regions-close-object-into-object-4.base.stderr b/src/test/ui/regions/regions-close-object-into-object-4.base.stderr
deleted file mode 100644
index 33d4df3d194..00000000000
--- a/src/test/ui/regions/regions-close-object-into-object-4.base.stderr
+++ /dev/null
@@ -1,27 +0,0 @@
-error[E0759]: `v` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/regions-close-object-into-object-4.rs:13:16
-   |
-LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
-   |                   ---------------- this data with lifetime `'a`...
-LL |     Box::new(B(&*v)) as Box<dyn X>
-   |                ^^^ ...is used and required to live as long as `'static` here
-   |
-note: `'static` lifetime requirement introduced by the return type
-  --> $DIR/regions-close-object-into-object-4.rs:12:52
-   |
-LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
-   |                                                    ^^^^^^^ `'static` requirement introduced here
-LL |     Box::new(B(&*v)) as Box<dyn X>
-   |     ------------------------------ because of this returned expression
-help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v`
-   |
-LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'a> {
-   |                                                    ~~
-help: alternatively, add an explicit `'static` bound to this reference
-   |
-LL | fn i<'a, T, U>(v: Box<(dyn A<U> + 'static)>) -> Box<dyn X + 'static> {
-   |                   ~~~~~~~~~~~~~~~~~~~~~~~~~
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0759`.
diff --git a/src/test/ui/regions/regions-close-object-into-object-4.rs b/src/test/ui/regions/regions-close-object-into-object-4.rs
index 5a852b7329a..3bbad9cbffe 100644
--- a/src/test/ui/regions/regions-close-object-into-object-4.rs
+++ b/src/test/ui/regions/regions-close-object-into-object-4.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait A<T> { }
 
 struct B<'a, T:'a>(&'a (dyn A<T> + 'a));
@@ -11,13 +7,12 @@ impl<'a, T> X for B<'a, T> {}
 
 fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
     Box::new(B(&*v)) as Box<dyn X>
-    //[base]~^ ERROR E0759
-    //[nll]~^^ ERROR the parameter type `U` may not live long enough [E0310]
-    //[nll]~| ERROR the parameter type `U` may not live long enough [E0310]
-    //[nll]~| ERROR the parameter type `U` may not live long enough [E0310]
-    //[nll]~| ERROR lifetime may not live long enough
-    //[nll]~| ERROR cannot return value referencing local data `*v` [E0515]
-    //[nll]~| ERROR the parameter type `U` may not live long enough [E0310]
+    //~^ ERROR the parameter type `U` may not live long enough [E0310]
+    //~| ERROR the parameter type `U` may not live long enough [E0310]
+    //~| ERROR the parameter type `U` may not live long enough [E0310]
+    //~| ERROR lifetime may not live long enough
+    //~| ERROR cannot return value referencing local data `*v` [E0515]
+    //~| ERROR the parameter type `U` may not live long enough [E0310]
 
 }
 
diff --git a/src/test/ui/regions/regions-close-object-into-object-4.nll.stderr b/src/test/ui/regions/regions-close-object-into-object-4.stderr
index 66d3102225e..7a9f1ab0001 100644
--- a/src/test/ui/regions/regions-close-object-into-object-4.nll.stderr
+++ b/src/test/ui/regions/regions-close-object-into-object-4.stderr
@@ -1,5 +1,5 @@
 error[E0310]: the parameter type `U` may not live long enough
-  --> $DIR/regions-close-object-into-object-4.rs:13:5
+  --> $DIR/regions-close-object-into-object-4.rs:9:5
    |
 LL |     Box::new(B(&*v)) as Box<dyn X>
    |     ^^^^^^^^ ...so that the type `U` will meet its required lifetime bounds
@@ -10,7 +10,7 @@ LL | fn i<'a, T, U: 'static>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
    |              +++++++++
 
 error[E0310]: the parameter type `U` may not live long enough
-  --> $DIR/regions-close-object-into-object-4.rs:13:5
+  --> $DIR/regions-close-object-into-object-4.rs:9:5
    |
 LL |     Box::new(B(&*v)) as Box<dyn X>
    |     ^^^^^^^^^^^^^^^^ ...so that the type `U` will meet its required lifetime bounds
@@ -21,7 +21,7 @@ LL | fn i<'a, T, U: 'static>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
    |              +++++++++
 
 error[E0310]: the parameter type `U` may not live long enough
-  --> $DIR/regions-close-object-into-object-4.rs:13:5
+  --> $DIR/regions-close-object-into-object-4.rs:9:5
    |
 LL |     Box::new(B(&*v)) as Box<dyn X>
    |     ^^^^^^^^^^^^^^^^ ...so that the type `U` will meet its required lifetime bounds
@@ -32,7 +32,7 @@ LL | fn i<'a, T, U: 'static>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
    |              +++++++++
 
 error: lifetime may not live long enough
-  --> $DIR/regions-close-object-into-object-4.rs:13:5
+  --> $DIR/regions-close-object-into-object-4.rs:9:5
    |
 LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
    |      -- lifetime `'a` defined here
@@ -49,7 +49,7 @@ LL | fn i<'a, T, U>(v: Box<(dyn A<U> + 'static)>) -> Box<dyn X + 'static> {
    |                   ~~~~~~~~~~~~~~~~~~~~~~~~~
 
 error[E0515]: cannot return value referencing local data `*v`
-  --> $DIR/regions-close-object-into-object-4.rs:13:5
+  --> $DIR/regions-close-object-into-object-4.rs:9:5
    |
 LL |     Box::new(B(&*v)) as Box<dyn X>
    |     ^^^^^^^^^^^---^^^^^^^^^^^^^^^^
@@ -58,7 +58,7 @@ LL |     Box::new(B(&*v)) as Box<dyn X>
    |     returns a value referencing data owned by the current function
 
 error[E0310]: the parameter type `U` may not live long enough
-  --> $DIR/regions-close-object-into-object-4.rs:13:14
+  --> $DIR/regions-close-object-into-object-4.rs:9:14
    |
 LL |     Box::new(B(&*v)) as Box<dyn X>
    |              ^^^^^^ ...so that the type `U` will meet its required lifetime bounds
diff --git a/src/test/ui/regions/regions-close-object-into-object-5.base.stderr b/src/test/ui/regions/regions-close-object-into-object-5.base.stderr
deleted file mode 100644
index 1a78079b638..00000000000
--- a/src/test/ui/regions/regions-close-object-into-object-5.base.stderr
+++ /dev/null
@@ -1,95 +0,0 @@
-error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/regions-close-object-into-object-5.rs:21:5
-   |
-LL |     Box::new(B(&*v)) as Box<dyn X>
-   |     ^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
-   |
-note: ...that is required by this bound
-  --> $DIR/regions-close-object-into-object-5.rs:13:17
-   |
-LL | struct B<'a, T: 'a>(&'a (A<T> + 'a));
-   |                 ^^
-help: consider adding an explicit lifetime bound...
-   |
-LL | fn f<'a, T: 'static, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
-   |           +++++++++
-
-error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/regions-close-object-into-object-5.rs:21:5
-   |
-LL |     Box::new(B(&*v)) as Box<dyn X>
-   |     ^^^^^^^^^^^^^^^^ ...so that the type `B<'_, T>` will meet its required lifetime bounds
-   |
-help: consider adding an explicit lifetime bound...
-   |
-LL | fn f<'a, T: 'static, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
-   |           +++++++++
-
-error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/regions-close-object-into-object-5.rs:21:14
-   |
-LL |     Box::new(B(&*v)) as Box<dyn X>
-   |              ^ ...so that the type `T` will meet its required lifetime bounds...
-   |
-note: ...that is required by this bound
-  --> $DIR/regions-close-object-into-object-5.rs:13:17
-   |
-LL | struct B<'a, T: 'a>(&'a (A<T> + 'a));
-   |                 ^^
-help: consider adding an explicit lifetime bound...
-   |
-LL | fn f<'a, T: 'static, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
-   |           +++++++++
-
-error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/regions-close-object-into-object-5.rs:21:14
-   |
-LL |     Box::new(B(&*v)) as Box<dyn X>
-   |              ^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
-   |
-note: ...that is required by this bound
-  --> $DIR/regions-close-object-into-object-5.rs:13:17
-   |
-LL | struct B<'a, T: 'a>(&'a (A<T> + 'a));
-   |                 ^^
-help: consider adding an explicit lifetime bound...
-   |
-LL | fn f<'a, T: 'static, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
-   |           +++++++++
-
-error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/regions-close-object-into-object-5.rs:21:16
-   |
-LL |     Box::new(B(&*v)) as Box<dyn X>
-   |                ^^^ ...so that the reference type `&dyn A<T>` does not outlive the data it points at
-   |
-help: consider adding an explicit lifetime bound...
-   |
-LL | fn f<'a, T: 'static, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
-   |           +++++++++
-
-error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/regions-close-object-into-object-5.rs:21:16
-   |
-LL |     Box::new(B(&*v)) as Box<dyn X>
-   |                ^^^ ...so that the type `(dyn A<T> + 'static)` is not borrowed for too long
-   |
-help: consider adding an explicit lifetime bound...
-   |
-LL | fn f<'a, T: 'static, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
-   |           +++++++++
-
-error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/regions-close-object-into-object-5.rs:21:16
-   |
-LL |     Box::new(B(&*v)) as Box<dyn X>
-   |                ^^^ ...so that the type `(dyn A<T> + 'static)` is not borrowed for too long
-   |
-help: consider adding an explicit lifetime bound...
-   |
-LL | fn f<'a, T: 'static, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
-   |           +++++++++
-
-error: aborting due to 7 previous errors
-
-For more information about this error, try `rustc --explain E0310`.
diff --git a/src/test/ui/regions/regions-close-object-into-object-5.rs b/src/test/ui/regions/regions-close-object-into-object-5.rs
index 0e5fec28d19..d534c37496d 100644
--- a/src/test/ui/regions/regions-close-object-into-object-5.rs
+++ b/src/test/ui/regions/regions-close-object-into-object-5.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 #![allow(warnings)]
 
 
@@ -23,10 +19,7 @@ fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
     //~| ERROR the parameter type `T` may not live long enough
     //~| ERROR the parameter type `T` may not live long enough
     //~| ERROR the parameter type `T` may not live long enough
-    //[base]~| ERROR the parameter type `T` may not live long enough
-    //[base]~| ERROR the parameter type `T` may not live long enough
-    //[base]~| ERROR the parameter type `T` may not live long enough
-    //[nll]~| ERROR cannot return value referencing local data `*v` [E0515]
+    //~| ERROR cannot return value referencing local data `*v` [E0515]
 }
 
 fn main() {}
diff --git a/src/test/ui/regions/regions-close-object-into-object-5.nll.stderr b/src/test/ui/regions/regions-close-object-into-object-5.stderr
index cb06326130e..311e8868c09 100644
--- a/src/test/ui/regions/regions-close-object-into-object-5.nll.stderr
+++ b/src/test/ui/regions/regions-close-object-into-object-5.stderr
@@ -1,5 +1,5 @@
 error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/regions-close-object-into-object-5.rs:21:5
+  --> $DIR/regions-close-object-into-object-5.rs:17:5
    |
 LL |     Box::new(B(&*v)) as Box<dyn X>
    |     ^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
@@ -10,7 +10,7 @@ LL | fn f<'a, T: 'static, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
    |           +++++++++
 
 error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/regions-close-object-into-object-5.rs:21:5
+  --> $DIR/regions-close-object-into-object-5.rs:17:5
    |
 LL |     Box::new(B(&*v)) as Box<dyn X>
    |     ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
@@ -21,7 +21,7 @@ LL | fn f<'a, T: 'static, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
    |           +++++++++
 
 error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/regions-close-object-into-object-5.rs:21:5
+  --> $DIR/regions-close-object-into-object-5.rs:17:5
    |
 LL |     Box::new(B(&*v)) as Box<dyn X>
    |     ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
@@ -32,7 +32,7 @@ LL | fn f<'a, T: 'static, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
    |           +++++++++
 
 error[E0515]: cannot return value referencing local data `*v`
-  --> $DIR/regions-close-object-into-object-5.rs:21:5
+  --> $DIR/regions-close-object-into-object-5.rs:17:5
    |
 LL |     Box::new(B(&*v)) as Box<dyn X>
    |     ^^^^^^^^^^^---^^^^^^^^^^^^^^^^
@@ -41,7 +41,7 @@ LL |     Box::new(B(&*v)) as Box<dyn X>
    |     returns a value referencing data owned by the current function
 
 error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/regions-close-object-into-object-5.rs:21:14
+  --> $DIR/regions-close-object-into-object-5.rs:17:14
    |
 LL |     Box::new(B(&*v)) as Box<dyn X>
    |              ^^^^^^ ...so that the type `T` will meet its required lifetime bounds
diff --git a/src/test/ui/regions/regions-close-over-type-parameter-1.nll.stderr b/src/test/ui/regions/regions-close-over-type-parameter-1.nll.stderr
deleted file mode 100644
index d8f77ad85c9..00000000000
--- a/src/test/ui/regions/regions-close-over-type-parameter-1.nll.stderr
+++ /dev/null
@@ -1,26 +0,0 @@
-error[E0310]: the parameter type `A` may not live long enough
-  --> $DIR/regions-close-over-type-parameter-1.rs:15:5
-   |
-LL |     Box::new(v) as Box<dyn SomeTrait + 'static>
-   |     ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
-   |
-help: consider adding an explicit lifetime bound...
-   |
-LL | fn make_object1<A: SomeTrait + 'static>(v: A) -> Box<dyn SomeTrait + 'static> {
-   |                              +++++++++
-
-error[E0309]: the parameter type `A` may not live long enough
-  --> $DIR/regions-close-over-type-parameter-1.rs:24:5
-   |
-LL |     Box::new(v) as Box<dyn SomeTrait + 'b>
-   |     ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
-   |
-help: consider adding an explicit lifetime bound...
-   |
-LL | fn make_object3<'a, 'b, A: SomeTrait + 'a + 'b>(v: A) -> Box<dyn SomeTrait + 'b> {
-   |                                           ++++
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0309, E0310.
-For more information about an error, try `rustc --explain E0309`.
diff --git a/src/test/ui/regions/regions-close-over-type-parameter-1.rs b/src/test/ui/regions/regions-close-over-type-parameter-1.rs
index cf425bcd4f3..610f757453b 100644
--- a/src/test/ui/regions/regions-close-over-type-parameter-1.rs
+++ b/src/test/ui/regions/regions-close-over-type-parameter-1.rs
@@ -2,10 +2,6 @@
 // an object. This should yield errors unless `A` (and the object)
 // both have suitable bounds.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait SomeTrait {
     fn get(&self) -> isize;
 }
diff --git a/src/test/ui/regions/regions-close-over-type-parameter-1.base.stderr b/src/test/ui/regions/regions-close-over-type-parameter-1.stderr
index d8f77ad85c9..b7b557d7a60 100644
--- a/src/test/ui/regions/regions-close-over-type-parameter-1.base.stderr
+++ b/src/test/ui/regions/regions-close-over-type-parameter-1.stderr
@@ -1,5 +1,5 @@
 error[E0310]: the parameter type `A` may not live long enough
-  --> $DIR/regions-close-over-type-parameter-1.rs:15:5
+  --> $DIR/regions-close-over-type-parameter-1.rs:11:5
    |
 LL |     Box::new(v) as Box<dyn SomeTrait + 'static>
    |     ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
@@ -10,7 +10,7 @@ LL | fn make_object1<A: SomeTrait + 'static>(v: A) -> Box<dyn SomeTrait + 'stati
    |                              +++++++++
 
 error[E0309]: the parameter type `A` may not live long enough
-  --> $DIR/regions-close-over-type-parameter-1.rs:24:5
+  --> $DIR/regions-close-over-type-parameter-1.rs:20:5
    |
 LL |     Box::new(v) as Box<dyn SomeTrait + 'b>
    |     ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
diff --git a/src/test/ui/regions/regions-close-over-type-parameter-multiple.base.stderr b/src/test/ui/regions/regions-close-over-type-parameter-multiple.base.stderr
deleted file mode 100644
index 171203897d7..00000000000
--- a/src/test/ui/regions/regions-close-over-type-parameter-multiple.base.stderr
+++ /dev/null
@@ -1,32 +0,0 @@
-error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
-  --> $DIR/regions-close-over-type-parameter-multiple.rs:23:5
-   |
-LL |     Box::new(v) as Box<dyn SomeTrait + 'a>
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
-  --> $DIR/regions-close-over-type-parameter-multiple.rs:21:20
-   |
-LL | fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box<dyn SomeTrait + 'c> {
-   |                    ^^
-note: ...so that the declared lifetime parameter bounds are satisfied
-  --> $DIR/regions-close-over-type-parameter-multiple.rs:23:5
-   |
-LL |     Box::new(v) as Box<dyn SomeTrait + 'a>
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: but, the lifetime must be valid for the lifetime `'c` as defined here...
-  --> $DIR/regions-close-over-type-parameter-multiple.rs:21:26
-   |
-LL | fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box<dyn SomeTrait + 'c> {
-   |                          ^^
-note: ...so that the types are compatible
-  --> $DIR/regions-close-over-type-parameter-multiple.rs:23:5
-   |
-LL |     Box::new(v) as Box<dyn SomeTrait + 'a>
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: expected `Box<(dyn SomeTrait + 'c)>`
-              found `Box<dyn SomeTrait>`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/regions/regions-close-over-type-parameter-multiple.rs b/src/test/ui/regions/regions-close-over-type-parameter-multiple.rs
index 3d5f4e12665..e032a94c32f 100644
--- a/src/test/ui/regions/regions-close-over-type-parameter-multiple.rs
+++ b/src/test/ui/regions/regions-close-over-type-parameter-multiple.rs
@@ -1,10 +1,6 @@
 // Various tests where we over type parameters with multiple lifetime
 // bounds.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait SomeTrait { fn get(&self) -> isize; }
 
 
@@ -21,8 +17,7 @@ fn make_object_good2<'a,'b,A:SomeTrait+'a+'b>(v: A) -> Box<dyn SomeTrait + 'b> {
 fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box<dyn SomeTrait + 'c> {
     // A outlives 'a AND 'b...but not 'c.
     Box::new(v) as Box<dyn SomeTrait + 'a>
-    //[base]~^ ERROR cannot infer an appropriate lifetime
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/regions/regions-close-over-type-parameter-multiple.nll.stderr b/src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr
index 66459957ed4..baa0506d04c 100644
--- a/src/test/ui/regions/regions-close-over-type-parameter-multiple.nll.stderr
+++ b/src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-close-over-type-parameter-multiple.rs:23:5
+  --> $DIR/regions-close-over-type-parameter-multiple.rs:19:5
    |
 LL | fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box<dyn SomeTrait + 'c> {
    |                    --    -- lifetime `'c` defined here
diff --git a/src/test/ui/regions/regions-close-param-into-object.base.stderr b/src/test/ui/regions/regions-close-param-into-object.base.stderr
deleted file mode 100644
index 79a5d34dea8..00000000000
--- a/src/test/ui/regions/regions-close-param-into-object.base.stderr
+++ /dev/null
@@ -1,48 +0,0 @@
-error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/regions-close-param-into-object.rs:10:5
-   |
-LL |     Box::new(v)
-   |     ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
-   |
-help: consider adding an explicit lifetime bound...
-   |
-LL |     where T : X + 'static
-   |                 +++++++++
-
-error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/regions-close-param-into-object.rs:16:5
-   |
-LL |     Box::new(v)
-   |     ^^^^^^^^^^^ ...so that the type `Box<T>` will meet its required lifetime bounds
-   |
-help: consider adding an explicit lifetime bound...
-   |
-LL | fn p2<T: 'static>(v: Box<T>) -> Box<dyn X + 'static>
-   |        +++++++++
-
-error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-close-param-into-object.rs:22:5
-   |
-LL |     Box::new(v)
-   |     ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
-   |
-help: consider adding an explicit lifetime bound...
-   |
-LL |     where T : X + 'a
-   |                 ++++
-
-error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-close-param-into-object.rs:28:5
-   |
-LL |     Box::new(v)
-   |     ^^^^^^^^^^^ ...so that the type `Box<T>` will meet its required lifetime bounds
-   |
-help: consider adding an explicit lifetime bound...
-   |
-LL | fn p4<'a,T: 'a>(v: Box<T>) -> Box<dyn X + 'a>
-   |           ++++
-
-error: aborting due to 4 previous errors
-
-Some errors have detailed explanations: E0309, E0310.
-For more information about an error, try `rustc --explain E0309`.
diff --git a/src/test/ui/regions/regions-close-param-into-object.rs b/src/test/ui/regions/regions-close-param-into-object.rs
index aab3ad202e6..2760e5eed95 100644
--- a/src/test/ui/regions/regions-close-param-into-object.rs
+++ b/src/test/ui/regions/regions-close-param-into-object.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait X { fn foo(&self) {} }
 
 fn p1<T>(v: T) -> Box<dyn X + 'static>
diff --git a/src/test/ui/regions/regions-close-param-into-object.nll.stderr b/src/test/ui/regions/regions-close-param-into-object.stderr
index 6ee12d5b82c..9162be5b93c 100644
--- a/src/test/ui/regions/regions-close-param-into-object.nll.stderr
+++ b/src/test/ui/regions/regions-close-param-into-object.stderr
@@ -1,5 +1,5 @@
 error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/regions-close-param-into-object.rs:10:5
+  --> $DIR/regions-close-param-into-object.rs:6:5
    |
 LL |     Box::new(v)
    |     ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
@@ -10,7 +10,7 @@ LL |     where T : X + 'static
    |                 +++++++++
 
 error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/regions-close-param-into-object.rs:16:5
+  --> $DIR/regions-close-param-into-object.rs:12:5
    |
 LL |     Box::new(v)
    |     ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
@@ -21,7 +21,7 @@ LL | fn p2<T: 'static>(v: Box<T>) -> Box<dyn X + 'static>
    |        +++++++++
 
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-close-param-into-object.rs:22:5
+  --> $DIR/regions-close-param-into-object.rs:18:5
    |
 LL |     Box::new(v)
    |     ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
@@ -32,7 +32,7 @@ LL |     where T : X + 'a
    |                 ++++
 
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-close-param-into-object.rs:28:5
+  --> $DIR/regions-close-param-into-object.rs:24:5
    |
 LL |     Box::new(v)
    |     ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
diff --git a/src/test/ui/regions/regions-creating-enums3.base.stderr b/src/test/ui/regions/regions-creating-enums3.base.stderr
deleted file mode 100644
index 68a7b473695..00000000000
--- a/src/test/ui/regions/regions-creating-enums3.base.stderr
+++ /dev/null
@@ -1,13 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/regions-creating-enums3.rs:11:5
-   |
-LL | fn mk_add_bad1<'a,'b>(x: &'a Ast<'a>, y: &'b Ast<'b>) -> Ast<'a> {
-   |                                          -----------     -------
-   |                                          |
-   |                                          this parameter and the return type are declared with different lifetimes...
-LL |     Ast::Add(x, y)
-   |     ^^^^^^^^^^^^^^ ...but data from `y` is returned here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/regions/regions-creating-enums3.rs b/src/test/ui/regions/regions-creating-enums3.rs
index dcea761d33f..39dbb3d8a7d 100644
--- a/src/test/ui/regions/regions-creating-enums3.rs
+++ b/src/test/ui/regions/regions-creating-enums3.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 enum Ast<'a> {
     Num(usize),
     Add(&'a Ast<'a>, &'a Ast<'a>)
@@ -9,8 +5,7 @@ enum Ast<'a> {
 
 fn mk_add_bad1<'a,'b>(x: &'a Ast<'a>, y: &'b Ast<'b>) -> Ast<'a> {
     Ast::Add(x, y)
-    //[base]~^ ERROR lifetime mismatch [E0623]
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/regions/regions-creating-enums3.nll.stderr b/src/test/ui/regions/regions-creating-enums3.stderr
index 8334dc77687..41d609b56d2 100644
--- a/src/test/ui/regions/regions-creating-enums3.nll.stderr
+++ b/src/test/ui/regions/regions-creating-enums3.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-creating-enums3.rs:11:5
+  --> $DIR/regions-creating-enums3.rs:7:5
    |
 LL | fn mk_add_bad1<'a,'b>(x: &'a Ast<'a>, y: &'b Ast<'b>) -> Ast<'a> {
    |                -- -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/regions-creating-enums4.base.stderr b/src/test/ui/regions/regions-creating-enums4.base.stderr
deleted file mode 100644
index 445a4291f27..00000000000
--- a/src/test/ui/regions/regions-creating-enums4.base.stderr
+++ /dev/null
@@ -1,34 +0,0 @@
-error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
-  --> $DIR/regions-creating-enums4.rs:11:5
-   |
-LL |     Ast::Add(x, y)
-   |     ^^^^^^^^
-   |
-note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
-  --> $DIR/regions-creating-enums4.rs:10:16
-   |
-LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> {
-   |                ^^
-note: ...so that the expression is assignable
-  --> $DIR/regions-creating-enums4.rs:11:14
-   |
-LL |     Ast::Add(x, y)
-   |              ^
-   = note: expected `&Ast<'_>`
-              found `&Ast<'a>`
-note: but, the lifetime must be valid for the lifetime `'b` as defined here...
-  --> $DIR/regions-creating-enums4.rs:10:19
-   |
-LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> {
-   |                   ^^
-note: ...so that the types are compatible
-  --> $DIR/regions-creating-enums4.rs:11:5
-   |
-LL |     Ast::Add(x, y)
-   |     ^^^^^^^^^^^^^^
-   = note: expected `Ast<'b>`
-              found `Ast<'_>`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/regions/regions-creating-enums4.rs b/src/test/ui/regions/regions-creating-enums4.rs
index 18bd592b1c3..c9eab08cbe9 100644
--- a/src/test/ui/regions/regions-creating-enums4.rs
+++ b/src/test/ui/regions/regions-creating-enums4.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 enum Ast<'a> {
     Num(usize),
     Add(&'a Ast<'a>, &'a Ast<'a>)
@@ -9,8 +5,7 @@ enum Ast<'a> {
 
 fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> {
     Ast::Add(x, y)
-    //[base]~^ ERROR cannot infer
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/regions/regions-creating-enums4.nll.stderr b/src/test/ui/regions/regions-creating-enums4.stderr
index e215c63d39d..91cf57e099d 100644
--- a/src/test/ui/regions/regions-creating-enums4.nll.stderr
+++ b/src/test/ui/regions/regions-creating-enums4.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-creating-enums4.rs:11:5
+  --> $DIR/regions-creating-enums4.rs:7:5
    |
 LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> {
    |                -- -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/regions-early-bound-error-method.base.stderr b/src/test/ui/regions/regions-early-bound-error-method.base.stderr
deleted file mode 100644
index 9e1f2b0e5bd..00000000000
--- a/src/test/ui/regions/regions-early-bound-error-method.base.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0312]: lifetime of reference outlives lifetime of borrowed content...
-  --> $DIR/regions-early-bound-error-method.rs:24:9
-   |
-LL |         g2.get()
-   |         ^^^^^^^^
-   |
-note: ...the reference is valid for the lifetime `'a` as defined here...
-  --> $DIR/regions-early-bound-error-method.rs:22:6
-   |
-LL | impl<'a> Box<'a> {
-   |      ^^
-note: ...but the borrowed content is only valid for the lifetime `'b` as defined here
-  --> $DIR/regions-early-bound-error-method.rs:23:11
-   |
-LL |     fn or<'b,G:GetRef<'b>>(&self, g2: G) -> &'a isize {
-   |           ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0312`.
diff --git a/src/test/ui/regions/regions-early-bound-error-method.rs b/src/test/ui/regions/regions-early-bound-error-method.rs
index 44ee19fa898..7edcc677d73 100644
--- a/src/test/ui/regions/regions-early-bound-error-method.rs
+++ b/src/test/ui/regions/regions-early-bound-error-method.rs
@@ -1,10 +1,6 @@
 // Tests that you can use a fn lifetime parameter as part of
 // the value for a type parameter in a bound.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait GetRef<'a> {
     fn get(&self) -> &'a isize;
 }
@@ -22,8 +18,7 @@ impl<'a> GetRef<'a> for Box<'a> {
 impl<'a> Box<'a> {
     fn or<'b,G:GetRef<'b>>(&self, g2: G) -> &'a isize {
         g2.get()
-        //[base]~^ ERROR E0312
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
diff --git a/src/test/ui/regions/regions-early-bound-error-method.nll.stderr b/src/test/ui/regions/regions-early-bound-error-method.stderr
index 98389ed0ca5..7f10c051f29 100644
--- a/src/test/ui/regions/regions-early-bound-error-method.nll.stderr
+++ b/src/test/ui/regions/regions-early-bound-error-method.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-early-bound-error-method.rs:24:9
+  --> $DIR/regions-early-bound-error-method.rs:20:9
    |
 LL | impl<'a> Box<'a> {
    |      -- lifetime `'a` defined here
diff --git a/src/test/ui/regions/regions-early-bound-error.base.stderr b/src/test/ui/regions/regions-early-bound-error.base.stderr
deleted file mode 100644
index e1b60536d29..00000000000
--- a/src/test/ui/regions/regions-early-bound-error.base.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0312]: lifetime of reference outlives lifetime of borrowed content...
-  --> $DIR/regions-early-bound-error.rs:23:5
-   |
-LL |     g1.get()
-   |     ^^^^^^^^
-   |
-note: ...the reference is valid for the lifetime `'b` as defined here...
-  --> $DIR/regions-early-bound-error.rs:22:11
-   |
-LL | fn get<'a,'b,G:GetRef<'a, isize>>(g1: G, b: &'b isize) -> &'b isize {
-   |           ^^
-note: ...but the borrowed content is only valid for the lifetime `'a` as defined here
-  --> $DIR/regions-early-bound-error.rs:22:8
-   |
-LL | fn get<'a,'b,G:GetRef<'a, isize>>(g1: G, b: &'b isize) -> &'b isize {
-   |        ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0312`.
diff --git a/src/test/ui/regions/regions-early-bound-error.rs b/src/test/ui/regions/regions-early-bound-error.rs
index 372596cd5f4..98a69c24f43 100644
--- a/src/test/ui/regions/regions-early-bound-error.rs
+++ b/src/test/ui/regions/regions-early-bound-error.rs
@@ -1,10 +1,6 @@
 // Tests that you can use a fn lifetime parameter as part of
 // the value for a type parameter in a bound.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait GetRef<'a, T> {
     fn get(&self) -> &'a T;
 }
@@ -21,8 +17,7 @@ impl<'a,T:Clone> GetRef<'a,T> for Box<'a,T> {
 
 fn get<'a,'b,G:GetRef<'a, isize>>(g1: G, b: &'b isize) -> &'b isize {
     g1.get()
-    //[base]~^ ERROR E0312
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/regions/regions-early-bound-error.nll.stderr b/src/test/ui/regions/regions-early-bound-error.stderr
index f57249e4e8f..eb4cd5ca72e 100644
--- a/src/test/ui/regions/regions-early-bound-error.nll.stderr
+++ b/src/test/ui/regions/regions-early-bound-error.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-early-bound-error.rs:23:5
+  --> $DIR/regions-early-bound-error.rs:19:5
    |
 LL | fn get<'a,'b,G:GetRef<'a, isize>>(g1: G, b: &'b isize) -> &'b isize {
    |        -- -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/regions-fn-subtyping-return-static-fail.nll.stderr b/src/test/ui/regions/regions-fn-subtyping-return-static-fail.nll.stderr
deleted file mode 100644
index 4616035870a..00000000000
--- a/src/test/ui/regions/regions-fn-subtyping-return-static-fail.nll.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/regions-fn-subtyping-return-static-fail.rs:52:12
-   |
-LL |     want_G(baz);
-   |     ------ ^^^ one type is more general than the other
-   |     |
-   |     arguments to this function are incorrect
-   |
-   = note: expected fn pointer `for<'cx> fn(&'cx S) -> &'static S`
-                 found fn item `for<'r> fn(&'r S) -> &'r S {baz}`
-note: function defined here
-  --> $DIR/regions-fn-subtyping-return-static-fail.rs:24:4
-   |
-LL | fn want_G(f: G) {}
-   |    ^^^^^^ ----
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/regions-fn-subtyping-return-static-fail.rs b/src/test/ui/regions/regions-fn-subtyping-return-static-fail.rs
index 05c6ac0cb1a..539221b5a04 100644
--- a/src/test/ui/regions/regions-fn-subtyping-return-static-fail.rs
+++ b/src/test/ui/regions/regions-fn-subtyping-return-static-fail.rs
@@ -6,10 +6,6 @@
 // This can safely be considered to be an instance of `F` because all
 // lifetimes are sublifetimes of 'static.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 #![allow(dead_code)]
 #![allow(unused_variables)]
 
diff --git a/src/test/ui/regions/regions-fn-subtyping-return-static-fail.base.stderr b/src/test/ui/regions/regions-fn-subtyping-return-static-fail.stderr
index 4616035870a..d87d0d2f6f9 100644
--- a/src/test/ui/regions/regions-fn-subtyping-return-static-fail.base.stderr
+++ b/src/test/ui/regions/regions-fn-subtyping-return-static-fail.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/regions-fn-subtyping-return-static-fail.rs:52:12
+  --> $DIR/regions-fn-subtyping-return-static-fail.rs:48:12
    |
 LL |     want_G(baz);
    |     ------ ^^^ one type is more general than the other
@@ -9,7 +9,7 @@ LL |     want_G(baz);
    = note: expected fn pointer `for<'cx> fn(&'cx S) -> &'static S`
                  found fn item `for<'r> fn(&'r S) -> &'r S {baz}`
 note: function defined here
-  --> $DIR/regions-fn-subtyping-return-static-fail.rs:24:4
+  --> $DIR/regions-fn-subtyping-return-static-fail.rs:20:4
    |
 LL | fn want_G(f: G) {}
    |    ^^^^^^ ----
diff --git a/src/test/ui/regions/regions-free-region-ordering-callee.base.stderr b/src/test/ui/regions/regions-free-region-ordering-callee.base.stderr
deleted file mode 100644
index ae6d95dd469..00000000000
--- a/src/test/ui/regions/regions-free-region-ordering-callee.base.stderr
+++ /dev/null
@@ -1,25 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/regions-free-region-ordering-callee.rs:17:5
-   |
-LL | fn ordering2<'a, 'b>(x: &'a &'b usize, y: &'a usize) -> &'b usize {
-   |                         -------------                   ---------
-   |                         |
-   |                         this parameter and the return type are declared with different lifetimes...
-LL |     // However, it is not safe to assume that 'b <= 'a
-LL |     &*y
-   |     ^^^ ...but data from `x` is returned here
-
-error[E0623]: lifetime mismatch
-  --> $DIR/regions-free-region-ordering-callee.rs:24:24
-   |
-LL | fn ordering3<'a, 'b>(x: &'a usize, y: &'b usize) -> &'a &'b usize {
-   |                                       ---------     -------------
-   |                                       |
-   |                                       this parameter and the return type are declared with different lifetimes...
-LL |     // Do not infer an ordering from the return value.
-LL |     let z: &'b usize = &*x;
-   |                        ^^^ ...but data from `x` is returned here
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/regions/regions-free-region-ordering-callee.rs b/src/test/ui/regions/regions-free-region-ordering-callee.rs
index eca863f2e79..8158e81e1dd 100644
--- a/src/test/ui/regions/regions-free-region-ordering-callee.rs
+++ b/src/test/ui/regions/regions-free-region-ordering-callee.rs
@@ -2,10 +2,6 @@
 // that appear in their parameter list.  See also
 // regions-free-region-ordering-caller.rs
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn ordering1<'a, 'b>(x: &'a &'b usize) -> &'a usize {
     // It is safe to assume that 'a <= 'b due to the type of x
     let y: &'b usize = &**x;
@@ -15,15 +11,13 @@ fn ordering1<'a, 'b>(x: &'a &'b usize) -> &'a usize {
 fn ordering2<'a, 'b>(x: &'a &'b usize, y: &'a usize) -> &'b usize {
     // However, it is not safe to assume that 'b <= 'a
     &*y
-    //[base]~^ ERROR lifetime mismatch [E0623]
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn ordering3<'a, 'b>(x: &'a usize, y: &'b usize) -> &'a &'b usize {
     // Do not infer an ordering from the return value.
     let z: &'b usize = &*x;
-    //[base]~^ ERROR lifetime mismatch [E0623]
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
     panic!();
 }
 
diff --git a/src/test/ui/regions/regions-free-region-ordering-callee.nll.stderr b/src/test/ui/regions/regions-free-region-ordering-callee.stderr
index 7dfff2bb060..a1b46a692f9 100644
--- a/src/test/ui/regions/regions-free-region-ordering-callee.nll.stderr
+++ b/src/test/ui/regions/regions-free-region-ordering-callee.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-free-region-ordering-callee.rs:17:5
+  --> $DIR/regions-free-region-ordering-callee.rs:13:5
    |
 LL | fn ordering2<'a, 'b>(x: &'a &'b usize, y: &'a usize) -> &'b usize {
    |              --  -- lifetime `'b` defined here
@@ -12,7 +12,7 @@ LL |     &*y
    = help: consider adding the following bound: `'a: 'b`
 
 error: lifetime may not live long enough
-  --> $DIR/regions-free-region-ordering-callee.rs:24:12
+  --> $DIR/regions-free-region-ordering-callee.rs:19:12
    |
 LL | fn ordering3<'a, 'b>(x: &'a usize, y: &'b usize) -> &'a &'b usize {
    |              --  -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/regions-free-region-ordering-caller.migrate.stderr b/src/test/ui/regions/regions-free-region-ordering-caller.migrate.stderr
deleted file mode 100644
index a27a010d7f3..00000000000
--- a/src/test/ui/regions/regions-free-region-ordering-caller.migrate.stderr
+++ /dev/null
@@ -1,54 +0,0 @@
-error[E0491]: in type `&'b &'a usize`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-free-region-ordering-caller.rs:16:12
-   |
-LL |     let z: Option<&'b &'a usize> = None;
-   |            ^^^^^^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime `'b` as defined here
-  --> $DIR/regions-free-region-ordering-caller.rs:15:14
-   |
-LL | fn call2<'a, 'b>(a: &'a usize, b: &'b usize) {
-   |              ^^
-note: but the referenced data is only valid for the lifetime `'a` as defined here
-  --> $DIR/regions-free-region-ordering-caller.rs:15:10
-   |
-LL | fn call2<'a, 'b>(a: &'a usize, b: &'b usize) {
-   |          ^^
-
-error[E0491]: in type `&'b Paramd<'a>`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-free-region-ordering-caller.rs:22:12
-   |
-LL |     let z: Option<&'b Paramd<'a>> = None;
-   |            ^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime `'b` as defined here
-  --> $DIR/regions-free-region-ordering-caller.rs:20:14
-   |
-LL | fn call3<'a, 'b>(a: &'a usize, b: &'b usize) {
-   |              ^^
-note: but the referenced data is only valid for the lifetime `'a` as defined here
-  --> $DIR/regions-free-region-ordering-caller.rs:20:10
-   |
-LL | fn call3<'a, 'b>(a: &'a usize, b: &'b usize) {
-   |          ^^
-
-error[E0491]: in type `&'a &'b usize`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-free-region-ordering-caller.rs:27:12
-   |
-LL |     let z: Option<&'a &'b usize> = None;
-   |            ^^^^^^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime `'a` as defined here
-  --> $DIR/regions-free-region-ordering-caller.rs:26:10
-   |
-LL | fn call4<'a, 'b>(a: &'a usize, b: &'b usize) {
-   |          ^^
-note: but the referenced data is only valid for the lifetime `'b` as defined here
-  --> $DIR/regions-free-region-ordering-caller.rs:26:14
-   |
-LL | fn call4<'a, 'b>(a: &'a usize, b: &'b usize) {
-   |              ^^
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/regions/regions-free-region-ordering-caller.rs b/src/test/ui/regions/regions-free-region-ordering-caller.rs
index 11997a5fb56..2e83c3258be 100644
--- a/src/test/ui/regions/regions-free-region-ordering-caller.rs
+++ b/src/test/ui/regions/regions-free-region-ordering-caller.rs
@@ -2,30 +2,22 @@
 // than the thing it points at and ensure that they result in
 // errors. See also regions-free-region-ordering-callee.rs
 
-// revisions: migrate nll
-//[nll]compile-flags: -Z borrowck=mir
-
-// Since we are testing nll (and migration) explicitly as a separate
-// revisions, don't worry about the --compare-mode=nll on this test.
-
-// ignore-compare-mode-nll
-
 struct Paramd<'a> { x: &'a usize }
 
 fn call2<'a, 'b>(a: &'a usize, b: &'b usize) {
-    let z: Option<&'b &'a usize> = None;//[migrate]~ ERROR E0491
-    //[nll]~^ ERROR lifetime may not live long enough
+    let z: Option<&'b &'a usize> = None;
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn call3<'a, 'b>(a: &'a usize, b: &'b usize) {
     let y: Paramd<'a> = Paramd { x: a };
-    let z: Option<&'b Paramd<'a>> = None;//[migrate]~ ERROR E0491
-    //[nll]~^ ERROR lifetime may not live long enough
+    let z: Option<&'b Paramd<'a>> = None;
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn call4<'a, 'b>(a: &'a usize, b: &'b usize) {
-    let z: Option<&'a &'b usize> = None;//[migrate]~ ERROR E0491
-    //[nll]~^ ERROR lifetime may not live long enough
+    let z: Option<&'a &'b usize> = None;
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/regions/regions-free-region-ordering-caller.nll.stderr b/src/test/ui/regions/regions-free-region-ordering-caller.stderr
index 546eb93d8ec..c79ed50c6a4 100644
--- a/src/test/ui/regions/regions-free-region-ordering-caller.nll.stderr
+++ b/src/test/ui/regions/regions-free-region-ordering-caller.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-free-region-ordering-caller.rs:16:12
+  --> $DIR/regions-free-region-ordering-caller.rs:8:12
    |
 LL | fn call2<'a, 'b>(a: &'a usize, b: &'b usize) {
    |          --  -- lifetime `'b` defined here
@@ -11,7 +11,7 @@ LL |     let z: Option<&'b &'a usize> = None;
    = help: consider adding the following bound: `'a: 'b`
 
 error: lifetime may not live long enough
-  --> $DIR/regions-free-region-ordering-caller.rs:22:12
+  --> $DIR/regions-free-region-ordering-caller.rs:14:12
    |
 LL | fn call3<'a, 'b>(a: &'a usize, b: &'b usize) {
    |          --  -- lifetime `'b` defined here
@@ -24,7 +24,7 @@ LL |     let z: Option<&'b Paramd<'a>> = None;
    = help: consider adding the following bound: `'a: 'b`
 
 error: lifetime may not live long enough
-  --> $DIR/regions-free-region-ordering-caller.rs:27:12
+  --> $DIR/regions-free-region-ordering-caller.rs:19:12
    |
 LL | fn call4<'a, 'b>(a: &'a usize, b: &'b usize) {
    |          --  -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/regions-free-region-ordering-incorrect.base.stderr b/src/test/ui/regions/regions-free-region-ordering-incorrect.base.stderr
deleted file mode 100644
index eb4ffce89a3..00000000000
--- a/src/test/ui/regions/regions-free-region-ordering-incorrect.base.stderr
+++ /dev/null
@@ -1,33 +0,0 @@
-error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements
-  --> $DIR/regions-free-region-ordering-incorrect.rs:21:21
-   |
-LL |             None => &self.val
-   |                     ^^^^^^^^^
-   |
-note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
-  --> $DIR/regions-free-region-ordering-incorrect.rs:18:12
-   |
-LL |     fn get<'a>(&'a self) -> &'b T {
-   |            ^^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/regions-free-region-ordering-incorrect.rs:21:21
-   |
-LL |             None => &self.val
-   |                     ^^^^^^^^^
-note: but, the lifetime must be valid for the lifetime `'b` as defined here...
-  --> $DIR/regions-free-region-ordering-incorrect.rs:17:6
-   |
-LL | impl<'b, T> Node<'b, T> {
-   |      ^^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/regions-free-region-ordering-incorrect.rs:19:9
-   |
-LL | /         match self.next {
-LL | |             Some(ref next) => next.get(),
-LL | |             None => &self.val
-LL | |         }
-   | |_________^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/regions/regions-free-region-ordering-incorrect.rs b/src/test/ui/regions/regions-free-region-ordering-incorrect.rs
index 43427d13ffa..1aee6e87644 100644
--- a/src/test/ui/regions/regions-free-region-ordering-incorrect.rs
+++ b/src/test/ui/regions/regions-free-region-ordering-incorrect.rs
@@ -5,10 +5,6 @@
 //
 // This test began its life as a test for issue #4325.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Node<'b, T: 'b> {
     val: T,
     next: Option<&'b Node<'b, T>>
@@ -16,9 +12,9 @@ struct Node<'b, T: 'b> {
 
 impl<'b, T> Node<'b, T> {
     fn get<'a>(&'a self) -> &'b T {
-        match self.next { //[nll]~ ERROR lifetime may not live long enough
+        match self.next { //~ ERROR lifetime may not live long enough
             Some(ref next) => next.get(),
-            None => &self.val //[base]~ ERROR cannot infer
+            None => &self.val
         }
     }
 }
diff --git a/src/test/ui/regions/regions-free-region-ordering-incorrect.nll.stderr b/src/test/ui/regions/regions-free-region-ordering-incorrect.stderr
index 336cfd3e6c5..f7c75033c04 100644
--- a/src/test/ui/regions/regions-free-region-ordering-incorrect.nll.stderr
+++ b/src/test/ui/regions/regions-free-region-ordering-incorrect.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-free-region-ordering-incorrect.rs:19:9
+  --> $DIR/regions-free-region-ordering-incorrect.rs:15:9
    |
 LL |   impl<'b, T> Node<'b, T> {
    |        -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/regions-implied-bounds-projection-gap-1.base.stderr b/src/test/ui/regions/regions-implied-bounds-projection-gap-1.base.stderr
deleted file mode 100644
index 85ced4b5241..00000000000
--- a/src/test/ui/regions/regions-implied-bounds-projection-gap-1.base.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-implied-bounds-projection-gap-1.rs:20:10
-   |
-LL |     wf::<&'x T>();
-   |          ^^^^^ ...so that the reference type `&'x T` does not outlive the data it points at
-   |
-help: consider adding an explicit lifetime bound...
-   |
-LL | fn func<'x, T:Trait1<'x> + 'x>(t: &'x T::Foo)
-   |                          ++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0309`.
diff --git a/src/test/ui/regions/regions-implied-bounds-projection-gap-1.rs b/src/test/ui/regions/regions-implied-bounds-projection-gap-1.rs
index f11fc207b91..38fc9c462da 100644
--- a/src/test/ui/regions/regions-implied-bounds-projection-gap-1.rs
+++ b/src/test/ui/regions/regions-implied-bounds-projection-gap-1.rs
@@ -3,10 +3,6 @@
 // there might be other ways for the caller of `func` to show that
 // `T::Foo: 'x` holds (e.g., where-clause).
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Trait1<'x> {
     type Foo;
 }
diff --git a/src/test/ui/regions/regions-implied-bounds-projection-gap-1.nll.stderr b/src/test/ui/regions/regions-implied-bounds-projection-gap-1.stderr
index 1a428eb25d7..7c9f405563c 100644
--- a/src/test/ui/regions/regions-implied-bounds-projection-gap-1.nll.stderr
+++ b/src/test/ui/regions/regions-implied-bounds-projection-gap-1.stderr
@@ -1,5 +1,5 @@
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-implied-bounds-projection-gap-1.rs:20:5
+  --> $DIR/regions-implied-bounds-projection-gap-1.rs:16:5
    |
 LL |     wf::<&'x T>();
    |     ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
diff --git a/src/test/ui/regions/regions-infer-bound-from-trait-self.base.stderr b/src/test/ui/regions/regions-infer-bound-from-trait-self.base.stderr
deleted file mode 100644
index faa638aa281..00000000000
--- a/src/test/ui/regions/regions-infer-bound-from-trait-self.base.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0309]: the parameter type `Self` may not live long enough
-  --> $DIR/regions-infer-bound-from-trait-self.rs:50:9
-   |
-LL |         check_bound(x, self)
-   |         ^^^^^^^^^^^
-   |
-   = help: consider adding an explicit lifetime bound `Self: 'a`...
-   = note: ...so that the type `Self` will meet its required lifetime bounds...
-note: ...that is required by this bound
-  --> $DIR/regions-infer-bound-from-trait-self.rs:16:21
-   |
-LL | fn check_bound<'a,A:'a>(x: Inv<'a>, a: A) { }
-   |                     ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0309`.
diff --git a/src/test/ui/regions/regions-infer-bound-from-trait-self.rs b/src/test/ui/regions/regions-infer-bound-from-trait-self.rs
index ef8be05b2d2..d15bfffe9d9 100644
--- a/src/test/ui/regions/regions-infer-bound-from-trait-self.rs
+++ b/src/test/ui/regions/regions-infer-bound-from-trait-self.rs
@@ -1,10 +1,6 @@
 // Test that we can derive lifetime bounds on `Self` from trait
 // inheritance.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Static : 'static { }
 
 trait Is<'a> : 'a { }
diff --git a/src/test/ui/regions/regions-infer-bound-from-trait-self.nll.stderr b/src/test/ui/regions/regions-infer-bound-from-trait-self.stderr
index 9c886c42c72..e88f79a3a8c 100644
--- a/src/test/ui/regions/regions-infer-bound-from-trait-self.nll.stderr
+++ b/src/test/ui/regions/regions-infer-bound-from-trait-self.stderr
@@ -1,5 +1,5 @@
 error[E0309]: the parameter type `Self` may not live long enough
-  --> $DIR/regions-infer-bound-from-trait-self.rs:50:9
+  --> $DIR/regions-infer-bound-from-trait-self.rs:46:9
    |
 LL |         check_bound(x, self)
    |         ^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/regions/regions-infer-bound-from-trait.base.stderr b/src/test/ui/regions/regions-infer-bound-from-trait.base.stderr
deleted file mode 100644
index 658740f3f87..00000000000
--- a/src/test/ui/regions/regions-infer-bound-from-trait.base.stderr
+++ /dev/null
@@ -1,35 +0,0 @@
-error[E0309]: the parameter type `A` may not live long enough
-  --> $DIR/regions-infer-bound-from-trait.rs:37:5
-   |
-LL |     check_bound(x, a)
-   |     ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds...
-   |
-note: ...that is required by this bound
-  --> $DIR/regions-infer-bound-from-trait.rs:16:21
-   |
-LL | fn check_bound<'a,A:'a>(x: Inv<'a>, a: A) { }
-   |                     ^^
-help: consider adding an explicit lifetime bound...
-   |
-LL | fn bar1<'a,A: 'a>(x: Inv<'a>, a: A) {
-   |             ++++
-
-error[E0309]: the parameter type `A` may not live long enough
-  --> $DIR/regions-infer-bound-from-trait.rs:41:5
-   |
-LL |     check_bound(x, a)
-   |     ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds...
-   |
-note: ...that is required by this bound
-  --> $DIR/regions-infer-bound-from-trait.rs:16:21
-   |
-LL | fn check_bound<'a,A:'a>(x: Inv<'a>, a: A) { }
-   |                     ^^
-help: consider adding an explicit lifetime bound...
-   |
-LL | fn bar2<'a,'b,A:Is<'b> + 'a>(x: Inv<'a>, y: Inv<'b>, a: A) {
-   |                        ++++
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0309`.
diff --git a/src/test/ui/regions/regions-infer-bound-from-trait.rs b/src/test/ui/regions/regions-infer-bound-from-trait.rs
index 96f9125313b..610452182f8 100644
--- a/src/test/ui/regions/regions-infer-bound-from-trait.rs
+++ b/src/test/ui/regions/regions-infer-bound-from-trait.rs
@@ -1,10 +1,6 @@
 // Test that we can derive lifetime bounds on type parameters
 // from trait inheritance.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Static : 'static { }
 
 trait Is<'a> : 'a { }
diff --git a/src/test/ui/regions/regions-infer-bound-from-trait.nll.stderr b/src/test/ui/regions/regions-infer-bound-from-trait.stderr
index 5cc2d20c2e0..3ee71543d15 100644
--- a/src/test/ui/regions/regions-infer-bound-from-trait.nll.stderr
+++ b/src/test/ui/regions/regions-infer-bound-from-trait.stderr
@@ -1,5 +1,5 @@
 error[E0309]: the parameter type `A` may not live long enough
-  --> $DIR/regions-infer-bound-from-trait.rs:37:5
+  --> $DIR/regions-infer-bound-from-trait.rs:33:5
    |
 LL |     check_bound(x, a)
    |     ^^^^^^^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
@@ -10,7 +10,7 @@ LL | fn bar1<'a,A: 'a>(x: Inv<'a>, a: A) {
    |             ++++
 
 error[E0309]: the parameter type `A` may not live long enough
-  --> $DIR/regions-infer-bound-from-trait.rs:41:5
+  --> $DIR/regions-infer-bound-from-trait.rs:37:5
    |
 LL |     check_bound(x, a)
    |     ^^^^^^^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
diff --git a/src/test/ui/regions/regions-infer-contravariance-due-to-decl.base.stderr b/src/test/ui/regions/regions-infer-contravariance-due-to-decl.base.stderr
deleted file mode 100644
index fbe2c0da6e2..00000000000
--- a/src/test/ui/regions/regions-infer-contravariance-due-to-decl.base.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/regions-infer-contravariance-due-to-decl.rs:29:35
-   |
-LL | fn use_<'short,'long>(c: Contravariant<'short>,
-   |                          --------------------- these two types are declared with different lifetimes...
-LL |                       s: &'short isize,
-LL |                       l: &'long isize,
-   |                          ------------
-...
-LL |     let _: Contravariant<'long> = c;
-   |                                   ^ ...but data from `c` flows into `l` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/regions/regions-infer-contravariance-due-to-decl.rs b/src/test/ui/regions/regions-infer-contravariance-due-to-decl.rs
index 233f72fd296..fbc0cec562f 100644
--- a/src/test/ui/regions/regions-infer-contravariance-due-to-decl.rs
+++ b/src/test/ui/regions/regions-infer-contravariance-due-to-decl.rs
@@ -4,10 +4,6 @@
 // Note: see variance-regions-*.rs for the tests that check that the
 // variance inference works in the first place.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 use std::marker;
 
 // This is contravariant with respect to 'a, meaning that
@@ -27,8 +23,7 @@ fn use_<'short,'long>(c: Contravariant<'short>,
     // covariant with respect to its parameter 'a.
 
     let _: Contravariant<'long> = c;
-    //[base]~^ ERROR E0623
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/regions/regions-infer-contravariance-due-to-decl.nll.stderr b/src/test/ui/regions/regions-infer-contravariance-due-to-decl.stderr
index 0b1bf5271a7..94b80852d01 100644
--- a/src/test/ui/regions/regions-infer-contravariance-due-to-decl.nll.stderr
+++ b/src/test/ui/regions/regions-infer-contravariance-due-to-decl.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-infer-contravariance-due-to-decl.rs:29:12
+  --> $DIR/regions-infer-contravariance-due-to-decl.rs:25:12
    |
 LL | fn use_<'short,'long>(c: Contravariant<'short>,
    |         ------ ----- lifetime `'long` defined here
diff --git a/src/test/ui/regions/regions-infer-covariance-due-to-decl.base.stderr b/src/test/ui/regions/regions-infer-covariance-due-to-decl.base.stderr
deleted file mode 100644
index bb22e15af69..00000000000
--- a/src/test/ui/regions/regions-infer-covariance-due-to-decl.base.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/regions-infer-covariance-due-to-decl.rs:26:32
-   |
-LL | fn use_<'short,'long>(c: Covariant<'long>,
-   |                          ----------------
-LL |                       s: &'short isize,
-   |                          ------------- these two types are declared with different lifetimes...
-...
-LL |     let _: Covariant<'short> = c;
-   |                                ^ ...but data from `s` flows into `c` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/regions/regions-infer-covariance-due-to-decl.rs b/src/test/ui/regions/regions-infer-covariance-due-to-decl.rs
index c4225e76967..03c0e436e31 100644
--- a/src/test/ui/regions/regions-infer-covariance-due-to-decl.rs
+++ b/src/test/ui/regions/regions-infer-covariance-due-to-decl.rs
@@ -4,10 +4,6 @@
 // Note: see variance-regions-*.rs for the tests that check that the
 // variance inference works in the first place.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 use std::marker;
 
 struct Covariant<'a> {
@@ -24,8 +20,7 @@ fn use_<'short,'long>(c: Covariant<'long>,
     // contravariant with respect to its parameter 'a.
 
     let _: Covariant<'short> = c;
-    //[base]~^ ERROR E0623
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/regions/regions-infer-covariance-due-to-decl.nll.stderr b/src/test/ui/regions/regions-infer-covariance-due-to-decl.stderr
index 4d72b8471dc..f44a0fad59b 100644
--- a/src/test/ui/regions/regions-infer-covariance-due-to-decl.nll.stderr
+++ b/src/test/ui/regions/regions-infer-covariance-due-to-decl.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-infer-covariance-due-to-decl.rs:26:12
+  --> $DIR/regions-infer-covariance-due-to-decl.rs:22:12
    |
 LL | fn use_<'short,'long>(c: Covariant<'long>,
    |         ------ ----- lifetime `'long` defined here
diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-decl.base.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-decl.base.stderr
deleted file mode 100644
index dc7d0005ca2..00000000000
--- a/src/test/ui/regions/regions-infer-invariance-due-to-decl.base.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/regions-infer-invariance-due-to-decl.rs:16:5
-   |
-LL |     b_isize
-   |     ^^^^^^^ lifetime mismatch
-   |
-   = note: expected struct `Invariant<'static>`
-              found struct `Invariant<'r>`
-note: the lifetime `'r` as defined here...
-  --> $DIR/regions-infer-invariance-due-to-decl.rs:15:23
-   |
-LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> {
-   |                       ^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-decl.rs b/src/test/ui/regions/regions-infer-invariance-due-to-decl.rs
index 6433773b2d1..102abc0e0d8 100644
--- a/src/test/ui/regions/regions-infer-invariance-due-to-decl.rs
+++ b/src/test/ui/regions/regions-infer-invariance-due-to-decl.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 use std::marker;
 
 struct Invariant<'a> {
@@ -14,8 +10,7 @@ fn to_same_lifetime<'r>(b_isize: Invariant<'r>) {
 
 fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> {
     b_isize
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-decl.nll.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-decl.stderr
index d7b7f9883a7..c8c7808e06c 100644
--- a/src/test/ui/regions/regions-infer-invariance-due-to-decl.nll.stderr
+++ b/src/test/ui/regions/regions-infer-invariance-due-to-decl.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-infer-invariance-due-to-decl.rs:16:5
+  --> $DIR/regions-infer-invariance-due-to-decl.rs:12:5
    |
 LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> {
    |                       -- lifetime `'r` defined here
diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.base.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.base.stderr
deleted file mode 100644
index b2530d7b6cd..00000000000
--- a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.base.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/regions-infer-invariance-due-to-mutability-3.rs:14:5
-   |
-LL |     b_isize
-   |     ^^^^^^^ lifetime mismatch
-   |
-   = note: expected struct `Invariant<'static>`
-              found struct `Invariant<'r>`
-note: the lifetime `'r` as defined here...
-  --> $DIR/regions-infer-invariance-due-to-mutability-3.rs:13:23
-   |
-LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> {
-   |                       ^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.rs b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.rs
index 4690f9d8b08..c1fb41bd917 100644
--- a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.rs
+++ b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Invariant<'a> {
     f: Box<dyn FnOnce(&mut &'a isize) + 'static>,
 }
@@ -12,8 +8,7 @@ fn to_same_lifetime<'r>(b_isize: Invariant<'r>) {
 
 fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> {
     b_isize
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.nll.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.stderr
index 37fa5e3bf44..1165011c1f4 100644
--- a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.nll.stderr
+++ b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-infer-invariance-due-to-mutability-3.rs:14:5
+  --> $DIR/regions-infer-invariance-due-to-mutability-3.rs:10:5
    |
 LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> {
    |                       -- lifetime `'r` defined here
diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.base.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.base.stderr
deleted file mode 100644
index 12774ca92e2..00000000000
--- a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.base.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/regions-infer-invariance-due-to-mutability-4.rs:14:5
-   |
-LL |     b_isize
-   |     ^^^^^^^ lifetime mismatch
-   |
-   = note: expected struct `Invariant<'static>`
-              found struct `Invariant<'r>`
-note: the lifetime `'r` as defined here...
-  --> $DIR/regions-infer-invariance-due-to-mutability-4.rs:13:23
-   |
-LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> {
-   |                       ^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.rs b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.rs
index 8e257c4fd0e..1078f77a04e 100644
--- a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.rs
+++ b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Invariant<'a> {
     f: Box<dyn FnOnce() -> *mut &'a isize + 'static>,
 }
@@ -12,8 +8,7 @@ fn to_same_lifetime<'r>(b_isize: Invariant<'r>) {
 
 fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> {
     b_isize
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.nll.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.stderr
index 1b3ef7bc028..f3973a93bad 100644
--- a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.nll.stderr
+++ b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-infer-invariance-due-to-mutability-4.rs:14:5
+  --> $DIR/regions-infer-invariance-due-to-mutability-4.rs:10:5
    |
 LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> {
    |                       -- lifetime `'r` defined here
diff --git a/src/test/ui/regions/regions-infer-not-param.base.stderr b/src/test/ui/regions/regions-infer-not-param.base.stderr
deleted file mode 100644
index f43274163d0..00000000000
--- a/src/test/ui/regions/regions-infer-not-param.base.stderr
+++ /dev/null
@@ -1,60 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/regions-infer-not-param.rs:19:54
-   |
-LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p }
-   |                                                      ^ lifetime mismatch
-   |
-   = note: expected struct `Direct<'b>`
-              found struct `Direct<'a>`
-note: the lifetime `'a` as defined here...
-  --> $DIR/regions-infer-not-param.rs:19:16
-   |
-LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p }
-   |                ^^
-note: ...does not necessarily outlive the lifetime `'b` as defined here
-  --> $DIR/regions-infer-not-param.rs:19:19
-   |
-LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p }
-   |                   ^^
-
-error[E0308]: mismatched types
-  --> $DIR/regions-infer-not-param.rs:25:63
-   |
-LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
-   |                                                               ^ lifetime mismatch
-   |
-   = note: expected struct `Indirect2<'b>`
-              found struct `Indirect2<'a>`
-note: the lifetime `'a` as defined here...
-  --> $DIR/regions-infer-not-param.rs:25:19
-   |
-LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
-   |                   ^^
-note: ...does not necessarily outlive the lifetime `'b` as defined here
-  --> $DIR/regions-infer-not-param.rs:25:22
-   |
-LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
-   |                      ^^
-
-error[E0308]: mismatched types
-  --> $DIR/regions-infer-not-param.rs:25:63
-   |
-LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
-   |                                                               ^ lifetime mismatch
-   |
-   = note: expected struct `Indirect2<'b>`
-              found struct `Indirect2<'a>`
-note: the lifetime `'b` as defined here...
-  --> $DIR/regions-infer-not-param.rs:25:22
-   |
-LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
-   |                      ^^
-note: ...does not necessarily outlive the lifetime `'a` as defined here
-  --> $DIR/regions-infer-not-param.rs:25:19
-   |
-LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
-   |                   ^^
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/regions-infer-not-param.rs b/src/test/ui/regions/regions-infer-not-param.rs
index 0b8af5bc152..c3766bce18a 100644
--- a/src/test/ui/regions/regions-infer-not-param.rs
+++ b/src/test/ui/regions/regions-infer-not-param.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Direct<'a> {
     f: &'a isize
 }
@@ -17,19 +13,12 @@ struct Indirect2<'a> {
 }
 
 fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p }
-//[base]~^ ERROR mismatched types
-//[nll]~^^ ERROR lifetime may not live long enough
+//~^ ERROR lifetime may not live long enough
 
 fn take_indirect1(p: Indirect1) -> Indirect1 { p }
 
 fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
-//[base]~^ ERROR mismatched types
-//[base]~| expected struct `Indirect2<'b>`
-//[base]~| found struct `Indirect2<'a>`
-//[base]~| ERROR mismatched types
-//[base]~| expected struct `Indirect2<'b>`
-//[base]~| found struct `Indirect2<'a>`
-//[nll]~^^^^^^^ ERROR lifetime may not live long enough
-//[nll]~| ERROR lifetime may not live long enough
+//~^ ERROR lifetime may not live long enough
+//~| ERROR lifetime may not live long enough
 
 fn main() {}
diff --git a/src/test/ui/regions/regions-infer-not-param.nll.stderr b/src/test/ui/regions/regions-infer-not-param.stderr
index 95e6b03c350..d12f07a7728 100644
--- a/src/test/ui/regions/regions-infer-not-param.nll.stderr
+++ b/src/test/ui/regions/regions-infer-not-param.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-infer-not-param.rs:19:54
+  --> $DIR/regions-infer-not-param.rs:15:54
    |
 LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p }
    |                -- -- lifetime `'b` defined here      ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
@@ -9,7 +9,7 @@ LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p }
    = help: consider adding the following bound: `'a: 'b`
 
 error: lifetime may not live long enough
-  --> $DIR/regions-infer-not-param.rs:25:63
+  --> $DIR/regions-infer-not-param.rs:20:63
    |
 LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
    |                   -- -- lifetime `'b` defined here            ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
@@ -22,7 +22,7 @@ LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/regions-infer-not-param.rs:25:63
+  --> $DIR/regions-infer-not-param.rs:20:63
    |
 LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
    |                   -- -- lifetime `'b` defined here            ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
diff --git a/src/test/ui/regions/regions-infer-paramd-indirect.base.stderr b/src/test/ui/regions/regions-infer-paramd-indirect.base.stderr
deleted file mode 100644
index 1d4471f910d..00000000000
--- a/src/test/ui/regions/regions-infer-paramd-indirect.base.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/regions-infer-paramd-indirect.rs:26:18
-   |
-LL |         self.f = b;
-   |                  ^ lifetime mismatch
-   |
-   = note: expected struct `Box<Box<&'a isize>>`
-              found struct `Box<Box<&isize>>`
-note: the anonymous lifetime defined here...
-  --> $DIR/regions-infer-paramd-indirect.rs:25:36
-   |
-LL |     fn set_f_bad(&mut self, b: Box<B>) {
-   |                                    ^
-note: ...does not necessarily outlive the lifetime `'a` as defined here
-  --> $DIR/regions-infer-paramd-indirect.rs:20:6
-   |
-LL | impl<'a> SetF<'a> for C<'a> {
-   |      ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/regions-infer-paramd-indirect.rs b/src/test/ui/regions/regions-infer-paramd-indirect.rs
index 060306f611e..978c84e5374 100644
--- a/src/test/ui/regions/regions-infer-paramd-indirect.rs
+++ b/src/test/ui/regions/regions-infer-paramd-indirect.rs
@@ -1,10 +1,6 @@
 // Check that we correctly infer that b and c must be region
 // parameterized because they reference a which requires a region.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 type A<'a> = &'a isize;
 type B<'a> = Box<A<'a>>;
 
@@ -24,11 +20,7 @@ impl<'a> SetF<'a> for C<'a> {
 
     fn set_f_bad(&mut self, b: Box<B>) {
         self.f = b;
-        //[base]~^ ERROR mismatched types
-        //[base]~| expected struct `Box<Box<&'a isize>>`
-        //[base]~| found struct `Box<Box<&isize>>`
-        //[base]~| lifetime mismatch
-        //[nll]~^^^^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
diff --git a/src/test/ui/regions/regions-infer-paramd-indirect.nll.stderr b/src/test/ui/regions/regions-infer-paramd-indirect.stderr
index 96377cbdab4..afabdc1de1c 100644
--- a/src/test/ui/regions/regions-infer-paramd-indirect.nll.stderr
+++ b/src/test/ui/regions/regions-infer-paramd-indirect.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-infer-paramd-indirect.rs:26:9
+  --> $DIR/regions-infer-paramd-indirect.rs:22:9
    |
 LL | impl<'a> SetF<'a> for C<'a> {
    |      -- lifetime `'a` defined here
diff --git a/src/test/ui/regions/regions-lifetime-bounds-on-fns.base.stderr b/src/test/ui/regions/regions-lifetime-bounds-on-fns.base.stderr
deleted file mode 100644
index 613e9af90a4..00000000000
--- a/src/test/ui/regions/regions-lifetime-bounds-on-fns.base.stderr
+++ /dev/null
@@ -1,31 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/regions-lifetime-bounds-on-fns.rs:12:10
-   |
-LL | fn b<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) {
-   |                      ---------          --------- these two types are declared with different lifetimes...
-LL |     // Illegal now because there is no `'b:'a` declaration.
-LL |     *x = *y;
-   |          ^^ ...but data from `y` flows into `x` here
-
-error[E0623]: lifetime mismatch
-  --> $DIR/regions-lifetime-bounds-on-fns.rs:19:7
-   |
-LL | fn c<'a,'b>(x: &mut &'a isize, y: &mut &'b isize) {
-   |                     ---------          --------- these two types are declared with different lifetimes...
-...
-LL |     a(x, y);
-   |       ^ ...but data from `y` flows into `x` here
-
-error[E0308]: mismatched types
-  --> $DIR/regions-lifetime-bounds-on-fns.rs:26:43
-   |
-LL |     let _: fn(&mut &isize, &mut &isize) = a;
-   |                                           ^ one type is more general than the other
-   |
-   = note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)`
-                 found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}`
-
-error: aborting due to 3 previous errors
-
-Some errors have detailed explanations: E0308, E0623.
-For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/regions-lifetime-bounds-on-fns.rs b/src/test/ui/regions/regions-lifetime-bounds-on-fns.rs
index ef5e5cb12ef..177f52fa72d 100644
--- a/src/test/ui/regions/regions-lifetime-bounds-on-fns.rs
+++ b/src/test/ui/regions/regions-lifetime-bounds-on-fns.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn a<'a, 'b:'a>(x: &mut &'a isize, y: &mut &'b isize) {
     // Note: this is legal because of the `'b:'a` declaration.
     *x = *y;
@@ -10,14 +6,12 @@ fn a<'a, 'b:'a>(x: &mut &'a isize, y: &mut &'b isize) {
 fn b<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) {
     // Illegal now because there is no `'b:'a` declaration.
     *x = *y;
-    //[base]~^ ERROR lifetime mismatch [E0623]
 }
 
 fn c<'a,'b>(x: &mut &'a isize, y: &mut &'b isize) {
     // Here we try to call `foo` but do not know that `'a` and `'b` are
     // related as required.
     a(x, y);
-    //[base]~^ ERROR lifetime mismatch [E0623]
 }
 
 fn d() {
diff --git a/src/test/ui/regions/regions-lifetime-bounds-on-fns.nll.stderr b/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr
index 268a60968b7..a0daf58c6b5 100644
--- a/src/test/ui/regions/regions-lifetime-bounds-on-fns.nll.stderr
+++ b/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/regions-lifetime-bounds-on-fns.rs:26:43
+  --> $DIR/regions-lifetime-bounds-on-fns.rs:20:43
    |
 LL |     let _: fn(&mut &isize, &mut &isize) = a;
    |                                           ^ one type is more general than the other
diff --git a/src/test/ui/regions/regions-nested-fns.base.stderr b/src/test/ui/regions/regions-nested-fns.base.stderr
deleted file mode 100644
index 37ce569e761..00000000000
--- a/src/test/ui/regions/regions-nested-fns.base.stderr
+++ /dev/null
@@ -1,78 +0,0 @@
-error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
-  --> $DIR/regions-nested-fns.rs:9:18
-   |
-LL |     let mut ay = &y;
-   |                  ^^
-   |
-note: first, the lifetime cannot outlive the anonymous lifetime #1 defined here...
-  --> $DIR/regions-nested-fns.rs:13:58
-   |
-LL |       ignore::<Box<dyn for<'z> FnMut(&'z isize)>>(Box::new(|z| {
-   |  __________________________________________________________^
-LL | |         ay = x;
-LL | |         ay = &y;
-LL | |
-LL | |         ay = z;
-LL | |
-LL | |     }));
-   | |_____^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/regions-nested-fns.rs:17:14
-   |
-LL |         ay = z;
-   |              ^
-note: but, the lifetime must be valid for the anonymous lifetime #1 defined here...
-  --> $DIR/regions-nested-fns.rs:21:72
-   |
-LL |       ignore::< Box<dyn for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
-   |  ________________________________________________________________________^
-LL | |         if false { return x; }
-LL | |
-LL | |
-LL | |         if false { return ay; }
-LL | |         return z;
-LL | |     }));
-   | |_____^
-note: ...so that the types are compatible
-  --> $DIR/regions-nested-fns.rs:21:76
-   |
-LL |       ignore::< Box<dyn for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
-   |  ____________________________________________________________________________^
-LL | |         if false { return x; }
-LL | |
-LL | |
-LL | |         if false { return ay; }
-LL | |         return z;
-LL | |     }));
-   | |_____^
-   = note: expected `&isize`
-              found `&isize`
-
-error[E0312]: lifetime of reference outlives lifetime of borrowed content...
-  --> $DIR/regions-nested-fns.rs:22:27
-   |
-LL |         if false { return x; }
-   |                           ^
-   |
-note: ...the reference is valid for the anonymous lifetime #1 defined here...
-  --> $DIR/regions-nested-fns.rs:21:72
-   |
-LL |       ignore::< Box<dyn for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
-   |  ________________________________________________________________________^
-LL | |         if false { return x; }
-LL | |
-LL | |
-LL | |         if false { return ay; }
-LL | |         return z;
-LL | |     }));
-   | |_____^
-note: ...but the borrowed content is only valid for the lifetime `'x` as defined here
-  --> $DIR/regions-nested-fns.rs:7:11
-   |
-LL | fn nested<'x>(x: &'x isize) {
-   |           ^^
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0312, E0495.
-For more information about an error, try `rustc --explain E0312`.
diff --git a/src/test/ui/regions/regions-nested-fns.rs b/src/test/ui/regions/regions-nested-fns.rs
index 8cc39792bd9..d9698ced3de 100644
--- a/src/test/ui/regions/regions-nested-fns.rs
+++ b/src/test/ui/regions/regions-nested-fns.rs
@@ -1,27 +1,21 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn ignore<T>(t: T) {}
 
 fn nested<'x>(x: &'x isize) {
     let y = 3;
     let mut ay = &y;
-    //[base]~^ ERROR E0495
-    //[nll]~^^ ERROR `y` does not live long enough [E0597]
+    //~^ ERROR `y` does not live long enough [E0597]
 
     ignore::<Box<dyn for<'z> FnMut(&'z isize)>>(Box::new(|z| {
         ay = x;
         ay = &y;
-        //[nll]~^ ERROR `y` does not live long enough
+        //~^ ERROR `y` does not live long enough
         ay = z;
-        //[nll]~^ ERROR borrowed data escapes outside of closure [E0521]
+        //~^ ERROR borrowed data escapes outside of closure [E0521]
     }));
 
     ignore::< Box<dyn for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
         if false { return x; }
-        //[base]~^ ERROR E0312
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
         if false { return ay; }
         return z;
     }));
diff --git a/src/test/ui/regions/regions-nested-fns.nll.stderr b/src/test/ui/regions/regions-nested-fns.stderr
index 6f2a89994b0..bb2740310f6 100644
--- a/src/test/ui/regions/regions-nested-fns.nll.stderr
+++ b/src/test/ui/regions/regions-nested-fns.stderr
@@ -1,5 +1,5 @@
 error[E0521]: borrowed data escapes outside of closure
-  --> $DIR/regions-nested-fns.rs:17:9
+  --> $DIR/regions-nested-fns.rs:12:9
    |
 LL |     let mut ay = &y;
    |         ------ `ay` declared here, outside of the closure body
@@ -11,7 +11,7 @@ LL |         ay = z;
    |         ^^^^^^ `z` escapes the closure body here
 
 error[E0597]: `y` does not live long enough
-  --> $DIR/regions-nested-fns.rs:9:18
+  --> $DIR/regions-nested-fns.rs:5:18
    |
 LL |     let mut ay = &y;
    |                  ^^ borrowed value does not live long enough
@@ -23,7 +23,7 @@ LL | }
    | - `y` dropped here while still borrowed
 
 error[E0597]: `y` does not live long enough
-  --> $DIR/regions-nested-fns.rs:15:15
+  --> $DIR/regions-nested-fns.rs:10:15
    |
 LL |     ignore::<Box<dyn for<'z> FnMut(&'z isize)>>(Box::new(|z| {
    |                                                          --- value captured here
@@ -38,7 +38,7 @@ LL | }
    | - `y` dropped here while still borrowed
 
 error: lifetime may not live long enough
-  --> $DIR/regions-nested-fns.rs:22:27
+  --> $DIR/regions-nested-fns.rs:17:27
    |
 LL | fn nested<'x>(x: &'x isize) {
    |           -- lifetime `'x` defined here
diff --git a/src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.stderr b/src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.stderr
deleted file mode 100644
index f2308bb7c78..00000000000
--- a/src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.stderr
+++ /dev/null
@@ -1,37 +0,0 @@
-error[E0491]: in type `&'a WithHrAssoc<TheType<'b>>`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-outlives-projection-container-hrtb.rs:35:12
-   |
-LL |     let _: &'a WithHrAssoc<TheType<'b>> = loop { };
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime `'a` as defined here
-  --> $DIR/regions-outlives-projection-container-hrtb.rs:32:15
-   |
-LL | fn with_assoc<'a,'b>() {
-   |               ^^
-note: but the referenced data is only valid for the lifetime `'b` as defined here
-  --> $DIR/regions-outlives-projection-container-hrtb.rs:32:18
-   |
-LL | fn with_assoc<'a,'b>() {
-   |                  ^^
-
-error[E0491]: in type `&'a WithHrAssocSub<TheType<'b>>`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-outlives-projection-container-hrtb.rs:55:12
-   |
-LL |     let _: &'a WithHrAssocSub<TheType<'b>> = loop { };
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime `'a` as defined here
-  --> $DIR/regions-outlives-projection-container-hrtb.rs:51:19
-   |
-LL | fn with_assoc_sub<'a,'b>() {
-   |                   ^^
-note: but the referenced data is only valid for the lifetime `'b` as defined here
-  --> $DIR/regions-outlives-projection-container-hrtb.rs:51:22
-   |
-LL | fn with_assoc_sub<'a,'b>() {
-   |                      ^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/regions/regions-outlives-projection-container-hrtb.rs b/src/test/ui/regions/regions-outlives-projection-container-hrtb.rs
index 695a81dca27..152eed5ac1d 100644
--- a/src/test/ui/regions/regions-outlives-projection-container-hrtb.rs
+++ b/src/test/ui/regions/regions-outlives-projection-container-hrtb.rs
@@ -1,14 +1,6 @@
 // Test that structs with higher-ranked where clauses don't generate
 // "outlives" requirements. Issue #22246.
 
-// revisions: migrate nll
-//[nll]compile-flags: -Z borrowck=mir
-
-// Since we are testing nll (and migration) explicitly as a separate
-// revisions, don't worry about the --compare-mode=nll on this test.
-
-// ignore-compare-mode-nll
-
 #![allow(dead_code)]
 
 pub trait TheTrait<'b> {
@@ -33,8 +25,7 @@ fn with_assoc<'a,'b>() {
     // We get an error because 'b:'a does not hold:
 
     let _: &'a WithHrAssoc<TheType<'b>> = loop { };
-    //[migrate]~^ ERROR reference has a longer lifetime
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 pub trait TheSubTrait : for<'a> TheTrait<'a> {
@@ -53,8 +44,7 @@ fn with_assoc_sub<'a,'b>() {
     // below to be well-formed, it is not related to the HR relation.
 
     let _: &'a WithHrAssocSub<TheType<'b>> = loop { };
-    //[migrate]~^ ERROR reference has a longer lifetime
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 
diff --git a/src/test/ui/regions/regions-outlives-projection-container-hrtb.nll.stderr b/src/test/ui/regions/regions-outlives-projection-container-hrtb.stderr
index 472323772c1..187e9056e11 100644
--- a/src/test/ui/regions/regions-outlives-projection-container-hrtb.nll.stderr
+++ b/src/test/ui/regions/regions-outlives-projection-container-hrtb.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-outlives-projection-container-hrtb.rs:35:12
+  --> $DIR/regions-outlives-projection-container-hrtb.rs:27:12
    |
 LL | fn with_assoc<'a,'b>() {
    |               -- -- lifetime `'b` defined here
@@ -12,7 +12,7 @@ LL |     let _: &'a WithHrAssoc<TheType<'b>> = loop { };
    = help: consider adding the following bound: `'b: 'a`
 
 error: lifetime may not live long enough
-  --> $DIR/regions-outlives-projection-container-hrtb.rs:55:12
+  --> $DIR/regions-outlives-projection-container-hrtb.rs:46:12
    |
 LL | fn with_assoc_sub<'a,'b>() {
    |                   -- -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/regions-outlives-projection-container-wc.migrate.stderr b/src/test/ui/regions/regions-outlives-projection-container-wc.migrate.stderr
deleted file mode 100644
index bda2896fca4..00000000000
--- a/src/test/ui/regions/regions-outlives-projection-container-wc.migrate.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0491]: in type `&'a WithAssoc<TheType<'b>>`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-outlives-projection-container-wc.rs:38:12
-   |
-LL |     let _: &'a WithAssoc<TheType<'b>> = loop { };
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime `'a` as defined here
-  --> $DIR/regions-outlives-projection-container-wc.rs:32:15
-   |
-LL | fn with_assoc<'a,'b>() {
-   |               ^^
-note: but the referenced data is only valid for the lifetime `'b` as defined here
-  --> $DIR/regions-outlives-projection-container-wc.rs:32:18
-   |
-LL | fn with_assoc<'a,'b>() {
-   |                  ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/regions/regions-outlives-projection-container-wc.rs b/src/test/ui/regions/regions-outlives-projection-container-wc.rs
index c9b714cffb6..4fda7774b5b 100644
--- a/src/test/ui/regions/regions-outlives-projection-container-wc.rs
+++ b/src/test/ui/regions/regions-outlives-projection-container-wc.rs
@@ -3,14 +3,6 @@
 // outlive the location in which the type appears, even when the
 // constraint is in a where clause not a bound. Issue #22246.
 
-// revisions: migrate nll
-//[nll]compile-flags: -Z borrowck=mir
-
-// Since we are testing nll (and migration) explicitly as a separate
-// revisions, don't worry about the --compare-mode=nll on this test.
-
-// ignore-compare-mode-nll
-
 #![allow(dead_code)]
 
 pub trait TheTrait {
@@ -36,8 +28,7 @@ fn with_assoc<'a,'b>() {
     // which is &'b (), must outlive 'a.
 
     let _: &'a WithAssoc<TheType<'b>> = loop { };
-    //[migrate]~^ ERROR reference has a longer lifetime
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/regions/regions-outlives-projection-container-wc.nll.stderr b/src/test/ui/regions/regions-outlives-projection-container-wc.stderr
index fc32a72d508..4178e951c86 100644
--- a/src/test/ui/regions/regions-outlives-projection-container-wc.nll.stderr
+++ b/src/test/ui/regions/regions-outlives-projection-container-wc.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-outlives-projection-container-wc.rs:38:12
+  --> $DIR/regions-outlives-projection-container-wc.rs:30:12
    |
 LL | fn with_assoc<'a,'b>() {
    |               -- -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/regions-outlives-projection-container.base.stderr b/src/test/ui/regions/regions-outlives-projection-container.base.stderr
deleted file mode 100644
index 9a66f67ea6e..00000000000
--- a/src/test/ui/regions/regions-outlives-projection-container.base.stderr
+++ /dev/null
@@ -1,71 +0,0 @@
-error[E0491]: in type `&'a WithAssoc<TheType<'b>>`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-outlives-projection-container.rs:40:13
-   |
-LL |     let _x: &'a WithAssoc<TheType<'b>> = loop { };
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime `'a` as defined here
-  --> $DIR/regions-outlives-projection-container.rs:32:15
-   |
-LL | fn with_assoc<'a,'b>() {
-   |               ^^
-note: but the referenced data is only valid for the lifetime `'b` as defined here
-  --> $DIR/regions-outlives-projection-container.rs:32:18
-   |
-LL | fn with_assoc<'a,'b>() {
-   |                  ^^
-
-error[E0491]: in type `&'a WithoutAssoc<TheType<'b>>`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-outlives-projection-container.rs:59:13
-   |
-LL |     let _x: &'a WithoutAssoc<TheType<'b>> = loop { };
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime `'a` as defined here
-  --> $DIR/regions-outlives-projection-container.rs:55:18
-   |
-LL | fn without_assoc<'a,'b>() {
-   |                  ^^
-note: but the referenced data is only valid for the lifetime `'b` as defined here
-  --> $DIR/regions-outlives-projection-container.rs:55:21
-   |
-LL | fn without_assoc<'a,'b>() {
-   |                     ^^
-
-error[E0491]: in type `&'a WithAssoc<TheType<'b>>`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-outlives-projection-container.rs:69:12
-   |
-LL |     call::<&'a WithAssoc<TheType<'b>>>();
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime `'a` as defined here
-  --> $DIR/regions-outlives-projection-container.rs:64:20
-   |
-LL | fn call_with_assoc<'a,'b>() {
-   |                    ^^
-note: but the referenced data is only valid for the lifetime `'b` as defined here
-  --> $DIR/regions-outlives-projection-container.rs:64:23
-   |
-LL | fn call_with_assoc<'a,'b>() {
-   |                       ^^
-
-error[E0491]: in type `&'a WithoutAssoc<TheType<'b>>`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-outlives-projection-container.rs:77:12
-   |
-LL |     call::<&'a WithoutAssoc<TheType<'b>>>();
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime `'a` as defined here
-  --> $DIR/regions-outlives-projection-container.rs:74:23
-   |
-LL | fn call_without_assoc<'a,'b>() {
-   |                       ^^
-note: but the referenced data is only valid for the lifetime `'b` as defined here
-  --> $DIR/regions-outlives-projection-container.rs:74:26
-   |
-LL | fn call_without_assoc<'a,'b>() {
-   |                          ^^
-
-error: aborting due to 4 previous errors
-
-For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/regions/regions-outlives-projection-container.rs b/src/test/ui/regions/regions-outlives-projection-container.rs
index ccfd2213b6f..7b9829cf8ef 100644
--- a/src/test/ui/regions/regions-outlives-projection-container.rs
+++ b/src/test/ui/regions/regions-outlives-projection-container.rs
@@ -2,10 +2,6 @@
 // type of a bound that appears in the where clause on a struct must
 // outlive the location in which the type appears. Issue #22246.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 #![allow(dead_code)]
 #![feature(rustc_attrs)]
 
@@ -38,8 +34,7 @@ fn with_assoc<'a,'b>() {
     // FIXME (#54943) NLL doesn't enforce WF condition in unreachable code if
     // `_x` is changed to `_`
     let _x: &'a WithAssoc<TheType<'b>> = loop { };
-    //[base]~^ ERROR reference has a longer lifetime
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn with_assoc1<'a,'b>() where 'b : 'a {
@@ -57,8 +52,7 @@ fn without_assoc<'a,'b>() {
     // that `'b:'a` holds because the `'b` appears in `TheType<'b>`.
 
     let _x: &'a WithoutAssoc<TheType<'b>> = loop { };
-    //[base]~^ ERROR reference has a longer lifetime
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn call_with_assoc<'a,'b>() {
@@ -67,16 +61,14 @@ fn call_with_assoc<'a,'b>() {
     // no data.
 
     call::<&'a WithAssoc<TheType<'b>>>();
-    //[base]~^ ERROR reference has a longer lifetime
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn call_without_assoc<'a,'b>() {
     // As `without_assoc`, but in a distinct scenario.
 
     call::<&'a WithoutAssoc<TheType<'b>>>();
-    //[base]~^ ERROR reference has a longer lifetime
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn call<T>() { }
diff --git a/src/test/ui/regions/regions-outlives-projection-container.nll.stderr b/src/test/ui/regions/regions-outlives-projection-container.stderr
index d93eef9ce0b..073a3190022 100644
--- a/src/test/ui/regions/regions-outlives-projection-container.nll.stderr
+++ b/src/test/ui/regions/regions-outlives-projection-container.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-outlives-projection-container.rs:40:13
+  --> $DIR/regions-outlives-projection-container.rs:36:13
    |
 LL | fn with_assoc<'a,'b>() {
    |               -- -- lifetime `'b` defined here
@@ -12,7 +12,7 @@ LL |     let _x: &'a WithAssoc<TheType<'b>> = loop { };
    = help: consider adding the following bound: `'b: 'a`
 
 error: lifetime may not live long enough
-  --> $DIR/regions-outlives-projection-container.rs:59:13
+  --> $DIR/regions-outlives-projection-container.rs:54:13
    |
 LL | fn without_assoc<'a,'b>() {
    |                  -- -- lifetime `'b` defined here
@@ -25,7 +25,7 @@ LL |     let _x: &'a WithoutAssoc<TheType<'b>> = loop { };
    = help: consider adding the following bound: `'b: 'a`
 
 error: lifetime may not live long enough
-  --> $DIR/regions-outlives-projection-container.rs:69:5
+  --> $DIR/regions-outlives-projection-container.rs:63:5
    |
 LL | fn call_with_assoc<'a,'b>() {
    |                    -- -- lifetime `'b` defined here
@@ -38,7 +38,7 @@ LL |     call::<&'a WithAssoc<TheType<'b>>>();
    = help: consider adding the following bound: `'b: 'a`
 
 error: lifetime may not live long enough
-  --> $DIR/regions-outlives-projection-container.rs:77:5
+  --> $DIR/regions-outlives-projection-container.rs:70:5
    |
 LL | fn call_without_assoc<'a,'b>() {
    |                       -- -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/regions-proc-bound-capture.base.stderr b/src/test/ui/regions/regions-proc-bound-capture.base.stderr
deleted file mode 100644
index 427c6f4ec8c..00000000000
--- a/src/test/ui/regions/regions-proc-bound-capture.base.stderr
+++ /dev/null
@@ -1,29 +0,0 @@
-error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/regions-proc-bound-capture.rs:13:14
-   |
-LL | fn static_proc(x: &isize) -> Box<dyn FnMut() -> (isize) + 'static> {
-   |                   ------ this data with an anonymous lifetime `'_`...
-LL |     // This is illegal, because the region bound on `proc` is 'static.
-LL |     Box::new(move || { *x })
-   |              ^^^^^^^^^^^^^^ ...is used and required to live as long as `'static` here
-   |
-note: `'static` lifetime requirement introduced by the return type
-  --> $DIR/regions-proc-bound-capture.rs:11:59
-   |
-LL | fn static_proc(x: &isize) -> Box<dyn FnMut() -> (isize) + 'static> {
-   |                                                           ^^^^^^^ `'static` requirement introduced here
-LL |     // This is illegal, because the region bound on `proc` is 'static.
-LL |     Box::new(move || { *x })
-   |     ------------------------ because of this returned expression
-help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x`
-   |
-LL | fn static_proc(x: &isize) -> Box<dyn FnMut() -> (isize) + '_> {
-   |                                                           ~~
-help: alternatively, add an explicit `'static` bound to this reference
-   |
-LL | fn static_proc(x: &'static isize) -> Box<dyn FnMut() -> (isize) + 'static> {
-   |                   ~~~~~~~~~~~~~~
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0759`.
diff --git a/src/test/ui/regions/regions-proc-bound-capture.rs b/src/test/ui/regions/regions-proc-bound-capture.rs
index 1033163c8dd..f79d9dc909f 100644
--- a/src/test/ui/regions/regions-proc-bound-capture.rs
+++ b/src/test/ui/regions/regions-proc-bound-capture.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn borrowed_proc<'a>(x: &'a isize) -> Box<dyn FnMut()->(isize) + 'a> {
     // This is legal, because the region bound on `proc`
     // states that it captures `x`.
@@ -11,8 +7,7 @@ fn borrowed_proc<'a>(x: &'a isize) -> Box<dyn FnMut()->(isize) + 'a> {
 fn static_proc(x: &isize) -> Box<dyn FnMut() -> (isize) + 'static> {
     // This is illegal, because the region bound on `proc` is 'static.
     Box::new(move || { *x })
-    //[base]~^ ERROR E0759
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/regions/regions-proc-bound-capture.nll.stderr b/src/test/ui/regions/regions-proc-bound-capture.stderr
index ce4d2d4d111..60c5246e240 100644
--- a/src/test/ui/regions/regions-proc-bound-capture.nll.stderr
+++ b/src/test/ui/regions/regions-proc-bound-capture.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-proc-bound-capture.rs:13:5
+  --> $DIR/regions-proc-bound-capture.rs:9:5
    |
 LL | fn static_proc(x: &isize) -> Box<dyn FnMut() -> (isize) + 'static> {
    |                   - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.base.stderr b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.base.stderr
deleted file mode 100644
index 7ecdb0cd15e..00000000000
--- a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.base.stderr
+++ /dev/null
@@ -1,13 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/regions-reborrow-from-shorter-mut-ref-mut-ref.rs:8:5
-   |
-LL | fn copy_borrowed_ptr<'a, 'b, 'c>(p: &'a mut &'b mut &'c mut isize) -> &'b mut isize {
-   |                                     -----------------------------     -------------
-   |                                     |
-   |                                     this parameter and the return type are declared with different lifetimes...
-LL |     &mut ***p
-   |     ^^^^^^^^^ ...but data from `p` is returned here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.rs b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.rs
index c4ad05010fb..57871b09837 100644
--- a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.rs
+++ b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.rs
@@ -1,13 +1,8 @@
 // Issue #8624. Test for reborrowing with 3 levels, not just two.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn copy_borrowed_ptr<'a, 'b, 'c>(p: &'a mut &'b mut &'c mut isize) -> &'b mut isize {
     &mut ***p
-    //[base]~^ ERROR lifetime mismatch [E0623]
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.nll.stderr b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.stderr
index 519ada7bdfc..dc905d076bb 100644
--- a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.nll.stderr
+++ b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-reborrow-from-shorter-mut-ref-mut-ref.rs:8:5
+  --> $DIR/regions-reborrow-from-shorter-mut-ref-mut-ref.rs:4:5
    |
 LL | fn copy_borrowed_ptr<'a, 'b, 'c>(p: &'a mut &'b mut &'c mut isize) -> &'b mut isize {
    |                      --  -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.base.stderr b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.base.stderr
deleted file mode 100644
index 3cb7de15850..00000000000
--- a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.base.stderr
+++ /dev/null
@@ -1,13 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/regions-reborrow-from-shorter-mut-ref.rs:10:5
-   |
-LL | fn copy_borrowed_ptr<'a, 'b>(p: &'a mut &'b mut isize) -> &'b mut isize {
-   |                                 ---------------------     -------------
-   |                                 |
-   |                                 this parameter and the return type are declared with different lifetimes...
-LL |     &mut **p
-   |     ^^^^^^^^ ...but data from `p` is returned here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.rs b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.rs
index c41e76e4d2a..88cc5465003 100644
--- a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.rs
+++ b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.rs
@@ -2,14 +2,9 @@
 // pointer which is backed by another `&'a mut` can only be done
 // for `'a` (which must be a sublifetime of `'b`).
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn copy_borrowed_ptr<'a, 'b>(p: &'a mut &'b mut isize) -> &'b mut isize {
     &mut **p
-    //[base]~^ ERROR lifetime mismatch [E0623]
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.nll.stderr b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.stderr
index 4dd2a83739c..c98ec477417 100644
--- a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.nll.stderr
+++ b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-reborrow-from-shorter-mut-ref.rs:10:5
+  --> $DIR/regions-reborrow-from-shorter-mut-ref.rs:6:5
    |
 LL | fn copy_borrowed_ptr<'a, 'b>(p: &'a mut &'b mut isize) -> &'b mut isize {
    |                      --  -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/regions-ret-borrowed-1.base.stderr b/src/test/ui/regions/regions-ret-borrowed-1.base.stderr
deleted file mode 100644
index d102f93a647..00000000000
--- a/src/test/ui/regions/regions-ret-borrowed-1.base.stderr
+++ /dev/null
@@ -1,32 +0,0 @@
-error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
-  --> $DIR/regions-ret-borrowed-1.rs:14:14
-   |
-LL |     with(|o| o)
-   |              ^
-   |
-note: first, the lifetime cannot outlive the anonymous lifetime #1 defined here...
-  --> $DIR/regions-ret-borrowed-1.rs:14:10
-   |
-LL |     with(|o| o)
-   |          ^^^^^
-note: ...so that the types are compatible
-  --> $DIR/regions-ret-borrowed-1.rs:14:14
-   |
-LL |     with(|o| o)
-   |              ^
-   = note: expected `&isize`
-              found `&isize`
-note: but, the lifetime must be valid for the lifetime `'a` as defined here...
-  --> $DIR/regions-ret-borrowed-1.rs:13:14
-   |
-LL | fn return_it<'a>() -> &'a isize {
-   |              ^^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/regions-ret-borrowed-1.rs:14:5
-   |
-LL |     with(|o| o)
-   |     ^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/regions/regions-ret-borrowed-1.rs b/src/test/ui/regions/regions-ret-borrowed-1.rs
index fed631320b4..54630caffb4 100644
--- a/src/test/ui/regions/regions-ret-borrowed-1.rs
+++ b/src/test/ui/regions/regions-ret-borrowed-1.rs
@@ -2,18 +2,13 @@
 // some point regions-ret-borrowed reported an error but this file did
 // not, due to special hardcoding around the anonymous region.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn with<R, F>(f: F) -> R where F: for<'a> FnOnce(&'a isize) -> R {
     f(&3)
 }
 
 fn return_it<'a>() -> &'a isize {
     with(|o| o)
-    //[base]~^ ERROR cannot infer an appropriate lifetime due to conflicting requirements [E0495]
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/regions/regions-ret-borrowed-1.nll.stderr b/src/test/ui/regions/regions-ret-borrowed-1.stderr
index 4fdadccab15..0784e894ea9 100644
--- a/src/test/ui/regions/regions-ret-borrowed-1.nll.stderr
+++ b/src/test/ui/regions/regions-ret-borrowed-1.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-ret-borrowed-1.rs:14:14
+  --> $DIR/regions-ret-borrowed-1.rs:10:14
    |
 LL |     with(|o| o)
    |           -- ^ returning this value requires that `'1` must outlive `'2`
diff --git a/src/test/ui/regions/regions-ret-borrowed.base.stderr b/src/test/ui/regions/regions-ret-borrowed.base.stderr
deleted file mode 100644
index 62b42b5dd11..00000000000
--- a/src/test/ui/regions/regions-ret-borrowed.base.stderr
+++ /dev/null
@@ -1,32 +0,0 @@
-error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
-  --> $DIR/regions-ret-borrowed.rs:17:14
-   |
-LL |     with(|o| o)
-   |              ^
-   |
-note: first, the lifetime cannot outlive the anonymous lifetime #1 defined here...
-  --> $DIR/regions-ret-borrowed.rs:17:10
-   |
-LL |     with(|o| o)
-   |          ^^^^^
-note: ...so that the types are compatible
-  --> $DIR/regions-ret-borrowed.rs:17:14
-   |
-LL |     with(|o| o)
-   |              ^
-   = note: expected `&isize`
-              found `&isize`
-note: but, the lifetime must be valid for the lifetime `'a` as defined here...
-  --> $DIR/regions-ret-borrowed.rs:16:14
-   |
-LL | fn return_it<'a>() -> &'a isize {
-   |              ^^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/regions-ret-borrowed.rs:17:5
-   |
-LL |     with(|o| o)
-   |     ^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/regions/regions-ret-borrowed.rs b/src/test/ui/regions/regions-ret-borrowed.rs
index 2b6855d1c71..bdb0341c97c 100644
--- a/src/test/ui/regions/regions-ret-borrowed.rs
+++ b/src/test/ui/regions/regions-ret-borrowed.rs
@@ -5,18 +5,13 @@
 // used to successfully compile because we failed to account for the
 // fact that fn(x: &isize) rebound the region &.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn with<R, F>(f: F) -> R where F: FnOnce(&isize) -> R {
     f(&3)
 }
 
 fn return_it<'a>() -> &'a isize {
     with(|o| o)
-    //[base]~^ ERROR cannot infer an appropriate lifetime due to conflicting requirements [E0495]
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/regions/regions-ret-borrowed.nll.stderr b/src/test/ui/regions/regions-ret-borrowed.stderr
index d3ea5bd875f..d9be5ef89cc 100644
--- a/src/test/ui/regions/regions-ret-borrowed.nll.stderr
+++ b/src/test/ui/regions/regions-ret-borrowed.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-ret-borrowed.rs:17:14
+  --> $DIR/regions-ret-borrowed.rs:13:14
    |
 LL |     with(|o| o)
    |           -- ^ returning this value requires that `'1` must outlive `'2`
diff --git a/src/test/ui/regions/regions-static-bound.base.stderr b/src/test/ui/regions/regions-static-bound.base.stderr
deleted file mode 100644
index 6b8120444d0..00000000000
--- a/src/test/ui/regions/regions-static-bound.base.stderr
+++ /dev/null
@@ -1,62 +0,0 @@
-warning: unnecessary lifetime parameter `'a`
-  --> $DIR/regions-static-bound.rs:6:11
-   |
-LL |     where 'a: 'static { t }
-   |           ^^
-   |
-   = help: you can use the `'static` lifetime directly, in place of `'a`
-
-warning: unnecessary lifetime parameter `'b`
-  --> $DIR/regions-static-bound.rs:10:19
-   |
-LL |     where 'a: 'b, 'b: 'static { t }
-   |                   ^^
-   |
-   = help: you can use the `'static` lifetime directly, in place of `'b`
-
-error[E0312]: lifetime of reference outlives lifetime of borrowed content...
-  --> $DIR/regions-static-bound.rs:14:5
-   |
-LL |     t
-   |     ^
-   |
-   = note: ...the reference is valid for the static lifetime...
-note: ...but the borrowed content is only valid for the lifetime `'a` as defined here
-  --> $DIR/regions-static-bound.rs:13:24
-   |
-LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a {
-   |                        ^^
-
-error[E0759]: `u` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/regions-static-bound.rs:20:5
-   |
-LL | fn error(u: &(), v: &()) {
-   |             --- this data with an anonymous lifetime `'_`...
-LL |     static_id(&u);
-   |     ^^^^^^^^^ -- ...is used here...
-   |
-note: ...and is required to live as long as `'static` here
-  --> $DIR/regions-static-bound.rs:20:5
-   |
-LL |     static_id(&u);
-   |     ^^^^^^^^^
-
-error[E0759]: `v` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/regions-static-bound.rs:23:5
-   |
-LL | fn error(u: &(), v: &()) {
-   |                     --- this data with an anonymous lifetime `'_`...
-...
-LL |     static_id_indirect(&v);
-   |     ^^^^^^^^^^^^^^^^^^ -- ...is used here...
-   |
-note: ...and is required to live as long as `'static` here
-  --> $DIR/regions-static-bound.rs:23:5
-   |
-LL |     static_id_indirect(&v);
-   |     ^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 3 previous errors; 2 warnings emitted
-
-Some errors have detailed explanations: E0312, E0759.
-For more information about an error, try `rustc --explain E0312`.
diff --git a/src/test/ui/regions/regions-static-bound.rs b/src/test/ui/regions/regions-static-bound.rs
index 1eed7e71745..4d2455470e2 100644
--- a/src/test/ui/regions/regions-static-bound.rs
+++ b/src/test/ui/regions/regions-static-bound.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn static_id<'a,'b>(t: &'a ()) -> &'static ()
     where 'a: 'static { t }
 //~^ WARN unnecessary lifetime parameter `'a`
@@ -12,17 +8,14 @@ fn static_id_indirect<'a,'b>(t: &'a ()) -> &'static ()
 
 fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a {
     t
-    //[base]~^ ERROR E0312
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn error(u: &(), v: &()) {
     static_id(&u);
-    //[base]~^ ERROR `u` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
-    //[nll]~^^ ERROR borrowed data escapes outside of function [E0521]
+    //~^ ERROR borrowed data escapes outside of function [E0521]
     static_id_indirect(&v);
-    //[base]~^ ERROR `v` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
-    //[nll]~^^ ERROR borrowed data escapes outside of function [E0521]
+    //~^ ERROR borrowed data escapes outside of function [E0521]
 }
 
 fn main() {}
diff --git a/src/test/ui/regions/regions-static-bound.nll.stderr b/src/test/ui/regions/regions-static-bound.stderr
index 68e36f3aeea..2886ec3ead5 100644
--- a/src/test/ui/regions/regions-static-bound.nll.stderr
+++ b/src/test/ui/regions/regions-static-bound.stderr
@@ -1,5 +1,5 @@
 warning: unnecessary lifetime parameter `'a`
-  --> $DIR/regions-static-bound.rs:6:11
+  --> $DIR/regions-static-bound.rs:2:11
    |
 LL |     where 'a: 'static { t }
    |           ^^
@@ -7,7 +7,7 @@ LL |     where 'a: 'static { t }
    = help: you can use the `'static` lifetime directly, in place of `'a`
 
 warning: unnecessary lifetime parameter `'b`
-  --> $DIR/regions-static-bound.rs:10:19
+  --> $DIR/regions-static-bound.rs:6:19
    |
 LL |     where 'a: 'b, 'b: 'static { t }
    |                   ^^
@@ -15,7 +15,7 @@ LL |     where 'a: 'b, 'b: 'static { t }
    = help: you can use the `'static` lifetime directly, in place of `'b`
 
 error: lifetime may not live long enough
-  --> $DIR/regions-static-bound.rs:14:5
+  --> $DIR/regions-static-bound.rs:10:5
    |
 LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a {
    |                        -- lifetime `'a` defined here
@@ -23,7 +23,7 @@ LL |     t
    |     ^ returning this value requires that `'a` must outlive `'static`
 
 error[E0521]: borrowed data escapes outside of function
-  --> $DIR/regions-static-bound.rs:20:5
+  --> $DIR/regions-static-bound.rs:15:5
    |
 LL | fn error(u: &(), v: &()) {
    |          -  - let's call the lifetime of this reference `'1`
@@ -36,7 +36,7 @@ LL |     static_id(&u);
    |     argument requires that `'1` must outlive `'static`
 
 error[E0521]: borrowed data escapes outside of function
-  --> $DIR/regions-static-bound.rs:23:5
+  --> $DIR/regions-static-bound.rs:17:5
    |
 LL | fn error(u: &(), v: &()) {
    |                  -  - let's call the lifetime of this reference `'2`
diff --git a/src/test/ui/regions/regions-trait-object-subtyping.base.stderr b/src/test/ui/regions/regions-trait-object-subtyping.base.stderr
deleted file mode 100644
index 9f52136f0c0..00000000000
--- a/src/test/ui/regions/regions-trait-object-subtyping.base.stderr
+++ /dev/null
@@ -1,69 +0,0 @@
-error[E0478]: lifetime bound not satisfied
-  --> $DIR/regions-trait-object-subtyping.rs:19:5
-   |
-LL |     x
-   |     ^
-   |
-note: lifetime parameter instantiated with the lifetime `'a` as defined here
-  --> $DIR/regions-trait-object-subtyping.rs:17:9
-   |
-LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy {
-   |         ^^
-note: but lifetime parameter must outlive the lifetime `'b` as defined here
-  --> $DIR/regions-trait-object-subtyping.rs:17:12
-   |
-LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy {
-   |            ^^
-
-error[E0495]: cannot infer an appropriate lifetime for automatic coercion due to conflicting requirements
-  --> $DIR/regions-trait-object-subtyping.rs:19:5
-   |
-LL |     x
-   |     ^
-   |
-note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
-  --> $DIR/regions-trait-object-subtyping.rs:17:9
-   |
-LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy {
-   |         ^^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/regions-trait-object-subtyping.rs:19:5
-   |
-LL |     x
-   |     ^
-note: but, the lifetime must be valid for the lifetime `'b` as defined here...
-  --> $DIR/regions-trait-object-subtyping.rs:17:12
-   |
-LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy {
-   |            ^^
-note: ...so that the types are compatible
-  --> $DIR/regions-trait-object-subtyping.rs:19:5
-   |
-LL |     x
-   |     ^
-   = note: expected `&'b mut (dyn Dummy + 'b)`
-              found `&mut (dyn Dummy + 'b)`
-
-error[E0308]: mismatched types
-  --> $DIR/regions-trait-object-subtyping.rs:28:5
-   |
-LL |     x
-   |     ^ lifetime mismatch
-   |
-   = note: expected struct `Wrapper<&'b mut (dyn Dummy + 'b)>`
-              found struct `Wrapper<&'a mut (dyn Dummy + 'a)>`
-note: the lifetime `'b` as defined here...
-  --> $DIR/regions-trait-object-subtyping.rs:26:15
-   |
-LL | fn foo4<'a:'b,'b>(x: Wrapper<&'a mut dyn Dummy>) -> Wrapper<&'b mut dyn Dummy> {
-   |               ^^
-note: ...does not necessarily outlive the lifetime `'a` as defined here
-  --> $DIR/regions-trait-object-subtyping.rs:26:9
-   |
-LL | fn foo4<'a:'b,'b>(x: Wrapper<&'a mut dyn Dummy>) -> Wrapper<&'b mut dyn Dummy> {
-   |         ^^
-
-error: aborting due to 3 previous errors
-
-Some errors have detailed explanations: E0308, E0478, E0495.
-For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/regions-trait-object-subtyping.rs b/src/test/ui/regions/regions-trait-object-subtyping.rs
index f108fc81cea..1d7a766de30 100644
--- a/src/test/ui/regions/regions-trait-object-subtyping.rs
+++ b/src/test/ui/regions/regions-trait-object-subtyping.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Dummy { fn dummy(&self); }
 
 fn foo1<'a:'b,'b>(x: &'a mut (dyn Dummy+'a)) -> &'b mut (dyn Dummy+'b) {
@@ -17,17 +13,14 @@ fn foo2<'a:'b,'b>(x: &'b mut (dyn Dummy+'a)) -> &'b mut (dyn Dummy+'b) {
 fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy {
     // Without knowing 'a:'b, we can't coerce
     x
-    //[base]~^ ERROR lifetime bound not satisfied
-    //[base]~| ERROR cannot infer an appropriate lifetime
-    //[nll]~^^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 struct Wrapper<T>(T);
 fn foo4<'a:'b,'b>(x: Wrapper<&'a mut dyn Dummy>) -> Wrapper<&'b mut dyn Dummy> {
     // We can't coerce because it is packed in `Wrapper`
     x
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/regions/regions-trait-object-subtyping.nll.stderr b/src/test/ui/regions/regions-trait-object-subtyping.stderr
index c8cec3bd377..1b3a116d508 100644
--- a/src/test/ui/regions/regions-trait-object-subtyping.nll.stderr
+++ b/src/test/ui/regions/regions-trait-object-subtyping.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-trait-object-subtyping.rs:19:5
+  --> $DIR/regions-trait-object-subtyping.rs:15:5
    |
 LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy {
    |         -- -- lifetime `'b` defined here
@@ -15,7 +15,7 @@ LL |     x
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/regions-trait-object-subtyping.rs:28:5
+  --> $DIR/regions-trait-object-subtyping.rs:22:5
    |
 LL | fn foo4<'a:'b,'b>(x: Wrapper<&'a mut dyn Dummy>) -> Wrapper<&'b mut dyn Dummy> {
    |         --    -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.base.stderr b/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.base.stderr
deleted file mode 100644
index 23b3dea885d..00000000000
--- a/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.base.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/regions-variance-contravariant-use-covariant-in-second-position.rs:29:30
-   |
-LL | fn use_<'short,'long>(c: S<'long, 'short>,
-   |                          ---------------- this type is declared with multiple lifetimes...
-...
-LL |     let _: S<'long, 'long> = c;
-   |                              ^ ...but data with one lifetime flows into the other here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.rs b/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.rs
index 4bf32ec3082..f23ca537fa8 100644
--- a/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.rs
+++ b/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.rs
@@ -4,10 +4,6 @@
 // Note: see variance-regions-*.rs for the tests that check that the
 // variance inference works in the first place.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 // `S` is contravariant with respect to both parameters.
 struct S<'a, 'b> {
     f: &'a isize,
@@ -27,8 +23,7 @@ fn use_<'short,'long>(c: S<'long, 'short>,
     // covariant with respect to its parameter 'a.
 
     let _: S<'long, 'long> = c;
-    //[base]~^ ERROR E0623
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.nll.stderr b/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.stderr
index f364f423f4e..5352be430fb 100644
--- a/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.nll.stderr
+++ b/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-variance-contravariant-use-covariant-in-second-position.rs:29:12
+  --> $DIR/regions-variance-contravariant-use-covariant-in-second-position.rs:25:12
    |
 LL | fn use_<'short,'long>(c: S<'long, 'short>,
    |         ------ ----- lifetime `'long` defined here
diff --git a/src/test/ui/regions/regions-variance-contravariant-use-covariant.base.stderr b/src/test/ui/regions/regions-variance-contravariant-use-covariant.base.stderr
deleted file mode 100644
index 8eca0d4d121..00000000000
--- a/src/test/ui/regions/regions-variance-contravariant-use-covariant.base.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/regions-variance-contravariant-use-covariant.rs:27:35
-   |
-LL | fn use_<'short,'long>(c: Contravariant<'short>,
-   |                          --------------------- these two types are declared with different lifetimes...
-LL |                       s: &'short isize,
-LL |                       l: &'long isize,
-   |                          ------------
-...
-LL |     let _: Contravariant<'long> = c;
-   |                                   ^ ...but data from `c` flows into `l` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/regions/regions-variance-contravariant-use-covariant.rs b/src/test/ui/regions/regions-variance-contravariant-use-covariant.rs
index ea08a709230..c73577cb350 100644
--- a/src/test/ui/regions/regions-variance-contravariant-use-covariant.rs
+++ b/src/test/ui/regions/regions-variance-contravariant-use-covariant.rs
@@ -4,10 +4,6 @@
 // Note: see variance-regions-*.rs for the tests that check that the
 // variance inference works in the first place.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 // This is contravariant with respect to 'a, meaning that
 // Contravariant<'long> <: Contravariant<'short> iff
 // 'short <= 'long
@@ -25,8 +21,7 @@ fn use_<'short,'long>(c: Contravariant<'short>,
     // covariant with respect to its parameter 'a.
 
     let _: Contravariant<'long> = c;
-    //[base]~^ ERROR E0623
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/regions/regions-variance-contravariant-use-covariant.nll.stderr b/src/test/ui/regions/regions-variance-contravariant-use-covariant.stderr
index bc6dd6e69ed..22c9b915bb9 100644
--- a/src/test/ui/regions/regions-variance-contravariant-use-covariant.nll.stderr
+++ b/src/test/ui/regions/regions-variance-contravariant-use-covariant.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-variance-contravariant-use-covariant.rs:27:12
+  --> $DIR/regions-variance-contravariant-use-covariant.rs:23:12
    |
 LL | fn use_<'short,'long>(c: Contravariant<'short>,
    |         ------ ----- lifetime `'long` defined here
diff --git a/src/test/ui/regions/regions-variance-covariant-use-contravariant.base.stderr b/src/test/ui/regions/regions-variance-covariant-use-contravariant.base.stderr
deleted file mode 100644
index 565de38ee11..00000000000
--- a/src/test/ui/regions/regions-variance-covariant-use-contravariant.base.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/regions-variance-covariant-use-contravariant.rs:27:32
-   |
-LL | fn use_<'short,'long>(c: Covariant<'long>,
-   |                          ----------------
-LL |                       s: &'short isize,
-   |                          ------------- these two types are declared with different lifetimes...
-...
-LL |     let _: Covariant<'short> = c;
-   |                                ^ ...but data from `s` flows into `c` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/regions/regions-variance-covariant-use-contravariant.rs b/src/test/ui/regions/regions-variance-covariant-use-contravariant.rs
index 748ad84840a..a2183b491ed 100644
--- a/src/test/ui/regions/regions-variance-covariant-use-contravariant.rs
+++ b/src/test/ui/regions/regions-variance-covariant-use-contravariant.rs
@@ -4,10 +4,6 @@
 // Note: see variance-regions-*.rs for the tests that check that the
 // variance inference works in the first place.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 // This is covariant with respect to 'a, meaning that
 // Covariant<'foo> <: Covariant<'static> because
 // 'foo <= 'static
@@ -25,8 +21,7 @@ fn use_<'short,'long>(c: Covariant<'long>,
     // contravariant with respect to its parameter 'a.
 
     let _: Covariant<'short> = c;
-    //[base]~^ ERROR E0623
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/regions/regions-variance-covariant-use-contravariant.nll.stderr b/src/test/ui/regions/regions-variance-covariant-use-contravariant.stderr
index 9d3cebc9a4d..a07181ad553 100644
--- a/src/test/ui/regions/regions-variance-covariant-use-contravariant.nll.stderr
+++ b/src/test/ui/regions/regions-variance-covariant-use-contravariant.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-variance-covariant-use-contravariant.rs:27:12
+  --> $DIR/regions-variance-covariant-use-contravariant.rs:23:12
    |
 LL | fn use_<'short,'long>(c: Covariant<'long>,
    |         ------ ----- lifetime `'long` defined here
diff --git a/src/test/ui/regions/regions-variance-invariant-use-contravariant.base.stderr b/src/test/ui/regions/regions-variance-invariant-use-contravariant.base.stderr
deleted file mode 100644
index e2e8958f53e..00000000000
--- a/src/test/ui/regions/regions-variance-invariant-use-contravariant.base.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/regions-variance-invariant-use-contravariant.rs:24:32
-   |
-LL | fn use_<'short,'long>(c: Invariant<'long>,
-   |                          ----------------
-LL |                       s: &'short isize,
-   |                          ------------- these two types are declared with different lifetimes...
-...
-LL |     let _: Invariant<'short> = c;
-   |                                ^ ...but data from `s` flows into `c` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/regions/regions-variance-invariant-use-contravariant.rs b/src/test/ui/regions/regions-variance-invariant-use-contravariant.rs
index 788f9b1b4d0..a81aaa9c776 100644
--- a/src/test/ui/regions/regions-variance-invariant-use-contravariant.rs
+++ b/src/test/ui/regions/regions-variance-invariant-use-contravariant.rs
@@ -4,10 +4,6 @@
 // Note: see variance-regions-*.rs for the tests that check that the
 // variance inference works in the first place.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Invariant<'a> {
     f: &'a mut &'a isize
 }
@@ -22,8 +18,7 @@ fn use_<'short,'long>(c: Invariant<'long>,
     // contravariant with respect to its parameter 'a.
 
     let _: Invariant<'short> = c;
-    //[base]~^ ERROR E0623
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/regions/regions-variance-invariant-use-contravariant.nll.stderr b/src/test/ui/regions/regions-variance-invariant-use-contravariant.stderr
index b4ccb1693a7..b35a2cb905d 100644
--- a/src/test/ui/regions/regions-variance-invariant-use-contravariant.nll.stderr
+++ b/src/test/ui/regions/regions-variance-invariant-use-contravariant.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-variance-invariant-use-contravariant.rs:24:12
+  --> $DIR/regions-variance-invariant-use-contravariant.rs:20:12
    |
 LL | fn use_<'short,'long>(c: Invariant<'long>,
    |         ------ ----- lifetime `'long` defined here
diff --git a/src/test/ui/regions/regions-variance-invariant-use-covariant.base.stderr b/src/test/ui/regions/regions-variance-invariant-use-covariant.base.stderr
deleted file mode 100644
index da91db1b918..00000000000
--- a/src/test/ui/regions/regions-variance-invariant-use-covariant.base.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/regions-variance-invariant-use-covariant.rs:21:33
-   |
-LL |     let _: Invariant<'static> = c;
-   |                                 ^ lifetime mismatch
-   |
-   = note: expected struct `Invariant<'static>`
-              found struct `Invariant<'b>`
-note: the lifetime `'b` as defined here...
-  --> $DIR/regions-variance-invariant-use-covariant.rs:15:9
-   |
-LL | fn use_<'b>(c: Invariant<'b>) {
-   |         ^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/regions-variance-invariant-use-covariant.rs b/src/test/ui/regions/regions-variance-invariant-use-covariant.rs
index 4b7da4493ac..ab6a82ee7c7 100644
--- a/src/test/ui/regions/regions-variance-invariant-use-covariant.rs
+++ b/src/test/ui/regions/regions-variance-invariant-use-covariant.rs
@@ -4,10 +4,6 @@
 // Note: see variance-regions-*.rs for the tests that check that the
 // variance inference works in the first place.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct Invariant<'a> {
     f: &'a mut &'a isize
 }
@@ -19,8 +15,7 @@ fn use_<'b>(c: Invariant<'b>) {
     // with respect to its parameter 'a.
 
     let _: Invariant<'static> = c;
-    //[base]~^ ERROR mismatched types [E0308]
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/regions/regions-variance-invariant-use-covariant.nll.stderr b/src/test/ui/regions/regions-variance-invariant-use-covariant.stderr
index 7b05c357589..761e78d179e 100644
--- a/src/test/ui/regions/regions-variance-invariant-use-covariant.nll.stderr
+++ b/src/test/ui/regions/regions-variance-invariant-use-covariant.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-variance-invariant-use-covariant.rs:21:12
+  --> $DIR/regions-variance-invariant-use-covariant.rs:17:12
    |
 LL | fn use_<'b>(c: Invariant<'b>) {
    |         -- lifetime `'b` defined here
diff --git a/src/test/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs b/src/test/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs
index 6403b3f55c4..151659e35c0 100644
--- a/src/test/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs
+++ b/src/test/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs
@@ -7,11 +7,11 @@ extern "C" {
         /// Bar
         //~^ ERROR documentation comments cannot be applied to function
         #[must_use]
-        //~^ ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in
+        //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
         /// Baz
         //~^ ERROR documentation comments cannot be applied to function
         #[no_mangle] b: i32,
-        //~^ ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in
+        //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
     );
 }
 
@@ -23,11 +23,11 @@ type FnType = fn(
     /// Bar
     //~^ ERROR documentation comments cannot be applied to function
     #[must_use]
-    //~^ ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in
+    //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
     /// Baz
     //~^ ERROR documentation comments cannot be applied to function
     #[no_mangle] b: i32,
-    //~^ ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in
+    //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
 );
 
 pub fn foo(
@@ -38,11 +38,11 @@ pub fn foo(
     /// Bar
     //~^ ERROR documentation comments cannot be applied to function
     #[must_use]
-    //~^ ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in
+    //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
     /// Baz
     //~^ ERROR documentation comments cannot be applied to function
     #[no_mangle] b: i32,
-    //~^ ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in
+    //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
 ) {}
 
 struct SelfStruct {}
@@ -58,11 +58,11 @@ impl SelfStruct {
         /// Baz
         //~^ ERROR documentation comments cannot be applied to function
         #[must_use]
-        //~^ ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in
+        //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
         /// Qux
         //~^ ERROR documentation comments cannot be applied to function
         #[no_mangle] b: i32,
-        //~^ ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in
+        //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
     ) {}
 
     fn issue_64682_associated_fn(
@@ -73,11 +73,11 @@ impl SelfStruct {
         /// Baz
         //~^ ERROR documentation comments cannot be applied to function
         #[must_use]
-        //~^ ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in
+        //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
         /// Qux
         //~^ ERROR documentation comments cannot be applied to function
         #[no_mangle] b: i32,
-        //~^ ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in
+        //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
     ) {}
 }
 
@@ -94,11 +94,11 @@ impl RefStruct {
         /// Baz
         //~^ ERROR documentation comments cannot be applied to function
         #[must_use]
-        //~^ ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in
+        //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
         /// Qux
         //~^ ERROR documentation comments cannot be applied to function
         #[no_mangle] b: i32,
-        //~^ ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in
+        //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
     ) {}
 }
 trait RefTrait {
@@ -113,11 +113,11 @@ trait RefTrait {
         /// Baz
         //~^ ERROR documentation comments cannot be applied to function
         #[must_use]
-        //~^ ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in
+        //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
         /// Qux
         //~^ ERROR documentation comments cannot be applied to function
         #[no_mangle] b: i32,
-        //~^ ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in
+        //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
     ) {}
 
     fn issue_64682_associated_fn(
@@ -128,11 +128,11 @@ trait RefTrait {
         /// Baz
         //~^ ERROR documentation comments cannot be applied to function
         #[must_use]
-        //~^ ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in
+        //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
         /// Qux
         //~^ ERROR documentation comments cannot be applied to function
         #[no_mangle] b: i32,
-        //~^ ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in
+        //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
     ) {}
 }
 
@@ -148,11 +148,11 @@ impl RefTrait for RefStruct {
         /// Baz
         //~^ ERROR documentation comments cannot be applied to function
         #[must_use]
-        //~^ ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in
+        //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
         /// Qux
         //~^ ERROR documentation comments cannot be applied to function
         #[no_mangle] b: i32,
-        //~^ ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in
+        //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
     ) {}
 }
 
@@ -165,10 +165,10 @@ fn main() {
         /// Bar
         //~^ ERROR documentation comments cannot be applied to function
         #[must_use]
-        //~^ ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in
+        //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
         /// Baz
         //~^ ERROR documentation comments cannot be applied to function
         #[no_mangle] b: i32
-        //~^ ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in
+        //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
     | {};
 }
diff --git a/src/test/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr b/src/test/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr
index edca8cea68d..7573e39d8eb 100644
--- a/src/test/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr
+++ b/src/test/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr
@@ -70,7 +70,7 @@ error: documentation comments cannot be applied to function parameters
 LL |         /// Bar
    |         ^^^^^^^ doc comments are not allowed here
 
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/param-attrs-builtin-attrs.rs:9:9
    |
 LL |         #[must_use]
@@ -82,7 +82,7 @@ error: documentation comments cannot be applied to function parameters
 LL |         /// Baz
    |         ^^^^^^^ doc comments are not allowed here
 
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/param-attrs-builtin-attrs.rs:13:9
    |
 LL |         #[no_mangle] b: i32,
@@ -100,7 +100,7 @@ error: documentation comments cannot be applied to function parameters
 LL |     /// Bar
    |     ^^^^^^^ doc comments are not allowed here
 
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/param-attrs-builtin-attrs.rs:25:5
    |
 LL |     #[must_use]
@@ -112,7 +112,7 @@ error: documentation comments cannot be applied to function parameters
 LL |     /// Baz
    |     ^^^^^^^ doc comments are not allowed here
 
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/param-attrs-builtin-attrs.rs:29:5
    |
 LL |     #[no_mangle] b: i32,
@@ -130,7 +130,7 @@ error: documentation comments cannot be applied to function parameters
 LL |     /// Bar
    |     ^^^^^^^ doc comments are not allowed here
 
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/param-attrs-builtin-attrs.rs:40:5
    |
 LL |     #[must_use]
@@ -142,7 +142,7 @@ error: documentation comments cannot be applied to function parameters
 LL |     /// Baz
    |     ^^^^^^^ doc comments are not allowed here
 
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/param-attrs-builtin-attrs.rs:44:5
    |
 LL |     #[no_mangle] b: i32,
@@ -166,7 +166,7 @@ error: documentation comments cannot be applied to function parameters
 LL |         /// Baz
    |         ^^^^^^^ doc comments are not allowed here
 
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/param-attrs-builtin-attrs.rs:60:9
    |
 LL |         #[must_use]
@@ -178,7 +178,7 @@ error: documentation comments cannot be applied to function parameters
 LL |         /// Qux
    |         ^^^^^^^ doc comments are not allowed here
 
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/param-attrs-builtin-attrs.rs:64:9
    |
 LL |         #[no_mangle] b: i32,
@@ -196,7 +196,7 @@ error: documentation comments cannot be applied to function parameters
 LL |         /// Baz
    |         ^^^^^^^ doc comments are not allowed here
 
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/param-attrs-builtin-attrs.rs:75:9
    |
 LL |         #[must_use]
@@ -208,7 +208,7 @@ error: documentation comments cannot be applied to function parameters
 LL |         /// Qux
    |         ^^^^^^^ doc comments are not allowed here
 
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/param-attrs-builtin-attrs.rs:79:9
    |
 LL |         #[no_mangle] b: i32,
@@ -232,7 +232,7 @@ error: documentation comments cannot be applied to function parameters
 LL |         /// Baz
    |         ^^^^^^^ doc comments are not allowed here
 
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/param-attrs-builtin-attrs.rs:96:9
    |
 LL |         #[must_use]
@@ -244,7 +244,7 @@ error: documentation comments cannot be applied to function parameters
 LL |         /// Qux
    |         ^^^^^^^ doc comments are not allowed here
 
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/param-attrs-builtin-attrs.rs:100:9
    |
 LL |         #[no_mangle] b: i32,
@@ -268,7 +268,7 @@ error: documentation comments cannot be applied to function parameters
 LL |         /// Baz
    |         ^^^^^^^ doc comments are not allowed here
 
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/param-attrs-builtin-attrs.rs:115:9
    |
 LL |         #[must_use]
@@ -280,7 +280,7 @@ error: documentation comments cannot be applied to function parameters
 LL |         /// Qux
    |         ^^^^^^^ doc comments are not allowed here
 
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/param-attrs-builtin-attrs.rs:119:9
    |
 LL |         #[no_mangle] b: i32,
@@ -298,7 +298,7 @@ error: documentation comments cannot be applied to function parameters
 LL |         /// Baz
    |         ^^^^^^^ doc comments are not allowed here
 
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/param-attrs-builtin-attrs.rs:130:9
    |
 LL |         #[must_use]
@@ -310,7 +310,7 @@ error: documentation comments cannot be applied to function parameters
 LL |         /// Qux
    |         ^^^^^^^ doc comments are not allowed here
 
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/param-attrs-builtin-attrs.rs:134:9
    |
 LL |         #[no_mangle] b: i32,
@@ -334,7 +334,7 @@ error: documentation comments cannot be applied to function parameters
 LL |         /// Baz
    |         ^^^^^^^ doc comments are not allowed here
 
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/param-attrs-builtin-attrs.rs:150:9
    |
 LL |         #[must_use]
@@ -346,7 +346,7 @@ error: documentation comments cannot be applied to function parameters
 LL |         /// Qux
    |         ^^^^^^^ doc comments are not allowed here
 
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/param-attrs-builtin-attrs.rs:154:9
    |
 LL |         #[no_mangle] b: i32,
@@ -364,7 +364,7 @@ error: documentation comments cannot be applied to function parameters
 LL |         /// Bar
    |         ^^^^^^^ doc comments are not allowed here
 
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/param-attrs-builtin-attrs.rs:167:9
    |
 LL |         #[must_use]
@@ -376,7 +376,7 @@ error: documentation comments cannot be applied to function parameters
 LL |         /// Baz
    |         ^^^^^^^ doc comments are not allowed here
 
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/param-attrs-builtin-attrs.rs:171:9
    |
 LL |         #[no_mangle] b: i32
diff --git a/src/test/ui/rfc1623.base.stderr b/src/test/ui/rfc1623.base.stderr
deleted file mode 100644
index 364c8c8f706..00000000000
--- a/src/test/ui/rfc1623.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: implementation of `FnOnce` is not general enough
-  --> $DIR/rfc1623.rs:32:8
-   |
-LL |     f: &id,
-   |        ^^^ implementation of `FnOnce` is not general enough
-   |
-   = note: `fn(&'2 Foo<'_>) -> &'2 Foo<'_> {id::<&'2 Foo<'_>>}` must implement `FnOnce<(&'1 Foo<'b>,)>`, for any lifetime `'1`...
-   = note: ...but it actually implements `FnOnce<(&'2 Foo<'_>,)>`, for some specific lifetime `'2`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/rfc1623.rs b/src/test/ui/rfc1623.rs
index 443da0aa955..c0e13a5f5f0 100644
--- a/src/test/ui/rfc1623.rs
+++ b/src/test/ui/rfc1623.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 #![allow(dead_code)]
 
 fn non_elidable<'a, 'b>(a: &'a u8, b: &'b u8) -> &'a u8 {
@@ -30,11 +26,10 @@ static SOME_STRUCT: &SomeStruct = &SomeStruct {
     foo: &Foo { bools: &[false, true] },
     bar: &Bar { bools: &[true, true] },
     f: &id,
-    //[base]~^ ERROR implementation of `FnOnce` is not general enough
-    //[nll]~^^ ERROR mismatched types
-    //[nll]~| ERROR mismatched types
-    //[nll]~| ERROR implementation of `FnOnce` is not general enough
-    //[nll]~| ERROR implementation of `FnOnce` is not general enough
+    //~^ ERROR mismatched types
+    //~| ERROR mismatched types
+    //~| ERROR implementation of `FnOnce` is not general enough
+    //~| ERROR implementation of `FnOnce` is not general enough
 };
 
 // very simple test for a 'static static with default lifetime
diff --git a/src/test/ui/rfc1623.nll.stderr b/src/test/ui/rfc1623.stderr
index 2eff4708547..2ca56afbc57 100644
--- a/src/test/ui/rfc1623.nll.stderr
+++ b/src/test/ui/rfc1623.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/rfc1623.rs:32:8
+  --> $DIR/rfc1623.rs:28:8
    |
 LL |     f: &id,
    |        ^^^ one type is more general than the other
@@ -8,7 +8,7 @@ LL |     f: &id,
               found type `Fn<(&Foo<'_>,)>`
 
 error[E0308]: mismatched types
-  --> $DIR/rfc1623.rs:32:8
+  --> $DIR/rfc1623.rs:28:8
    |
 LL |     f: &id,
    |        ^^^ one type is more general than the other
@@ -17,7 +17,7 @@ LL |     f: &id,
               found type `Fn<(&Foo<'_>,)>`
 
 error: implementation of `FnOnce` is not general enough
-  --> $DIR/rfc1623.rs:32:8
+  --> $DIR/rfc1623.rs:28:8
    |
 LL |     f: &id,
    |        ^^^ implementation of `FnOnce` is not general enough
@@ -26,7 +26,7 @@ LL |     f: &id,
    = note: ...but it actually implements `FnOnce<(&'2 Foo<'_>,)>`, for some specific lifetime `'2`
 
 error: implementation of `FnOnce` is not general enough
-  --> $DIR/rfc1623.rs:32:8
+  --> $DIR/rfc1623.rs:28:8
    |
 LL |     f: &id,
    |        ^^^ implementation of `FnOnce` is not general enough
diff --git a/src/test/ui/rustdoc/check-doc-alias-attr-location.stderr b/src/test/ui/rustdoc/check-doc-alias-attr-location.stderr
index 2b25882be21..650a82a23a9 100644
--- a/src/test/ui/rustdoc/check-doc-alias-attr-location.stderr
+++ b/src/test/ui/rustdoc/check-doc-alias-attr-location.stderr
@@ -1,4 +1,4 @@
-error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters
+error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
   --> $DIR/check-doc-alias-attr-location.rs:22:12
    |
 LL |     fn foo(#[doc(alias = "qux")] _x: u32) -> Self::X {
diff --git a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.base.stderr b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.base.stderr
deleted file mode 100644
index d2106630dfe..00000000000
--- a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.base.stderr
+++ /dev/null
@@ -1,39 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:11:52
-   |
-LL |     async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
-   |                                    ----     ----   ^ ...but data from `f` is returned here
-   |                                    |
-   |                                    this parameter and the return type are declared with different lifetimes...
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn a<'a>(self: Pin<&'a Foo>, f: &'a Foo) -> &Foo { f }
-   |               ++++            ++           ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:15:82
-   |
-LL |     async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
-   |                                     ----              -----------------          ^ ...but data from `f` is returned here
-   |                                     |
-   |                                     this parameter and the return type are declared with different lifetimes...
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn c<'a>(self: Pin<&'a Self>, f: &'a Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
-   |               ++++            ++            ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:22:64
-   |
-LL |     async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
-   |                                               ------     ---   ^^^ ...but data from `arg` is returned here
-   |                                               |
-   |                                               this parameter and the return type are declared with different lifetimes...
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.rs b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.rs
index c54f7963c23..a2b7f080568 100644
--- a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.rs
+++ b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.rs
@@ -1,7 +1,4 @@
 // edition:2018
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
 
 use std::pin::Pin;
 
@@ -9,19 +6,16 @@ struct Foo;
 
 impl Foo {
     async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 
     async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
-    //[base]~^ ERROR lifetime mismatch
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 }
 
 type Alias<T> = Pin<T>;
 impl Foo {
     async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
-    //[base]~^ ERROR E0623
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.nll.stderr b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.stderr
index 3fd58725d02..6180e1e0f2d 100644
--- a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.nll.stderr
+++ b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:11:52
+  --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:8:52
    |
 LL |     async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
    |                          -         -               ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
@@ -13,7 +13,7 @@ LL |     async fn a<'a>(self: Pin<&'a Foo>, f: &'a Foo) -> &Foo { f }
    |               ++++            ++           ++
 
 error: lifetime may not live long enough
-  --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:15:75
+  --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:11:75
    |
 LL |     async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
    |                          -          -                                     ^^^^^^^^^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
@@ -27,7 +27,7 @@ LL |     async fn c<'a>(self: Pin<&'a Self>, f: &'a Foo, g: &Foo) -> (Pin<&Foo>,
    |               ++++            ++            ++
 
 error: lifetime may not live long enough
-  --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:22:64
+  --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:17:64
    |
 LL |     async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
    |                  --              -                             ^^^ associated function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
diff --git a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.base.stderr b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.base.stderr
deleted file mode 100644
index c0e2f0bd3e9..00000000000
--- a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.base.stderr
+++ /dev/null
@@ -1,39 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:10:46
-   |
-LL |     fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
-   |                              ----     ----   ^ ...but data from `f` is returned here
-   |                              |
-   |                              this parameter and the return type are declared with different lifetimes...
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn a<'a>(self: Pin<&'a Foo>, f: &'a Foo) -> &Foo { f }
-   |         ++++            ++           ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:14:76
-   |
-LL |     fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
-   |                               ----              -----------------          ^ ...but data from `f` is returned here
-   |                               |
-   |                               this parameter and the return type are declared with different lifetimes...
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn c<'a>(self: Pin<&'a Self>, f: &'a Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
-   |         ++++            ++            ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:21:58
-   |
-LL |     fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
-   |                                         ------     ---   ^^^ ...but data from `arg` is returned here
-   |                                         |
-   |                                         this parameter and the return type are declared with different lifetimes...
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.rs b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.rs
index 34b08b364fb..f1a3fb0185d 100644
--- a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.rs
+++ b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.rs
@@ -1,26 +1,19 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 use std::pin::Pin;
 
 struct Foo;
 
 impl Foo {
     fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
-    //[base]~^ ERROR E0623
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 
     fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
-    //[base]~^ ERROR E0623
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 }
 
 type Alias<T> = Pin<T>;
 impl Foo {
     fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
-    //[base]~^ ERROR E0623
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.nll.stderr b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.stderr
index 057146e7cb0..fccee5d4363 100644
--- a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.nll.stderr
+++ b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:10:46
+  --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:6:46
    |
 LL |     fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
    |                    -         -               ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
@@ -13,7 +13,7 @@ LL |     fn a<'a>(self: Pin<&'a Foo>, f: &'a Foo) -> &Foo { f }
    |         ++++            ++           ++
 
 error: lifetime may not live long enough
-  --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:14:69
+  --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:9:69
    |
 LL |     fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
    |                    -          -                                     ^^^^^^^^^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
@@ -27,7 +27,7 @@ LL |     fn c<'a>(self: Pin<&'a Self>, f: &'a Foo, g: &Foo) -> (Pin<&Foo>, &Foo)
    |         ++++            ++            ++
 
 error: lifetime may not live long enough
-  --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:21:58
+  --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:15:58
    |
 LL |     fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
    |            --  ---- has type `Pin<&'1 Foo>`              ^^^ associated function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
diff --git a/src/test/ui/self/elision/lt-ref-self-async.base.stderr b/src/test/ui/self/elision/lt-ref-self-async.base.stderr
deleted file mode 100644
index 0e2bbcc3c04..00000000000
--- a/src/test/ui/self/elision/lt-ref-self-async.base.stderr
+++ /dev/null
@@ -1,99 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/lt-ref-self-async.rs:16:9
-   |
-LL |     async fn ref_self(&self, f: &u32) -> &u32 {
-   |                                 ----     ----
-   |                                 |
-   |                                 this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn ref_self<'a>(&'a self, f: &'a u32) -> &u32 {
-   |                      ++++  ++           ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/lt-ref-self-async.rs:24:9
-   |
-LL |     async fn ref_Self(self: &Self, f: &u32) -> &u32 {
-   |                                       ----     ----
-   |                                       |
-   |                                       this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn ref_Self<'a>(self: &'a Self, f: &'a u32) -> &u32 {
-   |                      ++++        ++           ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/lt-ref-self-async.rs:30:9
-   |
-LL |     async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
-   |                                                ----     ----
-   |                                                |
-   |                                                this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn box_ref_Self<'a>(self: Box<&'a Self>, f: &'a u32) -> &u32 {
-   |                          ++++            ++            ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/lt-ref-self-async.rs:36:9
-   |
-LL |     async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
-   |                                                ----     ----
-   |                                                |
-   |                                                this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn pin_ref_Self<'a>(self: Pin<&'a Self>, f: &'a u32) -> &u32 {
-   |                          ++++            ++            ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/lt-ref-self-async.rs:42:9
-   |
-LL |     async fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
-   |                                                         ----     ----
-   |                                                         |
-   |                                                         this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn box_box_ref_Self<'a>(self: Box<Box<&'a Self>>, f: &'a u32) -> &u32 {
-   |                              ++++                ++             ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/lt-ref-self-async.rs:48:9
-   |
-LL |     async fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
-   |                                                     ----     ----
-   |                                                     |
-   |                                                     this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn box_pin_Self<'a>(self: Box<Pin<&'a Self>>, f: &'a u32) -> &u32 {
-   |                          ++++                ++             ++
-
-error: aborting due to 6 previous errors
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/self/elision/lt-ref-self-async.rs b/src/test/ui/self/elision/lt-ref-self-async.rs
index 24482b3a278..a2325ba7fa6 100644
--- a/src/test/ui/self/elision/lt-ref-self-async.rs
+++ b/src/test/ui/self/elision/lt-ref-self-async.rs
@@ -1,7 +1,4 @@
 // edition:2018
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
 
 #![allow(non_snake_case)]
 
@@ -14,40 +11,34 @@ impl<'a> Struct<'a> {
 
     async fn ref_self(&self, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     // Test using `&Self` explicitly:
 
     async fn ref_Self(self: &Self, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     async fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     async fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
diff --git a/src/test/ui/self/elision/lt-ref-self-async.nll.stderr b/src/test/ui/self/elision/lt-ref-self-async.stderr
index 1c889838e70..787afd4dc9d 100644
--- a/src/test/ui/self/elision/lt-ref-self-async.nll.stderr
+++ b/src/test/ui/self/elision/lt-ref-self-async.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/lt-ref-self-async.rs:16:9
+  --> $DIR/lt-ref-self-async.rs:13:9
    |
 LL |     async fn ref_self(&self, f: &u32) -> &u32 {
    |                       -         - let's call the lifetime of this reference `'1`
@@ -14,7 +14,7 @@ LL |     async fn ref_self<'a>(&'a self, f: &'a u32) -> &u32 {
    |                      ++++  ++           ++
 
 error: lifetime may not live long enough
-  --> $DIR/lt-ref-self-async.rs:24:9
+  --> $DIR/lt-ref-self-async.rs:20:9
    |
 LL |     async fn ref_Self(self: &Self, f: &u32) -> &u32 {
    |                             -         - let's call the lifetime of this reference `'1`
@@ -29,7 +29,7 @@ LL |     async fn ref_Self<'a>(self: &'a Self, f: &'a u32) -> &u32 {
    |                      ++++        ++           ++
 
 error: lifetime may not live long enough
-  --> $DIR/lt-ref-self-async.rs:30:9
+  --> $DIR/lt-ref-self-async.rs:25:9
    |
 LL |     async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
    |                                     -          - let's call the lifetime of this reference `'1`
@@ -44,7 +44,7 @@ LL |     async fn box_ref_Self<'a>(self: Box<&'a Self>, f: &'a u32) -> &u32 {
    |                          ++++            ++            ++
 
 error: lifetime may not live long enough
-  --> $DIR/lt-ref-self-async.rs:36:9
+  --> $DIR/lt-ref-self-async.rs:30:9
    |
 LL |     async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
    |                                     -          - let's call the lifetime of this reference `'1`
@@ -59,7 +59,7 @@ LL |     async fn pin_ref_Self<'a>(self: Pin<&'a Self>, f: &'a u32) -> &u32 {
    |                          ++++            ++            ++
 
 error: lifetime may not live long enough
-  --> $DIR/lt-ref-self-async.rs:42:9
+  --> $DIR/lt-ref-self-async.rs:35:9
    |
 LL |     async fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
    |                                             -           - let's call the lifetime of this reference `'1`
@@ -74,7 +74,7 @@ LL |     async fn box_box_ref_Self<'a>(self: Box<Box<&'a Self>>, f: &'a u32) ->
    |                              ++++                ++             ++
 
 error: lifetime may not live long enough
-  --> $DIR/lt-ref-self-async.rs:48:9
+  --> $DIR/lt-ref-self-async.rs:40:9
    |
 LL |     async fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
    |                                         -           - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/self/elision/lt-ref-self.base.stderr b/src/test/ui/self/elision/lt-ref-self.base.stderr
deleted file mode 100644
index 0f5cd6fb853..00000000000
--- a/src/test/ui/self/elision/lt-ref-self.base.stderr
+++ /dev/null
@@ -1,99 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/lt-ref-self.rs:15:9
-   |
-LL |     fn ref_self(&self, f: &u32) -> &u32 {
-   |                           ----     ----
-   |                           |
-   |                           this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn ref_self<'a>(&'a self, f: &'a u32) -> &u32 {
-   |                ++++  ++           ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/lt-ref-self.rs:23:9
-   |
-LL |     fn ref_Self(self: &Self, f: &u32) -> &u32 {
-   |                                 ----     ----
-   |                                 |
-   |                                 this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn ref_Self<'a>(self: &'a Self, f: &'a u32) -> &u32 {
-   |                ++++        ++           ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/lt-ref-self.rs:29:9
-   |
-LL |     fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
-   |                                          ----     ----
-   |                                          |
-   |                                          this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn box_ref_Self<'a>(self: Box<&'a Self>, f: &'a u32) -> &u32 {
-   |                    ++++            ++            ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/lt-ref-self.rs:35:9
-   |
-LL |     fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
-   |                                          ----     ----
-   |                                          |
-   |                                          this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn pin_ref_Self<'a>(self: Pin<&'a Self>, f: &'a u32) -> &u32 {
-   |                    ++++            ++            ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/lt-ref-self.rs:41:9
-   |
-LL |     fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
-   |                                                   ----     ----
-   |                                                   |
-   |                                                   this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn box_box_ref_Self<'a>(self: Box<Box<&'a Self>>, f: &'a u32) -> &u32 {
-   |                        ++++                ++             ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/lt-ref-self.rs:47:9
-   |
-LL |     fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
-   |                                               ----     ----
-   |                                               |
-   |                                               this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn box_pin_Self<'a>(self: Box<Pin<&'a Self>>, f: &'a u32) -> &u32 {
-   |                    ++++                ++             ++
-
-error: aborting due to 6 previous errors
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/self/elision/lt-ref-self.rs b/src/test/ui/self/elision/lt-ref-self.rs
index 62bdb13dc0f..d37ed5acbcb 100644
--- a/src/test/ui/self/elision/lt-ref-self.rs
+++ b/src/test/ui/self/elision/lt-ref-self.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 #![allow(non_snake_case)]
 
 use std::pin::Pin;
@@ -13,40 +9,34 @@ impl<'a> Struct<'a> {
 
     fn ref_self(&self, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     // Test using `&Self` explicitly:
 
     fn ref_Self(self: &Self, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
diff --git a/src/test/ui/self/elision/lt-ref-self.nll.stderr b/src/test/ui/self/elision/lt-ref-self.stderr
index 2e26c703b65..49af638e4c6 100644
--- a/src/test/ui/self/elision/lt-ref-self.nll.stderr
+++ b/src/test/ui/self/elision/lt-ref-self.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/lt-ref-self.rs:15:9
+  --> $DIR/lt-ref-self.rs:11:9
    |
 LL |     fn ref_self(&self, f: &u32) -> &u32 {
    |                 -         - let's call the lifetime of this reference `'1`
@@ -14,7 +14,7 @@ LL |     fn ref_self<'a>(&'a self, f: &'a u32) -> &u32 {
    |                ++++  ++           ++
 
 error: lifetime may not live long enough
-  --> $DIR/lt-ref-self.rs:23:9
+  --> $DIR/lt-ref-self.rs:18:9
    |
 LL |     fn ref_Self(self: &Self, f: &u32) -> &u32 {
    |                       -         - let's call the lifetime of this reference `'1`
@@ -29,7 +29,7 @@ LL |     fn ref_Self<'a>(self: &'a Self, f: &'a u32) -> &u32 {
    |                ++++        ++           ++
 
 error: lifetime may not live long enough
-  --> $DIR/lt-ref-self.rs:29:9
+  --> $DIR/lt-ref-self.rs:23:9
    |
 LL |     fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
    |                               -          - let's call the lifetime of this reference `'1`
@@ -44,7 +44,7 @@ LL |     fn box_ref_Self<'a>(self: Box<&'a Self>, f: &'a u32) -> &u32 {
    |                    ++++            ++            ++
 
 error: lifetime may not live long enough
-  --> $DIR/lt-ref-self.rs:35:9
+  --> $DIR/lt-ref-self.rs:28:9
    |
 LL |     fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
    |                               -          - let's call the lifetime of this reference `'1`
@@ -59,7 +59,7 @@ LL |     fn pin_ref_Self<'a>(self: Pin<&'a Self>, f: &'a u32) -> &u32 {
    |                    ++++            ++            ++
 
 error: lifetime may not live long enough
-  --> $DIR/lt-ref-self.rs:41:9
+  --> $DIR/lt-ref-self.rs:33:9
    |
 LL |     fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
    |                                       -           - let's call the lifetime of this reference `'1`
@@ -74,7 +74,7 @@ LL |     fn box_box_ref_Self<'a>(self: Box<Box<&'a Self>>, f: &'a u32) -> &u32 {
    |                        ++++                ++             ++
 
 error: lifetime may not live long enough
-  --> $DIR/lt-ref-self.rs:47:9
+  --> $DIR/lt-ref-self.rs:38:9
    |
 LL |     fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
    |                                   -           - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/self/elision/ref-mut-self-async.base.stderr b/src/test/ui/self/elision/ref-mut-self-async.base.stderr
deleted file mode 100644
index 8ffc0d62242..00000000000
--- a/src/test/ui/self/elision/ref-mut-self-async.base.stderr
+++ /dev/null
@@ -1,99 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-self-async.rs:16:9
-   |
-LL |     async fn ref_self(&mut self, f: &u32) -> &u32 {
-   |                                     ----     ----
-   |                                     |
-   |                                     this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn ref_self<'a>(&'a mut self, f: &'a u32) -> &u32 {
-   |                      ++++  ++               ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-self-async.rs:24:9
-   |
-LL |     async fn ref_Self(self: &mut Self, f: &u32) -> &u32 {
-   |                                           ----     ----
-   |                                           |
-   |                                           this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn ref_Self<'a>(self: &'a mut Self, f: &'a u32) -> &u32 {
-   |                      ++++        ++               ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-self-async.rs:30:9
-   |
-LL |     async fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 {
-   |                                                    ----     ----
-   |                                                    |
-   |                                                    this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn box_ref_Self<'a>(self: Box<&'a mut Self>, f: &'a u32) -> &u32 {
-   |                          ++++            ++                ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-self-async.rs:36:9
-   |
-LL |     async fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 {
-   |                                                    ----     ----
-   |                                                    |
-   |                                                    this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn pin_ref_Self<'a>(self: Pin<&'a mut Self>, f: &'a u32) -> &u32 {
-   |                          ++++            ++                ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-self-async.rs:42:9
-   |
-LL |     async fn box_box_ref_Self(self: Box<Box<&mut Self>>, f: &u32) -> &u32 {
-   |                                                             ----     ----
-   |                                                             |
-   |                                                             this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn box_box_ref_Self<'a>(self: Box<Box<&'a mut Self>>, f: &'a u32) -> &u32 {
-   |                              ++++                ++                 ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-self-async.rs:48:9
-   |
-LL |     async fn box_pin_ref_Self(self: Box<Pin<&mut Self>>, f: &u32) -> &u32 {
-   |                                                             ----     ----
-   |                                                             |
-   |                                                             this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn box_pin_ref_Self<'a>(self: Box<Pin<&'a mut Self>>, f: &'a u32) -> &u32 {
-   |                              ++++                ++                 ++
-
-error: aborting due to 6 previous errors
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/self/elision/ref-mut-self-async.rs b/src/test/ui/self/elision/ref-mut-self-async.rs
index 59b41f364f9..e07bc85643c 100644
--- a/src/test/ui/self/elision/ref-mut-self-async.rs
+++ b/src/test/ui/self/elision/ref-mut-self-async.rs
@@ -1,7 +1,4 @@
 // edition:2018
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
 
 #![allow(non_snake_case)]
 
@@ -14,40 +11,34 @@ impl Struct {
 
     async fn ref_self(&mut self, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     // Test using `&mut Self` explicitly:
 
     async fn ref_Self(self: &mut Self, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     async fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     async fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     async fn box_box_ref_Self(self: Box<Box<&mut Self>>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     async fn box_pin_ref_Self(self: Box<Pin<&mut Self>>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
diff --git a/src/test/ui/self/elision/ref-mut-self-async.nll.stderr b/src/test/ui/self/elision/ref-mut-self-async.stderr
index 9beafcd4ff9..dff50aee918 100644
--- a/src/test/ui/self/elision/ref-mut-self-async.nll.stderr
+++ b/src/test/ui/self/elision/ref-mut-self-async.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-self-async.rs:16:9
+  --> $DIR/ref-mut-self-async.rs:13:9
    |
 LL |     async fn ref_self(&mut self, f: &u32) -> &u32 {
    |                       -             - let's call the lifetime of this reference `'1`
@@ -14,7 +14,7 @@ LL |     async fn ref_self<'a>(&'a mut self, f: &'a u32) -> &u32 {
    |                      ++++  ++               ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-self-async.rs:24:9
+  --> $DIR/ref-mut-self-async.rs:20:9
    |
 LL |     async fn ref_Self(self: &mut Self, f: &u32) -> &u32 {
    |                             -             - let's call the lifetime of this reference `'1`
@@ -29,7 +29,7 @@ LL |     async fn ref_Self<'a>(self: &'a mut Self, f: &'a u32) -> &u32 {
    |                      ++++        ++               ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-self-async.rs:30:9
+  --> $DIR/ref-mut-self-async.rs:25:9
    |
 LL |     async fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 {
    |                                     -              - let's call the lifetime of this reference `'1`
@@ -44,7 +44,7 @@ LL |     async fn box_ref_Self<'a>(self: Box<&'a mut Self>, f: &'a u32) -> &u32
    |                          ++++            ++                ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-self-async.rs:36:9
+  --> $DIR/ref-mut-self-async.rs:30:9
    |
 LL |     async fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 {
    |                                     -              - let's call the lifetime of this reference `'1`
@@ -59,7 +59,7 @@ LL |     async fn pin_ref_Self<'a>(self: Pin<&'a mut Self>, f: &'a u32) -> &u32
    |                          ++++            ++                ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-self-async.rs:42:9
+  --> $DIR/ref-mut-self-async.rs:35:9
    |
 LL |     async fn box_box_ref_Self(self: Box<Box<&mut Self>>, f: &u32) -> &u32 {
    |                                             -               - let's call the lifetime of this reference `'1`
@@ -74,7 +74,7 @@ LL |     async fn box_box_ref_Self<'a>(self: Box<Box<&'a mut Self>>, f: &'a u32)
    |                              ++++                ++                 ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-self-async.rs:48:9
+  --> $DIR/ref-mut-self-async.rs:40:9
    |
 LL |     async fn box_pin_ref_Self(self: Box<Pin<&mut Self>>, f: &u32) -> &u32 {
    |                                             -               - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/self/elision/ref-mut-self.base.stderr b/src/test/ui/self/elision/ref-mut-self.base.stderr
deleted file mode 100644
index fceddddf20e..00000000000
--- a/src/test/ui/self/elision/ref-mut-self.base.stderr
+++ /dev/null
@@ -1,99 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-self.rs:15:9
-   |
-LL |     fn ref_self(&mut self, f: &u32) -> &u32 {
-   |                               ----     ----
-   |                               |
-   |                               this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn ref_self<'a>(&'a mut self, f: &'a u32) -> &u32 {
-   |                ++++  ++               ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-self.rs:23:9
-   |
-LL |     fn ref_Self(self: &mut Self, f: &u32) -> &u32 {
-   |                                     ----     ----
-   |                                     |
-   |                                     this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn ref_Self<'a>(self: &'a mut Self, f: &'a u32) -> &u32 {
-   |                ++++        ++               ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-self.rs:29:9
-   |
-LL |     fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 {
-   |                                              ----     ----
-   |                                              |
-   |                                              this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn box_ref_Self<'a>(self: Box<&'a mut Self>, f: &'a u32) -> &u32 {
-   |                    ++++            ++                ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-self.rs:35:9
-   |
-LL |     fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 {
-   |                                              ----     ----
-   |                                              |
-   |                                              this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn pin_ref_Self<'a>(self: Pin<&'a mut Self>, f: &'a u32) -> &u32 {
-   |                    ++++            ++                ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-self.rs:41:9
-   |
-LL |     fn box_box_ref_Self(self: Box<Box<&mut Self>>, f: &u32) -> &u32 {
-   |                                                       ----     ----
-   |                                                       |
-   |                                                       this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn box_box_ref_Self<'a>(self: Box<Box<&'a mut Self>>, f: &'a u32) -> &u32 {
-   |                        ++++                ++                 ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-self.rs:47:9
-   |
-LL |     fn box_pin_ref_Self(self: Box<Pin<&mut Self>>, f: &u32) -> &u32 {
-   |                                                       ----     ----
-   |                                                       |
-   |                                                       this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn box_pin_ref_Self<'a>(self: Box<Pin<&'a mut Self>>, f: &'a u32) -> &u32 {
-   |                        ++++                ++                 ++
-
-error: aborting due to 6 previous errors
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/self/elision/ref-mut-self.rs b/src/test/ui/self/elision/ref-mut-self.rs
index 81bd279129d..bb82e6be748 100644
--- a/src/test/ui/self/elision/ref-mut-self.rs
+++ b/src/test/ui/self/elision/ref-mut-self.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 #![allow(non_snake_case)]
 
 use std::pin::Pin;
@@ -13,40 +9,34 @@ impl Struct {
 
     fn ref_self(&mut self, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     // Test using `&mut Self` explicitly:
 
     fn ref_Self(self: &mut Self, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn box_box_ref_Self(self: Box<Box<&mut Self>>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn box_pin_ref_Self(self: Box<Pin<&mut Self>>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
diff --git a/src/test/ui/self/elision/ref-mut-self.nll.stderr b/src/test/ui/self/elision/ref-mut-self.stderr
index fd4ecae3cfe..ccf1830167c 100644
--- a/src/test/ui/self/elision/ref-mut-self.nll.stderr
+++ b/src/test/ui/self/elision/ref-mut-self.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-self.rs:15:9
+  --> $DIR/ref-mut-self.rs:11:9
    |
 LL |     fn ref_self(&mut self, f: &u32) -> &u32 {
    |                 -             - let's call the lifetime of this reference `'1`
@@ -14,7 +14,7 @@ LL |     fn ref_self<'a>(&'a mut self, f: &'a u32) -> &u32 {
    |                ++++  ++               ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-self.rs:23:9
+  --> $DIR/ref-mut-self.rs:18:9
    |
 LL |     fn ref_Self(self: &mut Self, f: &u32) -> &u32 {
    |                       -             - let's call the lifetime of this reference `'1`
@@ -29,7 +29,7 @@ LL |     fn ref_Self<'a>(self: &'a mut Self, f: &'a u32) -> &u32 {
    |                ++++        ++               ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-self.rs:29:9
+  --> $DIR/ref-mut-self.rs:23:9
    |
 LL |     fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 {
    |                               -              - let's call the lifetime of this reference `'1`
@@ -44,7 +44,7 @@ LL |     fn box_ref_Self<'a>(self: Box<&'a mut Self>, f: &'a u32) -> &u32 {
    |                    ++++            ++                ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-self.rs:35:9
+  --> $DIR/ref-mut-self.rs:28:9
    |
 LL |     fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 {
    |                               -              - let's call the lifetime of this reference `'1`
@@ -59,7 +59,7 @@ LL |     fn pin_ref_Self<'a>(self: Pin<&'a mut Self>, f: &'a u32) -> &u32 {
    |                    ++++            ++                ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-self.rs:41:9
+  --> $DIR/ref-mut-self.rs:33:9
    |
 LL |     fn box_box_ref_Self(self: Box<Box<&mut Self>>, f: &u32) -> &u32 {
    |                                       -               - let's call the lifetime of this reference `'1`
@@ -74,7 +74,7 @@ LL |     fn box_box_ref_Self<'a>(self: Box<Box<&'a mut Self>>, f: &'a u32) -> &u
    |                        ++++                ++                 ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-self.rs:47:9
+  --> $DIR/ref-mut-self.rs:38:9
    |
 LL |     fn box_pin_ref_Self(self: Box<Pin<&mut Self>>, f: &u32) -> &u32 {
    |                                       -               - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/self/elision/ref-mut-struct-async.base.stderr b/src/test/ui/self/elision/ref-mut-struct-async.base.stderr
deleted file mode 100644
index fefb3fc1944..00000000000
--- a/src/test/ui/self/elision/ref-mut-struct-async.base.stderr
+++ /dev/null
@@ -1,83 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-struct-async.rs:16:9
-   |
-LL |     async fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 {
-   |                                               ----     ----
-   |                                               |
-   |                                               this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn ref_Struct<'a>(self: &'a mut Struct, f: &'a u32) -> &u32 {
-   |                        ++++        ++                 ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-struct-async.rs:22:9
-   |
-LL |     async fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 {
-   |                                                        ----     ----
-   |                                                        |
-   |                                                        this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn box_ref_Struct<'a>(self: Box<&'a mut Struct>, f: &'a u32) -> &u32 {
-   |                            ++++            ++                  ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-struct-async.rs:28:9
-   |
-LL |     async fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 {
-   |                                                        ----     ----
-   |                                                        |
-   |                                                        this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn pin_ref_Struct<'a>(self: Pin<&'a mut Struct>, f: &'a u32) -> &u32 {
-   |                            ++++            ++                  ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-struct-async.rs:34:9
-   |
-LL |     async fn box_box_ref_Struct(self: Box<Box<&mut Struct>>, f: &u32) -> &u32 {
-   |                                                                 ----     ----
-   |                                                                 |
-   |                                                                 this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn box_box_ref_Struct<'a>(self: Box<Box<&'a mut Struct>>, f: &'a u32) -> &u32 {
-   |                                ++++                ++                   ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-struct-async.rs:40:9
-   |
-LL |     async fn box_pin_ref_Struct(self: Box<Pin<&mut Struct>>, f: &u32) -> &u32 {
-   |                                                                 ----     ----
-   |                                                                 |
-   |                                                                 this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn box_pin_ref_Struct<'a>(self: Box<Pin<&'a mut Struct>>, f: &'a u32) -> &u32 {
-   |                                ++++                ++                   ++
-
-error: aborting due to 5 previous errors
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/self/elision/ref-mut-struct-async.rs b/src/test/ui/self/elision/ref-mut-struct-async.rs
index 7448988355c..392bf1d6be3 100644
--- a/src/test/ui/self/elision/ref-mut-struct-async.rs
+++ b/src/test/ui/self/elision/ref-mut-struct-async.rs
@@ -1,7 +1,4 @@
 // edition:2018
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
 
 #![allow(non_snake_case)]
 
@@ -14,32 +11,27 @@ impl Struct {
 
     async fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     async fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     async fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     async fn box_box_ref_Struct(self: Box<Box<&mut Struct>>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     async fn box_pin_ref_Struct(self: Box<Pin<&mut Struct>>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
diff --git a/src/test/ui/self/elision/ref-mut-struct-async.nll.stderr b/src/test/ui/self/elision/ref-mut-struct-async.stderr
index 7fbecbe76a5..5b7ad026f9d 100644
--- a/src/test/ui/self/elision/ref-mut-struct-async.nll.stderr
+++ b/src/test/ui/self/elision/ref-mut-struct-async.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-struct-async.rs:16:9
+  --> $DIR/ref-mut-struct-async.rs:13:9
    |
 LL |     async fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 {
    |                               -               - let's call the lifetime of this reference `'1`
@@ -14,7 +14,7 @@ LL |     async fn ref_Struct<'a>(self: &'a mut Struct, f: &'a u32) -> &u32 {
    |                        ++++        ++                 ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-struct-async.rs:22:9
+  --> $DIR/ref-mut-struct-async.rs:18:9
    |
 LL |     async fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 {
    |                                       -                - let's call the lifetime of this reference `'1`
@@ -29,7 +29,7 @@ LL |     async fn box_ref_Struct<'a>(self: Box<&'a mut Struct>, f: &'a u32) -> &
    |                            ++++            ++                  ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-struct-async.rs:28:9
+  --> $DIR/ref-mut-struct-async.rs:23:9
    |
 LL |     async fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 {
    |                                       -                - let's call the lifetime of this reference `'1`
@@ -44,7 +44,7 @@ LL |     async fn pin_ref_Struct<'a>(self: Pin<&'a mut Struct>, f: &'a u32) -> &
    |                            ++++            ++                  ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-struct-async.rs:34:9
+  --> $DIR/ref-mut-struct-async.rs:28:9
    |
 LL |     async fn box_box_ref_Struct(self: Box<Box<&mut Struct>>, f: &u32) -> &u32 {
    |                                               -                 - let's call the lifetime of this reference `'1`
@@ -59,7 +59,7 @@ LL |     async fn box_box_ref_Struct<'a>(self: Box<Box<&'a mut Struct>>, f: &'a
    |                                ++++                ++                   ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-struct-async.rs:40:9
+  --> $DIR/ref-mut-struct-async.rs:33:9
    |
 LL |     async fn box_pin_ref_Struct(self: Box<Pin<&mut Struct>>, f: &u32) -> &u32 {
    |                                               -                 - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/self/elision/ref-mut-struct.base.stderr b/src/test/ui/self/elision/ref-mut-struct.base.stderr
deleted file mode 100644
index a01492f6cd3..00000000000
--- a/src/test/ui/self/elision/ref-mut-struct.base.stderr
+++ /dev/null
@@ -1,83 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-struct.rs:15:9
-   |
-LL |     fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 {
-   |                                         ----     ----
-   |                                         |
-   |                                         this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn ref_Struct<'a>(self: &'a mut Struct, f: &'a u32) -> &u32 {
-   |                  ++++        ++                 ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-struct.rs:21:9
-   |
-LL |     fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 {
-   |                                                  ----     ----
-   |                                                  |
-   |                                                  this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn box_ref_Struct<'a>(self: Box<&'a mut Struct>, f: &'a u32) -> &u32 {
-   |                      ++++            ++                  ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-struct.rs:27:9
-   |
-LL |     fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 {
-   |                                                  ----     ----
-   |                                                  |
-   |                                                  this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn pin_ref_Struct<'a>(self: Pin<&'a mut Struct>, f: &'a u32) -> &u32 {
-   |                      ++++            ++                  ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-struct.rs:33:9
-   |
-LL |     fn box_box_ref_Struct(self: Box<Box<&mut Struct>>, f: &u32) -> &u32 {
-   |                                                           ----     ----
-   |                                                           |
-   |                                                           this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn box_box_ref_Struct<'a>(self: Box<Box<&'a mut Struct>>, f: &'a u32) -> &u32 {
-   |                          ++++                ++                   ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-mut-struct.rs:39:9
-   |
-LL |     fn box_pin_ref_Struct(self: Box<Pin<&mut Struct>>, f: &u32) -> &u32 {
-   |                                                           ----     ----
-   |                                                           |
-   |                                                           this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn box_pin_ref_Struct<'a>(self: Box<Pin<&'a mut Struct>>, f: &'a u32) -> &u32 {
-   |                          ++++                ++                   ++
-
-error: aborting due to 5 previous errors
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/self/elision/ref-mut-struct.rs b/src/test/ui/self/elision/ref-mut-struct.rs
index 72674bd65b6..ca8bd8da133 100644
--- a/src/test/ui/self/elision/ref-mut-struct.rs
+++ b/src/test/ui/self/elision/ref-mut-struct.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 #![allow(non_snake_case)]
 
 use std::pin::Pin;
@@ -13,32 +9,27 @@ impl Struct {
 
     fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn box_box_ref_Struct(self: Box<Box<&mut Struct>>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn box_pin_ref_Struct(self: Box<Pin<&mut Struct>>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
diff --git a/src/test/ui/self/elision/ref-mut-struct.nll.stderr b/src/test/ui/self/elision/ref-mut-struct.stderr
index ede790c0611..b9c71e8433c 100644
--- a/src/test/ui/self/elision/ref-mut-struct.nll.stderr
+++ b/src/test/ui/self/elision/ref-mut-struct.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-struct.rs:15:9
+  --> $DIR/ref-mut-struct.rs:11:9
    |
 LL |     fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 {
    |                         -               - let's call the lifetime of this reference `'1`
@@ -14,7 +14,7 @@ LL |     fn ref_Struct<'a>(self: &'a mut Struct, f: &'a u32) -> &u32 {
    |                  ++++        ++                 ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-struct.rs:21:9
+  --> $DIR/ref-mut-struct.rs:16:9
    |
 LL |     fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 {
    |                                 -                - let's call the lifetime of this reference `'1`
@@ -29,7 +29,7 @@ LL |     fn box_ref_Struct<'a>(self: Box<&'a mut Struct>, f: &'a u32) -> &u32 {
    |                      ++++            ++                  ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-struct.rs:27:9
+  --> $DIR/ref-mut-struct.rs:21:9
    |
 LL |     fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 {
    |                                 -                - let's call the lifetime of this reference `'1`
@@ -44,7 +44,7 @@ LL |     fn pin_ref_Struct<'a>(self: Pin<&'a mut Struct>, f: &'a u32) -> &u32 {
    |                      ++++            ++                  ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-struct.rs:33:9
+  --> $DIR/ref-mut-struct.rs:26:9
    |
 LL |     fn box_box_ref_Struct(self: Box<Box<&mut Struct>>, f: &u32) -> &u32 {
    |                                         -                 - let's call the lifetime of this reference `'1`
@@ -59,7 +59,7 @@ LL |     fn box_box_ref_Struct<'a>(self: Box<Box<&'a mut Struct>>, f: &'a u32) -
    |                          ++++                ++                   ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-mut-struct.rs:39:9
+  --> $DIR/ref-mut-struct.rs:31:9
    |
 LL |     fn box_pin_ref_Struct(self: Box<Pin<&mut Struct>>, f: &u32) -> &u32 {
    |                                         -                 - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/self/elision/ref-self-async.base.stderr b/src/test/ui/self/elision/ref-self-async.base.stderr
deleted file mode 100644
index 2b142b089d5..00000000000
--- a/src/test/ui/self/elision/ref-self-async.base.stderr
+++ /dev/null
@@ -1,115 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-self-async.rs:26:9
-   |
-LL |     async fn ref_self(&self, f: &u32) -> &u32 {
-   |                                 ----     ----
-   |                                 |
-   |                                 this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn ref_self<'a>(&'a self, f: &'a u32) -> &u32 {
-   |                      ++++  ++           ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-self-async.rs:34:9
-   |
-LL |     async fn ref_Self(self: &Self, f: &u32) -> &u32 {
-   |                                       ----     ----
-   |                                       |
-   |                                       this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn ref_Self<'a>(self: &'a Self, f: &'a u32) -> &u32 {
-   |                      ++++        ++           ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-self-async.rs:40:9
-   |
-LL |     async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
-   |                                                ----     ----
-   |                                                |
-   |                                                this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn box_ref_Self<'a>(self: Box<&'a Self>, f: &'a u32) -> &u32 {
-   |                          ++++            ++            ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-self-async.rs:46:9
-   |
-LL |     async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
-   |                                                ----     ----
-   |                                                |
-   |                                                this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn pin_ref_Self<'a>(self: Pin<&'a Self>, f: &'a u32) -> &u32 {
-   |                          ++++            ++            ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-self-async.rs:52:9
-   |
-LL |     async fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
-   |                                                         ----     ----
-   |                                                         |
-   |                                                         this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn box_box_ref_Self<'a>(self: Box<Box<&'a Self>>, f: &'a u32) -> &u32 {
-   |                              ++++                ++             ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-self-async.rs:58:9
-   |
-LL |     async fn box_pin_ref_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
-   |                                                         ----     ----
-   |                                                         |
-   |                                                         this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn box_pin_ref_Self<'a>(self: Box<Pin<&'a Self>>, f: &'a u32) -> &u32 {
-   |                              ++++                ++             ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-self-async.rs:64:9
-   |
-LL |     async fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 {
-   |                                                             ---     ---
-   |                                                             |
-   |                                                             this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn wrap_ref_Self_Self<'a>(self: Wrap<&'a Self, Self>, f: &'a u8) -> &u8 {
-   |                                ++++             ++                  ++
-
-error: aborting due to 7 previous errors
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/self/elision/ref-self-async.rs b/src/test/ui/self/elision/ref-self-async.rs
index afe5fe100e3..b0133ec1b61 100644
--- a/src/test/ui/self/elision/ref-self-async.rs
+++ b/src/test/ui/self/elision/ref-self-async.rs
@@ -1,7 +1,4 @@
 // edition:2018
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
 
 #![allow(non_snake_case)]
 #![feature(arbitrary_self_types)]
@@ -24,46 +21,39 @@ impl Struct {
 
     async fn ref_self(&self, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     // Test using `&Self` explicitly:
 
     async fn ref_Self(self: &Self, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     async fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     async fn box_pin_ref_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     async fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
diff --git a/src/test/ui/self/elision/ref-self-async.nll.stderr b/src/test/ui/self/elision/ref-self-async.stderr
index f4e531a817c..26ef9779be2 100644
--- a/src/test/ui/self/elision/ref-self-async.nll.stderr
+++ b/src/test/ui/self/elision/ref-self-async.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ref-self-async.rs:26:9
+  --> $DIR/ref-self-async.rs:23:9
    |
 LL |     async fn ref_self(&self, f: &u32) -> &u32 {
    |                       -         - let's call the lifetime of this reference `'1`
@@ -14,7 +14,7 @@ LL |     async fn ref_self<'a>(&'a self, f: &'a u32) -> &u32 {
    |                      ++++  ++           ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-self-async.rs:34:9
+  --> $DIR/ref-self-async.rs:30:9
    |
 LL |     async fn ref_Self(self: &Self, f: &u32) -> &u32 {
    |                             -         - let's call the lifetime of this reference `'1`
@@ -29,7 +29,7 @@ LL |     async fn ref_Self<'a>(self: &'a Self, f: &'a u32) -> &u32 {
    |                      ++++        ++           ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-self-async.rs:40:9
+  --> $DIR/ref-self-async.rs:35:9
    |
 LL |     async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
    |                                     -          - let's call the lifetime of this reference `'1`
@@ -44,7 +44,7 @@ LL |     async fn box_ref_Self<'a>(self: Box<&'a Self>, f: &'a u32) -> &u32 {
    |                          ++++            ++            ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-self-async.rs:46:9
+  --> $DIR/ref-self-async.rs:40:9
    |
 LL |     async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
    |                                     -          - let's call the lifetime of this reference `'1`
@@ -59,7 +59,7 @@ LL |     async fn pin_ref_Self<'a>(self: Pin<&'a Self>, f: &'a u32) -> &u32 {
    |                          ++++            ++            ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-self-async.rs:52:9
+  --> $DIR/ref-self-async.rs:45:9
    |
 LL |     async fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
    |                                             -           - let's call the lifetime of this reference `'1`
@@ -74,7 +74,7 @@ LL |     async fn box_box_ref_Self<'a>(self: Box<Box<&'a Self>>, f: &'a u32) ->
    |                              ++++                ++             ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-self-async.rs:58:9
+  --> $DIR/ref-self-async.rs:50:9
    |
 LL |     async fn box_pin_ref_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
    |                                             -           - let's call the lifetime of this reference `'1`
@@ -89,7 +89,7 @@ LL |     async fn box_pin_ref_Self<'a>(self: Box<Pin<&'a Self>>, f: &'a u32) ->
    |                              ++++                ++             ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-self-async.rs:64:9
+  --> $DIR/ref-self-async.rs:55:9
    |
 LL |     async fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 {
    |                                            -                - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/self/elision/ref-self.base.stderr b/src/test/ui/self/elision/ref-self.base.stderr
deleted file mode 100644
index 8bd194d701f..00000000000
--- a/src/test/ui/self/elision/ref-self.base.stderr
+++ /dev/null
@@ -1,115 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-self.rs:25:9
-   |
-LL |     fn ref_self(&self, f: &u32) -> &u32 {
-   |                           ----     ----
-   |                           |
-   |                           this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn ref_self<'a>(&'a self, f: &'a u32) -> &u32 {
-   |                ++++  ++           ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-self.rs:33:9
-   |
-LL |     fn ref_Self(self: &Self, f: &u32) -> &u32 {
-   |                                 ----     ----
-   |                                 |
-   |                                 this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn ref_Self<'a>(self: &'a Self, f: &'a u32) -> &u32 {
-   |                ++++        ++           ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-self.rs:39:9
-   |
-LL |     fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
-   |                                          ----     ----
-   |                                          |
-   |                                          this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn box_ref_Self<'a>(self: Box<&'a Self>, f: &'a u32) -> &u32 {
-   |                    ++++            ++            ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-self.rs:45:9
-   |
-LL |     fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
-   |                                          ----     ----
-   |                                          |
-   |                                          this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn pin_ref_Self<'a>(self: Pin<&'a Self>, f: &'a u32) -> &u32 {
-   |                    ++++            ++            ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-self.rs:51:9
-   |
-LL |     fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
-   |                                                   ----     ----
-   |                                                   |
-   |                                                   this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn box_box_ref_Self<'a>(self: Box<Box<&'a Self>>, f: &'a u32) -> &u32 {
-   |                        ++++                ++             ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-self.rs:57:9
-   |
-LL |     fn box_pin_ref_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
-   |                                                   ----     ----
-   |                                                   |
-   |                                                   this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn box_pin_ref_Self<'a>(self: Box<Pin<&'a Self>>, f: &'a u32) -> &u32 {
-   |                        ++++                ++             ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-self.rs:63:9
-   |
-LL |     fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 {
-   |                                                       ---     ---
-   |                                                       |
-   |                                                       this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn wrap_ref_Self_Self<'a>(self: Wrap<&'a Self, Self>, f: &'a u8) -> &u8 {
-   |                          ++++             ++                  ++
-
-error: aborting due to 7 previous errors
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/self/elision/ref-self.rs b/src/test/ui/self/elision/ref-self.rs
index 34df3da4505..dd07fe1b00b 100644
--- a/src/test/ui/self/elision/ref-self.rs
+++ b/src/test/ui/self/elision/ref-self.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 #![feature(arbitrary_self_types)]
 #![allow(non_snake_case)]
 
@@ -23,46 +19,39 @@ impl Struct {
 
     fn ref_self(&self, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     // Test using `&Self` explicitly:
 
     fn ref_Self(self: &Self, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn box_pin_ref_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
diff --git a/src/test/ui/self/elision/ref-self.nll.stderr b/src/test/ui/self/elision/ref-self.stderr
index c0efc35fa6c..32448f3a677 100644
--- a/src/test/ui/self/elision/ref-self.nll.stderr
+++ b/src/test/ui/self/elision/ref-self.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ref-self.rs:25:9
+  --> $DIR/ref-self.rs:21:9
    |
 LL |     fn ref_self(&self, f: &u32) -> &u32 {
    |                 -         - let's call the lifetime of this reference `'1`
@@ -14,7 +14,7 @@ LL |     fn ref_self<'a>(&'a self, f: &'a u32) -> &u32 {
    |                ++++  ++           ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-self.rs:33:9
+  --> $DIR/ref-self.rs:28:9
    |
 LL |     fn ref_Self(self: &Self, f: &u32) -> &u32 {
    |                       -         - let's call the lifetime of this reference `'1`
@@ -29,7 +29,7 @@ LL |     fn ref_Self<'a>(self: &'a Self, f: &'a u32) -> &u32 {
    |                ++++        ++           ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-self.rs:39:9
+  --> $DIR/ref-self.rs:33:9
    |
 LL |     fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
    |                               -          - let's call the lifetime of this reference `'1`
@@ -44,7 +44,7 @@ LL |     fn box_ref_Self<'a>(self: Box<&'a Self>, f: &'a u32) -> &u32 {
    |                    ++++            ++            ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-self.rs:45:9
+  --> $DIR/ref-self.rs:38:9
    |
 LL |     fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
    |                               -          - let's call the lifetime of this reference `'1`
@@ -59,7 +59,7 @@ LL |     fn pin_ref_Self<'a>(self: Pin<&'a Self>, f: &'a u32) -> &u32 {
    |                    ++++            ++            ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-self.rs:51:9
+  --> $DIR/ref-self.rs:43:9
    |
 LL |     fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
    |                                       -           - let's call the lifetime of this reference `'1`
@@ -74,7 +74,7 @@ LL |     fn box_box_ref_Self<'a>(self: Box<Box<&'a Self>>, f: &'a u32) -> &u32 {
    |                        ++++                ++             ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-self.rs:57:9
+  --> $DIR/ref-self.rs:48:9
    |
 LL |     fn box_pin_ref_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
    |                                       -           - let's call the lifetime of this reference `'1`
@@ -89,7 +89,7 @@ LL |     fn box_pin_ref_Self<'a>(self: Box<Pin<&'a Self>>, f: &'a u32) -> &u32 {
    |                        ++++                ++             ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-self.rs:63:9
+  --> $DIR/ref-self.rs:53:9
    |
 LL |     fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 {
    |                                      -                - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/self/elision/ref-struct-async.base.stderr b/src/test/ui/self/elision/ref-struct-async.base.stderr
deleted file mode 100644
index 88ddca89804..00000000000
--- a/src/test/ui/self/elision/ref-struct-async.base.stderr
+++ /dev/null
@@ -1,83 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-struct-async.rs:16:9
-   |
-LL |     async fn ref_Struct(self: &Struct, f: &u32) -> &u32 {
-   |                                           ----     ----
-   |                                           |
-   |                                           this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn ref_Struct<'a>(self: &'a Struct, f: &'a u32) -> &u32 {
-   |                        ++++        ++             ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-struct-async.rs:22:9
-   |
-LL |     async fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 {
-   |                                                    ----     ----
-   |                                                    |
-   |                                                    this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn box_ref_Struct<'a>(self: Box<&'a Struct>, f: &'a u32) -> &u32 {
-   |                            ++++            ++              ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-struct-async.rs:28:9
-   |
-LL |     async fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 {
-   |                                                    ----     ----
-   |                                                    |
-   |                                                    this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn pin_ref_Struct<'a>(self: Pin<&'a Struct>, f: &'a u32) -> &u32 {
-   |                            ++++            ++              ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-struct-async.rs:34:9
-   |
-LL |     async fn box_box_ref_Struct(self: Box<Box<&Struct>>, f: &u32) -> &u32 {
-   |                                                             ----     ----
-   |                                                             |
-   |                                                             this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn box_box_ref_Struct<'a>(self: Box<Box<&'a Struct>>, f: &'a u32) -> &u32 {
-   |                                ++++                ++               ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-struct-async.rs:40:9
-   |
-LL |     async fn box_pin_Struct(self: Box<Pin<&Struct>>, f: &u32) -> &u32 {
-   |                                                         ----     ----
-   |                                                         |
-   |                                                         this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     async fn box_pin_Struct<'a>(self: Box<Pin<&'a Struct>>, f: &'a u32) -> &u32 {
-   |                            ++++                ++               ++
-
-error: aborting due to 5 previous errors
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/self/elision/ref-struct-async.rs b/src/test/ui/self/elision/ref-struct-async.rs
index 12f8f6faf1b..0be74874515 100644
--- a/src/test/ui/self/elision/ref-struct-async.rs
+++ b/src/test/ui/self/elision/ref-struct-async.rs
@@ -1,7 +1,4 @@
 // edition:2018
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
 
 #![allow(non_snake_case)]
 
@@ -14,32 +11,27 @@ impl Struct {
 
     async fn ref_Struct(self: &Struct, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     async fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     async fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     async fn box_box_ref_Struct(self: Box<Box<&Struct>>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     async fn box_pin_Struct(self: Box<Pin<&Struct>>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
diff --git a/src/test/ui/self/elision/ref-struct-async.nll.stderr b/src/test/ui/self/elision/ref-struct-async.stderr
index 83c20329c3d..edb5c54ab00 100644
--- a/src/test/ui/self/elision/ref-struct-async.nll.stderr
+++ b/src/test/ui/self/elision/ref-struct-async.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ref-struct-async.rs:16:9
+  --> $DIR/ref-struct-async.rs:13:9
    |
 LL |     async fn ref_Struct(self: &Struct, f: &u32) -> &u32 {
    |                               -           - let's call the lifetime of this reference `'1`
@@ -14,7 +14,7 @@ LL |     async fn ref_Struct<'a>(self: &'a Struct, f: &'a u32) -> &u32 {
    |                        ++++        ++             ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-struct-async.rs:22:9
+  --> $DIR/ref-struct-async.rs:18:9
    |
 LL |     async fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 {
    |                                       -            - let's call the lifetime of this reference `'1`
@@ -29,7 +29,7 @@ LL |     async fn box_ref_Struct<'a>(self: Box<&'a Struct>, f: &'a u32) -> &u32
    |                            ++++            ++              ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-struct-async.rs:28:9
+  --> $DIR/ref-struct-async.rs:23:9
    |
 LL |     async fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 {
    |                                       -            - let's call the lifetime of this reference `'1`
@@ -44,7 +44,7 @@ LL |     async fn pin_ref_Struct<'a>(self: Pin<&'a Struct>, f: &'a u32) -> &u32
    |                            ++++            ++              ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-struct-async.rs:34:9
+  --> $DIR/ref-struct-async.rs:28:9
    |
 LL |     async fn box_box_ref_Struct(self: Box<Box<&Struct>>, f: &u32) -> &u32 {
    |                                               -             - let's call the lifetime of this reference `'1`
@@ -59,7 +59,7 @@ LL |     async fn box_box_ref_Struct<'a>(self: Box<Box<&'a Struct>>, f: &'a u32)
    |                                ++++                ++               ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-struct-async.rs:40:9
+  --> $DIR/ref-struct-async.rs:33:9
    |
 LL |     async fn box_pin_Struct(self: Box<Pin<&Struct>>, f: &u32) -> &u32 {
    |                                           -             - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/self/elision/ref-struct.base.stderr b/src/test/ui/self/elision/ref-struct.base.stderr
deleted file mode 100644
index 5650b3788e7..00000000000
--- a/src/test/ui/self/elision/ref-struct.base.stderr
+++ /dev/null
@@ -1,83 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-struct.rs:15:9
-   |
-LL |     fn ref_Struct(self: &Struct, f: &u32) -> &u32 {
-   |                                     ----     ----
-   |                                     |
-   |                                     this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn ref_Struct<'a>(self: &'a Struct, f: &'a u32) -> &u32 {
-   |                  ++++        ++             ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-struct.rs:21:9
-   |
-LL |     fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 {
-   |                                              ----     ----
-   |                                              |
-   |                                              this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn box_ref_Struct<'a>(self: Box<&'a Struct>, f: &'a u32) -> &u32 {
-   |                      ++++            ++              ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-struct.rs:27:9
-   |
-LL |     fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 {
-   |                                              ----     ----
-   |                                              |
-   |                                              this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn pin_ref_Struct<'a>(self: Pin<&'a Struct>, f: &'a u32) -> &u32 {
-   |                      ++++            ++              ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-struct.rs:33:9
-   |
-LL |     fn box_box_ref_Struct(self: Box<Box<&Struct>>, f: &u32) -> &u32 {
-   |                                                       ----     ----
-   |                                                       |
-   |                                                       this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn box_box_ref_Struct<'a>(self: Box<Box<&'a Struct>>, f: &'a u32) -> &u32 {
-   |                          ++++                ++               ++
-
-error[E0623]: lifetime mismatch
-  --> $DIR/ref-struct.rs:39:9
-   |
-LL |     fn box_pin_Struct(self: Box<Pin<&Struct>>, f: &u32) -> &u32 {
-   |                                                   ----     ----
-   |                                                   |
-   |                                                   this parameter and the return type are declared with different lifetimes...
-LL |         f
-   |         ^ ...but data from `f` is returned here
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter and update trait if needed
-   |
-LL |     fn box_pin_Struct<'a>(self: Box<Pin<&'a Struct>>, f: &'a u32) -> &u32 {
-   |                      ++++                ++               ++
-
-error: aborting due to 5 previous errors
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/self/elision/ref-struct.rs b/src/test/ui/self/elision/ref-struct.rs
index 0ffe72793d7..13a42cd1aed 100644
--- a/src/test/ui/self/elision/ref-struct.rs
+++ b/src/test/ui/self/elision/ref-struct.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 #![allow(non_snake_case)]
 
 use std::pin::Pin;
@@ -13,32 +9,27 @@ impl Struct {
 
     fn ref_Struct(self: &Struct, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn box_box_ref_Struct(self: Box<Box<&Struct>>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 
     fn box_pin_Struct(self: Box<Pin<&Struct>>, f: &u32) -> &u32 {
         f
-        //[base]~^ ERROR lifetime mismatch
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
diff --git a/src/test/ui/self/elision/ref-struct.nll.stderr b/src/test/ui/self/elision/ref-struct.stderr
index 226923f59ff..4492ed4aafc 100644
--- a/src/test/ui/self/elision/ref-struct.nll.stderr
+++ b/src/test/ui/self/elision/ref-struct.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ref-struct.rs:15:9
+  --> $DIR/ref-struct.rs:11:9
    |
 LL |     fn ref_Struct(self: &Struct, f: &u32) -> &u32 {
    |                         -           - let's call the lifetime of this reference `'1`
@@ -14,7 +14,7 @@ LL |     fn ref_Struct<'a>(self: &'a Struct, f: &'a u32) -> &u32 {
    |                  ++++        ++             ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-struct.rs:21:9
+  --> $DIR/ref-struct.rs:16:9
    |
 LL |     fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 {
    |                                 -            - let's call the lifetime of this reference `'1`
@@ -29,7 +29,7 @@ LL |     fn box_ref_Struct<'a>(self: Box<&'a Struct>, f: &'a u32) -> &u32 {
    |                      ++++            ++              ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-struct.rs:27:9
+  --> $DIR/ref-struct.rs:21:9
    |
 LL |     fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 {
    |                                 -            - let's call the lifetime of this reference `'1`
@@ -44,7 +44,7 @@ LL |     fn pin_ref_Struct<'a>(self: Pin<&'a Struct>, f: &'a u32) -> &u32 {
    |                      ++++            ++              ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-struct.rs:33:9
+  --> $DIR/ref-struct.rs:26:9
    |
 LL |     fn box_box_ref_Struct(self: Box<Box<&Struct>>, f: &u32) -> &u32 {
    |                                         -             - let's call the lifetime of this reference `'1`
@@ -59,7 +59,7 @@ LL |     fn box_box_ref_Struct<'a>(self: Box<Box<&'a Struct>>, f: &'a u32) -> &u
    |                          ++++                ++               ++
 
 error: lifetime may not live long enough
-  --> $DIR/ref-struct.rs:39:9
+  --> $DIR/ref-struct.rs:31:9
    |
 LL |     fn box_pin_Struct(self: Box<Pin<&Struct>>, f: &u32) -> &u32 {
    |                                     -             - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/structs/struct-path-associated-type.rs b/src/test/ui/structs/struct-path-associated-type.rs
index e44a203b783..f88572f8419 100644
--- a/src/test/ui/structs/struct-path-associated-type.rs
+++ b/src/test/ui/structs/struct-path-associated-type.rs
@@ -13,7 +13,7 @@ fn f<T: Tr>() {
     //~^ ERROR expected struct, variant or union type, found associated type
     let z = T::A::<u8> {};
     //~^ ERROR expected struct, variant or union type, found associated type
-    //~| ERROR type arguments are not allowed for this type
+    //~| ERROR type arguments are not allowed on this type
     match S {
         T::A {} => {}
         //~^ ERROR expected struct, variant or union type, found associated type
@@ -22,7 +22,7 @@ fn f<T: Tr>() {
 
 fn g<T: Tr<A = S>>() {
     let s = T::A {}; // OK
-    let z = T::A::<u8> {}; //~ ERROR type arguments are not allowed for this type
+    let z = T::A::<u8> {}; //~ ERROR type arguments are not allowed on this type
     match S {
         T::A {} => {} // OK
     }
diff --git a/src/test/ui/structs/struct-path-associated-type.stderr b/src/test/ui/structs/struct-path-associated-type.stderr
index 0b1b6a5e3af..7424ceecbe3 100644
--- a/src/test/ui/structs/struct-path-associated-type.stderr
+++ b/src/test/ui/structs/struct-path-associated-type.stderr
@@ -4,11 +4,13 @@ error[E0071]: expected struct, variant or union type, found associated type
 LL |     let s = T::A {};
    |             ^^^^ not a struct
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/struct-path-associated-type.rs:14:20
    |
 LL |     let z = T::A::<u8> {};
-   |                    ^^ type argument not allowed
+   |                -   ^^ type argument not allowed
+   |                |
+   |                not allowed on this
 
 error[E0071]: expected struct, variant or union type, found associated type
   --> $DIR/struct-path-associated-type.rs:14:13
@@ -22,11 +24,13 @@ error[E0071]: expected struct, variant or union type, found associated type
 LL |         T::A {} => {}
    |         ^^^^ not a struct
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/struct-path-associated-type.rs:25:20
    |
 LL |     let z = T::A::<u8> {};
-   |                    ^^ type argument not allowed
+   |                -   ^^ type argument not allowed
+   |                |
+   |                not allowed on this
 
 error[E0223]: ambiguous associated type
   --> $DIR/struct-path-associated-type.rs:32:13
diff --git a/src/test/ui/structs/struct-path-self.rs b/src/test/ui/structs/struct-path-self.rs
index c938ce8dad9..6e529c7ed2b 100644
--- a/src/test/ui/structs/struct-path-self.rs
+++ b/src/test/ui/structs/struct-path-self.rs
@@ -6,7 +6,7 @@ trait Tr {
         //~^ ERROR expected struct, variant or union type, found type parameter
         let z = Self::<u8> {};
         //~^ ERROR expected struct, variant or union type, found type parameter
-        //~| ERROR type arguments are not allowed for this type
+        //~| ERROR type arguments are not allowed on self type
         match s {
             Self { .. } => {}
             //~^ ERROR expected struct, variant or union type, found type parameter
@@ -17,7 +17,7 @@ trait Tr {
 impl Tr for S {
     fn f() {
         let s = Self {}; // OK
-        let z = Self::<u8> {}; //~ ERROR type arguments are not allowed for this type
+        let z = Self::<u8> {}; //~ ERROR type arguments are not allowed on self type
         match s {
             Self { .. } => {} // OK
         }
@@ -27,7 +27,7 @@ impl Tr for S {
 impl S {
     fn g() {
         let s = Self {}; // OK
-        let z = Self::<u8> {}; //~ ERROR type arguments are not allowed for this type
+        let z = Self::<u8> {}; //~ ERROR type arguments are not allowed on self type
         match s {
             Self { .. } => {} // OK
         }
diff --git a/src/test/ui/structs/struct-path-self.stderr b/src/test/ui/structs/struct-path-self.stderr
index 693ed35cbc9..cccdd7b0f02 100644
--- a/src/test/ui/structs/struct-path-self.stderr
+++ b/src/test/ui/structs/struct-path-self.stderr
@@ -4,11 +4,19 @@ error[E0071]: expected struct, variant or union type, found type parameter `Self
 LL |         let s = Self {};
    |                 ^^^^ not a struct
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on self type
   --> $DIR/struct-path-self.rs:7:24
    |
 LL |         let z = Self::<u8> {};
-   |                        ^^ type argument not allowed
+   |                 ----   ^^ type argument not allowed
+   |                 |
+   |                 not allowed on this
+   |
+help: the `Self` type doesn't accept type parameters
+   |
+LL -         let z = Self::<u8> {};
+LL +         let z = Self {};
+   | 
 
 error[E0071]: expected struct, variant or union type, found type parameter `Self`
   --> $DIR/struct-path-self.rs:7:17
@@ -22,17 +30,49 @@ error[E0071]: expected struct, variant or union type, found type parameter `Self
 LL |             Self { .. } => {}
    |             ^^^^ not a struct
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on self type
   --> $DIR/struct-path-self.rs:20:24
    |
 LL |         let z = Self::<u8> {};
-   |                        ^^ type argument not allowed
+   |                 ----   ^^ type argument not allowed
+   |                 |
+   |                 not allowed on this
+   |
+note: `Self` is of type `S`
+  --> $DIR/struct-path-self.rs:1:8
+   |
+LL | struct S;
+   |        ^ `Self` corresponds to this type, which doesn't have generic parameters
+...
+LL | impl Tr for S {
+   | ------------- `Self` is on type `S` in this `impl`
+help: the `Self` type doesn't accept type parameters
+   |
+LL -         let z = Self::<u8> {};
+LL +         let z = Self {};
+   | 
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on self type
   --> $DIR/struct-path-self.rs:30:24
    |
 LL |         let z = Self::<u8> {};
-   |                        ^^ type argument not allowed
+   |                 ----   ^^ type argument not allowed
+   |                 |
+   |                 not allowed on this
+   |
+note: `Self` is of type `S`
+  --> $DIR/struct-path-self.rs:1:8
+   |
+LL | struct S;
+   |        ^ `Self` corresponds to this type, which doesn't have generic parameters
+...
+LL | impl S {
+   | ------ `Self` is on type `S` in this `impl`
+help: the `Self` type doesn't accept type parameters
+   |
+LL -         let z = Self::<u8> {};
+LL +         let z = Self {};
+   | 
 
 error: aborting due to 6 previous errors
 
diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.base.stderr b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.base.stderr
deleted file mode 100644
index 12c7c8f9b7e..00000000000
--- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.base.stderr
+++ /dev/null
@@ -1,42 +0,0 @@
-error[E0515]: cannot return reference to function parameter `val`
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:25:9
-   |
-LL |         val.use_self()
-   |         ^^^^^^^^^^^^^^ returns a reference to data owned by the current function
-
-error[E0515]: cannot return reference to function parameter `val`
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:47:9
-   |
-LL |         val.use_self()
-   |         ^^^^^^^^^^^^^^ returns a reference to data owned by the current function
-
-error[E0515]: cannot return reference to function parameter `val`
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:113:9
-   |
-LL |         val.use_self()
-   |         ^^^^^^^^^^^^^^ returns a reference to data owned by the current function
-
-error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:70:13
-   |
-LL |     fn use_it<'a>(val: Box<dyn ObjectTrait<Assoc = i32> + 'a>) -> &'a () {
-   |                        -------------------------------------- this data with lifetime `'a`...
-LL |         val.use_self()
-   |             ^^^^^^^^ ...is used and required to live as long as `'static` here
-   |
-note: the used `impl` has a `'static` requirement
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:64:30
-   |
-LL |     impl MyTrait for Box<dyn ObjectTrait<Assoc = i32>> {
-   |                              ^^^^^^^^^^^^^^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
-LL |         fn use_self(&self) -> &() { panic!() }
-   |            -------- calling this method introduces the `impl`'s 'static` requirement
-help: consider relaxing the implicit `'static` requirement
-   |
-LL |     impl MyTrait for Box<dyn ObjectTrait<Assoc = i32> + '_> {
-   |                                                       ++++
-
-error: aborting due to 4 previous errors
-
-Some errors have detailed explanations: E0515, E0772.
-For more information about an error, try `rustc --explain E0515`.
diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs
index ec90a0987f0..711cbbd381a 100644
--- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs
+++ b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 // FIXME: the following cases need to suggest more things to make users reach a working end state.
 
 mod bav {
@@ -67,7 +63,7 @@ mod bay {
     impl Bar for i32 {}
 
     fn use_it<'a>(val: Box<dyn ObjectTrait<Assoc = i32> + 'a>) -> &'a () {
-        val.use_self() //[base]~ ERROR E0772
+        val.use_self()
     }
 }
 
diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.nll.stderr b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr
index db790049c6f..2dc300ac76f 100644
--- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.nll.stderr
+++ b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr
@@ -1,17 +1,17 @@
 error[E0515]: cannot return reference to function parameter `val`
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:25:9
+  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:21:9
    |
 LL |         val.use_self()
    |         ^^^^^^^^^^^^^^ returns a reference to data owned by the current function
 
 error[E0515]: cannot return reference to function parameter `val`
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:47:9
+  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:43:9
    |
 LL |         val.use_self()
    |         ^^^^^^^^^^^^^^ returns a reference to data owned by the current function
 
 error[E0515]: cannot return reference to function parameter `val`
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:113:9
+  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:109:9
    |
 LL |         val.use_self()
    |         ^^^^^^^^^^^^^^ returns a reference to data owned by the current function
diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-nll.rs b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-nll.rs
deleted file mode 100644
index 37be629e77c..00000000000
--- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-nll.rs
+++ /dev/null
@@ -1,118 +0,0 @@
-// FIXME(nll): On NLL stabilization, this should replace
-// `impl-on-dyn-trait-with-implicit-static-bound.rs`. Compiletest has
-// problems with rustfix and revisions.
-// ignore-compare-mode-nll
-// compile-flags: -Zborrowck=mir
-
-#![allow(dead_code)]
-
-mod foo {
-    trait OtherTrait<'a> {}
-    impl<'a> OtherTrait<'a> for &'a () {}
-
-    trait ObjectTrait<T> {}
-    trait MyTrait<T> {
-        fn use_self<K>(&self) -> &();
-    }
-    trait Irrelevant {}
-
-    impl<T> MyTrait<T> for dyn ObjectTrait<T> {
-        fn use_self<K>(&self) -> &() { panic!() }
-    }
-    impl<T> Irrelevant for dyn ObjectTrait<T> {}
-
-    fn use_it<'a, T>(val: &'a dyn ObjectTrait<T>) -> impl OtherTrait<'a> + 'a {
-        val.use_self::<T>() //~ ERROR borrowed data escapes
-    }
-}
-
-mod bar {
-    trait ObjectTrait {}
-    trait MyTrait {
-        fn use_self(&self) -> &();
-    }
-    trait Irrelevant {}
-
-    impl MyTrait for dyn ObjectTrait {
-        fn use_self(&self) -> &() { panic!() }
-    }
-    impl Irrelevant for dyn ObjectTrait {}
-
-    fn use_it<'a>(val: &'a dyn ObjectTrait) -> &'a () {
-        val.use_self()
-    }
-}
-
-mod baz {
-    trait ObjectTrait {}
-    trait MyTrait {
-        fn use_self(&self) -> &();
-    }
-    trait Irrelevant {}
-
-    impl MyTrait for Box<dyn ObjectTrait> {
-        fn use_self(&self) -> &() { panic!() }
-    }
-    impl Irrelevant for Box<dyn ObjectTrait> {}
-
-    fn use_it<'a>(val: &'a Box<dyn ObjectTrait + 'a>) -> &'a () {
-        val.use_self()
-    }
-}
-
-mod bat {
-    trait OtherTrait<'a> {}
-    impl<'a> OtherTrait<'a> for &'a () {}
-
-    trait ObjectTrait {}
-
-    impl dyn ObjectTrait {
-        fn use_self(&self) -> &() { panic!() }
-    }
-
-    fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
-        val.use_self()
-        //~^ ERROR borrowed data escapes
-    }
-}
-
-mod ban {
-    trait OtherTrait<'a> {}
-    impl<'a> OtherTrait<'a> for &'a () {}
-
-    trait ObjectTrait {}
-    trait MyTrait {
-        fn use_self(&self) -> &() { panic!() }
-    }
-    trait Irrelevant {
-        fn use_self(&self) -> &() { panic!() }
-    }
-
-    impl MyTrait for dyn ObjectTrait {}
-
-    fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> {
-        val.use_self() //~ ERROR borrowed data escapes
-    }
-}
-
-mod bal {
-    trait OtherTrait<'a> {}
-    impl<'a> OtherTrait<'a> for &'a () {}
-
-    trait ObjectTrait {}
-    trait MyTrait {
-        fn use_self(&self) -> &() { panic!() }
-    }
-    trait Irrelevant {
-        fn use_self(&self) -> &() { panic!() }
-    }
-
-    impl MyTrait for dyn ObjectTrait {}
-    impl Irrelevant for dyn ObjectTrait {}
-
-    fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
-        MyTrait::use_self(val) //~ ERROR borrowed data escapes
-    }
-}
-
-fn main() {}
diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-nll.stderr b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-nll.stderr
deleted file mode 100644
index 5d9c7077fa1..00000000000
--- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-nll.stderr
+++ /dev/null
@@ -1,105 +0,0 @@
-error[E0521]: borrowed data escapes outside of function
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:25:9
-   |
-LL |     fn use_it<'a, T>(val: &'a dyn ObjectTrait<T>) -> impl OtherTrait<'a> + 'a {
-   |               --     --- `val` is a reference that is only valid in the function body
-   |               |
-   |               lifetime `'a` defined here
-LL |         val.use_self::<T>()
-   |         ^^^^^^^^^^^^^^^^^^^
-   |         |
-   |         `val` escapes the function body here
-   |         argument requires that `'a` must outlive `'static`
-   |
-note: the used `impl` has a `'static` requirement
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:19:32
-   |
-LL |     impl<T> MyTrait<T> for dyn ObjectTrait<T> {
-   |                                ^^^^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
-LL |         fn use_self<K>(&self) -> &() { panic!() }
-   |            -------- calling this method introduces the `impl`'s 'static` requirement
-help: consider relaxing the implicit `'static` requirement
-   |
-LL |     impl<T> MyTrait<T> for dyn ObjectTrait<T> + '_ {
-   |                                               ++++
-
-error[E0521]: borrowed data escapes outside of function
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:74:9
-   |
-LL |     fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
-   |               --  --- `val` is a reference that is only valid in the function body
-   |               |
-   |               lifetime `'a` defined here
-LL |         val.use_self()
-   |         ^^^^^^^^^^^^^^
-   |         |
-   |         `val` escapes the function body here
-   |         argument requires that `'a` must outlive `'static`
-   |
-note: the used `impl` has a `'static` requirement
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:69:14
-   |
-LL |     impl dyn ObjectTrait {
-   |              ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
-LL |         fn use_self(&self) -> &() { panic!() }
-   |            -------- calling this method introduces the `impl`'s 'static` requirement
-help: consider relaxing the implicit `'static` requirement
-   |
-LL |     impl dyn ObjectTrait + '_ {
-   |                          ++++
-
-error[E0521]: borrowed data escapes outside of function
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:94:9
-   |
-LL |     fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> {
-   |               --  --- `val` is a reference that is only valid in the function body
-   |               |
-   |               lifetime `'a` defined here
-LL |         val.use_self()
-   |         ^^^^^^^^^^^^^^
-   |         |
-   |         `val` escapes the function body here
-   |         argument requires that `'a` must outlive `'static`
-   |
-note: the used `impl` has a `'static` requirement
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:91:26
-   |
-LL |         fn use_self(&self) -> &() { panic!() }
-   |            -------- calling this method introduces the `impl`'s 'static` requirement
-...
-LL |     impl MyTrait for dyn ObjectTrait {}
-   |                          ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
-help: consider relaxing the implicit `'static` requirement
-   |
-LL |     impl MyTrait for dyn ObjectTrait + '_ {}
-   |                                      ++++
-
-error[E0521]: borrowed data escapes outside of function
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:114:9
-   |
-LL |     fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
-   |               --  --- `val` is a reference that is only valid in the function body
-   |               |
-   |               lifetime `'a` defined here
-LL |         MyTrait::use_self(val)
-   |         ^^^^^^^^^^^^^^^^^^^^^^
-   |         |
-   |         `val` escapes the function body here
-   |         argument requires that `'a` must outlive `'static`
-   |
-note: the used `impl` has a `'static` requirement
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:110:26
-   |
-LL |         fn use_self(&self) -> &() { panic!() }
-   |            -------- calling this method introduces the `impl`'s 'static` requirement
-...
-LL |     impl MyTrait for dyn ObjectTrait {}
-   |                          ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
-help: consider relaxing the implicit `'static` requirement
-   |
-LL |     impl MyTrait for dyn ObjectTrait + '_ {}
-   |                                      ++++
-
-error: aborting due to 4 previous errors
-
-For more information about this error, try `rustc --explain E0521`.
diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.fixed b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.fixed
deleted file mode 100644
index 74da1cbfea5..00000000000
--- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.fixed
+++ /dev/null
@@ -1,117 +0,0 @@
-// FIXME(nll): On NLL stabilization, this should be replaced by
-// `impl-on-dyn-trait-with-implicit-static-bound-nll.rs`. Compiletest has
-// problems with rustfix and revisions.
-// ignore-compare-mode-nll
-
-// run-rustfix
-#![allow(dead_code)]
-
-mod foo {
-    trait OtherTrait<'a> {}
-    impl<'a> OtherTrait<'a> for &'a () {}
-
-    trait ObjectTrait<T> {}
-    trait MyTrait<T> {
-        fn use_self<K>(&self) -> &();
-    }
-    trait Irrelevant {}
-
-    impl<T> MyTrait<T> for dyn ObjectTrait<T> + '_ {
-        fn use_self<K>(&self) -> &() { panic!() }
-    }
-    impl<T> Irrelevant for dyn ObjectTrait<T> {}
-
-    fn use_it<'a, T>(val: &'a dyn ObjectTrait<T>) -> impl OtherTrait<'a> + 'a {
-        val.use_self::<T>() //~ ERROR E0759
-    }
-}
-
-mod bar {
-    trait ObjectTrait {}
-    trait MyTrait {
-        fn use_self(&self) -> &();
-    }
-    trait Irrelevant {}
-
-    impl MyTrait for dyn ObjectTrait + '_ {
-        fn use_self(&self) -> &() { panic!() }
-    }
-    impl Irrelevant for dyn ObjectTrait {}
-
-    fn use_it<'a>(val: &'a dyn ObjectTrait) -> &'a () {
-        val.use_self() //~ ERROR E0772
-    }
-}
-
-mod baz {
-    trait ObjectTrait {}
-    trait MyTrait {
-        fn use_self(&self) -> &();
-    }
-    trait Irrelevant {}
-
-    impl MyTrait for Box<dyn ObjectTrait + '_> {
-        fn use_self(&self) -> &() { panic!() }
-    }
-    impl Irrelevant for Box<dyn ObjectTrait> {}
-
-    fn use_it<'a>(val: &'a Box<dyn ObjectTrait + 'a>) -> &'a () {
-        val.use_self() //~ ERROR E0772
-    }
-}
-
-mod bat {
-    trait OtherTrait<'a> {}
-    impl<'a> OtherTrait<'a> for &'a () {}
-
-    trait ObjectTrait {}
-
-    impl dyn ObjectTrait + '_ {
-        fn use_self(&self) -> &() { panic!() }
-    }
-
-    fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
-        val.use_self() //~ ERROR E0772
-    }
-}
-
-mod ban {
-    trait OtherTrait<'a> {}
-    impl<'a> OtherTrait<'a> for &'a () {}
-
-    trait ObjectTrait {}
-    trait MyTrait {
-        fn use_self(&self) -> &() { panic!() }
-    }
-    trait Irrelevant {
-        fn use_self(&self) -> &() { panic!() }
-    }
-
-    impl MyTrait for dyn ObjectTrait + '_ {}
-
-    fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
-        val.use_self() //~ ERROR E0759
-    }
-}
-
-mod bal {
-    trait OtherTrait<'a> {}
-    impl<'a> OtherTrait<'a> for &'a () {}
-
-    trait ObjectTrait {}
-    trait MyTrait {
-        fn use_self(&self) -> &() { panic!() }
-    }
-    trait Irrelevant {
-        fn use_self(&self) -> &() { panic!() }
-    }
-
-    impl MyTrait for dyn ObjectTrait + '_ {}
-    impl Irrelevant for dyn ObjectTrait {}
-
-    fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
-        MyTrait::use_self(val) //~ ERROR E0759
-    }
-}
-
-fn main() {}
diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.rs b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.rs
index e0058b181b4..ae3cd315c83 100644
--- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.rs
+++ b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.rs
@@ -1,9 +1,5 @@
-// FIXME(nll): On NLL stabilization, this should be replaced by
-// `impl-on-dyn-trait-with-implicit-static-bound-nll.rs`. Compiletest has
-// problems with rustfix and revisions.
-// ignore-compare-mode-nll
+// FIXME(#96332): We should be able to suggest a fix and automatically fix.
 
-// run-rustfix
 #![allow(dead_code)]
 
 mod foo {
@@ -22,7 +18,7 @@ mod foo {
     impl<T> Irrelevant for dyn ObjectTrait<T> {}
 
     fn use_it<'a, T>(val: &'a dyn ObjectTrait<T>) -> impl OtherTrait<'a> + 'a {
-        val.use_self::<T>() //~ ERROR E0759
+        val.use_self::<T>() //~ ERROR borrowed data escapes
     }
 }
 
@@ -39,7 +35,7 @@ mod bar {
     impl Irrelevant for dyn ObjectTrait {}
 
     fn use_it<'a>(val: &'a dyn ObjectTrait) -> &'a () {
-        val.use_self() //~ ERROR E0772
+        val.use_self()
     }
 }
 
@@ -56,7 +52,7 @@ mod baz {
     impl Irrelevant for Box<dyn ObjectTrait> {}
 
     fn use_it<'a>(val: &'a Box<dyn ObjectTrait + 'a>) -> &'a () {
-        val.use_self() //~ ERROR E0772
+        val.use_self()
     }
 }
 
@@ -71,7 +67,8 @@ mod bat {
     }
 
     fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
-        val.use_self() //~ ERROR E0772
+        val.use_self()
+        //~^ ERROR borrowed data escapes
     }
 }
 
@@ -90,7 +87,7 @@ mod ban {
     impl MyTrait for dyn ObjectTrait {}
 
     fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> {
-        val.use_self() //~ ERROR E0759
+        val.use_self() //~ ERROR borrowed data escapes
     }
 }
 
@@ -110,7 +107,7 @@ mod bal {
     impl Irrelevant for dyn ObjectTrait {}
 
     fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
-        MyTrait::use_self(val) //~ ERROR E0759
+        MyTrait::use_self(val) //~ ERROR borrowed data escapes
     }
 }
 
diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr
index fbe7ac94a0a..679ebd61ead 100644
--- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr
+++ b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr
@@ -1,13 +1,18 @@
-error[E0759]: `val` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:25:13
+error[E0521]: borrowed data escapes outside of function
+  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:21:9
    |
 LL |     fn use_it<'a, T>(val: &'a dyn ObjectTrait<T>) -> impl OtherTrait<'a> + 'a {
-   |                           ---------------------- this data with lifetime `'a`...
+   |               --     --- `val` is a reference that is only valid in the function body
+   |               |
+   |               lifetime `'a` defined here
 LL |         val.use_self::<T>()
-   |             ^^^^^^^^ ...is used and required to live as long as `'static` here
+   |         ^^^^^^^^^^^^^^^^^^^
+   |         |
+   |         `val` escapes the function body here
+   |         argument requires that `'a` must outlive `'static`
    |
 note: the used `impl` has a `'static` requirement
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:19:32
+  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:15:32
    |
 LL |     impl<T> MyTrait<T> for dyn ObjectTrait<T> {
    |                                ^^^^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
@@ -18,16 +23,21 @@ help: consider relaxing the implicit `'static` requirement
 LL |     impl<T> MyTrait<T> for dyn ObjectTrait<T> + '_ {
    |                                               ++++
 
-error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:74:13
+error[E0521]: borrowed data escapes outside of function
+  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:70:9
    |
 LL |     fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
-   |                        ------------------- this data with lifetime `'a`...
+   |               --  --- `val` is a reference that is only valid in the function body
+   |               |
+   |               lifetime `'a` defined here
 LL |         val.use_self()
-   |             ^^^^^^^^ ...is used and required to live as long as `'static` here because of an implicit lifetime bound on the inherent `impl`
+   |         ^^^^^^^^^^^^^^
+   |         |
+   |         `val` escapes the function body here
+   |         argument requires that `'a` must outlive `'static`
    |
 note: the used `impl` has a `'static` requirement
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:69:14
+  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:65:14
    |
 LL |     impl dyn ObjectTrait {
    |              ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
@@ -38,16 +48,21 @@ help: consider relaxing the implicit `'static` requirement
 LL |     impl dyn ObjectTrait + '_ {
    |                          ++++
 
-error[E0759]: `val` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:93:13
+error[E0521]: borrowed data escapes outside of function
+  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:90:9
    |
 LL |     fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> {
-   |                        ------------------- this data with lifetime `'a`...
+   |               --  --- `val` is a reference that is only valid in the function body
+   |               |
+   |               lifetime `'a` defined here
 LL |         val.use_self()
-   |             ^^^^^^^^ ...is used and required to live as long as `'static` here
+   |         ^^^^^^^^^^^^^^
+   |         |
+   |         `val` escapes the function body here
+   |         argument requires that `'a` must outlive `'static`
    |
 note: the used `impl` has a `'static` requirement
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:90:26
+  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:87:26
    |
 LL |         fn use_self(&self) -> &() { panic!() }
    |            -------- calling this method introduces the `impl`'s 'static` requirement
@@ -58,26 +73,22 @@ help: consider relaxing the implicit `'static` requirement
    |
 LL |     impl MyTrait for dyn ObjectTrait + '_ {}
    |                                      ++++
-help: to declare that the `impl Trait` captures data from argument `val`, you can add an explicit `'a` lifetime bound
-   |
-LL |     fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
-   |                                                                    ++++
 
-error[E0759]: `val` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:113:27
+error[E0521]: borrowed data escapes outside of function
+  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:110:9
    |
 LL |     fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
-   |                        ------------------- this data with lifetime `'a`...
+   |               --  --- `val` is a reference that is only valid in the function body
+   |               |
+   |               lifetime `'a` defined here
 LL |         MyTrait::use_self(val)
-   |                           ^^^ ...is used here...
+   |         ^^^^^^^^^^^^^^^^^^^^^^
+   |         |
+   |         `val` escapes the function body here
+   |         argument requires that `'a` must outlive `'static`
    |
-note: ...and is required to live as long as `'static` here
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:113:9
-   |
-LL |         MyTrait::use_self(val)
-   |         ^^^^^^^^^^^^^^^^^
 note: the used `impl` has a `'static` requirement
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:109:26
+  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:106:26
    |
 LL |         fn use_self(&self) -> &() { panic!() }
    |            -------- calling this method introduces the `impl`'s 'static` requirement
@@ -89,47 +100,6 @@ help: consider relaxing the implicit `'static` requirement
 LL |     impl MyTrait for dyn ObjectTrait + '_ {}
    |                                      ++++
 
-error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:42:13
-   |
-LL |     fn use_it<'a>(val: &'a dyn ObjectTrait) -> &'a () {
-   |                        ------------------- this data with lifetime `'a`...
-LL |         val.use_self()
-   |             ^^^^^^^^ ...is used and required to live as long as `'static` here
-   |
-note: the used `impl` has a `'static` requirement
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:36:26
-   |
-LL |     impl MyTrait for dyn ObjectTrait {
-   |                          ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
-LL |         fn use_self(&self) -> &() { panic!() }
-   |            -------- calling this method introduces the `impl`'s 'static` requirement
-help: consider relaxing the implicit `'static` requirement
-   |
-LL |     impl MyTrait for dyn ObjectTrait + '_ {
-   |                                      ++++
-
-error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:59:13
-   |
-LL |     fn use_it<'a>(val: &'a Box<dyn ObjectTrait + 'a>) -> &'a () {
-   |                        ----------------------------- this data with lifetime `'a`...
-LL |         val.use_self()
-   |             ^^^^^^^^ ...is used and required to live as long as `'static` here
-   |
-note: the used `impl` has a `'static` requirement
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:53:30
-   |
-LL |     impl MyTrait for Box<dyn ObjectTrait> {
-   |                              ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
-LL |         fn use_self(&self) -> &() { panic!() }
-   |            -------- calling this method introduces the `impl`'s 'static` requirement
-help: consider relaxing the implicit `'static` requirement
-   |
-LL |     impl MyTrait for Box<dyn ObjectTrait + '_> {
-   |                                          ++++
-
-error: aborting due to 6 previous errors
+error: aborting due to 4 previous errors
 
-Some errors have detailed explanations: E0759, E0772.
-For more information about an error, try `rustc --explain E0759`.
+For more information about this error, try `rustc --explain E0521`.
diff --git a/src/test/ui/suggestions/issue-97704.fixed b/src/test/ui/suggestions/issue-97704.fixed
new file mode 100644
index 00000000000..c42bdfff5f9
--- /dev/null
+++ b/src/test/ui/suggestions/issue-97704.fixed
@@ -0,0 +1,19 @@
+// edition:2021
+// run-rustfix
+
+#![allow(unused)]
+
+use std::future::Future;
+
+async fn foo() -> Result<(), i32> {
+    func(async { Ok::<_, i32>(()) }).await?;
+    //~^ ERROR the `?` operator can only be applied to values that implement `Try`
+
+    Ok(())
+}
+
+async fn func<T>(fut: impl Future<Output = T>) -> T {
+    fut.await
+}
+
+fn main() {}
diff --git a/src/test/ui/suggestions/issue-97704.rs b/src/test/ui/suggestions/issue-97704.rs
new file mode 100644
index 00000000000..5dfee6cac60
--- /dev/null
+++ b/src/test/ui/suggestions/issue-97704.rs
@@ -0,0 +1,19 @@
+// edition:2021
+// run-rustfix
+
+#![allow(unused)]
+
+use std::future::Future;
+
+async fn foo() -> Result<(), i32> {
+    func(async { Ok::<_, i32>(()) })?;
+    //~^ ERROR the `?` operator can only be applied to values that implement `Try`
+
+    Ok(())
+}
+
+async fn func<T>(fut: impl Future<Output = T>) -> T {
+    fut.await
+}
+
+fn main() {}
diff --git a/src/test/ui/suggestions/issue-97704.stderr b/src/test/ui/suggestions/issue-97704.stderr
new file mode 100644
index 00000000000..ca017be45ac
--- /dev/null
+++ b/src/test/ui/suggestions/issue-97704.stderr
@@ -0,0 +1,15 @@
+error[E0277]: the `?` operator can only be applied to values that implement `Try`
+  --> $DIR/issue-97704.rs:9:5
+   |
+LL |     func(async { Ok::<_, i32>(()) })?;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `impl Future<Output = Result<(), i32>>`
+   |
+   = help: the trait `Try` is not implemented for `impl Future<Output = Result<(), i32>>`
+help: consider `await`ing on the `Future`
+   |
+LL |     func(async { Ok::<_, i32>(()) }).await?;
+   |                                     ++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.base.stderr b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.base.stderr
deleted file mode 100644
index 4e0e6675e5a..00000000000
--- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.base.stderr
+++ /dev/null
@@ -1,28 +0,0 @@
-error[E0311]: the parameter type `T` may not live long enough
-  --> $DIR/missing-lifetimes-in-signature-2.rs:24:9
-   |
-LL |     foo.bar(move |_| {
-   |         ^^^
-   |
-note: the parameter type `T` must be valid for the anonymous lifetime defined here...
-  --> $DIR/missing-lifetimes-in-signature-2.rs:23:24
-   |
-LL | fn func<T: Test>(foo: &Foo, t: T) {
-   |                        ^^^
-note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature-2.rs:24:13: 27:6]` will meet its required lifetime bounds...
-  --> $DIR/missing-lifetimes-in-signature-2.rs:24:9
-   |
-LL |     foo.bar(move |_| {
-   |         ^^^
-note: ...that is required by this bound
-  --> $DIR/missing-lifetimes-in-signature-2.rs:15:12
-   |
-LL |         F: 'a,
-   |            ^^
-help: consider adding an explicit lifetime bound...
-   |
-LL | fn func<T: Test + 'a>(foo: &Foo, t: T) {
-   |                 ++++
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs
index 3e3b4403304..c6802ac6cc7 100644
--- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs
+++ b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 // Regression test for #81650
 
 struct Foo<'a> {
diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.nll.stderr b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr
index 9f35175c08d..0212c2d712c 100644
--- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.nll.stderr
+++ b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr
@@ -1,5 +1,5 @@
 error[E0311]: the parameter type `T` may not live long enough
-  --> $DIR/missing-lifetimes-in-signature-2.rs:24:5
+  --> $DIR/missing-lifetimes-in-signature-2.rs:20:5
    |
 LL | /     foo.bar(move |_| {
 LL | |
@@ -8,12 +8,12 @@ LL | |     });
    | |______^
    |
 note: the parameter type `T` must be valid for the anonymous lifetime defined here...
-  --> $DIR/missing-lifetimes-in-signature-2.rs:23:24
+  --> $DIR/missing-lifetimes-in-signature-2.rs:19:24
    |
 LL | fn func<T: Test>(foo: &Foo, t: T) {
    |                        ^^^
 note: ...so that the type `T` will meet its required lifetime bounds
-  --> $DIR/missing-lifetimes-in-signature-2.rs:24:5
+  --> $DIR/missing-lifetimes-in-signature-2.rs:20:5
    |
 LL | /     foo.bar(move |_| {
 LL | |
diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.base.stderr b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.base.stderr
deleted file mode 100644
index d51d12b909d..00000000000
--- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.base.stderr
+++ /dev/null
@@ -1,114 +0,0 @@
-error[E0261]: use of undeclared lifetime name `'a`
-  --> $DIR/missing-lifetimes-in-signature.rs:42:11
-   |
-LL | fn baz<G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
-   |        -  ^^ undeclared lifetime
-   |        |
-   |        help: consider introducing lifetime `'a` here: `'a,`
-
-error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
-  --> $DIR/missing-lifetimes-in-signature.rs:23:5
-   |
-LL |   fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce()
-   |                            ------ hidden type `[closure@$DIR/missing-lifetimes-in-signature.rs:23:5: 26:6]` captures the anonymous lifetime defined here
-...
-LL | /     move || {
-LL | |
-LL | |         *dest = g.get();
-LL | |     }
-   | |_____^
-   |
-help: to declare that the `impl Trait` captures `'_`, you can add an explicit `'_` lifetime bound
-   |
-LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
-   |                                                   ++++
-
-error[E0311]: the parameter type `G` may not live long enough
-  --> $DIR/missing-lifetimes-in-signature.rs:30:37
-   |
-LL | fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
-   |                                     ^^^^^^^^^^^^^^^^^^
-   |
-note: the parameter type `G` must be valid for the anonymous lifetime defined here...
-  --> $DIR/missing-lifetimes-in-signature.rs:30:26
-   |
-LL | fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
-   |                          ^^^^^^
-note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:35:5: 38:6]` will meet its required lifetime bounds
-  --> $DIR/missing-lifetimes-in-signature.rs:30:37
-   |
-LL | fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
-   |                                     ^^^^^^^^^^^^^^^^^^
-help: consider introducing an explicit lifetime bound
-   |
-LL ~ fn bar<'a, G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
-LL |
-LL | where
-LL ~     G: Get<T> + 'a,
-   |
-
-error[E0311]: the parameter type `G` may not live long enough
-  --> $DIR/missing-lifetimes-in-signature.rs:53:45
-   |
-LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
-   |                                             ^^^^^^^^^^^^^^^^^^
-   |
-note: the parameter type `G` must be valid for the anonymous lifetime defined here...
-  --> $DIR/missing-lifetimes-in-signature.rs:53:34
-   |
-LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
-   |                                  ^^^^^^
-note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:58:5: 61:6]` will meet its required lifetime bounds
-  --> $DIR/missing-lifetimes-in-signature.rs:53:45
-   |
-LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
-   |                                             ^^^^^^^^^^^^^^^^^^
-help: consider introducing an explicit lifetime bound
-   |
-LL | fn qux<'b, 'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'b
-   |        +++           ++++                                               ++++
-
-error[E0311]: the parameter type `G` may not live long enough
-  --> $DIR/missing-lifetimes-in-signature.rs:66:58
-   |
-LL |     fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
-   |                                                          ^^^^^^^^^^^^^^^^^^
-   |
-note: the parameter type `G` must be valid for the anonymous lifetime defined here...
-  --> $DIR/missing-lifetimes-in-signature.rs:66:47
-   |
-LL |     fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
-   |                                               ^^^^^^
-note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:68:9: 71:10]` will meet its required lifetime bounds
-  --> $DIR/missing-lifetimes-in-signature.rs:66:58
-   |
-LL |     fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
-   |                                                          ^^^^^^^^^^^^^^^^^^
-help: consider introducing an explicit lifetime bound
-   |
-LL |     fn qux<'c, 'b, G: Get<T> + 'b + 'c, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'c {
-   |            +++                    ++++                                               ++++
-
-error[E0621]: explicit lifetime required in the type of `dest`
-  --> $DIR/missing-lifetimes-in-signature.rs:76:45
-   |
-LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
-   |                                  ------     ^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'a` required
-   |                                  |
-   |                                  help: add explicit lifetime `'a` to the type of `dest`: `&'a mut T`
-
-error[E0309]: the parameter type `G` may not live long enough
-  --> $DIR/missing-lifetimes-in-signature.rs:89:44
-   |
-LL | fn bak<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a
-   |                                            ^^^^^^^^^^^^^^^^^^ ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:94:5: 97:6]` will meet its required lifetime bounds
-   |
-help: consider adding an explicit lifetime bound...
-   |
-LL |     G: Get<T> + 'a,
-   |               ++++
-
-error: aborting due to 7 previous errors
-
-Some errors have detailed explanations: E0261, E0309, E0621, E0700.
-For more information about an error, try `rustc --explain E0261`.
diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs
index 20366201269..19a791a8c43 100644
--- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs
+++ b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 pub trait Get<T> {
     fn get(self) -> T;
 }
@@ -28,12 +24,11 @@ where
 
 // After applying suggestion for `foo`:
 fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
-//[base]~^ ERROR the parameter type `G` may not live long enough
 where
     G: Get<T>,
 {
     move || {
-        //[nll]~^ ERROR the parameter type `G` may not live long enough
+        //~^ ERROR the parameter type `G` may not live long enough
         *dest = g.get();
     }
 }
@@ -51,12 +46,11 @@ where
 
 // After applying suggestion for `baz`:
 fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
-//[base]~^ ERROR the parameter type `G` may not live long enough
 where
     G: Get<T>,
 {
     move || {
-        //[nll]~^ ERROR the parameter type `G` may not live long enough
+        //~^ ERROR the parameter type `G` may not live long enough
         *dest = g.get();
     }
 }
@@ -64,9 +58,8 @@ where
 // Same as above, but show that we pay attention to lifetime names from parent item
 impl<'a> Foo {
     fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
-        //[base]~^ ERROR the parameter type `G` may not live long enough
         move || {
-            //[nll]~^ ERROR the parameter type `G` may not live long enough
+            //~^ ERROR the parameter type `G` may not live long enough
             *dest = g.get();
         }
     }
@@ -74,25 +67,23 @@ impl<'a> Foo {
 
 // After applying suggestion for `qux`:
 fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
-//[base]~^ ERROR explicit lifetime required in the type of `dest`
 where
     G: Get<T>,
 {
     move || {
-        //[nll]~^ ERROR the parameter type `G` may not live long enough
-        //[nll]~| ERROR explicit lifetime required
+        //~^ ERROR the parameter type `G` may not live long enough
+        //~| ERROR explicit lifetime required
         *dest = g.get();
     }
 }
 
 // Potential incorrect attempt:
 fn bak<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a
-//[base]~^ ERROR the parameter type `G` may not live long enough
 where
     G: Get<T>,
 {
     move || {
-        //[nll]~^ ERROR the parameter type `G` may not live long enough
+        //~^ ERROR the parameter type `G` may not live long enough
         *dest = g.get();
     }
 }
diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.nll.stderr b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr
index 63932cb6ba0..85c534364b6 100644
--- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.nll.stderr
+++ b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr
@@ -1,5 +1,5 @@
 error[E0261]: use of undeclared lifetime name `'a`
-  --> $DIR/missing-lifetimes-in-signature.rs:42:11
+  --> $DIR/missing-lifetimes-in-signature.rs:37:11
    |
 LL | fn baz<G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
    |        -  ^^ undeclared lifetime
@@ -7,10 +7,10 @@ LL | fn baz<G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
    |        help: consider introducing lifetime `'a` here: `'a,`
 
 error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
-  --> $DIR/missing-lifetimes-in-signature.rs:23:5
+  --> $DIR/missing-lifetimes-in-signature.rs:19:5
    |
 LL |   fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce()
-   |                            ------ hidden type `[closure@$DIR/missing-lifetimes-in-signature.rs:23:5: 26:6]` captures the anonymous lifetime defined here
+   |                            ------ hidden type `[closure@$DIR/missing-lifetimes-in-signature.rs:19:5: 22:6]` captures the anonymous lifetime defined here
 ...
 LL | /     move || {
 LL | |
@@ -24,7 +24,7 @@ LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
    |                                                   ++++
 
 error[E0311]: the parameter type `G` may not live long enough
-  --> $DIR/missing-lifetimes-in-signature.rs:35:5
+  --> $DIR/missing-lifetimes-in-signature.rs:30:5
    |
 LL | /     move || {
 LL | |
@@ -33,12 +33,12 @@ LL | |     }
    | |_____^
    |
 note: the parameter type `G` must be valid for the anonymous lifetime defined here...
-  --> $DIR/missing-lifetimes-in-signature.rs:30:26
+  --> $DIR/missing-lifetimes-in-signature.rs:26:26
    |
 LL | fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
    |                          ^^^^^^
 note: ...so that the type `G` will meet its required lifetime bounds
-  --> $DIR/missing-lifetimes-in-signature.rs:35:5
+  --> $DIR/missing-lifetimes-in-signature.rs:30:5
    |
 LL | /     move || {
 LL | |
@@ -51,7 +51,7 @@ LL |     G: Get<T> + 'a,
    |               ++++
 
 error[E0311]: the parameter type `G` may not live long enough
-  --> $DIR/missing-lifetimes-in-signature.rs:58:5
+  --> $DIR/missing-lifetimes-in-signature.rs:52:5
    |
 LL | /     move || {
 LL | |
@@ -60,12 +60,12 @@ LL | |     }
    | |_____^
    |
 note: the parameter type `G` must be valid for the anonymous lifetime defined here...
-  --> $DIR/missing-lifetimes-in-signature.rs:53:34
+  --> $DIR/missing-lifetimes-in-signature.rs:48:34
    |
 LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
    |                                  ^^^^^^
 note: ...so that the type `G` will meet its required lifetime bounds
-  --> $DIR/missing-lifetimes-in-signature.rs:58:5
+  --> $DIR/missing-lifetimes-in-signature.rs:52:5
    |
 LL | /     move || {
 LL | |
@@ -78,7 +78,7 @@ LL | fn qux<'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
    |                  ++++
 
 error[E0311]: the parameter type `G` may not live long enough
-  --> $DIR/missing-lifetimes-in-signature.rs:68:9
+  --> $DIR/missing-lifetimes-in-signature.rs:61:9
    |
 LL | /         move || {
 LL | |
@@ -87,12 +87,12 @@ LL | |         }
    | |_________^
    |
 note: the parameter type `G` must be valid for the anonymous lifetime defined here...
-  --> $DIR/missing-lifetimes-in-signature.rs:66:47
+  --> $DIR/missing-lifetimes-in-signature.rs:60:47
    |
 LL |     fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
    |                                               ^^^^^^
 note: ...so that the type `G` will meet its required lifetime bounds
-  --> $DIR/missing-lifetimes-in-signature.rs:68:9
+  --> $DIR/missing-lifetimes-in-signature.rs:61:9
    |
 LL | /         move || {
 LL | |
@@ -105,7 +105,7 @@ LL |     fn qux<'b, G: Get<T> + 'b + 'c, T>(g: G, dest: &mut T) -> impl FnOnce()
    |                               ++++
 
 error[E0311]: the parameter type `G` may not live long enough
-  --> $DIR/missing-lifetimes-in-signature.rs:81:5
+  --> $DIR/missing-lifetimes-in-signature.rs:73:5
    |
 LL | /     move || {
 LL | |
@@ -115,12 +115,12 @@ LL | |     }
    | |_____^
    |
 note: the parameter type `G` must be valid for the anonymous lifetime defined here...
-  --> $DIR/missing-lifetimes-in-signature.rs:76:34
+  --> $DIR/missing-lifetimes-in-signature.rs:69:34
    |
 LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
    |                                  ^^^^^^
 note: ...so that the type `G` will meet its required lifetime bounds
-  --> $DIR/missing-lifetimes-in-signature.rs:81:5
+  --> $DIR/missing-lifetimes-in-signature.rs:73:5
    |
 LL | /     move || {
 LL | |
@@ -134,7 +134,7 @@ LL | fn bat<'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
    |                  ++++
 
 error[E0621]: explicit lifetime required in the type of `dest`
-  --> $DIR/missing-lifetimes-in-signature.rs:81:5
+  --> $DIR/missing-lifetimes-in-signature.rs:73:5
    |
 LL |   fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
    |                                    ------ help: add explicit lifetime `'a` to the type of `dest`: `&'a mut T`
@@ -147,7 +147,7 @@ LL | |     }
    | |_____^ lifetime `'a` required
 
 error[E0309]: the parameter type `G` may not live long enough
-  --> $DIR/missing-lifetimes-in-signature.rs:94:5
+  --> $DIR/missing-lifetimes-in-signature.rs:85:5
    |
 LL | /     move || {
 LL | |
diff --git a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.base.stderr b/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.base.stderr
deleted file mode 100644
index 0bd7f289340..00000000000
--- a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.base.stderr
+++ /dev/null
@@ -1,95 +0,0 @@
-error[E0759]: `self` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/trait-object-nested-in-impl-trait.rs:35:31
-   |
-LL |     fn iter(&self) -> impl Iterator<Item = Box<dyn Foo>> {
-   |             ----- this data with an anonymous lifetime `'_`...
-...
-LL |             remaining: self.0.iter(),
-   |                        ------ ^^^^
-   |                        |
-   |                        ...is used here...
-   |
-note: ...and is required to live as long as `'static` here
-  --> $DIR/trait-object-nested-in-impl-trait.rs:31:23
-   |
-LL |     fn iter(&self) -> impl Iterator<Item = Box<dyn Foo>> {
-   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-help: to declare that the `impl Trait` captures data from argument `self`, you can add an explicit `'_` lifetime bound
-   |
-LL |     fn iter(&self) -> impl Iterator<Item = Box<dyn Foo>> + '_ {
-   |                                                          ++++
-help: to declare that the trait object captures data from argument `self`, you can add an explicit `'_` lifetime bound
-   |
-LL |     fn iter(&self) -> impl Iterator<Item = Box<dyn Foo + '_>> {
-   |                                                        ++++
-
-error[E0759]: `self` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/trait-object-nested-in-impl-trait.rs:48:31
-   |
-LL |     fn iter(&self) -> impl Iterator<Item = Box<dyn Foo>> + '_ {
-   |             ----- this data with an anonymous lifetime `'_`...
-...
-LL |             remaining: self.0.iter(),
-   |                        ------ ^^^^
-   |                        |
-   |                        ...is used here...
-   |
-note: ...and is required to live as long as `'static` here
-  --> $DIR/trait-object-nested-in-impl-trait.rs:44:23
-   |
-LL |     fn iter(&self) -> impl Iterator<Item = Box<dyn Foo>> + '_ {
-   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-help: to declare that the trait object captures data from argument `self`, you can add an explicit `'_` lifetime bound
-   |
-LL |     fn iter(&self) -> impl Iterator<Item = Box<dyn Foo + '_>> + '_ {
-   |                                                        ++++
-
-error[E0759]: `self` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/trait-object-nested-in-impl-trait.rs:61:31
-   |
-LL |     fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo>> + 'a {
-   |                 -------- this data with lifetime `'a`...
-...
-LL |             remaining: self.0.iter(),
-   |                        ------ ^^^^
-   |                        |
-   |                        ...is used here...
-   |
-note: ...and is required to live as long as `'static` here
-  --> $DIR/trait-object-nested-in-impl-trait.rs:57:30
-   |
-LL |     fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo>> + 'a {
-   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-help: to declare that the trait object captures data from argument `self`, you can add an explicit `'a` lifetime bound
-   |
-LL |     fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo + 'a>> + 'a {
-   |                                                               ++++
-
-error[E0759]: `self` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/trait-object-nested-in-impl-trait.rs:74:31
-   |
-LL |     fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo>> {
-   |                 -------- this data with lifetime `'a`...
-...
-LL |             remaining: self.0.iter(),
-   |                        ------ ^^^^
-   |                        |
-   |                        ...is used here...
-   |
-note: ...and is required to live as long as `'static` here
-  --> $DIR/trait-object-nested-in-impl-trait.rs:70:30
-   |
-LL |     fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo>> {
-   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-help: to declare that the `impl Trait` captures data from argument `self`, you can add an explicit `'a` lifetime bound
-   |
-LL |     fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo>> + 'a {
-   |                                                                 ++++
-help: to declare that the trait object captures data from argument `self`, you can add an explicit `'a` lifetime bound
-   |
-LL |     fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo + 'a>> {
-   |                                                               ++++
-
-error: aborting due to 4 previous errors
-
-For more information about this error, try `rustc --explain E0759`.
diff --git a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.rs b/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.rs
index 5d868a58c0f..ff27011f89e 100644
--- a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.rs
+++ b/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Foo {}
 impl<'a, T: Foo> Foo for &'a T {}
 impl<T: Foo + ?Sized> Foo for Box<T> {}
@@ -30,10 +26,9 @@ struct Bar(Vec<Box<dyn Foo>>);
 impl Bar {
     fn iter(&self) -> impl Iterator<Item = Box<dyn Foo>> {
         Iter {
-            //[nll]~^ ERROR lifetime may not live long enough
+            //~^ ERROR lifetime may not live long enough
             current: None,
             remaining: self.0.iter(),
-            //[base]~^ ERROR E0759
         }
     }
 }
@@ -43,10 +38,9 @@ struct Baz(Vec<Box<dyn Foo>>);
 impl Baz {
     fn iter(&self) -> impl Iterator<Item = Box<dyn Foo>> + '_ {
         Iter {
-            //[nll]~^ ERROR lifetime may not live long enough
+            //~^ ERROR lifetime may not live long enough
             current: None,
             remaining: self.0.iter(),
-            //[base]~^ ERROR E0759
         }
     }
 }
@@ -56,10 +50,9 @@ struct Bat(Vec<Box<dyn Foo>>);
 impl Bat {
     fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo>> + 'a {
         Iter {
-            //[nll]~^ ERROR lifetime may not live long enough
+            //~^ ERROR lifetime may not live long enough
             current: None,
             remaining: self.0.iter(),
-            //[base]~^ ERROR E0759
         }
     }
 }
@@ -69,10 +62,9 @@ struct Ban(Vec<Box<dyn Foo>>);
 impl Ban {
     fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo>> {
         Iter {
-            //[nll]~^ ERROR lifetime may not live long enough
+            //~^ ERROR lifetime may not live long enough
             current: None,
             remaining: self.0.iter(),
-            //[base]~^ ERROR E0759
         }
     }
 }
diff --git a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.nll.stderr b/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr
index 989f18e7182..f49876bcd3f 100644
--- a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.nll.stderr
+++ b/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/trait-object-nested-in-impl-trait.rs:32:9
+  --> $DIR/trait-object-nested-in-impl-trait.rs:28:9
    |
 LL |       fn iter(&self) -> impl Iterator<Item = Box<dyn Foo>> {
    |               - let's call the lifetime of this reference `'1`
@@ -7,7 +7,6 @@ LL | /         Iter {
 LL | |
 LL | |             current: None,
 LL | |             remaining: self.0.iter(),
-LL | |
 LL | |         }
    | |_________^ returning this value requires that `'1` must outlive `'static`
    |
@@ -21,7 +20,7 @@ LL |     fn iter(&self) -> impl Iterator<Item = Box<dyn Foo + '_>> {
    |                                                        ++++
 
 error: lifetime may not live long enough
-  --> $DIR/trait-object-nested-in-impl-trait.rs:45:9
+  --> $DIR/trait-object-nested-in-impl-trait.rs:40:9
    |
 LL |       fn iter(&self) -> impl Iterator<Item = Box<dyn Foo>> + '_ {
    |               - let's call the lifetime of this reference `'1`
@@ -29,7 +28,6 @@ LL | /         Iter {
 LL | |
 LL | |             current: None,
 LL | |             remaining: self.0.iter(),
-LL | |
 LL | |         }
    | |_________^ returning this value requires that `'1` must outlive `'static`
    |
@@ -39,7 +37,7 @@ LL |     fn iter(&self) -> impl Iterator<Item = Box<dyn Foo + '_>> + '_ {
    |                                                        ++++
 
 error: lifetime may not live long enough
-  --> $DIR/trait-object-nested-in-impl-trait.rs:58:9
+  --> $DIR/trait-object-nested-in-impl-trait.rs:52:9
    |
 LL |       fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo>> + 'a {
    |               -- lifetime `'a` defined here
@@ -47,7 +45,6 @@ LL | /         Iter {
 LL | |
 LL | |             current: None,
 LL | |             remaining: self.0.iter(),
-LL | |
 LL | |         }
    | |_________^ returning this value requires that `'a` must outlive `'static`
    |
@@ -57,7 +54,7 @@ LL |     fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo + 'a>> + 'a {
    |                                                               ++++
 
 error: lifetime may not live long enough
-  --> $DIR/trait-object-nested-in-impl-trait.rs:71:9
+  --> $DIR/trait-object-nested-in-impl-trait.rs:64:9
    |
 LL |       fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo>> {
    |               -- lifetime `'a` defined here
@@ -65,7 +62,6 @@ LL | /         Iter {
 LL | |
 LL | |             current: None,
 LL | |             remaining: self.0.iter(),
-LL | |
 LL | |         }
    | |_________^ returning this value requires that `'a` must outlive `'static`
    |
diff --git a/src/test/ui/suggestions/missing-bound-in-derive-copy-impl-3.stderr b/src/test/ui/suggestions/missing-bound-in-derive-copy-impl-3.stderr
index 4eb1e318d97..faf730a5ce3 100644
--- a/src/test/ui/suggestions/missing-bound-in-derive-copy-impl-3.stderr
+++ b/src/test/ui/suggestions/missing-bound-in-derive-copy-impl-3.stderr
@@ -10,12 +10,12 @@ LL |     pub size: Vector2<K>
    |     -------------------- this field does not implement `Copy`
    |
 note: the `Copy` impl for `Vector2<K>` requires that `K: Debug`
-  --> $DIR/missing-bound-in-derive-copy-impl-3.rs:12:5
+  --> $DIR/missing-bound-in-derive-copy-impl-3.rs:12:14
    |
 LL |     pub loc: Vector2<K>,
-   |     ^^^^^^^^^^^^^^^^^^^
+   |              ^^^^^^^^^^
 LL |     pub size: Vector2<K>
-   |     ^^^^^^^^^^^^^^^^^^^^
+   |               ^^^^^^^^^^
    = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
 help: consider further restricting this bound
    |
diff --git a/src/test/ui/suggestions/missing-bound-in-derive-copy-impl.stderr b/src/test/ui/suggestions/missing-bound-in-derive-copy-impl.stderr
index 1cf2ab95bc3..11bc5409917 100644
--- a/src/test/ui/suggestions/missing-bound-in-derive-copy-impl.stderr
+++ b/src/test/ui/suggestions/missing-bound-in-derive-copy-impl.stderr
@@ -10,12 +10,12 @@ LL |     pub size: Vector2<K>
    |     -------------------- this field does not implement `Copy`
    |
 note: the `Copy` impl for `Vector2<K>` requires that `K: Debug`
-  --> $DIR/missing-bound-in-derive-copy-impl.rs:11:5
+  --> $DIR/missing-bound-in-derive-copy-impl.rs:11:14
    |
 LL |     pub loc: Vector2<K>,
-   |     ^^^^^^^^^^^^^^^^^^^
+   |              ^^^^^^^^^^
 LL |     pub size: Vector2<K>
-   |     ^^^^^^^^^^^^^^^^^^^^
+   |               ^^^^^^^^^^
    = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
 help: consider restricting type parameter `K`
    |
diff --git a/src/test/ui/suggestions/missing-lifetime-specifier.stderr b/src/test/ui/suggestions/missing-lifetime-specifier.stderr
index b04ea1c9158..1498337549d 100644
--- a/src/test/ui/suggestions/missing-lifetime-specifier.stderr
+++ b/src/test/ui/suggestions/missing-lifetime-specifier.stderr
@@ -171,8 +171,8 @@ LL | pub union Qux<'t, 'k, I> {
    |           ^^^ --  --
 help: add missing lifetime argument
    |
-LL |     static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, '_, i32>>>>> = RefCell::new(HashMap::new());
-   |                                                       ++++
+LL |     static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                                       +++++++++
 
 error[E0107]: this union takes 2 lifetime arguments but 1 lifetime argument was supplied
   --> $DIR/missing-lifetime-specifier.rs:43:44
@@ -243,8 +243,8 @@ LL | pub union Qux<'t, 'k, I> {
    |           ^^^ --  --
 help: add missing lifetime argument
    |
-LL |     static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, '_, i32>>>>> = RefCell::new(HashMap::new());
-   |                                                       ++++
+LL |     static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                                       +++++++++
 
 error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
   --> $DIR/missing-lifetime-specifier.rs:51:45
@@ -261,8 +261,8 @@ LL | trait Tar<'t, 'k, I> {}
    |       ^^^ --  --
 help: add missing lifetime argument
    |
-LL |     static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, '_, i32>>>>> = RefCell::new(HashMap::new());
-   |                                                        ++++
+LL |     static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                                        +++++++++
 
 error[E0106]: missing lifetime specifier
   --> $DIR/missing-lifetime-specifier.rs:51:44
@@ -360,8 +360,8 @@ LL | trait Tar<'t, 'k, I> {}
    |       ^^^ --  --
 help: add missing lifetime argument
    |
-LL |     static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, '_, i32>>>>> = RefCell::new(HashMap::new());
-   |                                                        ++++
+LL |     static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                                        +++++++++
 
 error: aborting due to 24 previous errors
 
diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.fixed b/src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.fixed
deleted file mode 100644
index c363cc2d0e1..00000000000
--- a/src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.fixed
+++ /dev/null
@@ -1,24 +0,0 @@
-// FIXME(nll): On NLL stabilization, this should be replace
-// `suggest-impl-trait-lifetime.rs`. Compiletest has
-// problems with rustfix and revisions.
-// ignore-compare-mode-nll
-// compile-flags: -Zborrowck=mir
-
-// run-rustfix
-
-use std::fmt::Debug;
-
-fn foo(d: impl Debug + 'static) {
-//~^ HELP consider adding an explicit lifetime bound...
-    bar(d);
-//~^ ERROR the parameter type `impl Debug` may not live long enough
-//~| NOTE ...so that the type `impl Debug` will meet its required lifetime bounds
-}
-
-fn bar(d: impl Debug + 'static) {
-    println!("{:?}", d)
-}
-
-fn main() {
-  foo("hi");
-}
diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.rs b/src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.rs
deleted file mode 100644
index dd275f6630b..00000000000
--- a/src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-// FIXME(nll): On NLL stabilization, this should be replace
-// `suggest-impl-trait-lifetime.rs`. Compiletest has
-// problems with rustfix and revisions.
-// ignore-compare-mode-nll
-// compile-flags: -Zborrowck=mir
-
-// run-rustfix
-
-use std::fmt::Debug;
-
-fn foo(d: impl Debug) {
-//~^ HELP consider adding an explicit lifetime bound...
-    bar(d);
-//~^ ERROR the parameter type `impl Debug` may not live long enough
-//~| NOTE ...so that the type `impl Debug` will meet its required lifetime bounds
-}
-
-fn bar(d: impl Debug + 'static) {
-    println!("{:?}", d)
-}
-
-fn main() {
-  foo("hi");
-}
diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.stderr b/src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.stderr
deleted file mode 100644
index 41226fdf9fe..00000000000
--- a/src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0310]: the parameter type `impl Debug` may not live long enough
-  --> $DIR/suggest-impl-trait-lifetime-nll.rs:13:5
-   |
-LL |     bar(d);
-   |     ^^^^^^ ...so that the type `impl Debug` will meet its required lifetime bounds
-   |
-help: consider adding an explicit lifetime bound...
-   |
-LL | fn foo(d: impl Debug + 'static) {
-   |                      +++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0310`.
diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed b/src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed
index 75ff26c0435..589ee1a474a 100644
--- a/src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed
+++ b/src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed
@@ -1,8 +1,3 @@
-// FIXME(nll): On NLL stabilization, this should be replaced by
-// `suggest-impl-trait-lifetime-nll.rs`. Compiletest has
-// problems with rustfix and revisions.
-// ignore-compare-mode-nll
-
 // run-rustfix
 
 use std::fmt::Debug;
@@ -14,7 +9,7 @@ fn foo(d: impl Debug + 'static) {
 //~| NOTE ...so that the type `impl Debug` will meet its required lifetime bounds
 }
 
-fn bar(d: impl Debug + 'static) { //~ NOTE ...that is required by this bound
+fn bar(d: impl Debug + 'static) {
     println!("{:?}", d)
 }
 
diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime.rs b/src/test/ui/suggestions/suggest-impl-trait-lifetime.rs
index b93fe103a4a..9a87129fbf2 100644
--- a/src/test/ui/suggestions/suggest-impl-trait-lifetime.rs
+++ b/src/test/ui/suggestions/suggest-impl-trait-lifetime.rs
@@ -1,8 +1,3 @@
-// FIXME(nll): On NLL stabilization, this should be replaced by
-// `suggest-impl-trait-lifetime-nll.rs`. Compiletest has
-// problems with rustfix and revisions.
-// ignore-compare-mode-nll
-
 // run-rustfix
 
 use std::fmt::Debug;
@@ -14,7 +9,7 @@ fn foo(d: impl Debug) {
 //~| NOTE ...so that the type `impl Debug` will meet its required lifetime bounds
 }
 
-fn bar(d: impl Debug + 'static) { //~ NOTE ...that is required by this bound
+fn bar(d: impl Debug + 'static) {
     println!("{:?}", d)
 }
 
diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr b/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr
index 85f36ea78aa..cf912f4aac2 100644
--- a/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr
+++ b/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr
@@ -1,14 +1,9 @@
 error[E0310]: the parameter type `impl Debug` may not live long enough
-  --> $DIR/suggest-impl-trait-lifetime.rs:12:5
+  --> $DIR/suggest-impl-trait-lifetime.rs:7:5
    |
 LL |     bar(d);
-   |     ^^^ ...so that the type `impl Debug` will meet its required lifetime bounds...
+   |     ^^^^^^ ...so that the type `impl Debug` will meet its required lifetime bounds
    |
-note: ...that is required by this bound
-  --> $DIR/suggest-impl-trait-lifetime.rs:17:24
-   |
-LL | fn bar(d: impl Debug + 'static) {
-   |                        ^^^^^^^
 help: consider adding an explicit lifetime bound...
    |
 LL | fn foo(d: impl Debug + 'static) {
diff --git a/src/test/ui/traits/issue-97695-double-trivial-bound.rs b/src/test/ui/traits/issue-97695-double-trivial-bound.rs
new file mode 100644
index 00000000000..213605b5114
--- /dev/null
+++ b/src/test/ui/traits/issue-97695-double-trivial-bound.rs
@@ -0,0 +1,24 @@
+// compile-flags: -Zinline-mir --emit=mir
+// build-pass
+
+pub trait Associate {
+    type Associated;
+}
+
+pub struct Wrap<'a> {
+    pub field: &'a i32,
+}
+
+pub trait Create<T> {
+    fn create() -> Self;
+}
+
+pub fn oh_no<'a, T>()
+where
+    Wrap<'a>: Associate,
+    <Wrap<'a> as Associate>::Associated: Create<T>,
+{
+    <Wrap<'a> as Associate>::Associated::create();
+}
+
+pub fn main() {}
diff --git a/src/test/ui/traits/object/supertrait-lifetime-bound.base.stderr b/src/test/ui/traits/object/supertrait-lifetime-bound.base.stderr
deleted file mode 100644
index 8d1ef324c81..00000000000
--- a/src/test/ui/traits/object/supertrait-lifetime-bound.base.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0477]: the type `(dyn Bar<&'a u32> + 'static)` does not fulfill the required lifetime
-  --> $DIR/supertrait-lifetime-bound.rs:14:5
-   |
-LL |     test1::<dyn Bar<&'a u32>, _>();
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: type must satisfy the static lifetime as required by this binding
-  --> $DIR/supertrait-lifetime-bound.rs:9:22
-   |
-LL | fn test1<T: ?Sized + Bar<S>, S>() { }
-   |                      ^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0477`.
diff --git a/src/test/ui/traits/object/supertrait-lifetime-bound.rs b/src/test/ui/traits/object/supertrait-lifetime-bound.rs
index a57151853e0..f929a9bb660 100644
--- a/src/test/ui/traits/object/supertrait-lifetime-bound.rs
+++ b/src/test/ui/traits/object/supertrait-lifetime-bound.rs
@@ -1,7 +1,3 @@
-// ignore-compare-mode-nll
-// revisions: base nll
-// [nll]compile-flags: -Zborrowck=mir
-
 trait Foo: 'static { }
 
 trait Bar<T>: Foo { }
@@ -12,8 +8,7 @@ fn test2<'a>() {
     // Here: the type `dyn Bar<&'a u32>` references `'a`,
     // and so it does not outlive `'static`.
     test1::<dyn Bar<&'a u32>, _>();
-    //[base]~^ ERROR the type `(dyn Bar<&'a u32> + 'static)` does not fulfill the required lifetime
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/traits/object/supertrait-lifetime-bound.nll.stderr b/src/test/ui/traits/object/supertrait-lifetime-bound.stderr
index 271c6a10998..ed2f8624357 100644
--- a/src/test/ui/traits/object/supertrait-lifetime-bound.nll.stderr
+++ b/src/test/ui/traits/object/supertrait-lifetime-bound.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/supertrait-lifetime-bound.rs:14:5
+  --> $DIR/supertrait-lifetime-bound.rs:10:5
    |
 LL | fn test2<'a>() {
    |          -- lifetime `'a` defined here
diff --git a/src/test/ui/traits/trait-upcasting/lifetime.rs b/src/test/ui/traits/trait-upcasting/lifetime.rs
index 052f090102e..f029a6f081f 100644
--- a/src/test/ui/traits/trait-upcasting/lifetime.rs
+++ b/src/test/ui/traits/trait-upcasting/lifetime.rs
@@ -1,5 +1,4 @@
 // run-pass
-// ignore-compare-mode-nll
 
 #![feature(trait_upcasting)]
 #![allow(incomplete_features)]
diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-3.base.stderr b/src/test/ui/traits/trait-upcasting/type-checking-test-3.base.stderr
deleted file mode 100644
index e1831c5617f..00000000000
--- a/src/test/ui/traits/trait-upcasting/type-checking-test-3.base.stderr
+++ /dev/null
@@ -1,33 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/type-checking-test-3.rs:16:13
-   |
-LL |     let _ = x as &dyn Bar<'a>; // Error
-   |             ^ lifetime mismatch
-   |
-   = note: expected trait object `dyn Bar<'a>`
-              found trait object `dyn Bar<'static>`
-note: the lifetime `'a` as defined here...
-  --> $DIR/type-checking-test-3.rs:15:16
-   |
-LL | fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) {
-   |                ^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error[E0308]: mismatched types
-  --> $DIR/type-checking-test-3.rs:22:13
-   |
-LL |     let _ = x as &dyn Bar<'static>; // Error
-   |             ^ lifetime mismatch
-   |
-   = note: expected trait object `dyn Bar<'static>`
-              found trait object `dyn Bar<'a>`
-note: the lifetime `'a` as defined here...
-  --> $DIR/type-checking-test-3.rs:21:16
-   |
-LL | fn test_wrong2<'a>(x: &dyn Foo<'a>) {
-   |                ^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-3.rs b/src/test/ui/traits/trait-upcasting/type-checking-test-3.rs
index 89e8821d34e..b3aa2279a30 100644
--- a/src/test/ui/traits/trait-upcasting/type-checking-test-3.rs
+++ b/src/test/ui/traits/trait-upcasting/type-checking-test-3.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 #![feature(trait_upcasting)]
 #![allow(incomplete_features)]
 
@@ -14,14 +10,12 @@ fn test_correct(x: &dyn Foo<'static>) {
 
 fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) {
     let _ = x as &dyn Bar<'a>; // Error
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn test_wrong2<'a>(x: &dyn Foo<'a>) {
     let _ = x as &dyn Bar<'static>; // Error
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-3.nll.stderr b/src/test/ui/traits/trait-upcasting/type-checking-test-3.stderr
index 983027d9b16..5ad151b5092 100644
--- a/src/test/ui/traits/trait-upcasting/type-checking-test-3.nll.stderr
+++ b/src/test/ui/traits/trait-upcasting/type-checking-test-3.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/type-checking-test-3.rs:16:13
+  --> $DIR/type-checking-test-3.rs:12:13
    |
 LL | fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) {
    |                -- lifetime `'a` defined here
@@ -7,7 +7,7 @@ LL |     let _ = x as &dyn Bar<'a>; // Error
    |             ^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/type-checking-test-3.rs:22:13
+  --> $DIR/type-checking-test-3.rs:17:13
    |
 LL | fn test_wrong2<'a>(x: &dyn Foo<'a>) {
    |                -- lifetime `'a` defined here
diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-4.base.stderr b/src/test/ui/traits/trait-upcasting/type-checking-test-4.base.stderr
deleted file mode 100644
index c343698f27f..00000000000
--- a/src/test/ui/traits/trait-upcasting/type-checking-test-4.base.stderr
+++ /dev/null
@@ -1,123 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/type-checking-test-4.rs:20:13
-   |
-LL |     let _ = x as &dyn Bar<'static, 'a>; // Error
-   |             ^ lifetime mismatch
-   |
-   = note: expected trait object `dyn Bar<'static, 'a>`
-              found trait object `dyn Bar<'static, 'static>`
-note: the lifetime `'a` as defined here...
-  --> $DIR/type-checking-test-4.rs:19:16
-   |
-LL | fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) {
-   |                ^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error[E0308]: mismatched types
-  --> $DIR/type-checking-test-4.rs:26:13
-   |
-LL |     let _ = x as &dyn Bar<'a, 'static>; // Error
-   |             ^ lifetime mismatch
-   |
-   = note: expected trait object `dyn Bar<'a, 'static>`
-              found trait object `dyn Bar<'static, 'static>`
-note: the lifetime `'a` as defined here...
-  --> $DIR/type-checking-test-4.rs:25:16
-   |
-LL | fn test_wrong2<'a>(x: &dyn Foo<'static>, y: &'a u32) {
-   |                ^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/type-checking-test-4.rs:32:27
-   |
-LL | fn test_wrong3<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
-   |                       ------------ this data with lifetime `'a`...
-LL |     let y = x as &dyn Bar<'_, '_>;
-   |             -             ^^
-   |             |
-   |             ...is used here...
-LL |
-LL |     y.get_b() // ERROR
-   |     - ...is used here...
-   |
-note: ...and is required to live as long as `'static` here
-  --> $DIR/type-checking-test-4.rs:34:5
-   |
-LL |     y.get_b() // ERROR
-   |     ^^^^^^^^^
-note: `'static` lifetime requirement introduced by the return type
-  --> $DIR/type-checking-test-4.rs:31:48
-   |
-LL | fn test_wrong3<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
-   |                                                ^^^^^^^ `'static` requirement introduced here
-...
-LL |     y.get_b() // ERROR
-   |     --------- because of this returned expression
-
-error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/type-checking-test-4.rs:39:5
-   |
-LL | fn test_wrong4<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
-   |                       ------------ this data with lifetime `'a`...
-LL |     <_ as Bar>::get_b(x) // ERROR
-   |     ^^^^^^^^^^^^^^^^^ ...is used and required to live as long as `'static` here
-   |
-note: `'static` lifetime requirement introduced by the return type
-  --> $DIR/type-checking-test-4.rs:38:48
-   |
-LL | fn test_wrong4<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
-   |                                                ^^^^^^^ `'static` requirement introduced here
-LL |     <_ as Bar>::get_b(x) // ERROR
-   |     -------------------- because of this returned expression
-
-error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/type-checking-test-4.rs:45:15
-   |
-LL | fn test_wrong5<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
-   |                       ------------ this data with lifetime `'a`...
-LL |     <_ as Bar<'_, '_>>::get_b(x) // ERROR
-   |     ----------^^------------- ...is used and required to live as long as `'static` here
-   |
-note: `'static` lifetime requirement introduced by the return type
-  --> $DIR/type-checking-test-4.rs:44:48
-   |
-LL | fn test_wrong5<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
-   |                                                ^^^^^^^ `'static` requirement introduced here
-LL |     <_ as Bar<'_, '_>>::get_b(x) // ERROR
-   |     ---------------------------- because of this returned expression
-
-error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/type-checking-test-4.rs:51:27
-   |
-LL | fn test_wrong6<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
-   |                       ------------ this data with lifetime `'a`...
-LL |     let y = x as &dyn Bar<'_, '_>;
-   |             -             ^^
-   |             |
-   |             ...is used here...
-LL |
-LL |     y.get_b(); // ERROR
-   |     - ...is used here...
-LL |     let z = y;
-LL |     z.get_b() // ERROR
-   |     - ...is used here...
-   |
-note: ...and is required to live as long as `'static` here
-  --> $DIR/type-checking-test-4.rs:55:5
-   |
-LL |     z.get_b() // ERROR
-   |     ^^^^^^^^^
-note: `'static` lifetime requirement introduced by the return type
-  --> $DIR/type-checking-test-4.rs:50:48
-   |
-LL | fn test_wrong6<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
-   |                                                ^^^^^^^ `'static` requirement introduced here
-...
-LL |     z.get_b() // ERROR
-   |     --------- because of this returned expression
-
-error: aborting due to 6 previous errors
-
-Some errors have detailed explanations: E0308, E0759.
-For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-4.rs b/src/test/ui/traits/trait-upcasting/type-checking-test-4.rs
index 575d60a5e56..70ccc87fc3e 100644
--- a/src/test/ui/traits/trait-upcasting/type-checking-test-4.rs
+++ b/src/test/ui/traits/trait-upcasting/type-checking-test-4.rs
@@ -1,7 +1,3 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 #![feature(trait_upcasting)]
 #![allow(incomplete_features)]
 
@@ -18,42 +14,36 @@ fn test_correct(x: &dyn Foo<'static>) {
 
 fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) {
     let _ = x as &dyn Bar<'static, 'a>; // Error
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn test_wrong2<'a>(x: &dyn Foo<'static>, y: &'a u32) {
     let _ = x as &dyn Bar<'a, 'static>; // Error
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn test_wrong3<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
     let y = x as &dyn Bar<'_, '_>;
-    //[base]~^ ERROR `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
     y.get_b() // ERROR
-    //[nll]~^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn test_wrong4<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
     <_ as Bar>::get_b(x) // ERROR
-    //[base]~^ ERROR `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn test_wrong5<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
     <_ as Bar<'_, '_>>::get_b(x) // ERROR
-    //[base]~^ ERROR `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn test_wrong6<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
     let y = x as &dyn Bar<'_, '_>;
-    //[base]~^ ERROR `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
     y.get_b(); // ERROR
     let z = y;
     z.get_b() // ERROR
-    //[nll]~^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-4.nll.stderr b/src/test/ui/traits/trait-upcasting/type-checking-test-4.stderr
index 9b69bab56ae..436129d0bee 100644
--- a/src/test/ui/traits/trait-upcasting/type-checking-test-4.nll.stderr
+++ b/src/test/ui/traits/trait-upcasting/type-checking-test-4.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/type-checking-test-4.rs:20:13
+  --> $DIR/type-checking-test-4.rs:16:13
    |
 LL | fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) {
    |                -- lifetime `'a` defined here
@@ -7,7 +7,7 @@ LL |     let _ = x as &dyn Bar<'static, 'a>; // Error
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/type-checking-test-4.rs:26:13
+  --> $DIR/type-checking-test-4.rs:21:13
    |
 LL | fn test_wrong2<'a>(x: &dyn Foo<'static>, y: &'a u32) {
    |                -- lifetime `'a` defined here
@@ -15,16 +15,16 @@ LL |     let _ = x as &dyn Bar<'a, 'static>; // Error
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/type-checking-test-4.rs:34:5
+  --> $DIR/type-checking-test-4.rs:27:5
    |
 LL | fn test_wrong3<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
    |                -- lifetime `'a` defined here
-...
+LL |     let y = x as &dyn Bar<'_, '_>;
 LL |     y.get_b() // ERROR
    |     ^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/type-checking-test-4.rs:39:5
+  --> $DIR/type-checking-test-4.rs:32:5
    |
 LL | fn test_wrong4<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
    |                -- lifetime `'a` defined here
@@ -32,7 +32,7 @@ LL |     <_ as Bar>::get_b(x) // ERROR
    |     ^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/type-checking-test-4.rs:45:5
+  --> $DIR/type-checking-test-4.rs:37:5
    |
 LL | fn test_wrong5<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
    |                -- lifetime `'a` defined here
@@ -40,7 +40,7 @@ LL |     <_ as Bar<'_, '_>>::get_b(x) // ERROR
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/type-checking-test-4.rs:55:5
+  --> $DIR/type-checking-test-4.rs:45:5
    |
 LL | fn test_wrong6<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
    |                -- lifetime `'a` defined here
diff --git a/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.rs b/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.rs
index 6bc4f528faa..e6f45036f85 100644
--- a/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.rs
+++ b/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.rs
@@ -13,38 +13,38 @@ impl<T> Enum<T> {
         Self::TSVariant(());
         //~^ ERROR mismatched types [E0308]
         Self::TSVariant::<()>(());
-        //~^ ERROR type arguments are not allowed for this type [E0109]
+        //~^ ERROR type arguments are not allowed on this type [E0109]
         Self::<()>::TSVariant(());
-        //~^ ERROR type arguments are not allowed for this type [E0109]
+        //~^ ERROR type arguments are not allowed on self type [E0109]
         //~| ERROR mismatched types [E0308]
         Self::<()>::TSVariant::<()>(());
-        //~^ ERROR type arguments are not allowed for this type [E0109]
-        //~| ERROR type arguments are not allowed for this type [E0109]
+        //~^ ERROR type arguments are not allowed on self type [E0109]
+        //~| ERROR type arguments are not allowed on this type [E0109]
     }
 
     fn s_variant() {
         Self::SVariant { v: () };
         //~^ ERROR mismatched types [E0308]
         Self::SVariant::<()> { v: () };
-        //~^ ERROR type arguments are not allowed for this type [E0109]
+        //~^ ERROR type arguments are not allowed on this type [E0109]
         //~| ERROR mismatched types [E0308]
         Self::<()>::SVariant { v: () };
-        //~^ ERROR type arguments are not allowed for this type [E0109]
+        //~^ ERROR type arguments are not allowed on self type [E0109]
         //~| ERROR mismatched types [E0308]
         Self::<()>::SVariant::<()> { v: () };
-        //~^ ERROR type arguments are not allowed for this type [E0109]
-        //~| ERROR type arguments are not allowed for this type [E0109]
+        //~^ ERROR type arguments are not allowed on self type [E0109]
+        //~| ERROR type arguments are not allowed on this type [E0109]
         //~| ERROR mismatched types [E0308]
     }
 
     fn u_variant() {
         Self::UVariant::<()>;
-        //~^ ERROR type arguments are not allowed for this type [E0109]
+        //~^ ERROR type arguments are not allowed on this type [E0109]
         Self::<()>::UVariant;
-        //~^ ERROR type arguments are not allowed for this type [E0109]
+        //~^ ERROR type arguments are not allowed on self type [E0109]
         Self::<()>::UVariant::<()>;
-        //~^ ERROR type arguments are not allowed for this type [E0109]
-        //~| ERROR type arguments are not allowed for this type [E0109]
+        //~^ ERROR type arguments are not allowed on self type [E0109]
+        //~| ERROR type arguments are not allowed on this type [E0109]
     }
 }
 
@@ -52,54 +52,54 @@ fn main() {
     // Tuple struct variant
 
     Enum::<()>::TSVariant::<()>(());
-    //~^ ERROR type arguments are not allowed for this type [E0109]
+    //~^ ERROR type arguments are not allowed on this type [E0109]
 
     Alias::TSVariant::<()>(());
-    //~^ ERROR type arguments are not allowed for this type [E0109]
+    //~^ ERROR type arguments are not allowed on this type [E0109]
     Alias::<()>::TSVariant::<()>(());
-    //~^ ERROR type arguments are not allowed for this type [E0109]
+    //~^ ERROR type arguments are not allowed on this type [E0109]
 
     AliasFixed::TSVariant::<()>(());
-    //~^ ERROR type arguments are not allowed for this type [E0109]
+    //~^ ERROR type arguments are not allowed on this type [E0109]
     AliasFixed::<()>::TSVariant(());
     //~^ ERROR this type alias takes 0 generic arguments but 1 generic argument was supplied [E0107]
     AliasFixed::<()>::TSVariant::<()>(());
-    //~^ ERROR type arguments are not allowed for this type [E0109]
+    //~^ ERROR type arguments are not allowed on this type [E0109]
     //~| ERROR this type alias takes 0 generic arguments but 1 generic argument was supplied [E0107]
 
     // Struct variant
 
     Enum::<()>::SVariant::<()> { v: () };
-    //~^ ERROR type arguments are not allowed for this type [E0109]
+    //~^ ERROR type arguments are not allowed on this type [E0109]
 
     Alias::SVariant::<()> { v: () };
-    //~^ ERROR type arguments are not allowed for this type [E0109]
+    //~^ ERROR type arguments are not allowed on this type [E0109]
     Alias::<()>::SVariant::<()> { v: () };
-    //~^ ERROR type arguments are not allowed for this type [E0109]
+    //~^ ERROR type arguments are not allowed on this type [E0109]
 
     AliasFixed::SVariant::<()> { v: () };
-    //~^ ERROR type arguments are not allowed for this type [E0109]
+    //~^ ERROR type arguments are not allowed on this type [E0109]
     AliasFixed::<()>::SVariant { v: () };
     //~^ ERROR this type alias takes 0 generic arguments but 1 generic argument was supplied [E0107]
     AliasFixed::<()>::SVariant::<()> { v: () };
-    //~^ ERROR type arguments are not allowed for this type [E0109]
+    //~^ ERROR type arguments are not allowed on this type [E0109]
     //~| ERROR this type alias takes 0 generic arguments but 1 generic argument was supplied [E0107]
 
     // Unit variant
 
     Enum::<()>::UVariant::<()>;
-    //~^ ERROR type arguments are not allowed for this type [E0109]
+    //~^ ERROR type arguments are not allowed on this type [E0109]
 
     Alias::UVariant::<()>;
-    //~^ ERROR type arguments are not allowed for this type [E0109]
+    //~^ ERROR type arguments are not allowed on this type [E0109]
     Alias::<()>::UVariant::<()>;
-    //~^ ERROR type arguments are not allowed for this type [E0109]
+    //~^ ERROR type arguments are not allowed on this type [E0109]
 
     AliasFixed::UVariant::<()>;
-    //~^ ERROR type arguments are not allowed for this type [E0109]
+    //~^ ERROR type arguments are not allowed on this type [E0109]
     AliasFixed::<()>::UVariant;
     //~^ ERROR this type alias takes 0 generic arguments but 1 generic argument was supplied [E0107]
     AliasFixed::<()>::UVariant::<()>;
-    //~^ ERROR type arguments are not allowed for this type [E0109]
+    //~^ ERROR type arguments are not allowed on this type [E0109]
     //~| ERROR this type alias takes 0 generic arguments but 1 generic argument was supplied [E0107]
 }
diff --git a/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr b/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr
index 115ecb01376..3e60ab108a8 100644
--- a/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr
+++ b/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr
@@ -17,17 +17,34 @@ note: tuple variant defined here
 LL | enum Enum<T> { TSVariant(T), SVariant { v: T }, UVariant }
    |                ^^^^^^^^^
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/enum-variant-generic-args.rs:15:27
    |
 LL |         Self::TSVariant::<()>(());
-   |                           ^^ type argument not allowed
+   |               ---------   ^^ type argument not allowed
+   |               |
+   |               not allowed on this
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on self type
   --> $DIR/enum-variant-generic-args.rs:17:16
    |
 LL |         Self::<()>::TSVariant(());
-   |                ^^ type argument not allowed
+   |         ----   ^^ type argument not allowed
+   |         |
+   |         not allowed on this
+   |
+note: `Self` is of type `Enum<T>`
+  --> $DIR/enum-variant-generic-args.rs:7:6
+   |
+LL | enum Enum<T> { TSVariant(T), SVariant { v: T }, UVariant }
+   |      ^^^^ `Self` corresponds to this type
+...
+LL | impl<T> Enum<T> {
+   | --------------- `Self` is on type `Enum` in this `impl`
+help: the `Self` type doesn't accept type parameters, use the concrete type's name `Enum` instead if you want to specify its type parameters
+   |
+LL |         Enum::<()>::TSVariant(());
+   |         ~~~~
 
 error[E0308]: mismatched types
   --> $DIR/enum-variant-generic-args.rs:17:31
@@ -48,17 +65,34 @@ note: tuple variant defined here
 LL | enum Enum<T> { TSVariant(T), SVariant { v: T }, UVariant }
    |                ^^^^^^^^^
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on self type
   --> $DIR/enum-variant-generic-args.rs:20:16
    |
 LL |         Self::<()>::TSVariant::<()>(());
-   |                ^^ type argument not allowed
+   |         ----   ^^ type argument not allowed
+   |         |
+   |         not allowed on this
+   |
+note: `Self` is of type `Enum<T>`
+  --> $DIR/enum-variant-generic-args.rs:7:6
+   |
+LL | enum Enum<T> { TSVariant(T), SVariant { v: T }, UVariant }
+   |      ^^^^ `Self` corresponds to this type
+...
+LL | impl<T> Enum<T> {
+   | --------------- `Self` is on type `Enum` in this `impl`
+help: the `Self` type doesn't accept type parameters, use the concrete type's name `Enum` instead if you want to specify its type parameters
+   |
+LL |         Enum::<()>::TSVariant::<()>(());
+   |         ~~~~
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/enum-variant-generic-args.rs:20:33
    |
 LL |         Self::<()>::TSVariant::<()>(());
-   |                                 ^^ type argument not allowed
+   |                     ---------   ^^ type argument not allowed
+   |                     |
+   |                     not allowed on this
 
 error[E0308]: mismatched types
   --> $DIR/enum-variant-generic-args.rs:26:29
@@ -72,11 +106,20 @@ LL |         Self::SVariant { v: () };
    = note: expected type parameter `T`
                    found unit type `()`
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/enum-variant-generic-args.rs:28:26
    |
 LL |         Self::SVariant::<()> { v: () };
-   |                          ^^ type argument not allowed
+   |               --------   ^^ type argument not allowed
+   |               |
+   |               not allowed on this
+   |
+   = note: enum variants can't have type parameters
+help: you might have meant to specity type parameters on enum `Enum`
+   |
+LL -         Self::SVariant::<()> { v: () };
+LL +         Enum::<()>::SVariant { v: () };
+   | 
 
 error[E0308]: mismatched types
   --> $DIR/enum-variant-generic-args.rs:28:35
@@ -90,11 +133,26 @@ LL |         Self::SVariant::<()> { v: () };
    = note: expected type parameter `T`
                    found unit type `()`
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on self type
   --> $DIR/enum-variant-generic-args.rs:31:16
    |
 LL |         Self::<()>::SVariant { v: () };
-   |                ^^ type argument not allowed
+   |         ----   ^^ type argument not allowed
+   |         |
+   |         not allowed on this
+   |
+note: `Self` is of type `Enum<T>`
+  --> $DIR/enum-variant-generic-args.rs:7:6
+   |
+LL | enum Enum<T> { TSVariant(T), SVariant { v: T }, UVariant }
+   |      ^^^^ `Self` corresponds to this type
+...
+LL | impl<T> Enum<T> {
+   | --------------- `Self` is on type `Enum` in this `impl`
+help: the `Self` type doesn't accept type parameters, use the concrete type's name `Enum` instead if you want to specify its type parameters
+   |
+LL |         Enum::<()>::SVariant { v: () };
+   |         ~~~~
 
 error[E0308]: mismatched types
   --> $DIR/enum-variant-generic-args.rs:31:35
@@ -108,17 +166,41 @@ LL |         Self::<()>::SVariant { v: () };
    = note: expected type parameter `T`
                    found unit type `()`
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on self type
   --> $DIR/enum-variant-generic-args.rs:34:16
    |
 LL |         Self::<()>::SVariant::<()> { v: () };
-   |                ^^ type argument not allowed
+   |         ----   ^^ type argument not allowed
+   |         |
+   |         not allowed on this
+   |
+note: `Self` is of type `Enum<T>`
+  --> $DIR/enum-variant-generic-args.rs:7:6
+   |
+LL | enum Enum<T> { TSVariant(T), SVariant { v: T }, UVariant }
+   |      ^^^^ `Self` corresponds to this type
+...
+LL | impl<T> Enum<T> {
+   | --------------- `Self` is on type `Enum` in this `impl`
+help: the `Self` type doesn't accept type parameters, use the concrete type's name `Enum` instead if you want to specify its type parameters
+   |
+LL |         Enum::<()>::SVariant::<()> { v: () };
+   |         ~~~~
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/enum-variant-generic-args.rs:34:32
    |
 LL |         Self::<()>::SVariant::<()> { v: () };
-   |                                ^^ type argument not allowed
+   |                     --------   ^^ type argument not allowed
+   |                     |
+   |                     not allowed on this
+   |
+   = note: enum variants can't have type parameters
+help: you might have meant to specity type parameters on enum `Enum`
+   |
+LL -         Self::<()>::SVariant::<()> { v: () };
+LL +         Enum::<()>::SVariant { v: () };
+   | 
 
 error[E0308]: mismatched types
   --> $DIR/enum-variant-generic-args.rs:34:41
@@ -132,53 +214,95 @@ LL |         Self::<()>::SVariant::<()> { v: () };
    = note: expected type parameter `T`
                    found unit type `()`
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/enum-variant-generic-args.rs:41:26
    |
 LL |         Self::UVariant::<()>;
-   |                          ^^ type argument not allowed
+   |               --------   ^^ type argument not allowed
+   |               |
+   |               not allowed on this
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on self type
   --> $DIR/enum-variant-generic-args.rs:43:16
    |
 LL |         Self::<()>::UVariant;
-   |                ^^ type argument not allowed
+   |         ----   ^^ type argument not allowed
+   |         |
+   |         not allowed on this
+   |
+note: `Self` is of type `Enum<T>`
+  --> $DIR/enum-variant-generic-args.rs:7:6
+   |
+LL | enum Enum<T> { TSVariant(T), SVariant { v: T }, UVariant }
+   |      ^^^^ `Self` corresponds to this type
+...
+LL | impl<T> Enum<T> {
+   | --------------- `Self` is on type `Enum` in this `impl`
+help: the `Self` type doesn't accept type parameters, use the concrete type's name `Enum` instead if you want to specify its type parameters
+   |
+LL |         Enum::<()>::UVariant;
+   |         ~~~~
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on self type
   --> $DIR/enum-variant-generic-args.rs:45:16
    |
 LL |         Self::<()>::UVariant::<()>;
-   |                ^^ type argument not allowed
+   |         ----   ^^ type argument not allowed
+   |         |
+   |         not allowed on this
+   |
+note: `Self` is of type `Enum<T>`
+  --> $DIR/enum-variant-generic-args.rs:7:6
+   |
+LL | enum Enum<T> { TSVariant(T), SVariant { v: T }, UVariant }
+   |      ^^^^ `Self` corresponds to this type
+...
+LL | impl<T> Enum<T> {
+   | --------------- `Self` is on type `Enum` in this `impl`
+help: the `Self` type doesn't accept type parameters, use the concrete type's name `Enum` instead if you want to specify its type parameters
+   |
+LL |         Enum::<()>::UVariant::<()>;
+   |         ~~~~
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/enum-variant-generic-args.rs:45:32
    |
 LL |         Self::<()>::UVariant::<()>;
-   |                                ^^ type argument not allowed
+   |                     --------   ^^ type argument not allowed
+   |                     |
+   |                     not allowed on this
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/enum-variant-generic-args.rs:54:29
    |
 LL |     Enum::<()>::TSVariant::<()>(());
-   |                             ^^ type argument not allowed
+   |                 ---------   ^^ type argument not allowed
+   |                 |
+   |                 not allowed on this
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/enum-variant-generic-args.rs:57:24
    |
 LL |     Alias::TSVariant::<()>(());
-   |                        ^^ type argument not allowed
+   |            ---------   ^^ type argument not allowed
+   |            |
+   |            not allowed on this
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/enum-variant-generic-args.rs:59:30
    |
 LL |     Alias::<()>::TSVariant::<()>(());
-   |                              ^^ type argument not allowed
+   |                  ---------   ^^ type argument not allowed
+   |                  |
+   |                  not allowed on this
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/enum-variant-generic-args.rs:62:29
    |
 LL |     AliasFixed::TSVariant::<()>(());
-   |                             ^^ type argument not allowed
+   |                 ---------   ^^ type argument not allowed
+   |                 |
+   |                 not allowed on this
 
 error[E0107]: this type alias takes 0 generic arguments but 1 generic argument was supplied
   --> $DIR/enum-variant-generic-args.rs:64:5
@@ -208,35 +332,68 @@ note: type alias defined here, with 0 generic parameters
 LL | type AliasFixed = Enum<()>;
    |      ^^^^^^^^^^
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/enum-variant-generic-args.rs:66:35
    |
 LL |     AliasFixed::<()>::TSVariant::<()>(());
-   |                                   ^^ type argument not allowed
+   |                       ---------   ^^ type argument not allowed
+   |                       |
+   |                       not allowed on this
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/enum-variant-generic-args.rs:72:28
    |
 LL |     Enum::<()>::SVariant::<()> { v: () };
-   |                            ^^ type argument not allowed
+   |                 --------   ^^ type argument not allowed
+   |                 |
+   |                 not allowed on this
+   |
+   = note: enum variants can't have type parameters
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/enum-variant-generic-args.rs:75:23
    |
 LL |     Alias::SVariant::<()> { v: () };
-   |                       ^^ type argument not allowed
+   |            --------   ^^ type argument not allowed
+   |            |
+   |            not allowed on this
+   |
+   = note: enum variants can't have type parameters
+help: you might have meant to specity type parameters on enum `Enum`
+   |
+LL -     Alias::SVariant::<()> { v: () };
+LL +     Alias::<()>::SVariant { v: () };
+   | 
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/enum-variant-generic-args.rs:77:29
    |
 LL |     Alias::<()>::SVariant::<()> { v: () };
-   |                             ^^ type argument not allowed
+   |                  --------   ^^ type argument not allowed
+   |                  |
+   |                  not allowed on this
+   |
+   = note: enum variants can't have type parameters
+help: you might have meant to specity type parameters on enum `Enum`
+   |
+LL -     Alias::<()>::SVariant::<()> { v: () };
+LL +     Alias::<()>::SVariant { v: () };
+   | 
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/enum-variant-generic-args.rs:80:28
    |
 LL |     AliasFixed::SVariant::<()> { v: () };
-   |                            ^^ type argument not allowed
+   |                 --------   ^^ type argument not allowed
+   |                 |
+   |                 not allowed on this
+   |
+   = note: enum variants can't have type parameters
+help: you might have meant to specity type parameters on enum `Enum`
+   |
+LL -     AliasFixed::SVariant::<()> { v: () };
+LL +     AliasFixed::<()>::SVariant { v: () };
+   | 
 
 error[E0107]: this type alias takes 0 generic arguments but 1 generic argument was supplied
   --> $DIR/enum-variant-generic-args.rs:82:5
@@ -266,35 +423,52 @@ note: type alias defined here, with 0 generic parameters
 LL | type AliasFixed = Enum<()>;
    |      ^^^^^^^^^^
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/enum-variant-generic-args.rs:84:34
    |
 LL |     AliasFixed::<()>::SVariant::<()> { v: () };
-   |                                  ^^ type argument not allowed
+   |                       --------   ^^ type argument not allowed
+   |                       |
+   |                       not allowed on this
+   |
+   = note: enum variants can't have type parameters
+help: you might have meant to specity type parameters on enum `Enum`
+   |
+LL -     AliasFixed::<()>::SVariant::<()> { v: () };
+LL +     AliasFixed::<()>::SVariant { v: () };
+   | 
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/enum-variant-generic-args.rs:90:28
    |
 LL |     Enum::<()>::UVariant::<()>;
-   |                            ^^ type argument not allowed
+   |                 --------   ^^ type argument not allowed
+   |                 |
+   |                 not allowed on this
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/enum-variant-generic-args.rs:93:23
    |
 LL |     Alias::UVariant::<()>;
-   |                       ^^ type argument not allowed
+   |            --------   ^^ type argument not allowed
+   |            |
+   |            not allowed on this
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/enum-variant-generic-args.rs:95:29
    |
 LL |     Alias::<()>::UVariant::<()>;
-   |                             ^^ type argument not allowed
+   |                  --------   ^^ type argument not allowed
+   |                  |
+   |                  not allowed on this
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/enum-variant-generic-args.rs:98:28
    |
 LL |     AliasFixed::UVariant::<()>;
-   |                            ^^ type argument not allowed
+   |                 --------   ^^ type argument not allowed
+   |                 |
+   |                 not allowed on this
 
 error[E0107]: this type alias takes 0 generic arguments but 1 generic argument was supplied
   --> $DIR/enum-variant-generic-args.rs:100:5
@@ -324,11 +498,13 @@ note: type alias defined here, with 0 generic parameters
 LL | type AliasFixed = Enum<()>;
    |      ^^^^^^^^^^
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/enum-variant-generic-args.rs:102:34
    |
 LL |     AliasFixed::<()>::UVariant::<()>;
-   |                                  ^^ type argument not allowed
+   |                       --------   ^^ type argument not allowed
+   |                       |
+   |                       not allowed on this
 
 error: aborting due to 39 previous errors
 
diff --git a/src/test/ui/type-alias-enum-variants/no-type-application-on-aliased-enum-variant.rs b/src/test/ui/type-alias-enum-variants/no-type-application-on-aliased-enum-variant.rs
index c1153fa4dc7..872ece0c0f9 100644
--- a/src/test/ui/type-alias-enum-variants/no-type-application-on-aliased-enum-variant.rs
+++ b/src/test/ui/type-alias-enum-variants/no-type-application-on-aliased-enum-variant.rs
@@ -10,5 +10,5 @@ fn main() {
     let _ = Option::<u8>::None; // OK
     let _ = Option::None::<u8>; // OK (Lint in future!)
     let _ = Alias::<u8>::None; // OK
-    let _ = Alias::None::<u8>; //~ ERROR type arguments are not allowed for this type
+    let _ = Alias::None::<u8>; //~ ERROR type arguments are not allowed on this type
 }
diff --git a/src/test/ui/type-alias-enum-variants/no-type-application-on-aliased-enum-variant.stderr b/src/test/ui/type-alias-enum-variants/no-type-application-on-aliased-enum-variant.stderr
index a1064d69251..474548a14a9 100644
--- a/src/test/ui/type-alias-enum-variants/no-type-application-on-aliased-enum-variant.stderr
+++ b/src/test/ui/type-alias-enum-variants/no-type-application-on-aliased-enum-variant.stderr
@@ -1,8 +1,10 @@
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/no-type-application-on-aliased-enum-variant.rs:13:27
    |
 LL |     let _ = Alias::None::<u8>;
-   |                           ^^ type argument not allowed
+   |                    ----   ^^ type argument not allowed
+   |                    |
+   |                    not allowed on this
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr
deleted file mode 100644
index 593fb8af32f..00000000000
--- a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr
+++ /dev/null
@@ -1,32 +0,0 @@
-error: at least one trait must be specified
-  --> $DIR/generic_type_does_not_live_long_enough.rs:14:24
-   |
-LL | type WrongGeneric<T> = impl 'static;
-   |                        ^^^^^^^^^^^^
-
-error: non-defining opaque type use in defining scope
-  --> $DIR/generic_type_does_not_live_long_enough.rs:10:18
-   |
-LL |     let z: i32 = x;
-   |                  ^
-   |
-note: used non-generic type `&'static i32` for generic parameter
-  --> $DIR/generic_type_does_not_live_long_enough.rs:14:19
-   |
-LL | type WrongGeneric<T> = impl 'static;
-   |                   ^
-
-error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/generic_type_does_not_live_long_enough.rs:18:5
-   |
-LL |     t
-   |     ^ ...so that the type `T` will meet its required lifetime bounds
-   |
-help: consider adding an explicit lifetime bound...
-   |
-LL | fn wrong_generic<T: 'static>(t: T) -> WrongGeneric<T> {
-   |                   +++++++++
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0310`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs
index 2ad7e615e19..cb90776472b 100644
--- a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs
@@ -1,9 +1,5 @@
 #![feature(type_alias_impl_trait)]
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn main() {
     let y = 42;
     let x = wrong_generic(&y);
diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.base.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr
index 593fb8af32f..ba583241a69 100644
--- a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.base.stderr
+++ b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr
@@ -1,23 +1,23 @@
 error: at least one trait must be specified
-  --> $DIR/generic_type_does_not_live_long_enough.rs:14:24
+  --> $DIR/generic_type_does_not_live_long_enough.rs:10:24
    |
 LL | type WrongGeneric<T> = impl 'static;
    |                        ^^^^^^^^^^^^
 
 error: non-defining opaque type use in defining scope
-  --> $DIR/generic_type_does_not_live_long_enough.rs:10:18
+  --> $DIR/generic_type_does_not_live_long_enough.rs:6:18
    |
 LL |     let z: i32 = x;
    |                  ^
    |
 note: used non-generic type `&'static i32` for generic parameter
-  --> $DIR/generic_type_does_not_live_long_enough.rs:14:19
+  --> $DIR/generic_type_does_not_live_long_enough.rs:10:19
    |
 LL | type WrongGeneric<T> = impl 'static;
    |                   ^
 
 error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/generic_type_does_not_live_long_enough.rs:18:5
+  --> $DIR/generic_type_does_not_live_long_enough.rs:14:5
    |
 LL |     t
    |     ^ ...so that the type `T` will meet its required lifetime bounds
diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.base.stderr b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.base.stderr
deleted file mode 100644
index be77b60ca8f..00000000000
--- a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: implementation of `FnOnce` is not general enough
-  --> $DIR/issue-57611-trait-alias.rs:25:9
-   |
-LL |         |x| x
-   |         ^^^^^ implementation of `FnOnce` is not general enough
-   |
-   = note: closure with signature `fn(&'2 X) -> &X` must implement `FnOnce<(&'1 X,)>`, for any lifetime `'1`...
-   = note: ...but it actually implements `FnOnce<(&'2 X,)>`, for some specific lifetime `'2`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs
index e95ddab75be..9c4e6c5496f 100644
--- a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs
@@ -3,10 +3,6 @@
 // FIXME: This should compile, but it currently doesn't
 // known-bug
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 #![feature(trait_alias)]
 #![feature(type_alias_impl_trait)]
 
diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.nll.stderr b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.stderr
index f5b91567ff5..559820b1b1a 100644
--- a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.nll.stderr
+++ b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-57611-trait-alias.rs:25:9
+  --> $DIR/issue-57611-trait-alias.rs:21:9
    |
 LL |         |x| x
    |         ^^^^^ one type is more general than the other
@@ -7,13 +7,13 @@ LL |         |x| x
    = note: expected type `for<'r> Fn<(&'r X,)>`
               found type `Fn<(&X,)>`
 note: this closure does not fulfill the lifetime requirements
-  --> $DIR/issue-57611-trait-alias.rs:25:9
+  --> $DIR/issue-57611-trait-alias.rs:21:9
    |
 LL |         |x| x
    |         ^^^^^
 
 error: implementation of `FnOnce` is not general enough
-  --> $DIR/issue-57611-trait-alias.rs:25:9
+  --> $DIR/issue-57611-trait-alias.rs:21:9
    |
 LL |         |x| x
    |         ^^^^^ implementation of `FnOnce` is not general enough
diff --git a/src/test/ui/type/issue-91268.rs b/src/test/ui/type/issue-91268.rs
index fd2733c1c54..01ed9ea9e23 100644
--- a/src/test/ui/type/issue-91268.rs
+++ b/src/test/ui/type/issue-91268.rs
@@ -1,7 +1,7 @@
 // error-pattern: this file contains an unclosed delimiter
 // error-pattern: cannot find type `ţ` in this scope
 // error-pattern: parenthesized type parameters may only be used with a `Fn` trait
-// error-pattern: type arguments are not allowed for this type
+// error-pattern: type arguments are not allowed on this type
 // error-pattern: mismatched types
 // ignore-tidy-trailing-newlines
 // `ţ` must be the last character in this file, it cannot be followed by a newline
diff --git a/src/test/ui/type/issue-91268.stderr b/src/test/ui/type/issue-91268.stderr
index 2fe6ba6248c..199fd6a23f7 100644
--- a/src/test/ui/type/issue-91268.stderr
+++ b/src/test/ui/type/issue-91268.stderr
@@ -30,11 +30,19 @@ error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
 LL |     0: u8(ţ
    |        ^^^^ only `Fn` traits may use parentheses
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/issue-91268.rs:9:11
    |
 LL |     0: u8(ţ
-   |           ^ type argument not allowed
+   |        -- ^ type argument not allowed
+   |        |
+   |        not allowed on this
+   |
+help: primitive type `u8` doesn't have generic parameters
+   |
+LL -     0: u8(ţ
+LL +     0: u8
+   | 
 
 error[E0308]: mismatched types
   --> $DIR/issue-91268.rs:9:5
diff --git a/src/test/ui/typeck/prim-with-args.fixed b/src/test/ui/typeck/prim-with-args.fixed
new file mode 100644
index 00000000000..1c5fd750867
--- /dev/null
+++ b/src/test/ui/typeck/prim-with-args.fixed
@@ -0,0 +1,28 @@
+// run-rustfix
+fn main() {
+
+let _x: isize; //~ ERROR type arguments are not allowed on this type
+let _x: i8; //~ ERROR type arguments are not allowed on this type
+let _x: i16; //~ ERROR type arguments are not allowed on this type
+let _x: i32; //~ ERROR type arguments are not allowed on this type
+let _x: i64; //~ ERROR type arguments are not allowed on this type
+let _x: usize; //~ ERROR type arguments are not allowed on this type
+let _x: u8; //~ ERROR type arguments are not allowed on this type
+let _x: u16; //~ ERROR type arguments are not allowed on this type
+let _x: u32; //~ ERROR type arguments are not allowed on this type
+let _x: u64; //~ ERROR type arguments are not allowed on this type
+let _x: char; //~ ERROR type arguments are not allowed on this type
+
+let _x: isize; //~ ERROR lifetime arguments are not allowed on this type
+let _x: i8; //~ ERROR lifetime arguments are not allowed on this type
+let _x: i16; //~ ERROR lifetime arguments are not allowed on this type
+let _x: i32; //~ ERROR lifetime arguments are not allowed on this type
+let _x: i64; //~ ERROR lifetime arguments are not allowed on this type
+let _x: usize; //~ ERROR lifetime arguments are not allowed on this type
+let _x: u8; //~ ERROR lifetime arguments are not allowed on this type
+let _x: u16; //~ ERROR lifetime arguments are not allowed on this type
+let _x: u32; //~ ERROR lifetime arguments are not allowed on this type
+let _x: u64; //~ ERROR lifetime arguments are not allowed on this type
+let _x: char; //~ ERROR lifetime arguments are not allowed on this type
+
+}
diff --git a/src/test/ui/typeck/prim-with-args.rs b/src/test/ui/typeck/prim-with-args.rs
index e5beaca6abb..b05d6c1cb4e 100644
--- a/src/test/ui/typeck/prim-with-args.rs
+++ b/src/test/ui/typeck/prim-with-args.rs
@@ -1,27 +1,28 @@
+// run-rustfix
 fn main() {
 
-let x: isize<isize>; //~ ERROR type arguments are not allowed for this type
-let x: i8<isize>; //~ ERROR type arguments are not allowed for this type
-let x: i16<isize>; //~ ERROR type arguments are not allowed for this type
-let x: i32<isize>; //~ ERROR type arguments are not allowed for this type
-let x: i64<isize>; //~ ERROR type arguments are not allowed for this type
-let x: usize<isize>; //~ ERROR type arguments are not allowed for this type
-let x: u8<isize>; //~ ERROR type arguments are not allowed for this type
-let x: u16<isize>; //~ ERROR type arguments are not allowed for this type
-let x: u32<isize>; //~ ERROR type arguments are not allowed for this type
-let x: u64<isize>; //~ ERROR type arguments are not allowed for this type
-let x: char<isize>; //~ ERROR type arguments are not allowed for this type
+let _x: isize<isize>; //~ ERROR type arguments are not allowed on this type
+let _x: i8<isize>; //~ ERROR type arguments are not allowed on this type
+let _x: i16<isize>; //~ ERROR type arguments are not allowed on this type
+let _x: i32<isize>; //~ ERROR type arguments are not allowed on this type
+let _x: i64<isize>; //~ ERROR type arguments are not allowed on this type
+let _x: usize<isize>; //~ ERROR type arguments are not allowed on this type
+let _x: u8<isize>; //~ ERROR type arguments are not allowed on this type
+let _x: u16<isize>; //~ ERROR type arguments are not allowed on this type
+let _x: u32<isize>; //~ ERROR type arguments are not allowed on this type
+let _x: u64<isize>; //~ ERROR type arguments are not allowed on this type
+let _x: char<isize>; //~ ERROR type arguments are not allowed on this type
 
-let x: isize<'static>; //~ ERROR lifetime arguments are not allowed for this type
-let x: i8<'static>; //~ ERROR lifetime arguments are not allowed for this type
-let x: i16<'static>; //~ ERROR lifetime arguments are not allowed for this type
-let x: i32<'static>; //~ ERROR lifetime arguments are not allowed for this type
-let x: i64<'static>; //~ ERROR lifetime arguments are not allowed for this type
-let x: usize<'static>; //~ ERROR lifetime arguments are not allowed for this type
-let x: u8<'static>; //~ ERROR lifetime arguments are not allowed for this type
-let x: u16<'static>; //~ ERROR lifetime arguments are not allowed for this type
-let x: u32<'static>; //~ ERROR lifetime arguments are not allowed for this type
-let x: u64<'static>; //~ ERROR lifetime arguments are not allowed for this type
-let x: char<'static>; //~ ERROR lifetime arguments are not allowed for this type
+let _x: isize<'static>; //~ ERROR lifetime arguments are not allowed on this type
+let _x: i8<'static>; //~ ERROR lifetime arguments are not allowed on this type
+let _x: i16<'static>; //~ ERROR lifetime arguments are not allowed on this type
+let _x: i32<'static>; //~ ERROR lifetime arguments are not allowed on this type
+let _x: i64<'static>; //~ ERROR lifetime arguments are not allowed on this type
+let _x: usize<'static>; //~ ERROR lifetime arguments are not allowed on this type
+let _x: u8<'static>; //~ ERROR lifetime arguments are not allowed on this type
+let _x: u16<'static>; //~ ERROR lifetime arguments are not allowed on this type
+let _x: u32<'static>; //~ ERROR lifetime arguments are not allowed on this type
+let _x: u64<'static>; //~ ERROR lifetime arguments are not allowed on this type
+let _x: char<'static>; //~ ERROR lifetime arguments are not allowed on this type
 
 }
diff --git a/src/test/ui/typeck/prim-with-args.stderr b/src/test/ui/typeck/prim-with-args.stderr
index 4bde981e7f2..7e7bc580b3b 100644
--- a/src/test/ui/typeck/prim-with-args.stderr
+++ b/src/test/ui/typeck/prim-with-args.stderr
@@ -1,134 +1,310 @@
-error[E0109]: type arguments are not allowed for this type
-  --> $DIR/prim-with-args.rs:3:14
+error[E0109]: type arguments are not allowed on this type
+  --> $DIR/prim-with-args.rs:4:15
    |
-LL | let x: isize<isize>;
-   |              ^^^^^ type argument not allowed
-
-error[E0109]: type arguments are not allowed for this type
-  --> $DIR/prim-with-args.rs:4:11
+LL | let _x: isize<isize>;
+   |         ----- ^^^^^ type argument not allowed
+   |         |
+   |         not allowed on this
+   |
+help: primitive type `isize` doesn't have generic parameters
    |
-LL | let x: i8<isize>;
-   |           ^^^^^ type argument not allowed
+LL - let _x: isize<isize>;
+LL + let _x: isize;
+   | 
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/prim-with-args.rs:5:12
    |
-LL | let x: i16<isize>;
-   |            ^^^^^ type argument not allowed
+LL | let _x: i8<isize>;
+   |         -- ^^^^^ type argument not allowed
+   |         |
+   |         not allowed on this
+   |
+help: primitive type `i8` doesn't have generic parameters
+   |
+LL - let _x: i8<isize>;
+LL + let _x: i8;
+   | 
 
-error[E0109]: type arguments are not allowed for this type
-  --> $DIR/prim-with-args.rs:6:12
+error[E0109]: type arguments are not allowed on this type
+  --> $DIR/prim-with-args.rs:6:13
+   |
+LL | let _x: i16<isize>;
+   |         --- ^^^^^ type argument not allowed
+   |         |
+   |         not allowed on this
+   |
+help: primitive type `i16` doesn't have generic parameters
    |
-LL | let x: i32<isize>;
-   |            ^^^^^ type argument not allowed
+LL - let _x: i16<isize>;
+LL + let _x: i16;
+   | 
 
-error[E0109]: type arguments are not allowed for this type
-  --> $DIR/prim-with-args.rs:7:12
+error[E0109]: type arguments are not allowed on this type
+  --> $DIR/prim-with-args.rs:7:13
    |
-LL | let x: i64<isize>;
-   |            ^^^^^ type argument not allowed
+LL | let _x: i32<isize>;
+   |         --- ^^^^^ type argument not allowed
+   |         |
+   |         not allowed on this
+   |
+help: primitive type `i32` doesn't have generic parameters
+   |
+LL - let _x: i32<isize>;
+LL + let _x: i32;
+   | 
 
-error[E0109]: type arguments are not allowed for this type
-  --> $DIR/prim-with-args.rs:8:14
+error[E0109]: type arguments are not allowed on this type
+  --> $DIR/prim-with-args.rs:8:13
+   |
+LL | let _x: i64<isize>;
+   |         --- ^^^^^ type argument not allowed
+   |         |
+   |         not allowed on this
    |
-LL | let x: usize<isize>;
-   |              ^^^^^ type argument not allowed
+help: primitive type `i64` doesn't have generic parameters
+   |
+LL - let _x: i64<isize>;
+LL + let _x: i64;
+   | 
 
-error[E0109]: type arguments are not allowed for this type
-  --> $DIR/prim-with-args.rs:9:11
+error[E0109]: type arguments are not allowed on this type
+  --> $DIR/prim-with-args.rs:9:15
+   |
+LL | let _x: usize<isize>;
+   |         ----- ^^^^^ type argument not allowed
+   |         |
+   |         not allowed on this
+   |
+help: primitive type `usize` doesn't have generic parameters
    |
-LL | let x: u8<isize>;
-   |           ^^^^^ type argument not allowed
+LL - let _x: usize<isize>;
+LL + let _x: usize;
+   | 
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/prim-with-args.rs:10:12
    |
-LL | let x: u16<isize>;
-   |            ^^^^^ type argument not allowed
+LL | let _x: u8<isize>;
+   |         -- ^^^^^ type argument not allowed
+   |         |
+   |         not allowed on this
+   |
+help: primitive type `u8` doesn't have generic parameters
+   |
+LL - let _x: u8<isize>;
+LL + let _x: u8;
+   | 
 
-error[E0109]: type arguments are not allowed for this type
-  --> $DIR/prim-with-args.rs:11:12
+error[E0109]: type arguments are not allowed on this type
+  --> $DIR/prim-with-args.rs:11:13
+   |
+LL | let _x: u16<isize>;
+   |         --- ^^^^^ type argument not allowed
+   |         |
+   |         not allowed on this
    |
-LL | let x: u32<isize>;
-   |            ^^^^^ type argument not allowed
+help: primitive type `u16` doesn't have generic parameters
+   |
+LL - let _x: u16<isize>;
+LL + let _x: u16;
+   | 
 
-error[E0109]: type arguments are not allowed for this type
-  --> $DIR/prim-with-args.rs:12:12
+error[E0109]: type arguments are not allowed on this type
+  --> $DIR/prim-with-args.rs:12:13
+   |
+LL | let _x: u32<isize>;
+   |         --- ^^^^^ type argument not allowed
+   |         |
+   |         not allowed on this
+   |
+help: primitive type `u32` doesn't have generic parameters
    |
-LL | let x: u64<isize>;
-   |            ^^^^^ type argument not allowed
+LL - let _x: u32<isize>;
+LL + let _x: u32;
+   | 
 
-error[E0109]: type arguments are not allowed for this type
+error[E0109]: type arguments are not allowed on this type
   --> $DIR/prim-with-args.rs:13:13
    |
-LL | let x: char<isize>;
-   |             ^^^^^ type argument not allowed
+LL | let _x: u64<isize>;
+   |         --- ^^^^^ type argument not allowed
+   |         |
+   |         not allowed on this
+   |
+help: primitive type `u64` doesn't have generic parameters
+   |
+LL - let _x: u64<isize>;
+LL + let _x: u64;
+   | 
 
-error[E0109]: lifetime arguments are not allowed for this type
-  --> $DIR/prim-with-args.rs:15:14
+error[E0109]: type arguments are not allowed on this type
+  --> $DIR/prim-with-args.rs:14:14
+   |
+LL | let _x: char<isize>;
+   |         ---- ^^^^^ type argument not allowed
+   |         |
+   |         not allowed on this
    |
-LL | let x: isize<'static>;
-   |              ^^^^^^^ lifetime argument not allowed
+help: primitive type `char` doesn't have generic parameters
+   |
+LL - let _x: char<isize>;
+LL + let _x: char;
+   | 
 
-error[E0109]: lifetime arguments are not allowed for this type
-  --> $DIR/prim-with-args.rs:16:11
+error[E0109]: lifetime arguments are not allowed on this type
+  --> $DIR/prim-with-args.rs:16:15
+   |
+LL | let _x: isize<'static>;
+   |         ----- ^^^^^^^ lifetime argument not allowed
+   |         |
+   |         not allowed on this
    |
-LL | let x: i8<'static>;
-   |           ^^^^^^^ lifetime argument not allowed
+help: primitive type `isize` doesn't have generic parameters
+   |
+LL - let _x: isize<'static>;
+LL + let _x: isize;
+   | 
 
-error[E0109]: lifetime arguments are not allowed for this type
+error[E0109]: lifetime arguments are not allowed on this type
   --> $DIR/prim-with-args.rs:17:12
    |
-LL | let x: i16<'static>;
-   |            ^^^^^^^ lifetime argument not allowed
+LL | let _x: i8<'static>;
+   |         -- ^^^^^^^ lifetime argument not allowed
+   |         |
+   |         not allowed on this
+   |
+help: primitive type `i8` doesn't have generic parameters
+   |
+LL - let _x: i8<'static>;
+LL + let _x: i8;
+   | 
 
-error[E0109]: lifetime arguments are not allowed for this type
-  --> $DIR/prim-with-args.rs:18:12
+error[E0109]: lifetime arguments are not allowed on this type
+  --> $DIR/prim-with-args.rs:18:13
    |
-LL | let x: i32<'static>;
-   |            ^^^^^^^ lifetime argument not allowed
+LL | let _x: i16<'static>;
+   |         --- ^^^^^^^ lifetime argument not allowed
+   |         |
+   |         not allowed on this
+   |
+help: primitive type `i16` doesn't have generic parameters
+   |
+LL - let _x: i16<'static>;
+LL + let _x: i16;
+   | 
 
-error[E0109]: lifetime arguments are not allowed for this type
-  --> $DIR/prim-with-args.rs:19:12
+error[E0109]: lifetime arguments are not allowed on this type
+  --> $DIR/prim-with-args.rs:19:13
+   |
+LL | let _x: i32<'static>;
+   |         --- ^^^^^^^ lifetime argument not allowed
+   |         |
+   |         not allowed on this
    |
-LL | let x: i64<'static>;
-   |            ^^^^^^^ lifetime argument not allowed
+help: primitive type `i32` doesn't have generic parameters
+   |
+LL - let _x: i32<'static>;
+LL + let _x: i32;
+   | 
 
-error[E0109]: lifetime arguments are not allowed for this type
-  --> $DIR/prim-with-args.rs:20:14
+error[E0109]: lifetime arguments are not allowed on this type
+  --> $DIR/prim-with-args.rs:20:13
+   |
+LL | let _x: i64<'static>;
+   |         --- ^^^^^^^ lifetime argument not allowed
+   |         |
+   |         not allowed on this
+   |
+help: primitive type `i64` doesn't have generic parameters
    |
-LL | let x: usize<'static>;
-   |              ^^^^^^^ lifetime argument not allowed
+LL - let _x: i64<'static>;
+LL + let _x: i64;
+   | 
 
-error[E0109]: lifetime arguments are not allowed for this type
-  --> $DIR/prim-with-args.rs:21:11
+error[E0109]: lifetime arguments are not allowed on this type
+  --> $DIR/prim-with-args.rs:21:15
    |
-LL | let x: u8<'static>;
-   |           ^^^^^^^ lifetime argument not allowed
+LL | let _x: usize<'static>;
+   |         ----- ^^^^^^^ lifetime argument not allowed
+   |         |
+   |         not allowed on this
+   |
+help: primitive type `usize` doesn't have generic parameters
+   |
+LL - let _x: usize<'static>;
+LL + let _x: usize;
+   | 
 
-error[E0109]: lifetime arguments are not allowed for this type
+error[E0109]: lifetime arguments are not allowed on this type
   --> $DIR/prim-with-args.rs:22:12
    |
-LL | let x: u16<'static>;
-   |            ^^^^^^^ lifetime argument not allowed
+LL | let _x: u8<'static>;
+   |         -- ^^^^^^^ lifetime argument not allowed
+   |         |
+   |         not allowed on this
+   |
+help: primitive type `u8` doesn't have generic parameters
+   |
+LL - let _x: u8<'static>;
+LL + let _x: u8;
+   | 
 
-error[E0109]: lifetime arguments are not allowed for this type
-  --> $DIR/prim-with-args.rs:23:12
+error[E0109]: lifetime arguments are not allowed on this type
+  --> $DIR/prim-with-args.rs:23:13
+   |
+LL | let _x: u16<'static>;
+   |         --- ^^^^^^^ lifetime argument not allowed
+   |         |
+   |         not allowed on this
+   |
+help: primitive type `u16` doesn't have generic parameters
    |
-LL | let x: u32<'static>;
-   |            ^^^^^^^ lifetime argument not allowed
+LL - let _x: u16<'static>;
+LL + let _x: u16;
+   | 
 
-error[E0109]: lifetime arguments are not allowed for this type
-  --> $DIR/prim-with-args.rs:24:12
+error[E0109]: lifetime arguments are not allowed on this type
+  --> $DIR/prim-with-args.rs:24:13
    |
-LL | let x: u64<'static>;
-   |            ^^^^^^^ lifetime argument not allowed
+LL | let _x: u32<'static>;
+   |         --- ^^^^^^^ lifetime argument not allowed
+   |         |
+   |         not allowed on this
+   |
+help: primitive type `u32` doesn't have generic parameters
+   |
+LL - let _x: u32<'static>;
+LL + let _x: u32;
+   | 
 
-error[E0109]: lifetime arguments are not allowed for this type
+error[E0109]: lifetime arguments are not allowed on this type
   --> $DIR/prim-with-args.rs:25:13
    |
-LL | let x: char<'static>;
-   |             ^^^^^^^ lifetime argument not allowed
+LL | let _x: u64<'static>;
+   |         --- ^^^^^^^ lifetime argument not allowed
+   |         |
+   |         not allowed on this
+   |
+help: primitive type `u64` doesn't have generic parameters
+   |
+LL - let _x: u64<'static>;
+LL + let _x: u64;
+   | 
+
+error[E0109]: lifetime arguments are not allowed on this type
+  --> $DIR/prim-with-args.rs:26:14
+   |
+LL | let _x: char<'static>;
+   |         ---- ^^^^^^^ lifetime argument not allowed
+   |         |
+   |         not allowed on this
+   |
+help: primitive type `char` doesn't have generic parameters
+   |
+LL - let _x: char<'static>;
+LL + let _x: char;
+   | 
 
 error: aborting due to 22 previous errors
 
diff --git a/src/test/ui/unboxed-closures/issue-30906.base.stderr b/src/test/ui/unboxed-closures/issue-30906.base.stderr
deleted file mode 100644
index 5d555a9c5e4..00000000000
--- a/src/test/ui/unboxed-closures/issue-30906.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: implementation of `FnOnce` is not general enough
-  --> $DIR/issue-30906.rs:22:5
-   |
-LL |     test(Compose(f, |_| {}));
-   |     ^^^^ implementation of `FnOnce` is not general enough
-   |
-   = note: `fn(&'2 str) -> T` must implement `FnOnce<(&'1 str,)>`, for any lifetime `'1`...
-   = note: ...but it actually implements `FnOnce<(&'2 str,)>`, for some specific lifetime `'2`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/unboxed-closures/issue-30906.rs b/src/test/ui/unboxed-closures/issue-30906.rs
index 1fd3a7f97de..e2d219e4703 100644
--- a/src/test/ui/unboxed-closures/issue-30906.rs
+++ b/src/test/ui/unboxed-closures/issue-30906.rs
@@ -1,9 +1,5 @@
 #![feature(fn_traits, unboxed_closures)]
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn test<F: for<'x> FnOnce<(&'x str,)>>(_: F) {}
 
 struct Compose<F, G>(F, G);
diff --git a/src/test/ui/unboxed-closures/issue-30906.nll.stderr b/src/test/ui/unboxed-closures/issue-30906.stderr
index 333e8e17821..147a2097473 100644
--- a/src/test/ui/unboxed-closures/issue-30906.nll.stderr
+++ b/src/test/ui/unboxed-closures/issue-30906.stderr
@@ -1,5 +1,5 @@
 error: implementation of `FnOnce` is not general enough
-  --> $DIR/issue-30906.rs:22:5
+  --> $DIR/issue-30906.rs:18:5
    |
 LL |     test(Compose(f, |_| {}));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.base.stderr b/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.base.stderr
deleted file mode 100644
index ebd14c64298..00000000000
--- a/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.base.stderr
+++ /dev/null
@@ -1,30 +0,0 @@
-error[E0312]: lifetime of reference outlives lifetime of borrowed content...
-  --> $DIR/unboxed-closures-infer-argument-types-two-region-pointers.rs:21:15
-   |
-LL |         x.set(y);
-   |               ^
-   |
-note: ...the reference is valid for the anonymous lifetime #2 defined here...
-  --> $DIR/unboxed-closures-infer-argument-types-two-region-pointers.rs:20:14
-   |
-LL |       doit(0, &|x, y| {
-   |  ______________^
-LL | |         x.set(y);
-LL | |
-LL | |
-LL | |     });
-   | |_____^
-note: ...but the borrowed content is only valid for the anonymous lifetime #3 defined here
-  --> $DIR/unboxed-closures-infer-argument-types-two-region-pointers.rs:20:14
-   |
-LL |       doit(0, &|x, y| {
-   |  ______________^
-LL | |         x.set(y);
-LL | |
-LL | |
-LL | |     });
-   | |_____^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0312`.
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.rs b/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.rs
index 288349e4456..6765da42132 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.rs
+++ b/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.rs
@@ -3,10 +3,6 @@
 // That a closure whose expected argument types include two distinct
 // bound regions.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 use std::cell::Cell;
 
 fn doit<T,F>(val: T, f: &F)
@@ -19,7 +15,6 @@ fn doit<T,F>(val: T, f: &F)
 pub fn main() {
     doit(0, &|x, y| {
         x.set(y);
-        //[base]~^ ERROR E0312
-        //[nll]~^^ lifetime may not live long enough
+        //~^ lifetime may not live long enough
     });
 }
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.nll.stderr b/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.stderr
index aeeee6e5003..e97157b8398 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.nll.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/unboxed-closures-infer-argument-types-two-region-pointers.rs:21:9
+  --> $DIR/unboxed-closures-infer-argument-types-two-region-pointers.rs:17:9
    |
 LL |     doit(0, &|x, y| {
    |               -  - has type `&'1 i32`
diff --git a/src/test/ui/underscore-lifetime/dyn-trait-underscore.base.stderr b/src/test/ui/underscore-lifetime/dyn-trait-underscore.base.stderr
deleted file mode 100644
index 07357795010..00000000000
--- a/src/test/ui/underscore-lifetime/dyn-trait-underscore.base.stderr
+++ /dev/null
@@ -1,27 +0,0 @@
-error[E0759]: `items` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/dyn-trait-underscore.rs:12:20
-   |
-LL | fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
-   |                ---- this data with an anonymous lifetime `'_`...
-LL |     //                      ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to `'static`
-LL |     Box::new(items.iter())
-   |              ----- ^^^^
-   |              |
-   |              ...is used and required to live as long as `'static` here
-   |
-note: `'static` lifetime requirement introduced by the return type
-  --> $DIR/dyn-trait-underscore.rs:10:29
-   |
-LL | fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
-   |                             ^^^^^^^^^^^^^^^^^^^^^ `'static` requirement introduced here
-LL |     //                      ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to `'static`
-LL |     Box::new(items.iter())
-   |     ---------------------- because of this returned expression
-help: to declare that the trait object captures data from argument `items`, you can add an explicit `'_` lifetime bound
-   |
-LL | fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T> + '_> {
-   |                                                   ++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0759`.
diff --git a/src/test/ui/underscore-lifetime/dyn-trait-underscore.rs b/src/test/ui/underscore-lifetime/dyn-trait-underscore.rs
index 7110d432210..fa6e65c7d2e 100644
--- a/src/test/ui/underscore-lifetime/dyn-trait-underscore.rs
+++ b/src/test/ui/underscore-lifetime/dyn-trait-underscore.rs
@@ -3,15 +3,10 @@
 //
 // cc #48468
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
     //                      ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to `'static`
     Box::new(items.iter())
-    //[base]~^ ERROR E0759
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn b<T>(items: &[T]) -> Box<dyn Iterator<Item=&T> + '_> {
diff --git a/src/test/ui/underscore-lifetime/dyn-trait-underscore.nll.stderr b/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr
index 0ffb77cf021..60b0b3ee7ba 100644
--- a/src/test/ui/underscore-lifetime/dyn-trait-underscore.nll.stderr
+++ b/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/dyn-trait-underscore.rs:12:5
+  --> $DIR/dyn-trait-underscore.rs:8:5
    |
 LL | fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
    |                - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.base.stderr b/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.base.stderr
deleted file mode 100644
index 2581911f5ce..00000000000
--- a/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.base.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/underscore-lifetime-elison-mismatch.rs:5:49
-   |
-LL | fn foo(x: &mut Vec<&'_ u8>, y: &'_ u8) { x.push(y); }
-   |                    ------      ------           ^ ...but data from `y` flows into `x` here
-   |                                |
-   |                                these two types are declared with different lifetimes...
-   |
-   = note: each elided lifetime in input position becomes a distinct lifetime
-help: consider introducing a named lifetime parameter
-   |
-LL | fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
-   |       ++++              ~~          ~~
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.rs b/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.rs
index 6d495138da9..c611268849a 100644
--- a/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.rs
+++ b/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.rs
@@ -1,9 +1,4 @@
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn foo(x: &mut Vec<&'_ u8>, y: &'_ u8) { x.push(y); }
-//[base]~^ ERROR lifetime mismatch
-//[nll]~^^ ERROR lifetime may not live long enough
+//~^ ERROR lifetime may not live long enough
 
 fn main() {}
diff --git a/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.nll.stderr b/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.stderr
index a4dece320ec..2b34f0c555a 100644
--- a/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.nll.stderr
+++ b/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/underscore-lifetime-elison-mismatch.rs:5:42
+  --> $DIR/underscore-lifetime-elison-mismatch.rs:1:42
    |
 LL | fn foo(x: &mut Vec<&'_ u8>, y: &'_ u8) { x.push(y); }
    |                    -           -         ^^^^^^^^^ argument requires that `'1` must outlive `'2`
diff --git a/src/test/ui/union/union-copy.stderr b/src/test/ui/union/union-copy.stderr
index 279808dd55b..8ecdafdde20 100644
--- a/src/test/ui/union/union-copy.stderr
+++ b/src/test/ui/union/union-copy.stderr
@@ -8,10 +8,10 @@ LL | impl Copy for W {}
    |      ^^^^
    |
 note: the `Copy` impl for `ManuallyDrop<String>` requires that `String: Copy`
-  --> $DIR/union-copy.rs:8:5
+  --> $DIR/union-copy.rs:8:8
    |
 LL |     a: std::mem::ManuallyDrop<String>
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/usize-generic-argument-parent.rs b/src/test/ui/usize-generic-argument-parent.rs
index 46b06e2b366..6d17ba9b5b2 100644
--- a/src/test/ui/usize-generic-argument-parent.rs
+++ b/src/test/ui/usize-generic-argument-parent.rs
@@ -1,5 +1,5 @@
 fn foo() {
-    let x: usize<foo>; //~ ERROR const arguments are not allowed for this type
+    let x: usize<foo>; //~ ERROR const arguments are not allowed on this type
 }
 
 fn main() {}
diff --git a/src/test/ui/usize-generic-argument-parent.stderr b/src/test/ui/usize-generic-argument-parent.stderr
index f1eae3b5008..c657f0faa0b 100644
--- a/src/test/ui/usize-generic-argument-parent.stderr
+++ b/src/test/ui/usize-generic-argument-parent.stderr
@@ -1,8 +1,16 @@
-error[E0109]: const arguments are not allowed for this type
+error[E0109]: const arguments are not allowed on this type
   --> $DIR/usize-generic-argument-parent.rs:2:18
    |
 LL |     let x: usize<foo>;
-   |                  ^^^ const argument not allowed
+   |            ----- ^^^ const argument not allowed
+   |            |
+   |            not allowed on this
+   |
+help: primitive type `usize` doesn't have generic parameters
+   |
+LL -     let x: usize<foo>;
+LL +     let x: usize;
+   | 
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/variance/variance-associated-types2.base.stderr b/src/test/ui/variance/variance-associated-types2.base.stderr
deleted file mode 100644
index c8ace084871..00000000000
--- a/src/test/ui/variance/variance-associated-types2.base.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/variance-associated-types2.rs:17:42
-   |
-LL |     let _: Box<dyn Foo<Bar = &'a u32>> = make();
-   |                                          ^^^^^^ lifetime mismatch
-   |
-   = note: expected trait object `dyn Foo<Bar = &'a u32>`
-              found trait object `dyn Foo<Bar = &'static u32>`
-note: the lifetime `'a` as defined here...
-  --> $DIR/variance-associated-types2.rs:16:9
-   |
-LL | fn take<'a>(_: &'a u32) {
-   |         ^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/variance/variance-associated-types2.rs b/src/test/ui/variance/variance-associated-types2.rs
index e3c8e6d7ca2..e487eefea63 100644
--- a/src/test/ui/variance/variance-associated-types2.rs
+++ b/src/test/ui/variance/variance-associated-types2.rs
@@ -1,10 +1,6 @@
 // Test that dyn Foo<Bar = T> is invariant with respect to T.
 // Failure to enforce invariance here can be weaponized, see #71550 for details.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Foo {
     type Bar;
 }
@@ -15,8 +11,7 @@ fn make() -> Box<dyn Foo<Bar = &'static u32>> {
 
 fn take<'a>(_: &'a u32) {
     let _: Box<dyn Foo<Bar = &'a u32>> = make();
-    //[base]~^ ERROR mismatched types [E0308]
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/ui/variance/variance-associated-types2.nll.stderr b/src/test/ui/variance/variance-associated-types2.stderr
index b74c4009692..35871c1236f 100644
--- a/src/test/ui/variance/variance-associated-types2.nll.stderr
+++ b/src/test/ui/variance/variance-associated-types2.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/variance-associated-types2.rs:17:12
+  --> $DIR/variance-associated-types2.rs:13:12
    |
 LL | fn take<'a>(_: &'a u32) {
    |         -- lifetime `'a` defined here
diff --git a/src/test/ui/variance/variance-btree-invariant-types.base.stderr b/src/test/ui/variance/variance-btree-invariant-types.base.stderr
deleted file mode 100644
index 5b78f4252b3..00000000000
--- a/src/test/ui/variance/variance-btree-invariant-types.base.stderr
+++ /dev/null
@@ -1,243 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/variance-btree-invariant-types.rs:8:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected struct `std::collections::btree_map::IterMut<'_, &'new (), _>`
-              found struct `std::collections::btree_map::IterMut<'_, &'static (), _>`
-note: the lifetime `'new` as defined here...
-  --> $DIR/variance-btree-invariant-types.rs:7:21
-   |
-LL | fn iter_cov_key<'a, 'new>(v: IterMut<'a, &'static (), ()>) -> IterMut<'a, &'new (), ()> {
-   |                     ^^^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error[E0308]: mismatched types
-  --> $DIR/variance-btree-invariant-types.rs:13:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected struct `std::collections::btree_map::IterMut<'_, _, &'new ()>`
-              found struct `std::collections::btree_map::IterMut<'_, _, &'static ()>`
-note: the lifetime `'new` as defined here...
-  --> $DIR/variance-btree-invariant-types.rs:12:21
-   |
-LL | fn iter_cov_val<'a, 'new>(v: IterMut<'a, (), &'static ()>) -> IterMut<'a, (), &'new ()> {
-   |                     ^^^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error[E0308]: mismatched types
-  --> $DIR/variance-btree-invariant-types.rs:18:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected struct `std::collections::btree_map::IterMut<'_, &'static (), _>`
-              found struct `std::collections::btree_map::IterMut<'_, &'new (), _>`
-note: the lifetime `'new` as defined here...
-  --> $DIR/variance-btree-invariant-types.rs:17:24
-   |
-LL | fn iter_contra_key<'a, 'new>(v: IterMut<'a, &'new (), ()>) -> IterMut<'a, &'static (), ()> {
-   |                        ^^^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error[E0308]: mismatched types
-  --> $DIR/variance-btree-invariant-types.rs:23:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected struct `std::collections::btree_map::IterMut<'_, _, &'static ()>`
-              found struct `std::collections::btree_map::IterMut<'_, _, &'new ()>`
-note: the lifetime `'new` as defined here...
-  --> $DIR/variance-btree-invariant-types.rs:22:24
-   |
-LL | fn iter_contra_val<'a, 'new>(v: IterMut<'a, (), &'new ()>) -> IterMut<'a, (), &'static ()> {
-   |                        ^^^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error[E0308]: mismatched types
-  --> $DIR/variance-btree-invariant-types.rs:29:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected struct `RangeMut<'_, &'new (), _>`
-              found struct `RangeMut<'_, &'static (), _>`
-note: the lifetime `'new` as defined here...
-  --> $DIR/variance-btree-invariant-types.rs:28:22
-   |
-LL | fn range_cov_key<'a, 'new>(v: RangeMut<'a, &'static (), ()>) -> RangeMut<'a, &'new (), ()> {
-   |                      ^^^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error[E0308]: mismatched types
-  --> $DIR/variance-btree-invariant-types.rs:34:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected struct `RangeMut<'_, _, &'new ()>`
-              found struct `RangeMut<'_, _, &'static ()>`
-note: the lifetime `'new` as defined here...
-  --> $DIR/variance-btree-invariant-types.rs:33:22
-   |
-LL | fn range_cov_val<'a, 'new>(v: RangeMut<'a, (), &'static ()>) -> RangeMut<'a, (), &'new ()> {
-   |                      ^^^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error[E0308]: mismatched types
-  --> $DIR/variance-btree-invariant-types.rs:39:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected struct `RangeMut<'_, &'static (), _>`
-              found struct `RangeMut<'_, &'new (), _>`
-note: the lifetime `'new` as defined here...
-  --> $DIR/variance-btree-invariant-types.rs:38:25
-   |
-LL | fn range_contra_key<'a, 'new>(v: RangeMut<'a, &'new (), ()>) -> RangeMut<'a, &'static (), ()> {
-   |                         ^^^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error[E0308]: mismatched types
-  --> $DIR/variance-btree-invariant-types.rs:44:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected struct `RangeMut<'_, _, &'static ()>`
-              found struct `RangeMut<'_, _, &'new ()>`
-note: the lifetime `'new` as defined here...
-  --> $DIR/variance-btree-invariant-types.rs:43:25
-   |
-LL | fn range_contra_val<'a, 'new>(v: RangeMut<'a, (), &'new ()>) -> RangeMut<'a, (), &'static ()> {
-   |                         ^^^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error[E0308]: mismatched types
-  --> $DIR/variance-btree-invariant-types.rs:51:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected struct `std::collections::btree_map::OccupiedEntry<'_, &'new (), _>`
-              found struct `std::collections::btree_map::OccupiedEntry<'_, &'static (), _>`
-note: the lifetime `'new` as defined here...
-  --> $DIR/variance-btree-invariant-types.rs:49:20
-   |
-LL | fn occ_cov_key<'a, 'new>(v: OccupiedEntry<'a, &'static (), ()>)
-   |                    ^^^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error[E0308]: mismatched types
-  --> $DIR/variance-btree-invariant-types.rs:57:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected struct `std::collections::btree_map::OccupiedEntry<'_, _, &'new ()>`
-              found struct `std::collections::btree_map::OccupiedEntry<'_, _, &'static ()>`
-note: the lifetime `'new` as defined here...
-  --> $DIR/variance-btree-invariant-types.rs:55:20
-   |
-LL | fn occ_cov_val<'a, 'new>(v: OccupiedEntry<'a, (), &'static ()>)
-   |                    ^^^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error[E0308]: mismatched types
-  --> $DIR/variance-btree-invariant-types.rs:63:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected struct `std::collections::btree_map::OccupiedEntry<'_, &'static (), _>`
-              found struct `std::collections::btree_map::OccupiedEntry<'_, &'new (), _>`
-note: the lifetime `'new` as defined here...
-  --> $DIR/variance-btree-invariant-types.rs:61:23
-   |
-LL | fn occ_contra_key<'a, 'new>(v: OccupiedEntry<'a, &'new (), ()>)
-   |                       ^^^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error[E0308]: mismatched types
-  --> $DIR/variance-btree-invariant-types.rs:69:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected struct `std::collections::btree_map::OccupiedEntry<'_, _, &'static ()>`
-              found struct `std::collections::btree_map::OccupiedEntry<'_, _, &'new ()>`
-note: the lifetime `'new` as defined here...
-  --> $DIR/variance-btree-invariant-types.rs:67:23
-   |
-LL | fn occ_contra_val<'a, 'new>(v: OccupiedEntry<'a, (), &'new ()>)
-   |                       ^^^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error[E0308]: mismatched types
-  --> $DIR/variance-btree-invariant-types.rs:76:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected struct `std::collections::btree_map::VacantEntry<'_, &'new (), _>`
-              found struct `std::collections::btree_map::VacantEntry<'_, &'static (), _>`
-note: the lifetime `'new` as defined here...
-  --> $DIR/variance-btree-invariant-types.rs:74:20
-   |
-LL | fn vac_cov_key<'a, 'new>(v: VacantEntry<'a, &'static (), ()>)
-   |                    ^^^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error[E0308]: mismatched types
-  --> $DIR/variance-btree-invariant-types.rs:82:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected struct `std::collections::btree_map::VacantEntry<'_, _, &'new ()>`
-              found struct `std::collections::btree_map::VacantEntry<'_, _, &'static ()>`
-note: the lifetime `'new` as defined here...
-  --> $DIR/variance-btree-invariant-types.rs:80:20
-   |
-LL | fn vac_cov_val<'a, 'new>(v: VacantEntry<'a, (), &'static ()>)
-   |                    ^^^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error[E0308]: mismatched types
-  --> $DIR/variance-btree-invariant-types.rs:88:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected struct `std::collections::btree_map::VacantEntry<'_, &'static (), _>`
-              found struct `std::collections::btree_map::VacantEntry<'_, &'new (), _>`
-note: the lifetime `'new` as defined here...
-  --> $DIR/variance-btree-invariant-types.rs:86:23
-   |
-LL | fn vac_contra_key<'a, 'new>(v: VacantEntry<'a, &'new (), ()>)
-   |                       ^^^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error[E0308]: mismatched types
-  --> $DIR/variance-btree-invariant-types.rs:94:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected struct `std::collections::btree_map::VacantEntry<'_, _, &'static ()>`
-              found struct `std::collections::btree_map::VacantEntry<'_, _, &'new ()>`
-note: the lifetime `'new` as defined here...
-  --> $DIR/variance-btree-invariant-types.rs:92:23
-   |
-LL | fn vac_contra_val<'a, 'new>(v: VacantEntry<'a, (), &'new ()>)
-   |                       ^^^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error: aborting due to 16 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/variance/variance-btree-invariant-types.rs b/src/test/ui/variance/variance-btree-invariant-types.rs
index 7ddf6b294a5..09c93d0013c 100644
--- a/src/test/ui/variance/variance-btree-invariant-types.rs
+++ b/src/test/ui/variance/variance-btree-invariant-types.rs
@@ -1,99 +1,79 @@
 use std::collections::btree_map::{IterMut, OccupiedEntry, RangeMut, VacantEntry};
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 fn iter_cov_key<'a, 'new>(v: IterMut<'a, &'static (), ()>) -> IterMut<'a, &'new (), ()> {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 }
 fn iter_cov_val<'a, 'new>(v: IterMut<'a, (), &'static ()>) -> IterMut<'a, (), &'new ()> {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 }
 fn iter_contra_key<'a, 'new>(v: IterMut<'a, &'new (), ()>) -> IterMut<'a, &'static (), ()> {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 }
 fn iter_contra_val<'a, 'new>(v: IterMut<'a, (), &'new ()>) -> IterMut<'a, (), &'static ()> {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 }
 
 fn range_cov_key<'a, 'new>(v: RangeMut<'a, &'static (), ()>) -> RangeMut<'a, &'new (), ()> {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 }
 fn range_cov_val<'a, 'new>(v: RangeMut<'a, (), &'static ()>) -> RangeMut<'a, (), &'new ()> {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 }
 fn range_contra_key<'a, 'new>(v: RangeMut<'a, &'new (), ()>) -> RangeMut<'a, &'static (), ()> {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 }
 fn range_contra_val<'a, 'new>(v: RangeMut<'a, (), &'new ()>) -> RangeMut<'a, (), &'static ()> {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 }
 
 fn occ_cov_key<'a, 'new>(v: OccupiedEntry<'a, &'static (), ()>)
                          -> OccupiedEntry<'a, &'new (), ()> {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 }
 fn occ_cov_val<'a, 'new>(v: OccupiedEntry<'a, (), &'static ()>)
                          -> OccupiedEntry<'a, (), &'new ()> {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 }
 fn occ_contra_key<'a, 'new>(v: OccupiedEntry<'a, &'new (), ()>)
                             -> OccupiedEntry<'a, &'static (), ()> {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 }
 fn occ_contra_val<'a, 'new>(v: OccupiedEntry<'a, (), &'new ()>)
                             -> OccupiedEntry<'a, (), &'static ()> {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 }
 
 fn vac_cov_key<'a, 'new>(v: VacantEntry<'a, &'static (), ()>)
                          -> VacantEntry<'a, &'new (), ()> {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 }
 fn vac_cov_val<'a, 'new>(v: VacantEntry<'a, (), &'static ()>)
                          -> VacantEntry<'a, (), &'new ()> {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 }
 fn vac_contra_key<'a, 'new>(v: VacantEntry<'a, &'new (), ()>)
                             -> VacantEntry<'a, &'static (), ()> {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 }
 fn vac_contra_val<'a, 'new>(v: VacantEntry<'a, (), &'new ()>)
                             -> VacantEntry<'a, (), &'static ()> {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ lifetime may not live long enough
+    //~^ lifetime may not live long enough
 }
 
 
diff --git a/src/test/ui/variance/variance-btree-invariant-types.nll.stderr b/src/test/ui/variance/variance-btree-invariant-types.stderr
index 991a7b0cdf0..22d149feb4d 100644
--- a/src/test/ui/variance/variance-btree-invariant-types.nll.stderr
+++ b/src/test/ui/variance/variance-btree-invariant-types.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:8:5
+  --> $DIR/variance-btree-invariant-types.rs:4:5
    |
 LL | fn iter_cov_key<'a, 'new>(v: IterMut<'a, &'static (), ()>) -> IterMut<'a, &'new (), ()> {
    |                     ---- lifetime `'new` defined here
@@ -11,7 +11,7 @@ LL |     v
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:13:5
+  --> $DIR/variance-btree-invariant-types.rs:8:5
    |
 LL | fn iter_cov_val<'a, 'new>(v: IterMut<'a, (), &'static ()>) -> IterMut<'a, (), &'new ()> {
    |                     ---- lifetime `'new` defined here
@@ -23,7 +23,7 @@ LL |     v
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:18:5
+  --> $DIR/variance-btree-invariant-types.rs:12:5
    |
 LL | fn iter_contra_key<'a, 'new>(v: IterMut<'a, &'new (), ()>) -> IterMut<'a, &'static (), ()> {
    |                        ---- lifetime `'new` defined here
@@ -35,7 +35,7 @@ LL |     v
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:23:5
+  --> $DIR/variance-btree-invariant-types.rs:16:5
    |
 LL | fn iter_contra_val<'a, 'new>(v: IterMut<'a, (), &'new ()>) -> IterMut<'a, (), &'static ()> {
    |                        ---- lifetime `'new` defined here
@@ -47,7 +47,7 @@ LL |     v
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:29:5
+  --> $DIR/variance-btree-invariant-types.rs:21:5
    |
 LL | fn range_cov_key<'a, 'new>(v: RangeMut<'a, &'static (), ()>) -> RangeMut<'a, &'new (), ()> {
    |                      ---- lifetime `'new` defined here
@@ -59,7 +59,7 @@ LL |     v
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:34:5
+  --> $DIR/variance-btree-invariant-types.rs:25:5
    |
 LL | fn range_cov_val<'a, 'new>(v: RangeMut<'a, (), &'static ()>) -> RangeMut<'a, (), &'new ()> {
    |                      ---- lifetime `'new` defined here
@@ -71,7 +71,7 @@ LL |     v
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:39:5
+  --> $DIR/variance-btree-invariant-types.rs:29:5
    |
 LL | fn range_contra_key<'a, 'new>(v: RangeMut<'a, &'new (), ()>) -> RangeMut<'a, &'static (), ()> {
    |                         ---- lifetime `'new` defined here
@@ -83,7 +83,7 @@ LL |     v
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:44:5
+  --> $DIR/variance-btree-invariant-types.rs:33:5
    |
 LL | fn range_contra_val<'a, 'new>(v: RangeMut<'a, (), &'new ()>) -> RangeMut<'a, (), &'static ()> {
    |                         ---- lifetime `'new` defined here
@@ -95,7 +95,7 @@ LL |     v
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:51:5
+  --> $DIR/variance-btree-invariant-types.rs:39:5
    |
 LL | fn occ_cov_key<'a, 'new>(v: OccupiedEntry<'a, &'static (), ()>)
    |                    ---- lifetime `'new` defined here
@@ -108,7 +108,7 @@ LL |     v
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:57:5
+  --> $DIR/variance-btree-invariant-types.rs:44:5
    |
 LL | fn occ_cov_val<'a, 'new>(v: OccupiedEntry<'a, (), &'static ()>)
    |                    ---- lifetime `'new` defined here
@@ -121,7 +121,7 @@ LL |     v
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:63:5
+  --> $DIR/variance-btree-invariant-types.rs:49:5
    |
 LL | fn occ_contra_key<'a, 'new>(v: OccupiedEntry<'a, &'new (), ()>)
    |                       ---- lifetime `'new` defined here
@@ -134,7 +134,7 @@ LL |     v
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:69:5
+  --> $DIR/variance-btree-invariant-types.rs:54:5
    |
 LL | fn occ_contra_val<'a, 'new>(v: OccupiedEntry<'a, (), &'new ()>)
    |                       ---- lifetime `'new` defined here
@@ -147,7 +147,7 @@ LL |     v
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:76:5
+  --> $DIR/variance-btree-invariant-types.rs:60:5
    |
 LL | fn vac_cov_key<'a, 'new>(v: VacantEntry<'a, &'static (), ()>)
    |                    ---- lifetime `'new` defined here
@@ -160,7 +160,7 @@ LL |     v
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:82:5
+  --> $DIR/variance-btree-invariant-types.rs:65:5
    |
 LL | fn vac_cov_val<'a, 'new>(v: VacantEntry<'a, (), &'static ()>)
    |                    ---- lifetime `'new` defined here
@@ -173,7 +173,7 @@ LL |     v
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:88:5
+  --> $DIR/variance-btree-invariant-types.rs:70:5
    |
 LL | fn vac_contra_key<'a, 'new>(v: VacantEntry<'a, &'new (), ()>)
    |                       ---- lifetime `'new` defined here
@@ -186,7 +186,7 @@ LL |     v
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:94:5
+  --> $DIR/variance-btree-invariant-types.rs:75:5
    |
 LL | fn vac_contra_val<'a, 'new>(v: VacantEntry<'a, (), &'new ()>)
    |                       ---- lifetime `'new` defined here
diff --git a/src/test/ui/variance/variance-cell-is-invariant.base.stderr b/src/test/ui/variance/variance-cell-is-invariant.base.stderr
deleted file mode 100644
index e3180b6d984..00000000000
--- a/src/test/ui/variance/variance-cell-is-invariant.base.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0623]: lifetime mismatch
-  --> $DIR/variance-cell-is-invariant.rs:18:25
-   |
-LL | fn use_<'short,'long>(c: Foo<'short>,
-   |                          ----------- these two types are declared with different lifetimes...
-LL |                       s: &'short isize,
-LL |                       l: &'long isize,
-   |                          ------------
-LL |                       _where:Option<&'short &'long ()>) {
-LL |     let _: Foo<'long> = c;
-   |                         ^ ...but data from `c` flows into `l` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/variance/variance-cell-is-invariant.rs b/src/test/ui/variance/variance-cell-is-invariant.rs
index b8b73147d0e..62ce4f91fe8 100644
--- a/src/test/ui/variance/variance-cell-is-invariant.rs
+++ b/src/test/ui/variance/variance-cell-is-invariant.rs
@@ -1,10 +1,6 @@
 // Test that Cell is considered invariant with respect to its
 // type.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 use std::cell::Cell;
 
 struct Foo<'a> {
@@ -16,8 +12,7 @@ fn use_<'short,'long>(c: Foo<'short>,
                       l: &'long isize,
                       _where:Option<&'short &'long ()>) {
     let _: Foo<'long> = c;
-    //[base]~^ ERROR E0623
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/variance/variance-cell-is-invariant.nll.stderr b/src/test/ui/variance/variance-cell-is-invariant.stderr
index c2e93d99c43..ab5435d1656 100644
--- a/src/test/ui/variance/variance-cell-is-invariant.nll.stderr
+++ b/src/test/ui/variance/variance-cell-is-invariant.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/variance-cell-is-invariant.rs:18:12
+  --> $DIR/variance-cell-is-invariant.rs:14:12
    |
 LL | fn use_<'short,'long>(c: Foo<'short>,
    |         ------ ----- lifetime `'long` defined here
diff --git a/src/test/ui/variance/variance-contravariant-arg-object.base.stderr b/src/test/ui/variance/variance-contravariant-arg-object.base.stderr
deleted file mode 100644
index 19b8b9d5aa0..00000000000
--- a/src/test/ui/variance/variance-contravariant-arg-object.base.stderr
+++ /dev/null
@@ -1,41 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/variance-contravariant-arg-object.rs:18:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected trait object `dyn Get<&'min i32>`
-              found trait object `dyn Get<&'max i32>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-contravariant-arg-object.rs:14:21
-   |
-LL | fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
-   |                     ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-contravariant-arg-object.rs:14:27
-   |
-LL | fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
-   |                           ^^^^
-
-error[E0308]: mismatched types
-  --> $DIR/variance-contravariant-arg-object.rs:28:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected trait object `dyn Get<&'max i32>`
-              found trait object `dyn Get<&'min i32>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-contravariant-arg-object.rs:23:21
-   |
-LL | fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
-   |                     ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-contravariant-arg-object.rs:23:27
-   |
-LL | fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
-   |                           ^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/variance/variance-contravariant-arg-object.rs b/src/test/ui/variance/variance-contravariant-arg-object.rs
index dab42c35218..e7e24e16731 100644
--- a/src/test/ui/variance/variance-contravariant-arg-object.rs
+++ b/src/test/ui/variance/variance-contravariant-arg-object.rs
@@ -3,10 +3,6 @@
 // Test that even when `T` is only used in contravariant position, it
 // is treated as invariant.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Get<T> : 'static {
     fn get(&self, t: T);
 }
@@ -16,8 +12,7 @@ fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
     where 'max : 'min
 {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
@@ -26,8 +21,7 @@ fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
 {
     // Previously OK:
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/variance/variance-contravariant-arg-object.nll.stderr b/src/test/ui/variance/variance-contravariant-arg-object.stderr
index 4071a41703e..162ec3a3f1e 100644
--- a/src/test/ui/variance/variance-contravariant-arg-object.nll.stderr
+++ b/src/test/ui/variance/variance-contravariant-arg-object.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/variance-contravariant-arg-object.rs:18:5
+  --> $DIR/variance-contravariant-arg-object.rs:14:5
    |
 LL | fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
    |                     ----  ---- lifetime `'max` defined here
@@ -12,7 +12,7 @@ LL |     v
    = help: consider adding the following bound: `'min: 'max`
 
 error: lifetime may not live long enough
-  --> $DIR/variance-contravariant-arg-object.rs:28:5
+  --> $DIR/variance-contravariant-arg-object.rs:23:5
    |
 LL | fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
    |                     ----  ---- lifetime `'max` defined here
diff --git a/src/test/ui/variance/variance-contravariant-arg-trait-match.base.stderr b/src/test/ui/variance/variance-contravariant-arg-trait-match.base.stderr
deleted file mode 100644
index 56cf8459010..00000000000
--- a/src/test/ui/variance/variance-contravariant-arg-trait-match.base.stderr
+++ /dev/null
@@ -1,41 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/variance-contravariant-arg-trait-match.rs:17:5
-   |
-LL |     impls_get::<G,&'min i32>()
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
-   |
-   = note: expected type `Get<&'min i32>`
-              found type `Get<&'max i32>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-contravariant-arg-trait-match.rs:14:21
-   |
-LL | fn get_min_from_max<'min, 'max, G>()
-   |                     ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-contravariant-arg-trait-match.rs:14:27
-   |
-LL | fn get_min_from_max<'min, 'max, G>()
-   |                           ^^^^
-
-error[E0308]: mismatched types
-  --> $DIR/variance-contravariant-arg-trait-match.rs:27:5
-   |
-LL |     impls_get::<G,&'max i32>()
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
-   |
-   = note: expected type `Get<&'max i32>`
-              found type `Get<&'min i32>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-contravariant-arg-trait-match.rs:22:21
-   |
-LL | fn get_max_from_min<'min, 'max, G>()
-   |                     ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-contravariant-arg-trait-match.rs:22:27
-   |
-LL | fn get_max_from_min<'min, 'max, G>()
-   |                           ^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/variance/variance-contravariant-arg-trait-match.rs b/src/test/ui/variance/variance-contravariant-arg-trait-match.rs
index 11513d5411c..e0b28010561 100644
--- a/src/test/ui/variance/variance-contravariant-arg-trait-match.rs
+++ b/src/test/ui/variance/variance-contravariant-arg-trait-match.rs
@@ -3,10 +3,6 @@
 // Test that even when `T` is only used in contravariant position, it
 // is treated as invariant.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Get<T> {
     fn get(&self, t: T);
 }
@@ -15,8 +11,7 @@ fn get_min_from_max<'min, 'max, G>()
     where 'max : 'min, G : Get<&'max i32>
 {
     impls_get::<G,&'min i32>()
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn get_max_from_min<'min, 'max, G>()
@@ -25,8 +20,7 @@ fn get_max_from_min<'min, 'max, G>()
     // Previously OK, but now an error because traits are invariant:
 
     impls_get::<G,&'max i32>()
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn impls_get<G,T>() where G : Get<T> { }
diff --git a/src/test/ui/variance/variance-contravariant-arg-trait-match.nll.stderr b/src/test/ui/variance/variance-contravariant-arg-trait-match.stderr
index 6ca8f5ed4cc..df9d93907cf 100644
--- a/src/test/ui/variance/variance-contravariant-arg-trait-match.nll.stderr
+++ b/src/test/ui/variance/variance-contravariant-arg-trait-match.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/variance-contravariant-arg-trait-match.rs:17:5
+  --> $DIR/variance-contravariant-arg-trait-match.rs:13:5
    |
 LL | fn get_min_from_max<'min, 'max, G>()
    |                     ----  ---- lifetime `'max` defined here
@@ -12,7 +12,7 @@ LL |     impls_get::<G,&'min i32>()
    = help: consider adding the following bound: `'min: 'max`
 
 error: lifetime may not live long enough
-  --> $DIR/variance-contravariant-arg-trait-match.rs:27:5
+  --> $DIR/variance-contravariant-arg-trait-match.rs:22:5
    |
 LL | fn get_max_from_min<'min, 'max, G>()
    |                     ----  ---- lifetime `'max` defined here
diff --git a/src/test/ui/variance/variance-contravariant-self-trait-match.base.stderr b/src/test/ui/variance/variance-contravariant-self-trait-match.base.stderr
deleted file mode 100644
index 2ccab2ee5f0..00000000000
--- a/src/test/ui/variance/variance-contravariant-self-trait-match.base.stderr
+++ /dev/null
@@ -1,41 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/variance-contravariant-self-trait-match.rs:17:5
-   |
-LL |     impls_get::<&'min G>();
-   |     ^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
-   |
-   = note: expected type `<&'min G as Get>`
-              found type `<&'max G as Get>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-contravariant-self-trait-match.rs:14:21
-   |
-LL | fn get_min_from_max<'min, 'max, G>()
-   |                     ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-contravariant-self-trait-match.rs:14:27
-   |
-LL | fn get_min_from_max<'min, 'max, G>()
-   |                           ^^^^
-
-error[E0308]: mismatched types
-  --> $DIR/variance-contravariant-self-trait-match.rs:28:5
-   |
-LL |     impls_get::<&'max G>();
-   |     ^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
-   |
-   = note: expected type `<&'max G as Get>`
-              found type `<&'min G as Get>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-contravariant-self-trait-match.rs:22:21
-   |
-LL | fn get_max_from_min<'min, 'max, G>()
-   |                     ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-contravariant-self-trait-match.rs:22:27
-   |
-LL | fn get_max_from_min<'min, 'max, G>()
-   |                           ^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/variance/variance-contravariant-self-trait-match.rs b/src/test/ui/variance/variance-contravariant-self-trait-match.rs
index f8d7c68fafe..8a10554f30c 100644
--- a/src/test/ui/variance/variance-contravariant-self-trait-match.rs
+++ b/src/test/ui/variance/variance-contravariant-self-trait-match.rs
@@ -3,10 +3,6 @@
 // Test that even when `Self` is only used in contravariant position, it
 // is treated as invariant.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Get {
     fn get(&self);
 }
@@ -15,8 +11,7 @@ fn get_min_from_max<'min, 'max, G>()
     where 'max : 'min, G : 'max, &'max G : Get
 {
     impls_get::<&'min G>();
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn get_max_from_min<'min, 'max, G>()
@@ -26,8 +21,7 @@ fn get_max_from_min<'min, 'max, G>()
     // respect to all inputs.
 
     impls_get::<&'max G>();
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn impls_get<G>() where G : Get { }
diff --git a/src/test/ui/variance/variance-contravariant-self-trait-match.nll.stderr b/src/test/ui/variance/variance-contravariant-self-trait-match.stderr
index d2c549b1f71..bfea1b1b380 100644
--- a/src/test/ui/variance/variance-contravariant-self-trait-match.nll.stderr
+++ b/src/test/ui/variance/variance-contravariant-self-trait-match.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/variance-contravariant-self-trait-match.rs:17:5
+  --> $DIR/variance-contravariant-self-trait-match.rs:13:5
    |
 LL | fn get_min_from_max<'min, 'max, G>()
    |                     ----  ---- lifetime `'max` defined here
@@ -12,7 +12,7 @@ LL |     impls_get::<&'min G>();
    = help: consider adding the following bound: `'min: 'max`
 
 error: lifetime may not live long enough
-  --> $DIR/variance-contravariant-self-trait-match.rs:28:5
+  --> $DIR/variance-contravariant-self-trait-match.rs:23:5
    |
 LL | fn get_max_from_min<'min, 'max, G>()
    |                     ----  ---- lifetime `'max` defined here
diff --git a/src/test/ui/variance/variance-covariant-arg-object.base.stderr b/src/test/ui/variance/variance-covariant-arg-object.base.stderr
deleted file mode 100644
index 3a97875fe0e..00000000000
--- a/src/test/ui/variance/variance-covariant-arg-object.base.stderr
+++ /dev/null
@@ -1,41 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/variance-covariant-arg-object.rs:19:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected trait object `dyn Get<&'min i32>`
-              found trait object `dyn Get<&'max i32>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-covariant-arg-object.rs:14:21
-   |
-LL | fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
-   |                     ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-covariant-arg-object.rs:14:27
-   |
-LL | fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
-   |                           ^^^^
-
-error[E0308]: mismatched types
-  --> $DIR/variance-covariant-arg-object.rs:28:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected trait object `dyn Get<&'max i32>`
-              found trait object `dyn Get<&'min i32>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-covariant-arg-object.rs:24:21
-   |
-LL | fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
-   |                     ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-covariant-arg-object.rs:24:27
-   |
-LL | fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
-   |                           ^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/variance/variance-covariant-arg-object.rs b/src/test/ui/variance/variance-covariant-arg-object.rs
index 20f74a3987e..129cf054a3c 100644
--- a/src/test/ui/variance/variance-covariant-arg-object.rs
+++ b/src/test/ui/variance/variance-covariant-arg-object.rs
@@ -3,10 +3,6 @@
 // Test that even when `T` is only used in covariant position, it
 // is treated as invariant.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Get<T> : 'static {
     fn get(&self) -> T;
 }
@@ -17,8 +13,7 @@ fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
 {
     // Previously OK, now an error as traits are invariant.
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
@@ -26,8 +21,7 @@ fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
     where 'max : 'min
 {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/variance/variance-covariant-arg-object.nll.stderr b/src/test/ui/variance/variance-covariant-arg-object.stderr
index 1b2ec61825f..f73418509ba 100644
--- a/src/test/ui/variance/variance-covariant-arg-object.nll.stderr
+++ b/src/test/ui/variance/variance-covariant-arg-object.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/variance-covariant-arg-object.rs:19:5
+  --> $DIR/variance-covariant-arg-object.rs:15:5
    |
 LL | fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
    |                     ----  ---- lifetime `'max` defined here
@@ -12,7 +12,7 @@ LL |     v
    = help: consider adding the following bound: `'min: 'max`
 
 error: lifetime may not live long enough
-  --> $DIR/variance-covariant-arg-object.rs:28:5
+  --> $DIR/variance-covariant-arg-object.rs:23:5
    |
 LL | fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
    |                     ----  ---- lifetime `'max` defined here
diff --git a/src/test/ui/variance/variance-covariant-arg-trait-match.base.stderr b/src/test/ui/variance/variance-covariant-arg-trait-match.base.stderr
deleted file mode 100644
index 1749a871230..00000000000
--- a/src/test/ui/variance/variance-covariant-arg-trait-match.base.stderr
+++ /dev/null
@@ -1,41 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/variance-covariant-arg-trait-match.rs:18:5
-   |
-LL |     impls_get::<G,&'min i32>()
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
-   |
-   = note: expected type `Get<&'min i32>`
-              found type `Get<&'max i32>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-covariant-arg-trait-match.rs:14:21
-   |
-LL | fn get_min_from_max<'min, 'max, G>()
-   |                     ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-covariant-arg-trait-match.rs:14:27
-   |
-LL | fn get_min_from_max<'min, 'max, G>()
-   |                           ^^^^
-
-error[E0308]: mismatched types
-  --> $DIR/variance-covariant-arg-trait-match.rs:26:5
-   |
-LL |     impls_get::<G,&'max i32>()
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
-   |
-   = note: expected type `Get<&'max i32>`
-              found type `Get<&'min i32>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-covariant-arg-trait-match.rs:23:21
-   |
-LL | fn get_max_from_min<'min, 'max, G>()
-   |                     ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-covariant-arg-trait-match.rs:23:27
-   |
-LL | fn get_max_from_min<'min, 'max, G>()
-   |                           ^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/variance/variance-covariant-arg-trait-match.rs b/src/test/ui/variance/variance-covariant-arg-trait-match.rs
index d3d66d3fc4b..68dd449d567 100644
--- a/src/test/ui/variance/variance-covariant-arg-trait-match.rs
+++ b/src/test/ui/variance/variance-covariant-arg-trait-match.rs
@@ -3,10 +3,6 @@
 // Test that even when `T` is only used in covariant position, it
 // is treated as invariant.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Get<T> {
     fn get(&self) -> T;
 }
@@ -16,16 +12,14 @@ fn get_min_from_max<'min, 'max, G>()
 {
     // Previously OK, now an error as traits are invariant.
     impls_get::<G,&'min i32>()
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn get_max_from_min<'min, 'max, G>()
     where 'max : 'min, G : Get<&'min i32>
 {
     impls_get::<G,&'max i32>()
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn impls_get<G,T>() where G : Get<T> { }
diff --git a/src/test/ui/variance/variance-invariant-arg-trait-match.nll.stderr b/src/test/ui/variance/variance-covariant-arg-trait-match.stderr
index 74d2745cbbe..4c7b6cf7ce9 100644
--- a/src/test/ui/variance/variance-invariant-arg-trait-match.nll.stderr
+++ b/src/test/ui/variance/variance-covariant-arg-trait-match.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/variance-invariant-arg-trait-match.rs:14:5
+  --> $DIR/variance-covariant-arg-trait-match.rs:14:5
    |
 LL | fn get_min_from_max<'min, 'max, G>()
    |                     ----  ---- lifetime `'max` defined here
@@ -12,7 +12,7 @@ LL |     impls_get::<G,&'min i32>()
    = help: consider adding the following bound: `'min: 'max`
 
 error: lifetime may not live long enough
-  --> $DIR/variance-invariant-arg-trait-match.rs:22:5
+  --> $DIR/variance-covariant-arg-trait-match.rs:21:5
    |
 LL | fn get_max_from_min<'min, 'max, G>()
    |                     ----  ---- lifetime `'max` defined here
diff --git a/src/test/ui/variance/variance-covariant-self-trait-match.base.stderr b/src/test/ui/variance/variance-covariant-self-trait-match.base.stderr
deleted file mode 100644
index 94afc010e21..00000000000
--- a/src/test/ui/variance/variance-covariant-self-trait-match.base.stderr
+++ /dev/null
@@ -1,41 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/variance-covariant-self-trait-match.rs:18:5
-   |
-LL |     impls_get::<&'min G>();
-   |     ^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
-   |
-   = note: expected type `<&'min G as Get>`
-              found type `<&'max G as Get>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-covariant-self-trait-match.rs:14:21
-   |
-LL | fn get_min_from_max<'min, 'max, G>()
-   |                     ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-covariant-self-trait-match.rs:14:27
-   |
-LL | fn get_min_from_max<'min, 'max, G>()
-   |                           ^^^^
-
-error[E0308]: mismatched types
-  --> $DIR/variance-covariant-self-trait-match.rs:26:5
-   |
-LL |     impls_get::<&'max G>();
-   |     ^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
-   |
-   = note: expected type `<&'max G as Get>`
-              found type `<&'min G as Get>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-covariant-self-trait-match.rs:23:21
-   |
-LL | fn get_max_from_min<'min, 'max, G>()
-   |                     ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-covariant-self-trait-match.rs:23:27
-   |
-LL | fn get_max_from_min<'min, 'max, G>()
-   |                           ^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/variance/variance-covariant-self-trait-match.rs b/src/test/ui/variance/variance-covariant-self-trait-match.rs
index ece450173ca..93c25e9808f 100644
--- a/src/test/ui/variance/variance-covariant-self-trait-match.rs
+++ b/src/test/ui/variance/variance-covariant-self-trait-match.rs
@@ -3,10 +3,6 @@
 // Test that even when `Self` is only used in covariant position, it
 // is treated as invariant.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Get {
     fn get() -> Self;
 }
@@ -16,16 +12,14 @@ fn get_min_from_max<'min, 'max, G>()
 {
     // Previously OK, now an error as traits are invariant.
     impls_get::<&'min G>();
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn get_max_from_min<'min, 'max, G>()
     where 'max : 'min, G : 'max, &'min G : Get
 {
     impls_get::<&'max G>();
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn impls_get<G>() where G : Get { }
diff --git a/src/test/ui/variance/variance-invariant-self-trait-match.nll.stderr b/src/test/ui/variance/variance-covariant-self-trait-match.stderr
index 9d16e89450d..9b7ba3b66b8 100644
--- a/src/test/ui/variance/variance-invariant-self-trait-match.nll.stderr
+++ b/src/test/ui/variance/variance-covariant-self-trait-match.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/variance-invariant-self-trait-match.rs:14:5
+  --> $DIR/variance-covariant-self-trait-match.rs:14:5
    |
 LL | fn get_min_from_max<'min, 'max, G>()
    |                     ----  ---- lifetime `'max` defined here
@@ -12,7 +12,7 @@ LL |     impls_get::<&'min G>();
    = help: consider adding the following bound: `'min: 'max`
 
 error: lifetime may not live long enough
-  --> $DIR/variance-invariant-self-trait-match.rs:22:5
+  --> $DIR/variance-covariant-self-trait-match.rs:21:5
    |
 LL | fn get_max_from_min<'min, 'max, G>()
    |                     ----  ---- lifetime `'max` defined here
diff --git a/src/test/ui/variance/variance-invariant-arg-object.base.stderr b/src/test/ui/variance/variance-invariant-arg-object.base.stderr
deleted file mode 100644
index ec9271e902f..00000000000
--- a/src/test/ui/variance/variance-invariant-arg-object.base.stderr
+++ /dev/null
@@ -1,41 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/variance-invariant-arg-object.rs:15:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected trait object `dyn Get<&'min i32>`
-              found trait object `dyn Get<&'max i32>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-invariant-arg-object.rs:11:21
-   |
-LL | fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
-   |                     ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-invariant-arg-object.rs:11:27
-   |
-LL | fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
-   |                           ^^^^
-
-error[E0308]: mismatched types
-  --> $DIR/variance-invariant-arg-object.rs:24:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected trait object `dyn Get<&'max i32>`
-              found trait object `dyn Get<&'min i32>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-invariant-arg-object.rs:20:21
-   |
-LL | fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
-   |                     ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-invariant-arg-object.rs:20:27
-   |
-LL | fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
-   |                           ^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/variance/variance-invariant-arg-object.rs b/src/test/ui/variance/variance-invariant-arg-object.rs
index cc8820fbac6..4a470cc646a 100644
--- a/src/test/ui/variance/variance-invariant-arg-object.rs
+++ b/src/test/ui/variance/variance-invariant-arg-object.rs
@@ -1,9 +1,5 @@
 #![allow(dead_code)]
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Get<T> : 'static {
     fn get(&self, t: T) -> T;
 }
@@ -13,8 +9,7 @@ fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
     where 'max : 'min
 {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
@@ -22,8 +17,7 @@ fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
     where 'max : 'min
 {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/variance/variance-invariant-arg-object.nll.stderr b/src/test/ui/variance/variance-invariant-arg-object.stderr
index 47364f42656..8acd5417de7 100644
--- a/src/test/ui/variance/variance-invariant-arg-object.nll.stderr
+++ b/src/test/ui/variance/variance-invariant-arg-object.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/variance-invariant-arg-object.rs:15:5
+  --> $DIR/variance-invariant-arg-object.rs:11:5
    |
 LL | fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
    |                     ----  ---- lifetime `'max` defined here
@@ -12,7 +12,7 @@ LL |     v
    = help: consider adding the following bound: `'min: 'max`
 
 error: lifetime may not live long enough
-  --> $DIR/variance-invariant-arg-object.rs:24:5
+  --> $DIR/variance-invariant-arg-object.rs:19:5
    |
 LL | fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
    |                     ----  ---- lifetime `'max` defined here
diff --git a/src/test/ui/variance/variance-invariant-arg-trait-match.base.stderr b/src/test/ui/variance/variance-invariant-arg-trait-match.base.stderr
deleted file mode 100644
index fe284682153..00000000000
--- a/src/test/ui/variance/variance-invariant-arg-trait-match.base.stderr
+++ /dev/null
@@ -1,41 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/variance-invariant-arg-trait-match.rs:14:5
-   |
-LL |     impls_get::<G,&'min i32>()
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
-   |
-   = note: expected type `Get<&'min i32>`
-              found type `Get<&'max i32>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-invariant-arg-trait-match.rs:11:21
-   |
-LL | fn get_min_from_max<'min, 'max, G>()
-   |                     ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-invariant-arg-trait-match.rs:11:27
-   |
-LL | fn get_min_from_max<'min, 'max, G>()
-   |                           ^^^^
-
-error[E0308]: mismatched types
-  --> $DIR/variance-invariant-arg-trait-match.rs:22:5
-   |
-LL |     impls_get::<G,&'max i32>()
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
-   |
-   = note: expected type `Get<&'max i32>`
-              found type `Get<&'min i32>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-invariant-arg-trait-match.rs:19:21
-   |
-LL | fn get_max_from_min<'min, 'max, G>()
-   |                     ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-invariant-arg-trait-match.rs:19:27
-   |
-LL | fn get_max_from_min<'min, 'max, G>()
-   |                           ^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/variance/variance-invariant-arg-trait-match.rs b/src/test/ui/variance/variance-invariant-arg-trait-match.rs
index 498dd574bb3..fbcc2438716 100644
--- a/src/test/ui/variance/variance-invariant-arg-trait-match.rs
+++ b/src/test/ui/variance/variance-invariant-arg-trait-match.rs
@@ -1,9 +1,5 @@
 #![allow(dead_code)]
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Get<T> {
     fn get(&self, t: T) -> T;
 }
@@ -12,16 +8,14 @@ fn get_min_from_max<'min, 'max, G>()
     where 'max : 'min, G : Get<&'max i32>
 {
     impls_get::<G,&'min i32>()
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn get_max_from_min<'min, 'max, G>()
     where 'max : 'min, G : Get<&'min i32>
 {
     impls_get::<G,&'max i32>()
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn impls_get<G,T>() where G : Get<T> { }
diff --git a/src/test/ui/variance/variance-covariant-arg-trait-match.nll.stderr b/src/test/ui/variance/variance-invariant-arg-trait-match.stderr
index 870af48b3e9..60ffdd02952 100644
--- a/src/test/ui/variance/variance-covariant-arg-trait-match.nll.stderr
+++ b/src/test/ui/variance/variance-invariant-arg-trait-match.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/variance-covariant-arg-trait-match.rs:18:5
+  --> $DIR/variance-invariant-arg-trait-match.rs:10:5
    |
 LL | fn get_min_from_max<'min, 'max, G>()
    |                     ----  ---- lifetime `'max` defined here
@@ -12,7 +12,7 @@ LL |     impls_get::<G,&'min i32>()
    = help: consider adding the following bound: `'min: 'max`
 
 error: lifetime may not live long enough
-  --> $DIR/variance-covariant-arg-trait-match.rs:26:5
+  --> $DIR/variance-invariant-arg-trait-match.rs:17:5
    |
 LL | fn get_max_from_min<'min, 'max, G>()
    |                     ----  ---- lifetime `'max` defined here
diff --git a/src/test/ui/variance/variance-invariant-self-trait-match.base.stderr b/src/test/ui/variance/variance-invariant-self-trait-match.base.stderr
deleted file mode 100644
index a2589f0ceee..00000000000
--- a/src/test/ui/variance/variance-invariant-self-trait-match.base.stderr
+++ /dev/null
@@ -1,41 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/variance-invariant-self-trait-match.rs:14:5
-   |
-LL |     impls_get::<&'min G>();
-   |     ^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
-   |
-   = note: expected type `<&'min G as Get>`
-              found type `<&'max G as Get>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-invariant-self-trait-match.rs:11:21
-   |
-LL | fn get_min_from_max<'min, 'max, G>()
-   |                     ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-invariant-self-trait-match.rs:11:27
-   |
-LL | fn get_min_from_max<'min, 'max, G>()
-   |                           ^^^^
-
-error[E0308]: mismatched types
-  --> $DIR/variance-invariant-self-trait-match.rs:22:5
-   |
-LL |     impls_get::<&'max G>();
-   |     ^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
-   |
-   = note: expected type `<&'max G as Get>`
-              found type `<&'min G as Get>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-invariant-self-trait-match.rs:19:21
-   |
-LL | fn get_max_from_min<'min, 'max, G>()
-   |                     ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-invariant-self-trait-match.rs:19:27
-   |
-LL | fn get_max_from_min<'min, 'max, G>()
-   |                           ^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/variance/variance-invariant-self-trait-match.rs b/src/test/ui/variance/variance-invariant-self-trait-match.rs
index 0f3176b14b4..95c4c24032c 100644
--- a/src/test/ui/variance/variance-invariant-self-trait-match.rs
+++ b/src/test/ui/variance/variance-invariant-self-trait-match.rs
@@ -1,9 +1,5 @@
 #![allow(dead_code)]
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Get {
     fn get(&self) -> Self;
 }
@@ -12,16 +8,14 @@ fn get_min_from_max<'min, 'max, G>()
     where 'max : 'min, &'max G : Get, G : 'max
 {
     impls_get::<&'min G>();
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn get_max_from_min<'min, 'max, G>()
     where 'max : 'min, &'min G : Get, G : 'min
 {
     impls_get::<&'max G>();
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn impls_get<G>() where G : Get { }
diff --git a/src/test/ui/variance/variance-covariant-self-trait-match.nll.stderr b/src/test/ui/variance/variance-invariant-self-trait-match.stderr
index 14da2d2a552..5b64bd0913a 100644
--- a/src/test/ui/variance/variance-covariant-self-trait-match.nll.stderr
+++ b/src/test/ui/variance/variance-invariant-self-trait-match.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/variance-covariant-self-trait-match.rs:18:5
+  --> $DIR/variance-invariant-self-trait-match.rs:10:5
    |
 LL | fn get_min_from_max<'min, 'max, G>()
    |                     ----  ---- lifetime `'max` defined here
@@ -12,7 +12,7 @@ LL |     impls_get::<&'min G>();
    = help: consider adding the following bound: `'min: 'max`
 
 error: lifetime may not live long enough
-  --> $DIR/variance-covariant-self-trait-match.rs:26:5
+  --> $DIR/variance-invariant-self-trait-match.rs:17:5
    |
 LL | fn get_max_from_min<'min, 'max, G>()
    |                     ----  ---- lifetime `'max` defined here
diff --git a/src/test/ui/variance/variance-trait-matching.base.stderr b/src/test/ui/variance/variance-trait-matching.base.stderr
deleted file mode 100644
index 8872620e38a..00000000000
--- a/src/test/ui/variance/variance-trait-matching.base.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0621]: explicit lifetime required in the type of `get`
-  --> $DIR/variance-trait-matching.rs:28:5
-   |
-LL | fn get<'a, G>(get: &G) -> i32
-   |                    -- help: add explicit lifetime `'a` to the type of `get`: `&'a G`
-...
-LL |     pick(get, &22)
-   |     ^^^^ lifetime `'a` required
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0621`.
diff --git a/src/test/ui/variance/variance-trait-matching.rs b/src/test/ui/variance/variance-trait-matching.rs
index 993db93533e..b4efee7d604 100644
--- a/src/test/ui/variance/variance-trait-matching.rs
+++ b/src/test/ui/variance/variance-trait-matching.rs
@@ -1,9 +1,5 @@
 #![allow(dead_code)]
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 // Get<T> is covariant in T
 trait Get<T> {
     fn get(&self) -> T;
diff --git a/src/test/ui/variance/variance-trait-matching.nll.stderr b/src/test/ui/variance/variance-trait-matching.stderr
index 52c5eed3167..3308cc6d250 100644
--- a/src/test/ui/variance/variance-trait-matching.nll.stderr
+++ b/src/test/ui/variance/variance-trait-matching.stderr
@@ -1,5 +1,5 @@
 error[E0621]: explicit lifetime required in the type of `get`
-  --> $DIR/variance-trait-matching.rs:28:5
+  --> $DIR/variance-trait-matching.rs:24:5
    |
 LL | fn get<'a, G>(get: &G) -> i32
    |                    -- help: add explicit lifetime `'a` to the type of `get`: `&'a G`
diff --git a/src/test/ui/variance/variance-use-contravariant-struct-1.base.stderr b/src/test/ui/variance/variance-use-contravariant-struct-1.base.stderr
deleted file mode 100644
index a354aa52b5c..00000000000
--- a/src/test/ui/variance/variance-use-contravariant-struct-1.base.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/variance-use-contravariant-struct-1.rs:14:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected struct `SomeStruct<&'min ()>`
-              found struct `SomeStruct<&'max ()>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-use-contravariant-struct-1.rs:10:8
-   |
-LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>)
-   |        ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-use-contravariant-struct-1.rs:10:13
-   |
-LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>)
-   |             ^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/variance/variance-use-contravariant-struct-1.rs b/src/test/ui/variance/variance-use-contravariant-struct-1.rs
index b55f5e76775..7f59067483b 100644
--- a/src/test/ui/variance/variance-use-contravariant-struct-1.rs
+++ b/src/test/ui/variance/variance-use-contravariant-struct-1.rs
@@ -1,10 +1,6 @@
 // Test various uses of structs with distint variances to make sure
 // they permit lifetimes to be approximated as expected.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct SomeStruct<T>(fn(T));
 
 fn foo<'min,'max>(v: SomeStruct<&'max ()>)
@@ -12,8 +8,7 @@ fn foo<'min,'max>(v: SomeStruct<&'max ()>)
     where 'max : 'min
 {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 
diff --git a/src/test/ui/variance/variance-use-contravariant-struct-1.nll.stderr b/src/test/ui/variance/variance-use-contravariant-struct-1.stderr
index 9549a8c08af..50de7c90f13 100644
--- a/src/test/ui/variance/variance-use-contravariant-struct-1.nll.stderr
+++ b/src/test/ui/variance/variance-use-contravariant-struct-1.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/variance-use-contravariant-struct-1.rs:14:5
+  --> $DIR/variance-use-contravariant-struct-1.rs:10:5
    |
 LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>)
    |        ---- ---- lifetime `'max` defined here
diff --git a/src/test/ui/variance/variance-use-covariant-struct-1.base.stderr b/src/test/ui/variance/variance-use-covariant-struct-1.base.stderr
deleted file mode 100644
index 542d44c2709..00000000000
--- a/src/test/ui/variance/variance-use-covariant-struct-1.base.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/variance-use-covariant-struct-1.rs:14:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected struct `SomeStruct<&'max ()>`
-              found struct `SomeStruct<&'min ()>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-use-covariant-struct-1.rs:10:8
-   |
-LL | fn foo<'min,'max>(v: SomeStruct<&'min ()>)
-   |        ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-use-covariant-struct-1.rs:10:13
-   |
-LL | fn foo<'min,'max>(v: SomeStruct<&'min ()>)
-   |             ^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/variance/variance-use-covariant-struct-1.rs b/src/test/ui/variance/variance-use-covariant-struct-1.rs
index 3e3e76d9792..f0fd7b26e4e 100644
--- a/src/test/ui/variance/variance-use-covariant-struct-1.rs
+++ b/src/test/ui/variance/variance-use-covariant-struct-1.rs
@@ -1,10 +1,6 @@
 // Test that a covariant struct does not permit the lifetime of a
 // reference to be enlarged.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct SomeStruct<T>(T);
 
 fn foo<'min,'max>(v: SomeStruct<&'min ()>)
@@ -12,8 +8,7 @@ fn foo<'min,'max>(v: SomeStruct<&'min ()>)
     where 'max : 'min
 {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/ui/variance/variance-use-covariant-struct-1.nll.stderr b/src/test/ui/variance/variance-use-covariant-struct-1.stderr
index 2fac827a0fb..bab858c5acb 100644
--- a/src/test/ui/variance/variance-use-covariant-struct-1.nll.stderr
+++ b/src/test/ui/variance/variance-use-covariant-struct-1.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/variance-use-covariant-struct-1.rs:14:5
+  --> $DIR/variance-use-covariant-struct-1.rs:10:5
    |
 LL | fn foo<'min,'max>(v: SomeStruct<&'min ()>)
    |        ---- ---- lifetime `'max` defined here
diff --git a/src/test/ui/variance/variance-use-invariant-struct-1.base.stderr b/src/test/ui/variance/variance-use-invariant-struct-1.base.stderr
deleted file mode 100644
index 02b4e91f781..00000000000
--- a/src/test/ui/variance/variance-use-invariant-struct-1.base.stderr
+++ /dev/null
@@ -1,41 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/variance-use-invariant-struct-1.rs:14:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected struct `SomeStruct<&'min ()>`
-              found struct `SomeStruct<&'max ()>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-use-invariant-struct-1.rs:10:8
-   |
-LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>)
-   |        ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-use-invariant-struct-1.rs:10:13
-   |
-LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>)
-   |             ^^^^
-
-error[E0308]: mismatched types
-  --> $DIR/variance-use-invariant-struct-1.rs:23:5
-   |
-LL |     v
-   |     ^ lifetime mismatch
-   |
-   = note: expected struct `SomeStruct<&'max ()>`
-              found struct `SomeStruct<&'min ()>`
-note: the lifetime `'min` as defined here...
-  --> $DIR/variance-use-invariant-struct-1.rs:19:8
-   |
-LL | fn bar<'min,'max>(v: SomeStruct<&'min ()>)
-   |        ^^^^
-note: ...does not necessarily outlive the lifetime `'max` as defined here
-  --> $DIR/variance-use-invariant-struct-1.rs:19:13
-   |
-LL | fn bar<'min,'max>(v: SomeStruct<&'min ()>)
-   |             ^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/variance/variance-use-invariant-struct-1.rs b/src/test/ui/variance/variance-use-invariant-struct-1.rs
index 7be03514e01..d40dbceb5f8 100644
--- a/src/test/ui/variance/variance-use-invariant-struct-1.rs
+++ b/src/test/ui/variance/variance-use-invariant-struct-1.rs
@@ -1,10 +1,6 @@
 // Test various uses of structs with distint variances to make sure
 // they permit lifetimes to be approximated as expected.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 struct SomeStruct<T>(*mut T);
 
 fn foo<'min,'max>(v: SomeStruct<&'max ()>)
@@ -12,8 +8,7 @@ fn foo<'min,'max>(v: SomeStruct<&'max ()>)
     where 'max : 'min
 {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn bar<'min,'max>(v: SomeStruct<&'min ()>)
@@ -21,8 +16,7 @@ fn bar<'min,'max>(v: SomeStruct<&'min ()>)
     where 'max : 'min
 {
     v
-    //[base]~^ ERROR mismatched types
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 
diff --git a/src/test/ui/variance/variance-use-invariant-struct-1.nll.stderr b/src/test/ui/variance/variance-use-invariant-struct-1.stderr
index e8460a388fc..b9ca6e7d596 100644
--- a/src/test/ui/variance/variance-use-invariant-struct-1.nll.stderr
+++ b/src/test/ui/variance/variance-use-invariant-struct-1.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/variance-use-invariant-struct-1.rs:14:5
+  --> $DIR/variance-use-invariant-struct-1.rs:10:5
    |
 LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>)
    |        ---- ---- lifetime `'max` defined here
@@ -15,7 +15,7 @@ LL |     v
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/variance-use-invariant-struct-1.rs:23:5
+  --> $DIR/variance-use-invariant-struct-1.rs:18:5
    |
 LL | fn bar<'min,'max>(v: SomeStruct<&'min ()>)
    |        ---- ---- lifetime `'max` defined here
diff --git a/src/test/ui/wf/wf-static-method.base.stderr b/src/test/ui/wf/wf-static-method.base.stderr
deleted file mode 100644
index 186ab2790a3..00000000000
--- a/src/test/ui/wf/wf-static-method.base.stderr
+++ /dev/null
@@ -1,136 +0,0 @@
-error[E0312]: lifetime of reference outlives lifetime of borrowed content...
-  --> $DIR/wf-static-method.rs:21:9
-   |
-LL |         u
-   |         ^
-   |
-note: ...the reference is valid for the lifetime `'a` as defined here...
-  --> $DIR/wf-static-method.rs:18:6
-   |
-LL | impl<'a, 'b> Foo<'a, 'b, Evil<'a, 'b>> for () {
-   |      ^^
-note: ...but the borrowed content is only valid for the lifetime `'b` as defined here
-  --> $DIR/wf-static-method.rs:18:10
-   |
-LL | impl<'a, 'b> Foo<'a, 'b, Evil<'a, 'b>> for () {
-   |          ^^
-
-error[E0478]: lifetime bound not satisfied
-  --> $DIR/wf-static-method.rs:32:18
-   |
-LL |         let me = Self::make_me();
-   |                  ^^^^
-   |
-note: lifetime parameter instantiated with the lifetime `'b` as defined here
-  --> $DIR/wf-static-method.rs:29:10
-   |
-LL | impl<'a, 'b> Foo<'a, 'b, ()> for IndirectEvil<'a, 'b> {
-   |          ^^
-note: but lifetime parameter must outlive the lifetime `'a` as defined here
-  --> $DIR/wf-static-method.rs:29:6
-   |
-LL | impl<'a, 'b> Foo<'a, 'b, ()> for IndirectEvil<'a, 'b> {
-   |      ^^
-
-error[E0312]: lifetime of reference outlives lifetime of borrowed content...
-  --> $DIR/wf-static-method.rs:41:9
-   |
-LL |         u
-   |         ^
-   |
-note: ...the reference is valid for the lifetime `'a` as defined here...
-  --> $DIR/wf-static-method.rs:39:6
-   |
-LL | impl<'a, 'b> Evil<'a, 'b> {
-   |      ^^
-note: ...but the borrowed content is only valid for the lifetime `'b` as defined here
-  --> $DIR/wf-static-method.rs:39:10
-   |
-LL | impl<'a, 'b> Evil<'a, 'b> {
-   |          ^^
-
-error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` due to conflicting requirements
-  --> $DIR/wf-static-method.rs:51:5
-   |
-LL |     <()>::static_evil(b)
-   |     ^^^^^^^^^^^^^^^^^
-   |
-note: first, the lifetime cannot outlive the lifetime `'b` as defined here...
-  --> $DIR/wf-static-method.rs:50:13
-   |
-LL | fn evil<'a, 'b>(b: &'b u32) -> &'a u32 {
-   |             ^^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/wf-static-method.rs:51:23
-   |
-LL |     <()>::static_evil(b)
-   |                       ^
-note: but, the lifetime must be valid for the lifetime `'a` as defined here...
-  --> $DIR/wf-static-method.rs:50:9
-   |
-LL | fn evil<'a, 'b>(b: &'b u32) -> &'a u32 {
-   |         ^^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/wf-static-method.rs:51:5
-   |
-LL |     <()>::static_evil(b)
-   |     ^^^^^^^^^^^^^^^^^^^^
-
-error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` due to conflicting requirements
-  --> $DIR/wf-static-method.rs:57:5
-   |
-LL |     <IndirectEvil>::static_evil(b)
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: first, the lifetime cannot outlive the lifetime `'b` as defined here...
-  --> $DIR/wf-static-method.rs:56:22
-   |
-LL | fn indirect_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
-   |                      ^^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/wf-static-method.rs:57:33
-   |
-LL |     <IndirectEvil>::static_evil(b)
-   |                                 ^
-note: but, the lifetime must be valid for the lifetime `'a` as defined here...
-  --> $DIR/wf-static-method.rs:56:18
-   |
-LL | fn indirect_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
-   |                  ^^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/wf-static-method.rs:57:5
-   |
-LL |     <IndirectEvil>::static_evil(b)
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` due to conflicting requirements
-  --> $DIR/wf-static-method.rs:63:5
-   |
-LL |     <Evil>::inherent_evil(b)
-   |     ^^^^^^^^^^^^^^^^^^^^^
-   |
-note: first, the lifetime cannot outlive the lifetime `'b` as defined here...
-  --> $DIR/wf-static-method.rs:62:22
-   |
-LL | fn inherent_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
-   |                      ^^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/wf-static-method.rs:63:27
-   |
-LL |     <Evil>::inherent_evil(b)
-   |                           ^
-note: but, the lifetime must be valid for the lifetime `'a` as defined here...
-  --> $DIR/wf-static-method.rs:62:18
-   |
-LL | fn inherent_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
-   |                  ^^
-note: ...so that reference does not outlive borrowed content
-  --> $DIR/wf-static-method.rs:63:5
-   |
-LL |     <Evil>::inherent_evil(b)
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 6 previous errors
-
-Some errors have detailed explanations: E0312, E0478, E0495.
-For more information about an error, try `rustc --explain E0312`.
diff --git a/src/test/ui/wf/wf-static-method.rs b/src/test/ui/wf/wf-static-method.rs
index 83557ce667b..7ff195230bf 100644
--- a/src/test/ui/wf/wf-static-method.rs
+++ b/src/test/ui/wf/wf-static-method.rs
@@ -4,10 +4,6 @@
 // static inherent methods isn't quite working - need to
 // fix that before removing the check.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 trait Foo<'a, 'b, T>: Sized {
     fn make_me() -> Self { loop {} }
     fn static_evil(u: &'b u32) -> &'a u32;
@@ -19,8 +15,7 @@ impl<'a, 'b> Foo<'a, 'b, Evil<'a, 'b>> for () {
     fn make_me() -> Self { }
     fn static_evil(u: &'b u32) -> &'a u32 {
         u
-        //[base]~^ ERROR E0312
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
@@ -30,8 +25,7 @@ impl<'a, 'b> Foo<'a, 'b, ()> for IndirectEvil<'a, 'b> {
     fn make_me() -> Self { IndirectEvil(None) }
     fn static_evil(u: &'b u32) -> &'a u32 {
         let me = Self::make_me();
-        //[base]~^ ERROR lifetime bound not satisfied
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
         loop {} // (`me` could be used for the lifetime transmute).
     }
 }
@@ -39,8 +33,7 @@ impl<'a, 'b> Foo<'a, 'b, ()> for IndirectEvil<'a, 'b> {
 impl<'a, 'b> Evil<'a, 'b> {
     fn inherent_evil(u: &'b u32) -> &'a u32 {
         u
-        //[base]~^ ERROR E0312
-        //[nll]~^^ ERROR lifetime may not live long enough
+        //~^ ERROR lifetime may not live long enough
     }
 }
 
@@ -49,20 +42,17 @@ impl<'a, 'b> Evil<'a, 'b> {
 
 fn evil<'a, 'b>(b: &'b u32) -> &'a u32 {
     <()>::static_evil(b)
-    //[base]~^ ERROR cannot infer an appropriate lifetime
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn indirect_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
     <IndirectEvil>::static_evil(b)
-    //[base]~^ ERROR cannot infer an appropriate lifetime
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 fn inherent_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
     <Evil>::inherent_evil(b)
-    //[base]~^ ERROR cannot infer an appropriate lifetime
-    //[nll]~^^ ERROR lifetime may not live long enough
+    //~^ ERROR lifetime may not live long enough
 }
 
 
diff --git a/src/test/ui/wf/wf-static-method.nll.stderr b/src/test/ui/wf/wf-static-method.stderr
index 7556d8e694d..161609a5f86 100644
--- a/src/test/ui/wf/wf-static-method.nll.stderr
+++ b/src/test/ui/wf/wf-static-method.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/wf-static-method.rs:21:9
+  --> $DIR/wf-static-method.rs:17:9
    |
 LL | impl<'a, 'b> Foo<'a, 'b, Evil<'a, 'b>> for () {
    |      --  -- lifetime `'b` defined here
@@ -12,7 +12,7 @@ LL |         u
    = help: consider adding the following bound: `'b: 'a`
 
 error: lifetime may not live long enough
-  --> $DIR/wf-static-method.rs:32:18
+  --> $DIR/wf-static-method.rs:27:18
    |
 LL | impl<'a, 'b> Foo<'a, 'b, ()> for IndirectEvil<'a, 'b> {
    |      --  -- lifetime `'b` defined here
@@ -25,7 +25,7 @@ LL |         let me = Self::make_me();
    = help: consider adding the following bound: `'b: 'a`
 
 error: lifetime may not live long enough
-  --> $DIR/wf-static-method.rs:41:9
+  --> $DIR/wf-static-method.rs:35:9
    |
 LL | impl<'a, 'b> Evil<'a, 'b> {
    |      --  -- lifetime `'b` defined here
@@ -38,7 +38,7 @@ LL |         u
    = help: consider adding the following bound: `'b: 'a`
 
 error: lifetime may not live long enough
-  --> $DIR/wf-static-method.rs:51:5
+  --> $DIR/wf-static-method.rs:44:5
    |
 LL | fn evil<'a, 'b>(b: &'b u32) -> &'a u32 {
    |         --  -- lifetime `'b` defined here
@@ -50,7 +50,7 @@ LL |     <()>::static_evil(b)
    = help: consider adding the following bound: `'b: 'a`
 
 error: lifetime may not live long enough
-  --> $DIR/wf-static-method.rs:57:5
+  --> $DIR/wf-static-method.rs:49:5
    |
 LL | fn indirect_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
    |                  --  -- lifetime `'b` defined here
@@ -62,7 +62,7 @@ LL |     <IndirectEvil>::static_evil(b)
    = help: consider adding the following bound: `'b: 'a`
 
 error: lifetime may not live long enough
-  --> $DIR/wf-static-method.rs:63:5
+  --> $DIR/wf-static-method.rs:54:5
    |
 LL | fn inherent_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
    |                  --  -- lifetime `'b` defined here
diff --git a/src/test/ui/where-clauses/where-for-self-2.base.stderr b/src/test/ui/where-clauses/where-for-self-2.base.stderr
deleted file mode 100644
index c09610cd696..00000000000
--- a/src/test/ui/where-clauses/where-for-self-2.base.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: implementation of `Bar` is not general enough
-  --> $DIR/where-for-self-2.rs:27:5
-   |
-LL |     foo(&X);
-   |     ^^^ implementation of `Bar` is not general enough
-   |
-   = note: `&'0 u32` must implement `Bar`, for any lifetime `'0`...
-   = note: ...but `Bar` is actually implemented for the type `&'static u32`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/where-clauses/where-for-self-2.rs b/src/test/ui/where-clauses/where-for-self-2.rs
index 4e4e0ec912e..37c6954fd52 100644
--- a/src/test/ui/where-clauses/where-for-self-2.rs
+++ b/src/test/ui/where-clauses/where-for-self-2.rs
@@ -3,10 +3,6 @@
 // specific lifetime is not enough to satisfy the `for<'a> ...` constraint, which
 // should require *all* lifetimes.
 
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
 static X: &'static u32 = &42;
 
 trait Bar {
diff --git a/src/test/ui/where-clauses/where-for-self-2.nll.stderr b/src/test/ui/where-clauses/where-for-self-2.stderr
index 92d1b2121a6..f65db78fc89 100644
--- a/src/test/ui/where-clauses/where-for-self-2.nll.stderr
+++ b/src/test/ui/where-clauses/where-for-self-2.stderr
@@ -1,5 +1,5 @@
 error: implementation of `Bar` is not general enough
-  --> $DIR/where-for-self-2.rs:27:5
+  --> $DIR/where-for-self-2.rs:23:5
    |
 LL |     foo(&X);
    |     ^^^^^^^ implementation of `Bar` is not general enough
diff --git a/src/tools/clippy/CHANGELOG.md b/src/tools/clippy/CHANGELOG.md
index 10ef00fcbaf..6ef338b819d 100644
--- a/src/tools/clippy/CHANGELOG.md
+++ b/src/tools/clippy/CHANGELOG.md
@@ -3276,9 +3276,11 @@ Released 2018-09-13
 <!-- begin autogenerated links to lint list -->
 [`absurd_extreme_comparisons`]: https://rust-lang.github.io/rust-clippy/master/index.html#absurd_extreme_comparisons
 [`allow_attributes_without_reason`]: https://rust-lang.github.io/rust-clippy/master/index.html#allow_attributes_without_reason
+[`almost_complete_letter_range`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_complete_letter_range
 [`almost_swapped`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_swapped
 [`approx_constant`]: https://rust-lang.github.io/rust-clippy/master/index.html#approx_constant
 [`as_conversions`]: https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
+[`as_underscore`]: https://rust-lang.github.io/rust-clippy/master/index.html#as_underscore
 [`assertions_on_constants`]: https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants
 [`assign_op_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern
 [`assign_ops`]: https://rust-lang.github.io/rust-clippy/master/index.html#assign_ops
@@ -3296,6 +3298,7 @@ Released 2018-09-13
 [`bool_assert_comparison`]: https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison
 [`bool_comparison`]: https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison
 [`borrow_as_ptr`]: https://rust-lang.github.io/rust-clippy/master/index.html#borrow_as_ptr
+[`borrow_deref_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref
 [`borrow_interior_mutable_const`]: https://rust-lang.github.io/rust-clippy/master/index.html#borrow_interior_mutable_const
 [`borrowed_box`]: https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box
 [`box_collection`]: https://rust-lang.github.io/rust-clippy/master/index.html#box_collection
@@ -3362,6 +3365,7 @@ Released 2018-09-13
 [`disallowed_type`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_type
 [`disallowed_types`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_types
 [`diverging_sub_expression`]: https://rust-lang.github.io/rust-clippy/master/index.html#diverging_sub_expression
+[`doc_link_with_quotes`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_link_with_quotes
 [`doc_markdown`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
 [`double_comparisons`]: https://rust-lang.github.io/rust-clippy/master/index.html#double_comparisons
 [`double_must_use`]: https://rust-lang.github.io/rust-clippy/master/index.html#double_must_use
@@ -3435,6 +3439,7 @@ Released 2018-09-13
 [`from_over_into`]: https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
 [`from_str_radix_10`]: https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10
 [`future_not_send`]: https://rust-lang.github.io/rust-clippy/master/index.html#future_not_send
+[`get_first`]: https://rust-lang.github.io/rust-clippy/master/index.html#get_first
 [`get_last_with_len`]: https://rust-lang.github.io/rust-clippy/master/index.html#get_last_with_len
 [`get_unwrap`]: https://rust-lang.github.io/rust-clippy/master/index.html#get_unwrap
 [`identity_conversion`]: https://rust-lang.github.io/rust-clippy/master/index.html#identity_conversion
@@ -3556,6 +3561,7 @@ Released 2018-09-13
 [`min_max`]: https://rust-lang.github.io/rust-clippy/master/index.html#min_max
 [`misaligned_transmute`]: https://rust-lang.github.io/rust-clippy/master/index.html#misaligned_transmute
 [`mismatched_target_os`]: https://rust-lang.github.io/rust-clippy/master/index.html#mismatched_target_os
+[`mismatching_type_param_order`]: https://rust-lang.github.io/rust-clippy/master/index.html#mismatching_type_param_order
 [`misrefactored_assign_op`]: https://rust-lang.github.io/rust-clippy/master/index.html#misrefactored_assign_op
 [`missing_const_for_fn`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
 [`missing_docs_in_private_items`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
@@ -3613,6 +3619,7 @@ Released 2018-09-13
 [`new_without_default`]: https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
 [`new_without_default_derive`]: https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default_derive
 [`no_effect`]: https://rust-lang.github.io/rust-clippy/master/index.html#no_effect
+[`no_effect_replace`]: https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace
 [`no_effect_underscore_binding`]: https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_underscore_binding
 [`non_ascii_literal`]: https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
 [`non_octal_unix_permissions`]: https://rust-lang.github.io/rust-clippy/master/index.html#non_octal_unix_permissions
@@ -3729,7 +3736,6 @@ Released 2018-09-13
 [`skip_while_next`]: https://rust-lang.github.io/rust-clippy/master/index.html#skip_while_next
 [`slow_vector_initialization`]: https://rust-lang.github.io/rust-clippy/master/index.html#slow_vector_initialization
 [`stable_sort_primitive`]: https://rust-lang.github.io/rust-clippy/master/index.html#stable_sort_primitive
-[`significant_drop_in_scrutinee`]: https://rust-lang.github.io/rust-clippy/master/index.html#significant_drop_in_scrutinee
 [`str_to_string`]: https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
 [`string_add`]: https://rust-lang.github.io/rust-clippy/master/index.html#string_add
 [`string_add_assign`]: https://rust-lang.github.io/rust-clippy/master/index.html#string_add_assign
@@ -3750,6 +3756,7 @@ Released 2018-09-13
 [`suspicious_operation_groupings`]: https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_operation_groupings
 [`suspicious_splitn`]: https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_splitn
 [`suspicious_unary_op_formatting`]: https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_unary_op_formatting
+[`swap_ptr_to_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#swap_ptr_to_ref
 [`tabs_in_doc_comments`]: https://rust-lang.github.io/rust-clippy/master/index.html#tabs_in_doc_comments
 [`temporary_assignment`]: https://rust-lang.github.io/rust-clippy/master/index.html#temporary_assignment
 [`temporary_cstring_as_ptr`]: https://rust-lang.github.io/rust-clippy/master/index.html#temporary_cstring_as_ptr
@@ -3820,6 +3827,7 @@ Released 2018-09-13
 [`unused_collect`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_collect
 [`unused_io_amount`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_io_amount
 [`unused_label`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_label
+[`unused_rounding`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_rounding
 [`unused_self`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_self
 [`unused_unit`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
 [`unusual_byte_groupings`]: https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings
diff --git a/src/tools/clippy/Cargo.toml b/src/tools/clippy/Cargo.toml
index 373e720b0d5..3c8b758d53d 100644
--- a/src/tools/clippy/Cargo.toml
+++ b/src/tools/clippy/Cargo.toml
@@ -28,7 +28,7 @@ tempfile = { version = "3.2", optional = true }
 termize = "0.1"
 
 [dev-dependencies]
-compiletest_rs = { version = "0.7.1", features = ["tmp"] }
+compiletest_rs = { version = "0.8", features = ["tmp"] }
 tester = "0.9"
 regex = "1.5"
 # This is used by the `collect-metadata` alias.
@@ -48,7 +48,7 @@ quote = "1.0"
 serde = { version = "1.0.125", features = ["derive"] }
 syn = { version = "1.0", features = ["full"] }
 futures = "0.3"
-parking_lot = "0.11.2"
+parking_lot = "0.12"
 tokio = { version = "1", features = ["io-util"] }
 rustc-semver = "1.1"
 
diff --git a/src/tools/clippy/clippy_dev/Cargo.toml b/src/tools/clippy/clippy_dev/Cargo.toml
index 2cfbcea5034..b0d470a2124 100644
--- a/src/tools/clippy/clippy_dev/Cargo.toml
+++ b/src/tools/clippy/clippy_dev/Cargo.toml
@@ -5,7 +5,7 @@ edition = "2021"
 
 [dependencies]
 aho-corasick = "0.7"
-clap = "2.33"
+clap = "3.1"
 indoc = "1.0"
 itertools = "0.10.1"
 opener = "0.5"
diff --git a/src/tools/clippy/clippy_dev/src/main.rs b/src/tools/clippy/clippy_dev/src/main.rs
index d5cd7ca96c0..ee535b1d3be 100644
--- a/src/tools/clippy/clippy_dev/src/main.rs
+++ b/src/tools/clippy/clippy_dev/src/main.rs
@@ -2,20 +2,20 @@
 // warn on lints, that are included in `rust-lang/rust`s bootstrap
 #![warn(rust_2018_idioms, unused_lifetimes)]
 
-use clap::{App, AppSettings, Arg, ArgMatches, SubCommand};
+use clap::{Arg, ArgMatches, Command};
 use clippy_dev::{bless, fmt, lint, new_lint, serve, setup, update_lints};
 use indoc::indoc;
 fn main() {
     let matches = get_clap_config();
 
     match matches.subcommand() {
-        ("bless", Some(matches)) => {
+        Some(("bless", matches)) => {
             bless::bless(matches.is_present("ignore-timestamp"));
         },
-        ("fmt", Some(matches)) => {
+        Some(("fmt", matches)) => {
             fmt::run(matches.is_present("check"), matches.is_present("verbose"));
         },
-        ("update_lints", Some(matches)) => {
+        Some(("update_lints", matches)) => {
             if matches.is_present("print-only") {
                 update_lints::print_lints();
             } else if matches.is_present("check") {
@@ -24,7 +24,7 @@ fn main() {
                 update_lints::update(update_lints::UpdateMode::Change);
             }
         },
-        ("new_lint", Some(matches)) => {
+        Some(("new_lint", matches)) => {
             match new_lint::create(
                 matches.value_of("pass"),
                 matches.value_of("name"),
@@ -35,8 +35,8 @@ fn main() {
                 Err(e) => eprintln!("Unable to create lint: {}", e),
             }
         },
-        ("setup", Some(sub_command)) => match sub_command.subcommand() {
-            ("intellij", Some(matches)) => {
+        Some(("setup", sub_command)) => match sub_command.subcommand() {
+            Some(("intellij", matches)) => {
                 if matches.is_present("remove") {
                     setup::intellij::remove_rustc_src();
                 } else {
@@ -47,14 +47,14 @@ fn main() {
                     );
                 }
             },
-            ("git-hook", Some(matches)) => {
+            Some(("git-hook", matches)) => {
                 if matches.is_present("remove") {
                     setup::git_hook::remove_hook();
                 } else {
                     setup::git_hook::install_hook(matches.is_present("force-override"));
                 }
             },
-            ("vscode-tasks", Some(matches)) => {
+            Some(("vscode-tasks", matches)) => {
                 if matches.is_present("remove") {
                     setup::vscode::remove_tasks();
                 } else {
@@ -63,23 +63,23 @@ fn main() {
             },
             _ => {},
         },
-        ("remove", Some(sub_command)) => match sub_command.subcommand() {
-            ("git-hook", Some(_)) => setup::git_hook::remove_hook(),
-            ("intellij", Some(_)) => setup::intellij::remove_rustc_src(),
-            ("vscode-tasks", Some(_)) => setup::vscode::remove_tasks(),
+        Some(("remove", sub_command)) => match sub_command.subcommand() {
+            Some(("git-hook", _)) => setup::git_hook::remove_hook(),
+            Some(("intellij", _)) => setup::intellij::remove_rustc_src(),
+            Some(("vscode-tasks", _)) => setup::vscode::remove_tasks(),
             _ => {},
         },
-        ("serve", Some(matches)) => {
+        Some(("serve", matches)) => {
             let port = matches.value_of("port").unwrap().parse().unwrap();
             let lint = matches.value_of("lint");
             serve::run(port, lint);
         },
-        ("lint", Some(matches)) => {
+        Some(("lint", matches)) => {
             let path = matches.value_of("path").unwrap();
             let args = matches.values_of("args").into_iter().flatten();
             lint::run(path, args);
         },
-        ("rename_lint", Some(matches)) => {
+        Some(("rename_lint", matches)) => {
             let old_name = matches.value_of("old_name").unwrap();
             let new_name = matches.value_of("new_name").unwrap_or(old_name);
             let uplift = matches.is_present("uplift");
@@ -89,35 +89,24 @@ fn main() {
     }
 }
 
-fn get_clap_config<'a>() -> ArgMatches<'a> {
-    App::new("Clippy developer tooling")
-        .setting(AppSettings::ArgRequiredElseHelp)
+fn get_clap_config() -> ArgMatches {
+    Command::new("Clippy developer tooling")
+        .arg_required_else_help(true)
         .subcommand(
-            SubCommand::with_name("bless")
-                .about("bless the test output changes")
-                .arg(
-                    Arg::with_name("ignore-timestamp")
-                        .long("ignore-timestamp")
-                        .help("Include files updated before clippy was built"),
-                ),
+            Command::new("bless").about("bless the test output changes").arg(
+                Arg::new("ignore-timestamp")
+                    .long("ignore-timestamp")
+                    .help("Include files updated before clippy was built"),
+            ),
         )
         .subcommand(
-            SubCommand::with_name("fmt")
+            Command::new("fmt")
                 .about("Run rustfmt on all projects and tests")
-                .arg(
-                    Arg::with_name("check")
-                        .long("check")
-                        .help("Use the rustfmt --check option"),
-                )
-                .arg(
-                    Arg::with_name("verbose")
-                        .short("v")
-                        .long("verbose")
-                        .help("Echo commands run"),
-                ),
+                .arg(Arg::new("check").long("check").help("Use the rustfmt --check option"))
+                .arg(Arg::new("verbose").short('v').long("verbose").help("Echo commands run")),
         )
         .subcommand(
-            SubCommand::with_name("update_lints")
+            Command::new("update_lints")
                 .about("Updates lint registration and information from the source code")
                 .long_about(
                     "Makes sure that:\n \
@@ -127,23 +116,23 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
                  * lint modules in `clippy_lints/*` are visible in `src/lib.rs` via `pub mod`\n \
                  * all lints are registered in the lint store",
                 )
-                .arg(Arg::with_name("print-only").long("print-only").help(
+                .arg(Arg::new("print-only").long("print-only").help(
                     "Print a table of lints to STDOUT. \
                  This does not include deprecated and internal lints. \
                  (Does not modify any files)",
                 ))
                 .arg(
-                    Arg::with_name("check")
+                    Arg::new("check")
                         .long("check")
                         .help("Checks that `cargo dev update_lints` has been run. Used on CI."),
                 ),
         )
         .subcommand(
-            SubCommand::with_name("new_lint")
+            Command::new("new_lint")
                 .about("Create new lint and run `cargo dev update_lints`")
                 .arg(
-                    Arg::with_name("pass")
-                        .short("p")
+                    Arg::new("pass")
+                        .short('p')
                         .long("pass")
                         .help("Specify whether the lint runs during the early or late pass")
                         .takes_value(true)
@@ -151,16 +140,16 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
                         .required(true),
                 )
                 .arg(
-                    Arg::with_name("name")
-                        .short("n")
+                    Arg::new("name")
+                        .short('n')
                         .long("name")
                         .help("Name of the new lint in snake case, ex: fn_too_long")
                         .takes_value(true)
                         .required(true),
                 )
                 .arg(
-                    Arg::with_name("category")
-                        .short("c")
+                    Arg::new("category")
+                        .short('c')
                         .long("category")
                         .help("What category the lint belongs to")
                         .default_value("nursery")
@@ -179,29 +168,25 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
                         ])
                         .takes_value(true),
                 )
-                .arg(
-                    Arg::with_name("msrv")
-                        .long("msrv")
-                        .help("Add MSRV config code to the lint"),
-                ),
+                .arg(Arg::new("msrv").long("msrv").help("Add MSRV config code to the lint")),
         )
         .subcommand(
-            SubCommand::with_name("setup")
+            Command::new("setup")
                 .about("Support for setting up your personal development environment")
-                .setting(AppSettings::ArgRequiredElseHelp)
+                .arg_required_else_help(true)
                 .subcommand(
-                    SubCommand::with_name("intellij")
+                    Command::new("intellij")
                         .about("Alter dependencies so Intellij Rust can find rustc internals")
                         .arg(
-                            Arg::with_name("remove")
+                            Arg::new("remove")
                                 .long("remove")
                                 .help("Remove the dependencies added with 'cargo dev setup intellij'")
                                 .required(false),
                         )
                         .arg(
-                            Arg::with_name("rustc-repo-path")
+                            Arg::new("rustc-repo-path")
                                 .long("repo-path")
-                                .short("r")
+                                .short('r')
                                 .help("The path to a rustc repo that will be used for setting the dependencies")
                                 .takes_value(true)
                                 .value_name("path")
@@ -210,66 +195,65 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
                         ),
                 )
                 .subcommand(
-                    SubCommand::with_name("git-hook")
+                    Command::new("git-hook")
                         .about("Add a pre-commit git hook that formats your code to make it look pretty")
                         .arg(
-                            Arg::with_name("remove")
+                            Arg::new("remove")
                                 .long("remove")
                                 .help("Remove the pre-commit hook added with 'cargo dev setup git-hook'")
                                 .required(false),
                         )
                         .arg(
-                            Arg::with_name("force-override")
+                            Arg::new("force-override")
                                 .long("force-override")
-                                .short("f")
+                                .short('f')
                                 .help("Forces the override of an existing git pre-commit hook")
                                 .required(false),
                         ),
                 )
                 .subcommand(
-                    SubCommand::with_name("vscode-tasks")
+                    Command::new("vscode-tasks")
                         .about("Add several tasks to vscode for formatting, validation and testing")
                         .arg(
-                            Arg::with_name("remove")
+                            Arg::new("remove")
                                 .long("remove")
                                 .help("Remove the tasks added with 'cargo dev setup vscode-tasks'")
                                 .required(false),
                         )
                         .arg(
-                            Arg::with_name("force-override")
+                            Arg::new("force-override")
                                 .long("force-override")
-                                .short("f")
+                                .short('f')
                                 .help("Forces the override of existing vscode tasks")
                                 .required(false),
                         ),
                 ),
         )
         .subcommand(
-            SubCommand::with_name("remove")
+            Command::new("remove")
                 .about("Support for undoing changes done by the setup command")
-                .setting(AppSettings::ArgRequiredElseHelp)
-                .subcommand(SubCommand::with_name("git-hook").about("Remove any existing pre-commit git hook"))
-                .subcommand(SubCommand::with_name("vscode-tasks").about("Remove any existing vscode tasks"))
+                .arg_required_else_help(true)
+                .subcommand(Command::new("git-hook").about("Remove any existing pre-commit git hook"))
+                .subcommand(Command::new("vscode-tasks").about("Remove any existing vscode tasks"))
                 .subcommand(
-                    SubCommand::with_name("intellij")
-                        .about("Removes rustc source paths added via `cargo dev setup intellij`"),
+                    Command::new("intellij").about("Removes rustc source paths added via `cargo dev setup intellij`"),
                 ),
         )
         .subcommand(
-            SubCommand::with_name("serve")
+            Command::new("serve")
                 .about("Launch a local 'ALL the Clippy Lints' website in a browser")
                 .arg(
-                    Arg::with_name("port")
+                    Arg::new("port")
                         .long("port")
-                        .short("p")
+                        .short('p')
                         .help("Local port for the http server")
                         .default_value("8000")
                         .validator_os(serve::validate_port),
                 )
-                .arg(Arg::with_name("lint").help("Which lint's page to load initially (optional)")),
+                .arg(Arg::new("lint").help("Which lint's page to load initially (optional)")),
         )
         .subcommand(
-            SubCommand::with_name("lint")
+            Command::new("lint")
                 .about("Manually run clippy on a file or package")
                 .after_help(indoc! {"
                     EXAMPLES
@@ -288,33 +272,33 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
                             cargo dev lint ~/my-project -- -- -W clippy::pedantic
                 "})
                 .arg(
-                    Arg::with_name("path")
+                    Arg::new("path")
                         .required(true)
                         .help("The path to a file or package directory to lint"),
                 )
                 .arg(
-                    Arg::with_name("args")
-                        .multiple(true)
+                    Arg::new("args")
+                        .multiple_occurrences(true)
                         .help("Pass extra arguments to cargo/clippy-driver"),
                 ),
         )
         .subcommand(
-            SubCommand::with_name("rename_lint")
+            Command::new("rename_lint")
                 .about("Renames the given lint")
                 .arg(
-                    Arg::with_name("old_name")
+                    Arg::new("old_name")
                         .index(1)
                         .required(true)
                         .help("The name of the lint to rename"),
                 )
                 .arg(
-                    Arg::with_name("new_name")
+                    Arg::new("new_name")
                         .index(2)
-                        .required_unless("uplift")
+                        .required_unless_present("uplift")
                         .help("The new name of the lint"),
                 )
                 .arg(
-                    Arg::with_name("uplift")
+                    Arg::new("uplift")
                         .long("uplift")
                         .help("This lint will be uplifted into rustc"),
                 ),
diff --git a/src/tools/clippy/clippy_dev/src/serve.rs b/src/tools/clippy/clippy_dev/src/serve.rs
index b36e2a28ee4..d55b1a354d0 100644
--- a/src/tools/clippy/clippy_dev/src/serve.rs
+++ b/src/tools/clippy/clippy_dev/src/serve.rs
@@ -1,4 +1,5 @@
-use std::ffi::{OsStr, OsString};
+use std::ffi::OsStr;
+use std::num::ParseIntError;
 use std::path::Path;
 use std::process::Command;
 use std::thread;
@@ -59,9 +60,6 @@ fn mtime(path: impl AsRef<Path>) -> SystemTime {
 }
 
 #[allow(clippy::missing_errors_doc)]
-pub fn validate_port(arg: &OsStr) -> Result<(), OsString> {
-    match arg.to_string_lossy().parse::<u16>() {
-        Ok(_port) => Ok(()),
-        Err(err) => Err(OsString::from(err.to_string())),
-    }
+pub fn validate_port(arg: &OsStr) -> Result<(), ParseIntError> {
+    arg.to_string_lossy().parse::<u16>().map(|_| ())
 }
diff --git a/src/tools/clippy/clippy_lints/src/almost_complete_letter_range.rs b/src/tools/clippy/clippy_lints/src/almost_complete_letter_range.rs
new file mode 100644
index 00000000000..b364a370efa
--- /dev/null
+++ b/src/tools/clippy/clippy_lints/src/almost_complete_letter_range.rs
@@ -0,0 +1,100 @@
+use clippy_utils::diagnostics::span_lint_and_then;
+use clippy_utils::source::{trim_span, walk_span_to_context};
+use clippy_utils::{meets_msrv, msrvs};
+use rustc_ast::ast::{Expr, ExprKind, LitKind, Pat, PatKind, RangeEnd, RangeLimits};
+use rustc_errors::Applicability;
+use rustc_lint::{EarlyContext, EarlyLintPass, LintContext};
+use rustc_semver::RustcVersion;
+use rustc_session::{declare_tool_lint, impl_lint_pass};
+use rustc_span::Span;
+
+declare_clippy_lint! {
+    /// ### What it does
+    /// Checks for ranges which almost include the entire range of letters from 'a' to 'z', but
+    /// don't because they're a half open range.
+    ///
+    /// ### Why is this bad?
+    /// This (`'a'..'z'`) is almost certainly a typo meant to include all letters.
+    ///
+    /// ### Example
+    /// ```rust
+    /// let _ = 'a'..'z';
+    /// ```
+    /// Use instead:
+    /// ```rust
+    /// let _ = 'a'..='z';
+    /// ```
+    #[clippy::version = "1.63.0"]
+    pub ALMOST_COMPLETE_LETTER_RANGE,
+    suspicious,
+    "almost complete letter range"
+}
+impl_lint_pass!(AlmostCompleteLetterRange => [ALMOST_COMPLETE_LETTER_RANGE]);
+
+pub struct AlmostCompleteLetterRange {
+    msrv: Option<RustcVersion>,
+}
+impl AlmostCompleteLetterRange {
+    pub fn new(msrv: Option<RustcVersion>) -> Self {
+        Self { msrv }
+    }
+}
+impl EarlyLintPass for AlmostCompleteLetterRange {
+    fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &Expr) {
+        if let ExprKind::Range(Some(start), Some(end), RangeLimits::HalfOpen) = &e.kind {
+            let ctxt = e.span.ctxt();
+            let sugg = if let Some(start) = walk_span_to_context(start.span, ctxt)
+                && let Some(end) = walk_span_to_context(end.span, ctxt)
+                && meets_msrv(self.msrv, msrvs::RANGE_INCLUSIVE)
+            {
+                Some((trim_span(cx.sess().source_map(), start.between(end)), "..="))
+            } else {
+                None
+            };
+            check_range(cx, e.span, start, end, sugg);
+        }
+    }
+
+    fn check_pat(&mut self, cx: &EarlyContext<'_>, p: &Pat) {
+        if let PatKind::Range(Some(start), Some(end), kind) = &p.kind
+            && matches!(kind.node, RangeEnd::Excluded)
+        {
+            let sugg = if meets_msrv(self.msrv, msrvs::RANGE_INCLUSIVE) {
+                "..="
+            } else {
+                "..."
+            };
+            check_range(cx, p.span, start, end, Some((kind.span, sugg)));
+        }
+    }
+
+    extract_msrv_attr!(EarlyContext);
+}
+
+fn check_range(cx: &EarlyContext<'_>, span: Span, start: &Expr, end: &Expr, sugg: Option<(Span, &str)>) {
+    if let ExprKind::Lit(start_lit) = &start.peel_parens().kind
+        && let ExprKind::Lit(end_lit) = &end.peel_parens().kind
+        && matches!(
+            (&start_lit.kind, &end_lit.kind),
+            (LitKind::Byte(b'a') | LitKind::Char('a'), LitKind::Byte(b'z') | LitKind::Char('z'))
+            | (LitKind::Byte(b'A') | LitKind::Char('A'), LitKind::Byte(b'Z') | LitKind::Char('Z'))
+        )
+    {
+        span_lint_and_then(
+            cx,
+            ALMOST_COMPLETE_LETTER_RANGE,
+            span,
+            "almost complete ascii letter range",
+            |diag| {
+                if let Some((span, sugg)) = sugg {
+                    diag.span_suggestion(
+                        span,
+                        "use an inclusive range",
+                        sugg.to_owned(),
+                        Applicability::MaybeIncorrect,
+                    );
+                }
+            }
+        );
+    }
+}
diff --git a/src/tools/clippy/clippy_lints/src/approx_const.rs b/src/tools/clippy/clippy_lints/src/approx_const.rs
index da1b646f477..159f3b0cd01 100644
--- a/src/tools/clippy/clippy_lints/src/approx_const.rs
+++ b/src/tools/clippy/clippy_lints/src/approx_const.rs
@@ -28,7 +28,7 @@ declare_clippy_lint! {
     /// let x = 3.14;
     /// let y = 1_f64 / x;
     /// ```
-    /// Use predefined constants instead:
+    /// Use instead:
     /// ```rust
     /// let x = std::f32::consts::PI;
     /// let y = std::f64::consts::FRAC_1_PI;
diff --git a/src/tools/clippy/clippy_lints/src/as_conversions.rs b/src/tools/clippy/clippy_lints/src/as_conversions.rs
index 88b91d58907..6e5c8f44581 100644
--- a/src/tools/clippy/clippy_lints/src/as_conversions.rs
+++ b/src/tools/clippy/clippy_lints/src/as_conversions.rs
@@ -29,15 +29,14 @@ declare_clippy_lint! {
     /// f(a as u16);
     /// ```
     ///
-    /// Usually better represents the semantics you expect:
+    /// Use instead:
     /// ```rust,ignore
     /// f(a.try_into()?);
-    /// ```
-    /// or
-    /// ```rust,ignore
+    ///
+    /// // or
+    ///
     /// f(a.try_into().expect("Unexpected u16 overflow in f"));
     /// ```
-    ///
     #[clippy::version = "1.41.0"]
     pub AS_CONVERSIONS,
     restriction,
diff --git a/src/tools/clippy/clippy_lints/src/as_underscore.rs b/src/tools/clippy/clippy_lints/src/as_underscore.rs
new file mode 100644
index 00000000000..464be4218dd
--- /dev/null
+++ b/src/tools/clippy/clippy_lints/src/as_underscore.rs
@@ -0,0 +1,74 @@
+use clippy_utils::diagnostics::{span_lint_and_help, span_lint_and_then};
+use rustc_errors::Applicability;
+use rustc_hir::{Expr, ExprKind, TyKind};
+use rustc_lint::{LateContext, LateLintPass, LintContext};
+use rustc_middle::lint::in_external_macro;
+use rustc_middle::ty;
+use rustc_session::{declare_lint_pass, declare_tool_lint};
+
+declare_clippy_lint! {
+    /// ### What it does
+    /// Check for the usage of `as _` conversion using inferred type.
+    ///
+    /// ### Why is this bad?
+    /// The conversion might include lossy conversion and dangerous cast that might go
+    /// undetected du to the type being inferred.
+    ///
+    /// The lint is allowed by default as using `_` is less wordy than always specifying the type.
+    ///
+    /// ### Example
+    /// ```rust
+    /// fn foo(n: usize) {}
+    /// let n: u16 = 256;
+    /// foo(n as _);
+    /// ```
+    /// Use instead:
+    /// ```rust
+    /// fn foo(n: usize) {}
+    /// let n: u16 = 256;
+    /// foo(n as usize);
+    /// ```
+    #[clippy::version = "1.63.0"]
+    pub AS_UNDERSCORE,
+    restriction,
+    "detects `as _` conversion"
+}
+declare_lint_pass!(AsUnderscore => [AS_UNDERSCORE]);
+
+impl<'tcx> LateLintPass<'tcx> for AsUnderscore {
+    fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'tcx>) {
+        if in_external_macro(cx.sess(), expr.span) {
+            return;
+        }
+
+        if let ExprKind::Cast(_, ty) = expr.kind && let TyKind::Infer = ty.kind {
+
+            let ty_resolved = cx.typeck_results().expr_ty(expr);
+            if let ty::Error(_) = ty_resolved.kind() {
+                span_lint_and_help(
+                    cx,
+                AS_UNDERSCORE,
+                expr.span,
+                "using `as _` conversion",
+                None,
+                "consider giving the type explicitly",
+                );
+            } else {
+            span_lint_and_then(
+                cx,
+                AS_UNDERSCORE,
+                expr.span,
+                "using `as _` conversion",
+                |diag| {
+                    diag.span_suggestion(
+                        ty.span,
+                        "consider giving the type explicitly",
+                        format!("{}", ty_resolved),
+                        Applicability::MachineApplicable,
+                    );
+            }
+            );
+        }
+        }
+    }
+}
diff --git a/src/tools/clippy/clippy_lints/src/assign_ops.rs b/src/tools/clippy/clippy_lints/src/assign_ops.rs
index 4c2d3366483..f81da2d4223 100644
--- a/src/tools/clippy/clippy_lints/src/assign_ops.rs
+++ b/src/tools/clippy/clippy_lints/src/assign_ops.rs
@@ -27,10 +27,16 @@ declare_clippy_lint! {
     /// let mut a = 5;
     /// let b = 0;
     /// // ...
-    /// // Bad
+    ///
     /// a = a + b;
+    /// ```
+    ///
+    /// Use instead:
+    /// ```rust
+    /// let mut a = 5;
+    /// let b = 0;
+    /// // ...
     ///
-    /// // Good
     /// a += b;
     /// ```
     #[clippy::version = "pre 1.29.0"]
diff --git a/src/tools/clippy/clippy_lints/src/attrs.rs b/src/tools/clippy/clippy_lints/src/attrs.rs
index 3de91f3d24a..770cb6a3d7b 100644
--- a/src/tools/clippy/clippy_lints/src/attrs.rs
+++ b/src/tools/clippy/clippy_lints/src/attrs.rs
@@ -89,13 +89,14 @@ declare_clippy_lint! {
     ///
     /// ### Example
     /// ```ignore
-    /// // Bad
     /// #[deny(dead_code)]
     /// extern crate foo;
     /// #[forbid(dead_code)]
     /// use foo::bar;
+    /// ```
     ///
-    /// // Ok
+    /// Use instead:
+    /// ```rust,ignore
     /// #[allow(unused_imports)]
     /// use foo::baz;
     /// #[allow(unused_imports)]
@@ -146,15 +147,19 @@ declare_clippy_lint! {
     ///
     /// ### Example
     /// ```rust
+    /// #[allow(dead_code)]
+    ///
+    /// fn not_quite_good_code() { }
+    /// ```
+    ///
+    /// Use instead:
+    /// ```rust
     /// // Good (as inner attribute)
     /// #![allow(dead_code)]
     ///
     /// fn this_is_fine() { }
     ///
-    /// // Bad
-    /// #[allow(dead_code)]
-    ///
-    /// fn not_quite_good_code() { }
+    /// // or
     ///
     /// // Good (as outer attribute)
     /// #[allow(dead_code)]
@@ -175,12 +180,11 @@ declare_clippy_lint! {
     /// These lints should only be enabled on a lint-by-lint basis and with careful consideration.
     ///
     /// ### Example
-    /// Bad:
     /// ```rust
     /// #![deny(clippy::restriction)]
     /// ```
     ///
-    /// Good:
+    /// Use instead:
     /// ```rust
     /// #![deny(clippy::as_conversions)]
     /// ```
@@ -205,13 +209,12 @@ declare_clippy_lint! {
     /// [#3123](https://github.com/rust-lang/rust-clippy/pull/3123#issuecomment-422321765)
     ///
     /// ### Example
-    /// Bad:
     /// ```rust
     /// #[cfg_attr(rustfmt, rustfmt_skip)]
     /// fn main() { }
     /// ```
     ///
-    /// Good:
+    /// Use instead:
     /// ```rust
     /// #[rustfmt::skip]
     /// fn main() { }
@@ -231,20 +234,20 @@ declare_clippy_lint! {
     /// by the conditional compilation engine.
     ///
     /// ### Example
-    /// Bad:
     /// ```rust
     /// #[cfg(linux)]
     /// fn conditional() { }
     /// ```
     ///
-    /// Good:
+    /// Use instead:
     /// ```rust
+    /// # mod hidden {
     /// #[cfg(target_os = "linux")]
     /// fn conditional() { }
-    /// ```
+    /// # }
+    ///
+    /// // or
     ///
-    /// Or:
-    /// ```rust
     /// #[cfg(unix)]
     /// fn conditional() { }
     /// ```
@@ -266,14 +269,13 @@ declare_clippy_lint! {
     /// ensure that others understand the reasoning
     ///
     /// ### Example
-    /// Bad:
     /// ```rust
     /// #![feature(lint_reasons)]
     ///
     /// #![allow(clippy::some_lint)]
     /// ```
     ///
-    /// Good:
+    /// Use instead:
     /// ```rust
     /// #![feature(lint_reasons)]
     ///
@@ -585,15 +587,21 @@ impl EarlyLintPass for EarlyAttributes {
 }
 
 fn check_empty_line_after_outer_attr(cx: &EarlyContext<'_>, item: &rustc_ast::Item) {
-    for attr in &item.attrs {
+    let mut iter = item.attrs.iter().peekable();
+    while let Some(attr) = iter.next() {
         if matches!(attr.kind, AttrKind::Normal(..))
             && attr.style == AttrStyle::Outer
             && is_present_in_source(cx, attr.span)
         {
             let begin_of_attr_to_item = Span::new(attr.span.lo(), item.span.lo(), item.span.ctxt(), item.span.parent());
-            let end_of_attr_to_item = Span::new(attr.span.hi(), item.span.lo(), item.span.ctxt(), item.span.parent());
+            let end_of_attr_to_next_attr_or_item = Span::new(
+                attr.span.hi(),
+                iter.peek().map_or(item.span.lo(), |next_attr| next_attr.span.lo()),
+                item.span.ctxt(),
+                item.span.parent(),
+            );
 
-            if let Some(snippet) = snippet_opt(cx, end_of_attr_to_item) {
+            if let Some(snippet) = snippet_opt(cx, end_of_attr_to_next_attr_or_item) {
                 let lines = snippet.split('\n').collect::<Vec<_>>();
                 let lines = without_block_comments(lines);
 
@@ -623,8 +631,15 @@ fn check_deprecated_cfg_attr(cx: &EarlyContext<'_>, attr: &Attribute, msrv: Opti
         if feature_item.has_name(sym::rustfmt);
         // check for `rustfmt_skip` and `rustfmt::skip`
         if let Some(skip_item) = &items[1].meta_item();
-        if skip_item.has_name(sym!(rustfmt_skip)) ||
-            skip_item.path.segments.last().expect("empty path in attribute").ident.name == sym::skip;
+        if skip_item.has_name(sym!(rustfmt_skip))
+            || skip_item
+                .path
+                .segments
+                .last()
+                .expect("empty path in attribute")
+                .ident
+                .name
+                == sym::skip;
         // Only lint outer attributes, because custom inner attributes are unstable
         // Tracking issue: https://github.com/rust-lang/rust/issues/54726
         if attr.style == AttrStyle::Outer;
diff --git a/src/tools/clippy/clippy_lints/src/blocks_in_if_conditions.rs b/src/tools/clippy/clippy_lints/src/blocks_in_if_conditions.rs
index 4c4dd85d518..5bd7a342389 100644
--- a/src/tools/clippy/clippy_lints/src/blocks_in_if_conditions.rs
+++ b/src/tools/clippy/clippy_lints/src/blocks_in_if_conditions.rs
@@ -22,21 +22,17 @@ declare_clippy_lint! {
     ///
     /// ### Examples
     /// ```rust
-    /// // Bad
+    /// # fn somefunc() -> bool { true };
     /// if { true } { /* ... */ }
     ///
-    /// // Good
-    /// if true { /* ... */ }
+    /// if { let x = somefunc(); x } { /* ... */ }
     /// ```
     ///
-    /// // or
-    ///
+    /// Use instead:
     /// ```rust
     /// # fn somefunc() -> bool { true };
-    /// // Bad
-    /// if { let x = somefunc(); x } { /* ... */ }
+    /// if true { /* ... */ }
     ///
-    /// // Good
     /// let res = { let x = somefunc(); x };
     /// if res { /* ... */ }
     /// ```
diff --git a/src/tools/clippy/clippy_lints/src/booleans.rs b/src/tools/clippy/clippy_lints/src/booleans.rs
index 0adb6327164..e4e122ba6eb 100644
--- a/src/tools/clippy/clippy_lints/src/booleans.rs
+++ b/src/tools/clippy/clippy_lints/src/booleans.rs
@@ -27,8 +27,14 @@ declare_clippy_lint! {
     ///
     /// ### Example
     /// ```ignore
-    /// if a && true  // should be: if a
-    /// if !(a == b)  // should be: if a != b
+    /// if a && true {}
+    /// if !(a == b) {}
+    /// ```
+    ///
+    /// Use instead:
+    /// ```rust,ignore
+    /// if a {}
+    /// if a != b {}
     /// ```
     #[clippy::version = "pre 1.29.0"]
     pub NONMINIMAL_BOOL,
@@ -48,10 +54,15 @@ declare_clippy_lint! {
     /// Ignores short circuiting behavior.
     ///
     /// ### Example
-    /// ```ignore
+    /// ```rust,ignore
+    /// // The `b` is unnecessary, the expression is equivalent to `if a`.
     /// if a && b || a { ... }
     /// ```
-    /// The `b` is unnecessary, the expression is equivalent to `if a`.
+    ///
+    /// Use instead:
+    /// ```rust,ignore
+    /// if a {}
+    /// ```
     #[clippy::version = "pre 1.29.0"]
     pub LOGIC_BUG,
     correctness,
diff --git a/src/tools/clippy/clippy_lints/src/borrow_deref_ref.rs b/src/tools/clippy/clippy_lints/src/borrow_deref_ref.rs
new file mode 100644
index 00000000000..ec2f31cf673
--- /dev/null
+++ b/src/tools/clippy/clippy_lints/src/borrow_deref_ref.rs
@@ -0,0 +1,118 @@
+use crate::reference::DEREF_ADDROF;
+use clippy_utils::diagnostics::span_lint_and_then;
+use clippy_utils::source::snippet_opt;
+use clippy_utils::ty::implements_trait;
+use clippy_utils::{get_parent_expr, is_lint_allowed};
+use rustc_errors::Applicability;
+use rustc_hir::{ExprKind, UnOp};
+use rustc_lint::{LateContext, LateLintPass};
+use rustc_middle::mir::Mutability;
+use rustc_middle::ty;
+use rustc_session::{declare_lint_pass, declare_tool_lint};
+
+declare_clippy_lint! {
+    /// ### What it does
+    /// Checks for `&*(&T)`.
+    ///
+    /// ### Why is this bad?
+    /// Dereferencing and then borrowing a reference value has no effect in most cases.
+    ///
+    /// ### Known problems
+    /// false negative on such code:
+    /// ```
+    /// let x = &12;
+    /// let addr_x = &x as *const _ as usize;
+    /// let addr_y = &&*x as *const _ as usize; // assert ok now, and lint triggerd.
+    ///                                         // But if we fix it, assert will fail.
+    /// assert_ne!(addr_x, addr_y);
+    /// ```
+    ///
+    /// ### Example
+    /// ```rust
+    /// let s = &String::new();
+    ///
+    /// // Bad
+    /// let a: &String = &* s;
+    /// foo(&*s);
+    ///
+    /// // Good
+    /// let a: &String = s;
+    /// foo(&**s);
+    ///
+    /// fn foo(_: &str){ }
+    /// ```
+    #[clippy::version = "1.59.0"]
+    pub BORROW_DEREF_REF,
+    complexity,
+    "deref on an immutable reference returns the same type as itself"
+}
+
+declare_lint_pass!(BorrowDerefRef => [BORROW_DEREF_REF]);
+
+impl LateLintPass<'_> for BorrowDerefRef {
+    fn check_expr(&mut self, cx: &LateContext<'_>, e: &rustc_hir::Expr<'_>) {
+        if_chain! {
+            if !e.span.from_expansion();
+            if let ExprKind::AddrOf(_, Mutability::Not, addrof_target) = e.kind;
+            if !addrof_target.span.from_expansion();
+            if let ExprKind::Unary(UnOp::Deref, deref_target) = addrof_target.kind;
+            if !deref_target.span.from_expansion();
+            if !matches!(deref_target.kind, ExprKind::Unary(UnOp::Deref, ..) );
+            let ref_ty = cx.typeck_results().expr_ty(deref_target);
+            if let ty::Ref(_, inner_ty, Mutability::Not) = ref_ty.kind();
+            then{
+
+                if let Some(parent_expr) = get_parent_expr(cx, e){
+                    if matches!(parent_expr.kind, ExprKind::Unary(UnOp::Deref, ..)) &&
+                       !is_lint_allowed(cx, DEREF_ADDROF, parent_expr.hir_id) {
+                        return;
+                    }
+
+                    // modification to `&mut &*x` is different from `&mut x`
+                    if matches!(deref_target.kind, ExprKind::Path(..)
+                                             | ExprKind::Field(..)
+                                             | ExprKind::Index(..)
+                                             | ExprKind::Unary(UnOp::Deref, ..))
+                     && matches!(parent_expr.kind, ExprKind::AddrOf(_, Mutability::Mut, _)) {
+                       return;
+                    }
+                }
+
+                span_lint_and_then(
+                    cx,
+                    BORROW_DEREF_REF,
+                    e.span,
+                    "deref on an immutable reference",
+                    |diag| {
+                        diag.span_suggestion(
+                            e.span,
+                            "if you would like to reborrow, try removing `&*`",
+                            snippet_opt(cx, deref_target.span).unwrap(),
+                            Applicability::MachineApplicable
+                        );
+
+                        // has deref trait -> give 2 help
+                        // doesn't have deref trait -> give 1 help
+                        if let Some(deref_trait_id) = cx.tcx.lang_items().deref_trait(){
+                            if !implements_trait(cx, *inner_ty, deref_trait_id, &[]) {
+                                return;
+                            }
+                        }
+
+                        diag.span_suggestion(
+                            e.span,
+                            "if you would like to deref, try using `&**`",
+                            format!(
+                                "&**{}",
+                                &snippet_opt(cx, deref_target.span).unwrap(),
+                             ),
+                            Applicability::MaybeIncorrect
+                        );
+
+                    }
+                );
+
+            }
+        }
+    }
+}
diff --git a/src/tools/clippy/clippy_lints/src/bytecount.rs b/src/tools/clippy/clippy_lints/src/bytecount.rs
index 02d97bf43df..bfdbaf2413a 100644
--- a/src/tools/clippy/clippy_lints/src/bytecount.rs
+++ b/src/tools/clippy/clippy_lints/src/bytecount.rs
@@ -28,7 +28,13 @@ declare_clippy_lint! {
     /// ### Example
     /// ```rust
     /// # let vec = vec![1_u8];
-    /// &vec.iter().filter(|x| **x == 0u8).count(); // use bytecount::count instead
+    /// let count = vec.iter().filter(|x| **x == 0u8).count();
+    /// ```
+    ///
+    /// Use instead:
+    /// ```rust,ignore
+    /// # let vec = vec![1_u8];
+    /// let count = bytecount::count(&vec, 0u8);
     /// ```
     #[clippy::version = "pre 1.29.0"]
     pub NAIVE_BYTECOUNT,
diff --git a/src/tools/clippy/clippy_lints/src/casts/cast_abs_to_unsigned.rs b/src/tools/clippy/clippy_lints/src/casts/cast_abs_to_unsigned.rs
index 6bac6bf83f8..64ea326b75a 100644
--- a/src/tools/clippy/clippy_lints/src/casts/cast_abs_to_unsigned.rs
+++ b/src/tools/clippy/clippy_lints/src/casts/cast_abs_to_unsigned.rs
@@ -1,11 +1,10 @@
 use clippy_utils::diagnostics::span_lint_and_sugg;
 use clippy_utils::sugg::Sugg;
 use clippy_utils::{meets_msrv, msrvs};
-use if_chain::if_chain;
 use rustc_errors::Applicability;
 use rustc_hir::{Expr, ExprKind};
 use rustc_lint::LateContext;
-use rustc_middle::ty::Ty;
+use rustc_middle::ty::{self, Ty};
 use rustc_semver::RustcVersion;
 
 use super::CAST_ABS_TO_UNSIGNED;
@@ -18,25 +17,28 @@ pub(super) fn check(
     cast_to: Ty<'_>,
     msrv: Option<RustcVersion>,
 ) {
-    if_chain! {
-        if meets_msrv(msrv, msrvs::UNSIGNED_ABS);
-        if cast_from.is_integral();
-        if cast_to.is_integral();
-        if cast_from.is_signed();
-        if !cast_to.is_signed();
-        if let ExprKind::MethodCall(method_path, args, _) = cast_expr.kind;
-        if let method_name = method_path.ident.name.as_str();
-        if method_name == "abs";
-        then {
-            span_lint_and_sugg(
-                cx,
-                CAST_ABS_TO_UNSIGNED,
-                expr.span,
-                &format!("casting the result of `{}::{}()` to {}", cast_from, method_name, cast_to),
-                "replace with",
-                format!("{}.unsigned_abs()", Sugg::hir(cx, &args[0], "..")),
-                Applicability::MachineApplicable,
-            );
-        }
+    if meets_msrv(msrv, msrvs::UNSIGNED_ABS)
+        && let ty::Int(from) = cast_from.kind()
+        && let ty::Uint(to) = cast_to.kind()
+        && let ExprKind::MethodCall(method_path, args, _) = cast_expr.kind
+        && method_path.ident.name.as_str() == "abs"
+    {
+        let span = if from.bit_width() == to.bit_width() {
+            expr.span
+        } else {
+            // if the result of `.unsigned_abs` would be a different type, keep the cast
+            // e.g. `i64 -> usize`, `i16 -> u8`
+            cast_expr.span
+        };
+
+        span_lint_and_sugg(
+            cx,
+            CAST_ABS_TO_UNSIGNED,
+            span,
+            &format!("casting the result of `{cast_from}::abs()` to {cast_to}"),
+            "replace with",
+            format!("{}.unsigned_abs()", Sugg::hir(cx, &args[0], "..")),
+            Applicability::MachineApplicable,
+        );
     }
 }
diff --git a/src/tools/clippy/clippy_lints/src/checked_conversions.rs b/src/tools/clippy/clippy_lints/src/checked_conversions.rs
index 7eeaaa01921..1010340c712 100644
--- a/src/tools/clippy/clippy_lints/src/checked_conversions.rs
+++ b/src/tools/clippy/clippy_lints/src/checked_conversions.rs
@@ -318,7 +318,7 @@ fn get_implementing_type<'a>(path: &QPath<'_>, candidates: &'a [&str], function:
         if let QPath::TypeRelative(ty, path) = &path;
         if path.ident.name.as_str() == function;
         if let TyKind::Path(QPath::Resolved(None, tp)) = &ty.kind;
-        if let [int] = &*tp.segments;
+        if let [int] = tp.segments;
         then {
             let name = int.ident.name.as_str();
             candidates.iter().find(|c| &name == *c).copied()
@@ -332,7 +332,7 @@ fn get_implementing_type<'a>(path: &QPath<'_>, candidates: &'a [&str], function:
 fn int_ty_to_sym<'tcx>(path: &QPath<'_>) -> Option<&'tcx str> {
     if_chain! {
         if let QPath::Resolved(_, path) = *path;
-        if let [ty] = &*path.segments;
+        if let [ty] = path.segments;
         then {
             let name = ty.ident.name.as_str();
             INTS.iter().find(|c| &name == *c).copied()
diff --git a/src/tools/clippy/clippy_lints/src/cognitive_complexity.rs b/src/tools/clippy/clippy_lints/src/cognitive_complexity.rs
index 317c4bfb322..33c44f8b2db 100644
--- a/src/tools/clippy/clippy_lints/src/cognitive_complexity.rs
+++ b/src/tools/clippy/clippy_lints/src/cognitive_complexity.rs
@@ -25,7 +25,7 @@ declare_clippy_lint! {
     /// complexity.
     ///
     /// ### Example
-    /// No. You'll see it when you get the warning.
+    /// You'll see it when you get the warning.
     #[clippy::version = "1.35.0"]
     pub COGNITIVE_COMPLEXITY,
     nursery,
diff --git a/src/tools/clippy/clippy_lints/src/collapsible_if.rs b/src/tools/clippy/clippy_lints/src/collapsible_if.rs
index 3227e6e86af..3eceb848822 100644
--- a/src/tools/clippy/clippy_lints/src/collapsible_if.rs
+++ b/src/tools/clippy/clippy_lints/src/collapsible_if.rs
@@ -41,7 +41,7 @@ declare_clippy_lint! {
     ///
     /// ```
     ///
-    /// Should be written:
+    /// Use instead:
     ///
     /// ```rust,ignore
     /// if x && y {
diff --git a/src/tools/clippy/clippy_lints/src/comparison_chain.rs b/src/tools/clippy/clippy_lints/src/comparison_chain.rs
index 399d11472b0..913e081af3b 100644
--- a/src/tools/clippy/clippy_lints/src/comparison_chain.rs
+++ b/src/tools/clippy/clippy_lints/src/comparison_chain.rs
@@ -34,7 +34,7 @@ declare_clippy_lint! {
     /// }
     /// ```
     ///
-    /// Could be written:
+    /// Use instead:
     ///
     /// ```rust,ignore
     /// use std::cmp::Ordering;
diff --git a/src/tools/clippy/clippy_lints/src/copies.rs b/src/tools/clippy/clippy_lints/src/copies.rs
index e6a0162fd02..1e9a1153011 100644
--- a/src/tools/clippy/clippy_lints/src/copies.rs
+++ b/src/tools/clippy/clippy_lints/src/copies.rs
@@ -141,7 +141,7 @@ declare_clippy_lint! {
     /// };
     /// ```
     ///
-    /// Could be written as:
+    /// Use instead:
     /// ```ignore
     /// println!("Hello World");
     /// let foo = if … {
diff --git a/src/tools/clippy/clippy_lints/src/crate_in_macro_def.rs b/src/tools/clippy/clippy_lints/src/crate_in_macro_def.rs
index fc141b4a6e3..9b8a481b6ea 100644
--- a/src/tools/clippy/clippy_lints/src/crate_in_macro_def.rs
+++ b/src/tools/clippy/clippy_lints/src/crate_in_macro_def.rs
@@ -90,7 +90,7 @@ fn contains_unhygienic_crate_reference(tts: &TokenStream) -> Option<Span> {
     while let Some(curr) = cursor.next() {
         if_chain! {
             if !prev_is_dollar;
-            if let Some(span) = is_crate_keyword(&curr);
+            if let Some(span) = is_crate_keyword(curr);
             if let Some(next) = cursor.look_ahead(0);
             if is_token(next, &TokenKind::ModSep);
             then {
@@ -103,7 +103,7 @@ fn contains_unhygienic_crate_reference(tts: &TokenStream) -> Option<Span> {
                 return span;
             }
         }
-        prev_is_dollar = is_token(&curr, &TokenKind::Dollar);
+        prev_is_dollar = is_token(curr, &TokenKind::Dollar);
     }
     None
 }
diff --git a/src/tools/clippy/clippy_lints/src/dbg_macro.rs b/src/tools/clippy/clippy_lints/src/dbg_macro.rs
index f99d793c201..17deccf8c39 100644
--- a/src/tools/clippy/clippy_lints/src/dbg_macro.rs
+++ b/src/tools/clippy/clippy_lints/src/dbg_macro.rs
@@ -5,7 +5,7 @@ use clippy_utils::{is_in_cfg_test, is_in_test_function};
 use rustc_errors::Applicability;
 use rustc_hir::{Expr, ExprKind};
 use rustc_lint::{LateContext, LateLintPass};
-use rustc_session::{declare_lint_pass, declare_tool_lint};
+use rustc_session::{declare_tool_lint, impl_lint_pass};
 use rustc_span::sym;
 
 declare_clippy_lint! {
@@ -30,14 +30,27 @@ declare_clippy_lint! {
     "`dbg!` macro is intended as a debugging tool"
 }
 
-declare_lint_pass!(DbgMacro => [DBG_MACRO]);
+#[derive(Copy, Clone)]
+pub struct DbgMacro {
+    allow_dbg_in_tests: bool,
+}
+
+impl_lint_pass!(DbgMacro => [DBG_MACRO]);
+
+impl DbgMacro {
+    pub fn new(allow_dbg_in_tests: bool) -> Self {
+        DbgMacro { allow_dbg_in_tests }
+    }
+}
 
 impl LateLintPass<'_> for DbgMacro {
     fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
         let Some(macro_call) = root_macro_call_first_node(cx, expr) else { return };
         if cx.tcx.is_diagnostic_item(sym::dbg_macro, macro_call.def_id) {
-            // we make an exception for test code
-            if is_in_test_function(cx.tcx, expr.hir_id) || is_in_cfg_test(cx.tcx, expr.hir_id) {
+            // allows `dbg!` in test code if allow-dbg-in-test is set to true in clippy.toml
+            if self.allow_dbg_in_tests
+                && (is_in_test_function(cx.tcx, expr.hir_id) || is_in_cfg_test(cx.tcx, expr.hir_id))
+            {
                 return;
             }
             let mut applicability = Applicability::MachineApplicable;
diff --git a/src/tools/clippy/clippy_lints/src/derivable_impls.rs b/src/tools/clippy/clippy_lints/src/derivable_impls.rs
index 34a5f8444de..e98691fd5bb 100644
--- a/src/tools/clippy/clippy_lints/src/derivable_impls.rs
+++ b/src/tools/clippy/clippy_lints/src/derivable_impls.rs
@@ -21,7 +21,7 @@ declare_clippy_lint! {
     ///     bar: bool
     /// }
     ///
-    /// impl std::default::Default for Foo {
+    /// impl Default for Foo {
     ///     fn default() -> Self {
     ///         Self {
     ///             bar: false
diff --git a/src/tools/clippy/clippy_lints/src/derive.rs b/src/tools/clippy/clippy_lints/src/derive.rs
index fe99f4a8d55..99347ebadc6 100644
--- a/src/tools/clippy/clippy_lints/src/derive.rs
+++ b/src/tools/clippy/clippy_lints/src/derive.rs
@@ -1,16 +1,17 @@
 use clippy_utils::diagnostics::{span_lint_and_help, span_lint_and_note, span_lint_and_sugg, span_lint_and_then};
 use clippy_utils::paths;
-use clippy_utils::ty::{implements_trait, is_copy};
+use clippy_utils::ty::{implements_trait, implements_trait_with_env, is_copy};
 use clippy_utils::{is_lint_allowed, match_def_path};
 use if_chain::if_chain;
 use rustc_errors::Applicability;
 use rustc_hir::intravisit::{walk_expr, walk_fn, walk_item, FnKind, Visitor};
 use rustc_hir::{
-    BlockCheckMode, BodyId, Expr, ExprKind, FnDecl, HirId, Impl, Item, ItemKind, TraitRef, UnsafeSource, Unsafety,
+    self as hir, BlockCheckMode, BodyId, Expr, ExprKind, FnDecl, HirId, Impl, Item, ItemKind, UnsafeSource, Unsafety,
 };
 use rustc_lint::{LateContext, LateLintPass};
 use rustc_middle::hir::nested_filter;
-use rustc_middle::ty::{self, Ty};
+use rustc_middle::ty::subst::GenericArg;
+use rustc_middle::ty::{self, BoundConstness, ImplPolarity, ParamEnv, PredicateKind, TraitPredicate, TraitRef, Ty};
 use rustc_session::{declare_lint_pass, declare_tool_lint};
 use rustc_span::source_map::Span;
 use rustc_span::sym;
@@ -224,7 +225,7 @@ impl<'tcx> LateLintPass<'tcx> for Derive {
 fn check_hash_peq<'tcx>(
     cx: &LateContext<'tcx>,
     span: Span,
-    trait_ref: &TraitRef<'_>,
+    trait_ref: &hir::TraitRef<'_>,
     ty: Ty<'tcx>,
     hash_is_automatically_derived: bool,
 ) {
@@ -277,7 +278,7 @@ fn check_hash_peq<'tcx>(
 fn check_ord_partial_ord<'tcx>(
     cx: &LateContext<'tcx>,
     span: Span,
-    trait_ref: &TraitRef<'_>,
+    trait_ref: &hir::TraitRef<'_>,
     ty: Ty<'tcx>,
     ord_is_automatically_derived: bool,
 ) {
@@ -328,7 +329,7 @@ fn check_ord_partial_ord<'tcx>(
 }
 
 /// Implementation of the `EXPL_IMPL_CLONE_ON_COPY` lint.
-fn check_copy_clone<'tcx>(cx: &LateContext<'tcx>, item: &Item<'_>, trait_ref: &TraitRef<'_>, ty: Ty<'tcx>) {
+fn check_copy_clone<'tcx>(cx: &LateContext<'tcx>, item: &Item<'_>, trait_ref: &hir::TraitRef<'_>, ty: Ty<'tcx>) {
     let clone_id = match cx.tcx.lang_items().clone_trait() {
         Some(id) if trait_ref.trait_def_id() == Some(id) => id,
         _ => return,
@@ -378,7 +379,7 @@ fn check_copy_clone<'tcx>(cx: &LateContext<'tcx>, item: &Item<'_>, trait_ref: &T
 fn check_unsafe_derive_deserialize<'tcx>(
     cx: &LateContext<'tcx>,
     item: &Item<'_>,
-    trait_ref: &TraitRef<'_>,
+    trait_ref: &hir::TraitRef<'_>,
     ty: Ty<'tcx>,
 ) {
     fn has_unsafe<'tcx>(cx: &LateContext<'tcx>, item: &'tcx Item<'_>) -> bool {
@@ -455,13 +456,41 @@ impl<'tcx> Visitor<'tcx> for UnsafeVisitor<'_, 'tcx> {
 }
 
 /// Implementation of the `DERIVE_PARTIAL_EQ_WITHOUT_EQ` lint.
-fn check_partial_eq_without_eq<'tcx>(cx: &LateContext<'tcx>, span: Span, trait_ref: &TraitRef<'_>, ty: Ty<'tcx>) {
+fn check_partial_eq_without_eq<'tcx>(cx: &LateContext<'tcx>, span: Span, trait_ref: &hir::TraitRef<'_>, ty: Ty<'tcx>) {
     if_chain! {
         if let ty::Adt(adt, substs) = ty.kind();
         if let Some(eq_trait_def_id) = cx.tcx.get_diagnostic_item(sym::Eq);
+        if let Some(peq_trait_def_id) = cx.tcx.get_diagnostic_item(sym::PartialEq);
         if let Some(def_id) = trait_ref.trait_def_id();
         if cx.tcx.is_diagnostic_item(sym::PartialEq, def_id);
-        if !implements_trait(cx, ty, eq_trait_def_id, substs);
+        // New `ParamEnv` replacing `T: PartialEq` with `T: Eq`
+        let param_env = ParamEnv::new(
+            cx.tcx.mk_predicates(cx.param_env.caller_bounds().iter().map(|p| {
+                let kind = p.kind();
+                match kind.skip_binder() {
+                    PredicateKind::Trait(p)
+                        if p.trait_ref.def_id == peq_trait_def_id
+                            && p.trait_ref.substs.get(0) == p.trait_ref.substs.get(1)
+                            && matches!(p.trait_ref.self_ty().kind(), ty::Param(_))
+                            && p.constness == BoundConstness::NotConst
+                            && p.polarity == ImplPolarity::Positive =>
+                    {
+                        cx.tcx.mk_predicate(kind.rebind(PredicateKind::Trait(TraitPredicate {
+                            trait_ref: TraitRef::new(
+                                eq_trait_def_id,
+                                cx.tcx.mk_substs([GenericArg::from(p.trait_ref.self_ty())].into_iter()),
+                            ),
+                            constness: BoundConstness::NotConst,
+                            polarity: ImplPolarity::Positive,
+                        })))
+                    },
+                    _ => p,
+                }
+            })),
+            cx.param_env.reveal(),
+            cx.param_env.constness(),
+        );
+        if !implements_trait_with_env(cx.tcx, param_env, ty, eq_trait_def_id, substs);
         then {
             // If all of our fields implement `Eq`, we can implement `Eq` too
             for variant in adt.variants() {
diff --git a/src/tools/clippy/clippy_lints/src/doc_link_with_quotes.rs b/src/tools/clippy/clippy_lints/src/doc_link_with_quotes.rs
new file mode 100644
index 00000000000..cb07f57e870
--- /dev/null
+++ b/src/tools/clippy/clippy_lints/src/doc_link_with_quotes.rs
@@ -0,0 +1,60 @@
+use clippy_utils::diagnostics::span_lint;
+use itertools::Itertools;
+use rustc_ast::{AttrKind, Attribute};
+use rustc_lint::{EarlyContext, EarlyLintPass};
+use rustc_session::{declare_lint_pass, declare_tool_lint};
+
+declare_clippy_lint! {
+    /// ### What it does
+    /// Detects the syntax `['foo']` in documentation comments (notice quotes instead of backticks)
+    /// outside of code blocks
+    /// ### Why is this bad?
+    /// It is likely a typo when defining an intra-doc link
+    ///
+    /// ### Example
+    /// ```rust
+    /// /// See also: ['foo']
+    /// fn bar() {}
+    /// ```
+    /// Use instead:
+    /// ```rust
+    /// /// See also: [`foo`]
+    /// fn bar() {}
+    /// ```
+    #[clippy::version = "1.60.0"]
+    pub DOC_LINK_WITH_QUOTES,
+    pedantic,
+    "possible typo for an intra-doc link"
+}
+declare_lint_pass!(DocLinkWithQuotes => [DOC_LINK_WITH_QUOTES]);
+
+impl EarlyLintPass for DocLinkWithQuotes {
+    fn check_attribute(&mut self, ctx: &EarlyContext<'_>, attr: &Attribute) {
+        if let AttrKind::DocComment(_, symbol) = attr.kind {
+            if contains_quote_link(symbol.as_str()) {
+                span_lint(
+                    ctx,
+                    DOC_LINK_WITH_QUOTES,
+                    attr.span,
+                    "possible intra-doc link using quotes instead of backticks",
+                );
+            }
+        }
+    }
+}
+
+fn contains_quote_link(s: &str) -> bool {
+    let mut in_backticks = false;
+    let mut found_opening = false;
+
+    for c in s.chars().tuple_windows::<(char, char)>() {
+        match c {
+            ('`', _) => in_backticks = !in_backticks,
+            ('[', '\'') if !in_backticks => found_opening = true,
+            ('\'', ']') if !in_backticks && found_opening => return true,
+            _ => {},
+        }
+    }
+
+    false
+}
diff --git a/src/tools/clippy/clippy_lints/src/double_comparison.rs b/src/tools/clippy/clippy_lints/src/double_comparison.rs
index be95375789d..ee0440e52ff 100644
--- a/src/tools/clippy/clippy_lints/src/double_comparison.rs
+++ b/src/tools/clippy/clippy_lints/src/double_comparison.rs
@@ -24,7 +24,7 @@ declare_clippy_lint! {
     /// if x == y || x < y {}
     /// ```
     ///
-    /// Could be written as:
+    /// Use instead:
     ///
     /// ```rust
     /// # let x = 1;
diff --git a/src/tools/clippy/clippy_lints/src/double_parens.rs b/src/tools/clippy/clippy_lints/src/double_parens.rs
index e10f740d24a..a33ef5ce6e3 100644
--- a/src/tools/clippy/clippy_lints/src/double_parens.rs
+++ b/src/tools/clippy/clippy_lints/src/double_parens.rs
@@ -13,23 +13,21 @@ declare_clippy_lint! {
     ///
     /// ### Example
     /// ```rust
-    /// // Bad
     /// fn simple_double_parens() -> i32 {
     ///     ((0))
     /// }
     ///
-    /// // Good
+    /// # fn foo(bar: usize) {}
+    /// foo((0));
+    /// ```
+    ///
+    /// Use instead:
+    /// ```rust
     /// fn simple_no_parens() -> i32 {
     ///     0
     /// }
     ///
-    /// // or
-    ///
     /// # fn foo(bar: usize) {}
-    /// // Bad
-    /// foo((0));
-    ///
-    /// // Good
     /// foo(0);
     /// ```
     #[clippy::version = "pre 1.29.0"]
diff --git a/src/tools/clippy/clippy_lints/src/duration_subsec.rs b/src/tools/clippy/clippy_lints/src/duration_subsec.rs
index 09318f74527..d85ace3a279 100644
--- a/src/tools/clippy/clippy_lints/src/duration_subsec.rs
+++ b/src/tools/clippy/clippy_lints/src/duration_subsec.rs
@@ -22,15 +22,17 @@ declare_clippy_lint! {
     /// ### Example
     /// ```rust
     /// # use std::time::Duration;
-    /// let dur = Duration::new(5, 0);
-    ///
-    /// // Bad
-    /// let _micros = dur.subsec_nanos() / 1_000;
-    /// let _millis = dur.subsec_nanos() / 1_000_000;
+    /// # let duration = Duration::new(5, 0);
+    /// let micros = duration.subsec_nanos() / 1_000;
+    /// let millis = duration.subsec_nanos() / 1_000_000;
+    /// ```
     ///
-    /// // Good
-    /// let _micros = dur.subsec_micros();
-    /// let _millis = dur.subsec_millis();
+    /// Use instead:
+    /// ```rust
+    /// # use std::time::Duration;
+    /// # let duration = Duration::new(5, 0);
+    /// let micros = duration.subsec_micros();
+    /// let millis = duration.subsec_millis();
     /// ```
     #[clippy::version = "pre 1.29.0"]
     pub DURATION_SUBSEC,
diff --git a/src/tools/clippy/clippy_lints/src/else_if_without_else.rs b/src/tools/clippy/clippy_lints/src/else_if_without_else.rs
index 0b9f54231c5..bf4488570ea 100644
--- a/src/tools/clippy/clippy_lints/src/else_if_without_else.rs
+++ b/src/tools/clippy/clippy_lints/src/else_if_without_else.rs
@@ -26,7 +26,7 @@ declare_clippy_lint! {
     /// }
     /// ```
     ///
-    /// Could be written:
+    /// Use instead:
     ///
     /// ```rust
     /// # fn a() {}
diff --git a/src/tools/clippy/clippy_lints/src/empty_enum.rs b/src/tools/clippy/clippy_lints/src/empty_enum.rs
index b5d6b3c7524..bbebc024414 100644
--- a/src/tools/clippy/clippy_lints/src/empty_enum.rs
+++ b/src/tools/clippy/clippy_lints/src/empty_enum.rs
@@ -23,12 +23,11 @@ declare_clippy_lint! {
     ///
     ///
     /// ### Example
-    /// Bad:
     /// ```rust
     /// enum Test {}
     /// ```
     ///
-    /// Good:
+    /// Use instead:
     /// ```rust
     /// #![feature(never_type)]
     ///
diff --git a/src/tools/clippy/clippy_lints/src/entry.rs b/src/tools/clippy/clippy_lints/src/entry.rs
index c5a987842c3..27743a0ebec 100644
--- a/src/tools/clippy/clippy_lints/src/entry.rs
+++ b/src/tools/clippy/clippy_lints/src/entry.rs
@@ -46,7 +46,7 @@ declare_clippy_lint! {
     ///     map.insert(k, v);
     /// }
     /// ```
-    /// can both be rewritten as:
+    /// Use instead:
     /// ```rust
     /// # use std::collections::HashMap;
     /// # let mut map = HashMap::new();
diff --git a/src/tools/clippy/clippy_lints/src/enum_variants.rs b/src/tools/clippy/clippy_lints/src/enum_variants.rs
index e029b8e8537..263a5b573c9 100644
--- a/src/tools/clippy/clippy_lints/src/enum_variants.rs
+++ b/src/tools/clippy/clippy_lints/src/enum_variants.rs
@@ -32,7 +32,7 @@ declare_clippy_lint! {
     ///     BattenbergCake,
     /// }
     /// ```
-    /// Could be written as:
+    /// Use instead:
     /// ```rust
     /// enum Cake {
     ///     BlackForest,
diff --git a/src/tools/clippy/clippy_lints/src/eq_op.rs b/src/tools/clippy/clippy_lints/src/eq_op.rs
index afb5d32f953..c3176d987c6 100644
--- a/src/tools/clippy/clippy_lints/src/eq_op.rs
+++ b/src/tools/clippy/clippy_lints/src/eq_op.rs
@@ -30,9 +30,9 @@ declare_clippy_lint! {
     /// ```rust
     /// # let x = 1;
     /// if x + 1 == x + 1 {}
-    /// ```
-    /// or
-    /// ```rust
+    ///
+    /// // or
+    ///
     /// # let a = 3;
     /// # let b = 4;
     /// assert_eq!(a, a);
diff --git a/src/tools/clippy/clippy_lints/src/equatable_if_let.rs b/src/tools/clippy/clippy_lints/src/equatable_if_let.rs
index cf47e581ccb..ef1216358dd 100644
--- a/src/tools/clippy/clippy_lints/src/equatable_if_let.rs
+++ b/src/tools/clippy/clippy_lints/src/equatable_if_let.rs
@@ -26,7 +26,7 @@ declare_clippy_lint! {
     ///     do_thing();
     /// }
     /// ```
-    /// Should be written
+    /// Use instead:
     /// ```rust,ignore
     /// if x == Some(2) {
     ///     do_thing();
diff --git a/src/tools/clippy/clippy_lints/src/escape.rs b/src/tools/clippy/clippy_lints/src/escape.rs
index 807ecd2ddd1..9d21dd71e0e 100644
--- a/src/tools/clippy/clippy_lints/src/escape.rs
+++ b/src/tools/clippy/clippy_lints/src/escape.rs
@@ -31,12 +31,14 @@ declare_clippy_lint! {
     /// ### Example
     /// ```rust
     /// # fn foo(bar: usize) {}
-    /// // Bad
     /// let x = Box::new(1);
     /// foo(*x);
     /// println!("{}", *x);
+    /// ```
     ///
-    /// // Good
+    /// Use instead:
+    /// ```rust
+    /// # fn foo(bar: usize) {}
     /// let x = 1;
     /// foo(x);
     /// println!("{}", x);
diff --git a/src/tools/clippy/clippy_lints/src/excessive_bools.rs b/src/tools/clippy/clippy_lints/src/excessive_bools.rs
index 7a81fb37e84..a2af10e2ba5 100644
--- a/src/tools/clippy/clippy_lints/src/excessive_bools.rs
+++ b/src/tools/clippy/clippy_lints/src/excessive_bools.rs
@@ -18,7 +18,6 @@ declare_clippy_lint! {
     /// readability and API.
     ///
     /// ### Example
-    /// Bad:
     /// ```rust
     /// struct S {
     ///     is_pending: bool,
@@ -27,7 +26,7 @@ declare_clippy_lint! {
     /// }
     /// ```
     ///
-    /// Good:
+    /// Use instead:
     /// ```rust
     /// enum S {
     ///     Pending,
diff --git a/src/tools/clippy/clippy_lints/src/explicit_write.rs b/src/tools/clippy/clippy_lints/src/explicit_write.rs
index d8f765b288a..12d636cf410 100644
--- a/src/tools/clippy/clippy_lints/src/explicit_write.rs
+++ b/src/tools/clippy/clippy_lints/src/explicit_write.rs
@@ -22,8 +22,16 @@ declare_clippy_lint! {
     /// ```rust
     /// # use std::io::Write;
     /// # let bar = "furchtbar";
-    /// // this would be clearer as `eprintln!("foo: {:?}", bar);`
     /// writeln!(&mut std::io::stderr(), "foo: {:?}", bar).unwrap();
+    /// writeln!(&mut std::io::stdout(), "foo: {:?}", bar).unwrap();
+    /// ```
+    ///
+    /// Use instead:
+    /// ```rust
+    /// # use std::io::Write;
+    /// # let bar = "furchtbar";
+    /// eprintln!("foo: {:?}", bar);
+    /// println!("foo: {:?}", bar);
     /// ```
     #[clippy::version = "pre 1.29.0"]
     pub EXPLICIT_WRITE,
diff --git a/src/tools/clippy/clippy_lints/src/fallible_impl_from.rs b/src/tools/clippy/clippy_lints/src/fallible_impl_from.rs
index 9f868df3ad0..b88e53aeca6 100644
--- a/src/tools/clippy/clippy_lints/src/fallible_impl_from.rs
+++ b/src/tools/clippy/clippy_lints/src/fallible_impl_from.rs
@@ -20,7 +20,6 @@ declare_clippy_lint! {
     /// ```rust
     /// struct Foo(i32);
     ///
-    /// // Bad
     /// impl From<String> for Foo {
     ///     fn from(s: String) -> Self {
     ///         Foo(s.parse().unwrap())
@@ -28,8 +27,8 @@ declare_clippy_lint! {
     /// }
     /// ```
     ///
+    /// Use instead:
     /// ```rust
-    /// // Good
     /// struct Foo(i32);
     ///
     /// impl TryFrom<String> for Foo {
diff --git a/src/tools/clippy/clippy_lints/src/float_literal.rs b/src/tools/clippy/clippy_lints/src/float_literal.rs
index 7a4397a7b74..f850ea31f4d 100644
--- a/src/tools/clippy/clippy_lints/src/float_literal.rs
+++ b/src/tools/clippy/clippy_lints/src/float_literal.rs
@@ -19,11 +19,12 @@ declare_clippy_lint! {
     ///
     /// ### Example
     /// ```rust
-    /// // Bad
     /// let v: f32 = 0.123_456_789_9;
     /// println!("{}", v); //  0.123_456_789
+    /// ```
     ///
-    /// // Good
+    /// Use instead:
+    /// ```rust
     /// let v: f64 = 0.123_456_789_9;
     /// println!("{}", v); //  0.123_456_789_9
     /// ```
diff --git a/src/tools/clippy/clippy_lints/src/floating_point_arithmetic.rs b/src/tools/clippy/clippy_lints/src/floating_point_arithmetic.rs
index 42503c26de1..df9b41d2c98 100644
--- a/src/tools/clippy/clippy_lints/src/floating_point_arithmetic.rs
+++ b/src/tools/clippy/clippy_lints/src/floating_point_arithmetic.rs
@@ -35,8 +35,7 @@ declare_clippy_lint! {
     /// let _ = a.exp() - 1.0;
     /// ```
     ///
-    /// is better expressed as
-    ///
+    /// Use instead:
     /// ```rust
     /// let a = 3f32;
     /// let _ = a.cbrt();
diff --git a/src/tools/clippy/clippy_lints/src/format.rs b/src/tools/clippy/clippy_lints/src/format.rs
index 64c41b56587..3084c70589f 100644
--- a/src/tools/clippy/clippy_lints/src/format.rs
+++ b/src/tools/clippy/clippy_lints/src/format.rs
@@ -25,12 +25,13 @@ declare_clippy_lint! {
     ///
     /// ### Examples
     /// ```rust
-    ///
-    /// // Bad
     /// let foo = "foo";
     /// format!("{}", foo);
+    /// ```
     ///
-    /// // Good
+    /// Use instead:
+    /// ```rust
+    /// let foo = "foo";
     /// foo.to_owned();
     /// ```
     #[clippy::version = "pre 1.29.0"]
diff --git a/src/tools/clippy/clippy_lints/src/formatting.rs b/src/tools/clippy/clippy_lints/src/formatting.rs
index 57964b8d48e..db0166da57f 100644
--- a/src/tools/clippy/clippy_lints/src/formatting.rs
+++ b/src/tools/clippy/clippy_lints/src/formatting.rs
@@ -36,12 +36,18 @@ declare_clippy_lint! {
     /// This is either a typo in the binary operator or confusing.
     ///
     /// ### Example
-    /// ```rust,ignore
-    /// if foo <- 30 { // this should be `foo < -30` but looks like a different operator
-    /// }
+    /// ```rust
+    /// # let foo = true;
+    /// # let bar = false;
+    /// // &&! looks like a different operator
+    /// if foo &&! bar {}
+    /// ```
     ///
-    /// if foo &&! bar { // this should be `foo && !bar` but looks like a different operator
-    /// }
+    /// Use instead:
+    /// ```rust
+    /// # let foo = true;
+    /// # let bar = false;
+    /// if foo && !bar {}
     /// ```
     #[clippy::version = "1.40.0"]
     pub SUSPICIOUS_UNARY_OP_FORMATTING,
diff --git a/src/tools/clippy/clippy_lints/src/get_first.rs b/src/tools/clippy/clippy_lints/src/get_first.rs
new file mode 100644
index 00000000000..0748ab45252
--- /dev/null
+++ b/src/tools/clippy/clippy_lints/src/get_first.rs
@@ -0,0 +1,69 @@
+use clippy_utils::diagnostics::span_lint_and_sugg;
+use clippy_utils::source::snippet_with_applicability;
+use clippy_utils::{is_slice_of_primitives, match_def_path, paths};
+use if_chain::if_chain;
+use rustc_ast::LitKind;
+use rustc_errors::Applicability;
+use rustc_hir as hir;
+use rustc_lint::{LateContext, LateLintPass};
+use rustc_session::{declare_lint_pass, declare_tool_lint};
+use rustc_span::source_map::Spanned;
+
+declare_clippy_lint! {
+    /// ### What it does
+    /// Checks for using `x.get(0)` instead of
+    /// `x.first()`.
+    ///
+    /// ### Why is this bad?
+    /// Using `x.first()` is easier to read and has the same
+    /// result.
+    ///
+    /// ### Example
+    /// ```rust
+    /// // Bad
+    /// let x = vec![2, 3, 5];
+    /// let first_element = x.get(0);
+    /// ```
+    /// Use instead:
+    /// ```rust
+    /// // Good
+    /// let x = vec![2, 3, 5];
+    /// let first_element = x.first();
+    /// ```
+    #[clippy::version = "1.63.0"]
+    pub GET_FIRST,
+    style,
+    "Using `x.get(0)` when `x.first()` is simpler"
+}
+declare_lint_pass!(GetFirst => [GET_FIRST]);
+
+impl<'tcx> LateLintPass<'tcx> for GetFirst {
+    fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) {
+        if_chain! {
+            if let hir::ExprKind::MethodCall(_, [struct_calling_on, method_arg], _) = &expr.kind;
+            if let Some(expr_def_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id);
+            if match_def_path(cx, expr_def_id, &paths::SLICE_GET);
+
+            if let Some(_) = is_slice_of_primitives(cx, struct_calling_on);
+            if let hir::ExprKind::Lit(Spanned { node: LitKind::Int(0, _), .. }) = method_arg.kind;
+
+            then {
+                let mut applicability = Applicability::MachineApplicable;
+                let slice_name = snippet_with_applicability(
+                    cx,
+                    struct_calling_on.span, "..",
+                    &mut applicability,
+                );
+                span_lint_and_sugg(
+                    cx,
+                    GET_FIRST,
+                    expr.span,
+                    &format!("accessing first element with `{0}.get(0)`", slice_name),
+                    "try",
+                    format!("{}.first()", slice_name),
+                    applicability,
+                );
+            }
+        }
+    }
+}
diff --git a/src/tools/clippy/clippy_lints/src/get_last_with_len.rs b/src/tools/clippy/clippy_lints/src/get_last_with_len.rs
deleted file mode 100644
index df29d9308e7..00000000000
--- a/src/tools/clippy/clippy_lints/src/get_last_with_len.rs
+++ /dev/null
@@ -1,107 +0,0 @@
-//! lint on using `x.get(x.len() - 1)` instead of `x.last()`
-
-use clippy_utils::diagnostics::span_lint_and_sugg;
-use clippy_utils::source::snippet_with_applicability;
-use clippy_utils::ty::is_type_diagnostic_item;
-use clippy_utils::SpanlessEq;
-use if_chain::if_chain;
-use rustc_ast::ast::LitKind;
-use rustc_errors::Applicability;
-use rustc_hir::{BinOpKind, Expr, ExprKind};
-use rustc_lint::{LateContext, LateLintPass};
-use rustc_session::{declare_lint_pass, declare_tool_lint};
-use rustc_span::source_map::Spanned;
-use rustc_span::sym;
-
-declare_clippy_lint! {
-    /// ### What it does
-    /// Checks for using `x.get(x.len() - 1)` instead of
-    /// `x.last()`.
-    ///
-    /// ### Why is this bad?
-    /// Using `x.last()` is easier to read and has the same
-    /// result.
-    ///
-    /// Note that using `x[x.len() - 1]` is semantically different from
-    /// `x.last()`.  Indexing into the array will panic on out-of-bounds
-    /// accesses, while `x.get()` and `x.last()` will return `None`.
-    ///
-    /// There is another lint (get_unwrap) that covers the case of using
-    /// `x.get(index).unwrap()` instead of `x[index]`.
-    ///
-    /// ### Example
-    /// ```rust
-    /// // Bad
-    /// let x = vec![2, 3, 5];
-    /// let last_element = x.get(x.len() - 1);
-    ///
-    /// // Good
-    /// let x = vec![2, 3, 5];
-    /// let last_element = x.last();
-    /// ```
-    #[clippy::version = "1.37.0"]
-    pub GET_LAST_WITH_LEN,
-    complexity,
-    "Using `x.get(x.len() - 1)` when `x.last()` is correct and simpler"
-}
-
-declare_lint_pass!(GetLastWithLen => [GET_LAST_WITH_LEN]);
-
-impl<'tcx> LateLintPass<'tcx> for GetLastWithLen {
-    fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
-        if_chain! {
-            // Is a method call
-            if let ExprKind::MethodCall(path, args, _) = expr.kind;
-
-            // Method name is "get"
-            if path.ident.name == sym!(get);
-
-            // Argument 0 (the struct we're calling the method on) is a vector
-            if let Some(struct_calling_on) = args.get(0);
-            let struct_ty = cx.typeck_results().expr_ty(struct_calling_on);
-            if is_type_diagnostic_item(cx, struct_ty, sym::Vec);
-
-            // Argument to "get" is a subtraction
-            if let Some(get_index_arg) = args.get(1);
-            if let ExprKind::Binary(
-                Spanned {
-                    node: BinOpKind::Sub,
-                    ..
-                },
-                lhs,
-                rhs,
-            ) = &get_index_arg.kind;
-
-            // LHS of subtraction is "x.len()"
-            if let ExprKind::MethodCall(arg_lhs_path, lhs_args, _) = &lhs.kind;
-            if arg_lhs_path.ident.name == sym::len;
-            if let Some(arg_lhs_struct) = lhs_args.get(0);
-
-            // The two vectors referenced (x in x.get(...) and in x.len())
-            if SpanlessEq::new(cx).eq_expr(struct_calling_on, arg_lhs_struct);
-
-            // RHS of subtraction is 1
-            if let ExprKind::Lit(rhs_lit) = &rhs.kind;
-            if let LitKind::Int(1, ..) = rhs_lit.node;
-
-            then {
-                let mut applicability = Applicability::MachineApplicable;
-                let vec_name = snippet_with_applicability(
-                    cx,
-                    struct_calling_on.span, "vec",
-                    &mut applicability,
-                );
-
-                span_lint_and_sugg(
-                    cx,
-                    GET_LAST_WITH_LEN,
-                    expr.span,
-                    &format!("accessing last element with `{0}.get({0}.len() - 1)`", vec_name),
-                    "try",
-                    format!("{}.last()", vec_name),
-                    applicability,
-                );
-            }
-        }
-    }
-}
diff --git a/src/tools/clippy/clippy_lints/src/identity_op.rs b/src/tools/clippy/clippy_lints/src/identity_op.rs
index 40cc5cd4bcf..419ea5a6811 100644
--- a/src/tools/clippy/clippy_lints/src/identity_op.rs
+++ b/src/tools/clippy/clippy_lints/src/identity_op.rs
@@ -1,15 +1,14 @@
-use clippy_utils::get_parent_expr;
-use clippy_utils::source::snippet;
-use rustc_hir::{BinOp, BinOpKind, Expr, ExprKind};
+use clippy_utils::consts::{constant_full_int, constant_simple, Constant, FullInt};
+use clippy_utils::diagnostics::span_lint_and_sugg;
+use clippy_utils::source::snippet_with_applicability;
+use clippy_utils::{clip, unsext};
+use rustc_errors::Applicability;
+use rustc_hir::{BinOp, BinOpKind, Expr, ExprKind, Node};
 use rustc_lint::{LateContext, LateLintPass};
 use rustc_middle::ty;
 use rustc_session::{declare_lint_pass, declare_tool_lint};
 use rustc_span::source_map::Span;
 
-use clippy_utils::consts::{constant_full_int, constant_simple, Constant, FullInt};
-use clippy_utils::diagnostics::span_lint;
-use clippy_utils::{clip, unsext};
-
 declare_clippy_lint! {
     /// ### What it does
     /// Checks for identity operations, e.g., `x + 0`.
@@ -23,11 +22,6 @@ declare_clippy_lint! {
     /// # let x = 1;
     /// x / 1 + 0 * 1 - 0 | 0;
     /// ```
-    ///
-    /// ### Known problems
-    /// False negatives: `f(0 + if b { 1 } else { 2 } + 3);` is reducible to
-    /// `f(if b { 1 } else { 2 } + 3);`. But the lint doesn't trigger for the code.
-    /// See [#8724](https://github.com/rust-lang/rust-clippy/issues/8724)
     #[clippy::version = "pre 1.29.0"]
     pub IDENTITY_OP,
     complexity,
@@ -45,31 +39,22 @@ impl<'tcx> LateLintPass<'tcx> for IdentityOp {
             if !is_allowed(cx, *cmp, left, right) {
                 match cmp.node {
                     BinOpKind::Add | BinOpKind::BitOr | BinOpKind::BitXor => {
-                        if reducible_to_right(cx, expr, right) {
-                            check(cx, left, 0, expr.span, right.span);
-                        }
-                        check(cx, right, 0, expr.span, left.span);
+                        check(cx, left, 0, expr.span, right.span, needs_parenthesis(cx, expr, right));
+                        check(cx, right, 0, expr.span, left.span, Parens::Unneeded);
                     },
                     BinOpKind::Shl | BinOpKind::Shr | BinOpKind::Sub => {
-                        check(cx, right, 0, expr.span, left.span);
+                        check(cx, right, 0, expr.span, left.span, Parens::Unneeded);
                     },
                     BinOpKind::Mul => {
-                        if reducible_to_right(cx, expr, right) {
-                            check(cx, left, 1, expr.span, right.span);
-                        }
-                        check(cx, right, 1, expr.span, left.span);
+                        check(cx, left, 1, expr.span, right.span, needs_parenthesis(cx, expr, right));
+                        check(cx, right, 1, expr.span, left.span, Parens::Unneeded);
                     },
-                    BinOpKind::Div => check(cx, right, 1, expr.span, left.span),
+                    BinOpKind::Div => check(cx, right, 1, expr.span, left.span, Parens::Unneeded),
                     BinOpKind::BitAnd => {
-                        if reducible_to_right(cx, expr, right) {
-                            check(cx, left, -1, expr.span, right.span);
-                        }
-                        check(cx, right, -1, expr.span, left.span);
-                    },
-                    BinOpKind::Rem => {
-                        // Don't call reducible_to_right because N % N is always reducible to 1
-                        check_remainder(cx, left, right, expr.span, left.span);
+                        check(cx, left, -1, expr.span, right.span, needs_parenthesis(cx, expr, right));
+                        check(cx, right, -1, expr.span, left.span, Parens::Unneeded);
                     },
+                    BinOpKind::Rem => check_remainder(cx, left, right, expr.span, left.span),
                     _ => (),
                 }
             }
@@ -77,24 +62,50 @@ impl<'tcx> LateLintPass<'tcx> for IdentityOp {
     }
 }
 
-/// Checks if `left op ..right` can be actually reduced to `right`
-/// e.g. `0 + if b { 1 } else { 2 } + if b { 3 } else { 4 }`
-/// cannot be reduced to `if b { 1 } else { 2 } +  if b { 3 } else { 4 }`
+#[derive(Copy, Clone)]
+enum Parens {
+    Needed,
+    Unneeded,
+}
+
+/// Checks if `left op right` needs parenthesis when reduced to `right`
+/// e.g. `0 + if b { 1 } else { 2 } + if b { 3 } else { 4 }` cannot be reduced
+/// to `if b { 1 } else { 2 } + if b { 3 } else { 4 }` where the `if` could be
+/// interpreted as a statement
+///
 /// See #8724
-fn reducible_to_right(cx: &LateContext<'_>, binary: &Expr<'_>, right: &Expr<'_>) -> bool {
-    if let ExprKind::If(..) | ExprKind::Match(..) | ExprKind::Block(..) | ExprKind::Loop(..) = right.kind {
-        is_toplevel_binary(cx, binary)
-    } else {
-        true
+fn needs_parenthesis(cx: &LateContext<'_>, binary: &Expr<'_>, right: &Expr<'_>) -> Parens {
+    match right.kind {
+        ExprKind::Binary(_, lhs, _) | ExprKind::Cast(lhs, _) => {
+            // ensure we're checking against the leftmost expression of `right`
+            //
+            //     ~~~ `lhs`
+            // 0 + {4} * 2
+            //     ~~~~~~~ `right`
+            return needs_parenthesis(cx, binary, lhs);
+        },
+        ExprKind::If(..) | ExprKind::Match(..) | ExprKind::Block(..) | ExprKind::Loop(..) => {},
+        _ => return Parens::Unneeded,
     }
-}
 
-fn is_toplevel_binary(cx: &LateContext<'_>, must_be_binary: &Expr<'_>) -> bool {
-    if let Some(parent) = get_parent_expr(cx, must_be_binary) && let ExprKind::Binary(..) = &parent.kind {
-        false
-    } else {
-        true
+    let mut prev_id = binary.hir_id;
+    for (_, node) in cx.tcx.hir().parent_iter(binary.hir_id) {
+        if let Node::Expr(expr) = node
+            && let ExprKind::Binary(_, lhs, _) | ExprKind::Cast(lhs, _) = expr.kind
+            && lhs.hir_id == prev_id
+        {
+            // keep going until we find a node that encompasses left of `binary`
+            prev_id = expr.hir_id;
+            continue;
+        }
+
+        match node {
+            Node::Block(_) | Node::Stmt(_) => break,
+            _ => return Parens::Unneeded,
+        };
     }
+
+    Parens::Needed
 }
 
 fn is_allowed(cx: &LateContext<'_>, cmp: BinOp, left: &Expr<'_>, right: &Expr<'_>) -> bool {
@@ -115,11 +126,11 @@ fn check_remainder(cx: &LateContext<'_>, left: &Expr<'_>, right: &Expr<'_>, span
         (Some(FullInt::U(lv)), Some(FullInt::U(rv))) => lv < rv,
         _ => return,
     } {
-        span_ineffective_operation(cx, span, arg);
+        span_ineffective_operation(cx, span, arg, Parens::Unneeded);
     }
 }
 
-fn check(cx: &LateContext<'_>, e: &Expr<'_>, m: i8, span: Span, arg: Span) {
+fn check(cx: &LateContext<'_>, e: &Expr<'_>, m: i8, span: Span, arg: Span, parens: Parens) {
     if let Some(Constant::Int(v)) = constant_simple(cx, cx.typeck_results(), e).map(Constant::peel_refs) {
         let check = match *cx.typeck_results().expr_ty(e).peel_refs().kind() {
             ty::Int(ity) => unsext(cx.tcx, -1_i128, ity),
@@ -132,19 +143,27 @@ fn check(cx: &LateContext<'_>, e: &Expr<'_>, m: i8, span: Span, arg: Span) {
             1 => v == 1,
             _ => unreachable!(),
         } {
-            span_ineffective_operation(cx, span, arg);
+            span_ineffective_operation(cx, span, arg, parens);
         }
     }
 }
 
-fn span_ineffective_operation(cx: &LateContext<'_>, span: Span, arg: Span) {
-    span_lint(
+fn span_ineffective_operation(cx: &LateContext<'_>, span: Span, arg: Span, parens: Parens) {
+    let mut applicability = Applicability::MachineApplicable;
+    let expr_snippet = snippet_with_applicability(cx, arg, "..", &mut applicability);
+
+    let suggestion = match parens {
+        Parens::Needed => format!("({expr_snippet})"),
+        Parens::Unneeded => expr_snippet.into_owned(),
+    };
+
+    span_lint_and_sugg(
         cx,
         IDENTITY_OP,
         span,
-        &format!(
-            "the operation is ineffective. Consider reducing it to `{}`",
-            snippet(cx, arg, "..")
-        ),
+        "this operation has no effect",
+        "consider reducing it to",
+        suggestion,
+        applicability,
     );
 }
diff --git a/src/tools/clippy/clippy_lints/src/large_enum_variant.rs b/src/tools/clippy/clippy_lints/src/large_enum_variant.rs
index 0f3889a2936..63ac092dfaf 100644
--- a/src/tools/clippy/clippy_lints/src/large_enum_variant.rs
+++ b/src/tools/clippy/clippy_lints/src/large_enum_variant.rs
@@ -1,12 +1,13 @@
 //! lint when there is a large size difference between variants on an enum
 
-use clippy_utils::diagnostics::span_lint_and_then;
 use clippy_utils::source::snippet_with_applicability;
+use clippy_utils::{diagnostics::span_lint_and_then, ty::is_copy};
 use rustc_errors::Applicability;
 use rustc_hir::{Item, ItemKind};
 use rustc_lint::{LateContext, LateLintPass};
 use rustc_middle::lint::in_external_macro;
 use rustc_middle::ty::layout::LayoutOf;
+use rustc_middle::ty::{Adt, Ty};
 use rustc_session::{declare_tool_lint, impl_lint_pass};
 use rustc_span::source_map::Span;
 
@@ -26,6 +27,15 @@ declare_clippy_lint! {
     /// the overhead is negligible and the boxing is counter-productive. Always
     /// measure the change this lint suggests.
     ///
+    /// For types that implement `Copy`, the suggestion to `Box` a variant's
+    /// data would require removing the trait impl. The types can of course
+    /// still be `Clone`, but that is worse ergonomically. Depending on the
+    /// use case it may be possible to store the large data in an auxillary
+    /// structure (e.g. Arena or ECS).
+    ///
+    /// The lint will ignore generic types if the layout depends on the
+    /// generics, even if the size difference will be large anyway.
+    ///
     /// ### Example
     /// ```rust
     /// // Bad
@@ -74,7 +84,7 @@ struct VariantInfo {
 impl_lint_pass!(LargeEnumVariant => [LARGE_ENUM_VARIANT]);
 
 impl<'tcx> LateLintPass<'tcx> for LargeEnumVariant {
-    fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) {
+    fn check_item(&mut self, cx: &LateContext<'tcx>, item: &Item<'tcx>) {
         if in_external_macro(cx.tcx.sess, item.span) {
             return;
         }
@@ -132,37 +142,43 @@ impl<'tcx> LateLintPass<'tcx> for LargeEnumVariant {
                         let fields = def.variants[variants_size[0].ind].data.fields();
                         variants_size[0].fields_size.sort_by(|a, b| (a.size.cmp(&b.size)));
                         let mut applicability = Applicability::MaybeIncorrect;
-                        let sugg: Vec<(Span, String)> = variants_size[0]
-                            .fields_size
-                            .iter()
-                            .rev()
-                            .map_while(|val| {
-                                if difference > self.maximum_size_difference_allowed {
-                                    difference = difference.saturating_sub(val.size);
-                                    Some((
-                                        fields[val.ind].ty.span,
-                                        format!(
-                                            "Box<{}>",
-                                            snippet_with_applicability(
-                                                cx,
-                                                fields[val.ind].ty.span,
-                                                "..",
-                                                &mut applicability
-                                            )
-                                            .into_owned()
-                                        ),
-                                    ))
-                                } else {
-                                    None
-                                }
-                            })
-                            .collect();
+                        if is_copy(cx, ty) || maybe_copy(cx, ty) {
+                            diag.span_note(
+                                item.ident.span,
+                                "boxing a variant would require the type no longer be `Copy`",
+                            );
+                        } else {
+                            let sugg: Vec<(Span, String)> = variants_size[0]
+                                .fields_size
+                                .iter()
+                                .rev()
+                                .map_while(|val| {
+                                    if difference > self.maximum_size_difference_allowed {
+                                        difference = difference.saturating_sub(val.size);
+                                        Some((
+                                            fields[val.ind].ty.span,
+                                            format!(
+                                                "Box<{}>",
+                                                snippet_with_applicability(
+                                                    cx,
+                                                    fields[val.ind].ty.span,
+                                                    "..",
+                                                    &mut applicability
+                                                )
+                                                .into_owned()
+                                            ),
+                                        ))
+                                    } else {
+                                        None
+                                    }
+                                })
+                                .collect();
 
-                        if !sugg.is_empty() {
-                            diag.multipart_suggestion(help_text, sugg, Applicability::MaybeIncorrect);
-                            return;
+                            if !sugg.is_empty() {
+                                diag.multipart_suggestion(help_text, sugg, Applicability::MaybeIncorrect);
+                                return;
+                            }
                         }
-
                         diag.span_help(def.variants[variants_size[0].ind].span, help_text);
                     },
                 );
@@ -170,3 +186,13 @@ impl<'tcx> LateLintPass<'tcx> for LargeEnumVariant {
         }
     }
 }
+
+fn maybe_copy<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool {
+    if let Adt(_def, substs) = ty.kind()
+        && substs.types().next().is_some()
+        && let Some(copy_trait) = cx.tcx.lang_items().copy_trait()
+    {
+        return cx.tcx.non_blanket_impls_for_ty(copy_trait, ty).next().is_some();
+    }
+    false
+}
diff --git a/src/tools/clippy/clippy_lints/src/let_if_seq.rs b/src/tools/clippy/clippy_lints/src/let_if_seq.rs
index db09d00d730..56bbbbbc819 100644
--- a/src/tools/clippy/clippy_lints/src/let_if_seq.rs
+++ b/src/tools/clippy/clippy_lints/src/let_if_seq.rs
@@ -68,7 +68,7 @@ impl<'tcx> LateLintPass<'tcx> for LetIfSeq {
                 if let hir::ExprKind::If(hir::Expr { kind: hir::ExprKind::DropTemps(cond), ..}, then, else_) = if_.kind;
                 if !is_local_used(cx, *cond, canonical_id);
                 if let hir::ExprKind::Block(then, _) = then.kind;
-                if let Some(value) = check_assign(cx, canonical_id, &*then);
+                if let Some(value) = check_assign(cx, canonical_id, then);
                 if !is_local_used(cx, value, canonical_id);
                 then {
                     let span = stmt.span.to(if_.span);
diff --git a/src/tools/clippy/clippy_lints/src/lib.register_all.rs b/src/tools/clippy/clippy_lints/src/lib.register_all.rs
index be5c478900f..d4ec046d0bb 100644
--- a/src/tools/clippy/clippy_lints/src/lib.register_all.rs
+++ b/src/tools/clippy/clippy_lints/src/lib.register_all.rs
@@ -4,6 +4,7 @@
 
 store.register_group(true, "clippy::all", Some("clippy_all"), vec![
     LintId::of(absurd_extreme_comparisons::ABSURD_EXTREME_COMPARISONS),
+    LintId::of(almost_complete_letter_range::ALMOST_COMPLETE_LETTER_RANGE),
     LintId::of(approx_const::APPROX_CONSTANT),
     LintId::of(assertions_on_constants::ASSERTIONS_ON_CONSTANTS),
     LintId::of(assign_ops::ASSIGN_OP_PATTERN),
@@ -24,6 +25,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
     LintId::of(bool_assert_comparison::BOOL_ASSERT_COMPARISON),
     LintId::of(booleans::LOGIC_BUG),
     LintId::of(booleans::NONMINIMAL_BOOL),
+    LintId::of(borrow_deref_ref::BORROW_DEREF_REF),
     LintId::of(bytes_count_to_len::BYTES_COUNT_TO_LEN),
     LintId::of(casts::CAST_ABS_TO_UNSIGNED),
     LintId::of(casts::CAST_ENUM_CONSTRUCTOR),
@@ -36,7 +38,6 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
     LintId::of(casts::UNNECESSARY_CAST),
     LintId::of(collapsible_if::COLLAPSIBLE_ELSE_IF),
     LintId::of(collapsible_if::COLLAPSIBLE_IF),
-    LintId::of(collapsible_match::COLLAPSIBLE_MATCH),
     LintId::of(comparison_chain::COMPARISON_CHAIN),
     LintId::of(copies::IFS_SAME_COND),
     LintId::of(copies::IF_SAME_THEN_ELSE),
@@ -91,7 +92,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
     LintId::of(functions::NOT_UNSAFE_PTR_ARG_DEREF),
     LintId::of(functions::RESULT_UNIT_ERR),
     LintId::of(functions::TOO_MANY_ARGUMENTS),
-    LintId::of(get_last_with_len::GET_LAST_WITH_LEN),
+    LintId::of(get_first::GET_FIRST),
     LintId::of(identity_op::IDENTITY_OP),
     LintId::of(if_let_mutex::IF_LET_MUTEX),
     LintId::of(indexing_slicing::OUT_OF_BOUNDS_INDEXING),
@@ -132,23 +133,25 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
     LintId::of(main_recursion::MAIN_RECURSION),
     LintId::of(manual_async_fn::MANUAL_ASYNC_FN),
     LintId::of(manual_bits::MANUAL_BITS),
-    LintId::of(manual_map::MANUAL_MAP),
     LintId::of(manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE),
     LintId::of(manual_strip::MANUAL_STRIP),
-    LintId::of(manual_unwrap_or::MANUAL_UNWRAP_OR),
     LintId::of(map_clone::MAP_CLONE),
     LintId::of(map_unit_fn::OPTION_MAP_UNIT_FN),
     LintId::of(map_unit_fn::RESULT_MAP_UNIT_FN),
     LintId::of(match_result_ok::MATCH_RESULT_OK),
-    LintId::of(match_str_case_mismatch::MATCH_STR_CASE_MISMATCH),
+    LintId::of(matches::COLLAPSIBLE_MATCH),
     LintId::of(matches::INFALLIBLE_DESTRUCTURING_MATCH),
+    LintId::of(matches::MANUAL_MAP),
+    LintId::of(matches::MANUAL_UNWRAP_OR),
     LintId::of(matches::MATCH_AS_REF),
     LintId::of(matches::MATCH_LIKE_MATCHES_MACRO),
     LintId::of(matches::MATCH_OVERLAPPING_ARM),
     LintId::of(matches::MATCH_REF_PATS),
     LintId::of(matches::MATCH_SINGLE_BINDING),
+    LintId::of(matches::MATCH_STR_CASE_MISMATCH),
     LintId::of(matches::NEEDLESS_MATCH),
     LintId::of(matches::REDUNDANT_PATTERN_MATCHING),
+    LintId::of(matches::SIGNIFICANT_DROP_IN_SCRUTINEE),
     LintId::of(matches::SINGLE_MATCH),
     LintId::of(matches::WILDCARD_IN_OR_PATTERNS),
     LintId::of(mem_replace::MEM_REPLACE_OPTION_WITH_NONE),
@@ -166,6 +169,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
     LintId::of(methods::FILTER_MAP_IDENTITY),
     LintId::of(methods::FILTER_NEXT),
     LintId::of(methods::FLAT_MAP_IDENTITY),
+    LintId::of(methods::GET_LAST_WITH_LEN),
     LintId::of(methods::INSPECT_FOR_EACH),
     LintId::of(methods::INTO_ITER_ON_REF),
     LintId::of(methods::IS_DIGIT_ASCII_RADIX),
@@ -189,6 +193,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
     LintId::of(methods::NEEDLESS_OPTION_TAKE),
     LintId::of(methods::NEEDLESS_SPLITN),
     LintId::of(methods::NEW_RET_NO_SELF),
+    LintId::of(methods::NO_EFFECT_REPLACE),
     LintId::of(methods::OK_EXPECT),
     LintId::of(methods::OPTION_AS_REF_DEREF),
     LintId::of(methods::OPTION_FILTER_MAP),
@@ -278,7 +283,6 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
     LintId::of(self_assignment::SELF_ASSIGNMENT),
     LintId::of(self_named_constructors::SELF_NAMED_CONSTRUCTORS),
     LintId::of(serde_api::SERDE_API_MISUSE),
-    LintId::of(significant_drop_in_scrutinee::SIGNIFICANT_DROP_IN_SCRUTINEE),
     LintId::of(single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS),
     LintId::of(size_of_in_element_count::SIZE_OF_IN_ELEMENT_COUNT),
     LintId::of(slow_vector_initialization::SLOW_VECTOR_INITIALIZATION),
@@ -289,6 +293,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
     LintId::of(suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL),
     LintId::of(swap::ALMOST_SWAPPED),
     LintId::of(swap::MANUAL_SWAP),
+    LintId::of(swap_ptr_to_ref::SWAP_PTR_TO_REF),
     LintId::of(tabs_in_doc_comments::TABS_IN_DOC_COMMENTS),
     LintId::of(temporary_assignment::TEMPORARY_ASSIGNMENT),
     LintId::of(to_digit_is_some::TO_DIGIT_IS_SOME),
@@ -302,6 +307,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
     LintId::of(transmute::TRANSMUTE_NUM_TO_BYTES),
     LintId::of(transmute::TRANSMUTE_PTR_TO_REF),
     LintId::of(transmute::UNSOUND_COLLECTION_TRANSMUTE),
+    LintId::of(transmute::USELESS_TRANSMUTE),
     LintId::of(transmute::WRONG_TRANSMUTE),
     LintId::of(transmuting_null::TRANSMUTING_NULL),
     LintId::of(types::BORROWED_BOX),
diff --git a/src/tools/clippy/clippy_lints/src/lib.register_complexity.rs b/src/tools/clippy/clippy_lints/src/lib.register_complexity.rs
index b15c979d0c7..4f1c3673f85 100644
--- a/src/tools/clippy/clippy_lints/src/lib.register_complexity.rs
+++ b/src/tools/clippy/clippy_lints/src/lib.register_complexity.rs
@@ -5,6 +5,7 @@
 store.register_group(true, "clippy::complexity", Some("clippy_complexity"), vec![
     LintId::of(attrs::DEPRECATED_CFG_ATTR),
     LintId::of(booleans::NONMINIMAL_BOOL),
+    LintId::of(borrow_deref_ref::BORROW_DEREF_REF),
     LintId::of(bytes_count_to_len::BYTES_COUNT_TO_LEN),
     LintId::of(casts::CHAR_LIT_AS_U8),
     LintId::of(casts::UNNECESSARY_CAST),
@@ -15,7 +16,6 @@ store.register_group(true, "clippy::complexity", Some("clippy_complexity"), vec!
     LintId::of(explicit_write::EXPLICIT_WRITE),
     LintId::of(format::USELESS_FORMAT),
     LintId::of(functions::TOO_MANY_ARGUMENTS),
-    LintId::of(get_last_with_len::GET_LAST_WITH_LEN),
     LintId::of(identity_op::IDENTITY_OP),
     LintId::of(int_plus_one::INT_PLUS_ONE),
     LintId::of(lifetimes::EXTRA_UNUSED_LIFETIMES),
@@ -25,9 +25,9 @@ store.register_group(true, "clippy::complexity", Some("clippy_complexity"), vec!
     LintId::of(loops::SINGLE_ELEMENT_LOOP),
     LintId::of(loops::WHILE_LET_LOOP),
     LintId::of(manual_strip::MANUAL_STRIP),
-    LintId::of(manual_unwrap_or::MANUAL_UNWRAP_OR),
     LintId::of(map_unit_fn::OPTION_MAP_UNIT_FN),
     LintId::of(map_unit_fn::RESULT_MAP_UNIT_FN),
+    LintId::of(matches::MANUAL_UNWRAP_OR),
     LintId::of(matches::MATCH_AS_REF),
     LintId::of(matches::MATCH_SINGLE_BINDING),
     LintId::of(matches::NEEDLESS_MATCH),
@@ -37,6 +37,7 @@ store.register_group(true, "clippy::complexity", Some("clippy_complexity"), vec!
     LintId::of(methods::FILTER_MAP_IDENTITY),
     LintId::of(methods::FILTER_NEXT),
     LintId::of(methods::FLAT_MAP_IDENTITY),
+    LintId::of(methods::GET_LAST_WITH_LEN),
     LintId::of(methods::INSPECT_FOR_EACH),
     LintId::of(methods::ITER_COUNT),
     LintId::of(methods::MANUAL_FILTER_MAP),
@@ -90,6 +91,7 @@ store.register_group(true, "clippy::complexity", Some("clippy_complexity"), vec!
     LintId::of(transmute::TRANSMUTE_INT_TO_FLOAT),
     LintId::of(transmute::TRANSMUTE_NUM_TO_BYTES),
     LintId::of(transmute::TRANSMUTE_PTR_TO_REF),
+    LintId::of(transmute::USELESS_TRANSMUTE),
     LintId::of(types::BORROWED_BOX),
     LintId::of(types::TYPE_COMPLEXITY),
     LintId::of(types::VEC_BOX),
diff --git a/src/tools/clippy/clippy_lints/src/lib.register_correctness.rs b/src/tools/clippy/clippy_lints/src/lib.register_correctness.rs
index 6bf2c4bbaed..50cdd0af923 100644
--- a/src/tools/clippy/clippy_lints/src/lib.register_correctness.rs
+++ b/src/tools/clippy/clippy_lints/src/lib.register_correctness.rs
@@ -39,7 +39,7 @@ store.register_group(true, "clippy::correctness", Some("clippy_correctness"), ve
     LintId::of(loops::ITER_NEXT_LOOP),
     LintId::of(loops::NEVER_LOOP),
     LintId::of(loops::WHILE_IMMUTABLE_CONDITION),
-    LintId::of(match_str_case_mismatch::MATCH_STR_CASE_MISMATCH),
+    LintId::of(matches::MATCH_STR_CASE_MISMATCH),
     LintId::of(mem_replace::MEM_REPLACE_WITH_UNINIT),
     LintId::of(methods::CLONE_DOUBLE_REF),
     LintId::of(methods::ITERATOR_STEP_BY_ZERO),
diff --git a/src/tools/clippy/clippy_lints/src/lib.register_lints.rs b/src/tools/clippy/clippy_lints/src/lib.register_lints.rs
index 5552ea8aa80..b927ba3b17c 100644
--- a/src/tools/clippy/clippy_lints/src/lib.register_lints.rs
+++ b/src/tools/clippy/clippy_lints/src/lib.register_lints.rs
@@ -34,10 +34,10 @@ store.register_lints(&[
     #[cfg(feature = "internal")]
     utils::internal_lints::UNNECESSARY_SYMBOL_STR,
     absurd_extreme_comparisons::ABSURD_EXTREME_COMPARISONS,
+    almost_complete_letter_range::ALMOST_COMPLETE_LETTER_RANGE,
     approx_const::APPROX_CONSTANT,
-    arithmetic::FLOAT_ARITHMETIC,
-    arithmetic::INTEGER_ARITHMETIC,
     as_conversions::AS_CONVERSIONS,
+    as_underscore::AS_UNDERSCORE,
     asm_syntax::INLINE_ASM_X86_ATT_SYNTAX,
     asm_syntax::INLINE_ASM_X86_INTEL_SYNTAX,
     assertions_on_constants::ASSERTIONS_ON_CONSTANTS,
@@ -64,6 +64,7 @@ store.register_lints(&[
     booleans::LOGIC_BUG,
     booleans::NONMINIMAL_BOOL,
     borrow_as_ptr::BORROW_AS_PTR,
+    borrow_deref_ref::BORROW_DEREF_REF,
     bytecount::NAIVE_BYTECOUNT,
     bytes_count_to_len::BYTES_COUNT_TO_LEN,
     cargo::CARGO_COMMON_METADATA,
@@ -93,7 +94,6 @@ store.register_lints(&[
     cognitive_complexity::COGNITIVE_COMPLEXITY,
     collapsible_if::COLLAPSIBLE_ELSE_IF,
     collapsible_if::COLLAPSIBLE_IF,
-    collapsible_match::COLLAPSIBLE_MATCH,
     comparison_chain::COMPARISON_CHAIN,
     copies::BRANCHES_SHARING_CODE,
     copies::IFS_SAME_COND,
@@ -124,6 +124,7 @@ store.register_lints(&[
     doc::MISSING_PANICS_DOC,
     doc::MISSING_SAFETY_DOC,
     doc::NEEDLESS_DOCTEST_MAIN,
+    doc_link_with_quotes::DOC_LINK_WITH_QUOTES,
     double_comparison::DOUBLE_COMPARISONS,
     double_parens::DOUBLE_PARENS,
     drop_forget_ref::DROP_COPY,
@@ -183,7 +184,7 @@ store.register_lints(&[
     functions::TOO_MANY_ARGUMENTS,
     functions::TOO_MANY_LINES,
     future_not_send::FUTURE_NOT_SEND,
-    get_last_with_len::GET_LAST_WITH_LEN,
+    get_first::GET_FIRST,
     identity_op::IDENTITY_OP,
     if_let_mutex::IF_LET_MUTEX,
     if_not_else::IF_NOT_ELSE,
@@ -250,33 +251,36 @@ store.register_lints(&[
     manual_assert::MANUAL_ASSERT,
     manual_async_fn::MANUAL_ASYNC_FN,
     manual_bits::MANUAL_BITS,
-    manual_map::MANUAL_MAP,
     manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE,
     manual_ok_or::MANUAL_OK_OR,
     manual_strip::MANUAL_STRIP,
-    manual_unwrap_or::MANUAL_UNWRAP_OR,
     map_clone::MAP_CLONE,
     map_err_ignore::MAP_ERR_IGNORE,
     map_unit_fn::OPTION_MAP_UNIT_FN,
     map_unit_fn::RESULT_MAP_UNIT_FN,
-    match_on_vec_items::MATCH_ON_VEC_ITEMS,
     match_result_ok::MATCH_RESULT_OK,
-    match_str_case_mismatch::MATCH_STR_CASE_MISMATCH,
+    matches::COLLAPSIBLE_MATCH,
     matches::INFALLIBLE_DESTRUCTURING_MATCH,
+    matches::MANUAL_MAP,
+    matches::MANUAL_UNWRAP_OR,
     matches::MATCH_AS_REF,
     matches::MATCH_BOOL,
     matches::MATCH_LIKE_MATCHES_MACRO,
+    matches::MATCH_ON_VEC_ITEMS,
     matches::MATCH_OVERLAPPING_ARM,
     matches::MATCH_REF_PATS,
     matches::MATCH_SAME_ARMS,
     matches::MATCH_SINGLE_BINDING,
+    matches::MATCH_STR_CASE_MISMATCH,
     matches::MATCH_WILDCARD_FOR_SINGLE_VARIANTS,
     matches::MATCH_WILD_ERR_ARM,
     matches::NEEDLESS_MATCH,
     matches::REDUNDANT_PATTERN_MATCHING,
     matches::REST_PAT_IN_FULLY_BOUND_STRUCTS,
+    matches::SIGNIFICANT_DROP_IN_SCRUTINEE,
     matches::SINGLE_MATCH,
     matches::SINGLE_MATCH_ELSE,
+    matches::TRY_ERR,
     matches::WILDCARD_ENUM_MATCH_ARM,
     matches::WILDCARD_IN_OR_PATTERNS,
     mem_forget::MEM_FORGET,
@@ -302,6 +306,7 @@ store.register_lints(&[
     methods::FLAT_MAP_IDENTITY,
     methods::FLAT_MAP_OPTION,
     methods::FROM_ITER_INSTEAD_OF_COLLECT,
+    methods::GET_LAST_WITH_LEN,
     methods::GET_UNWRAP,
     methods::IMPLICIT_CLONE,
     methods::INEFFICIENT_TO_STRING,
@@ -330,6 +335,7 @@ store.register_lints(&[
     methods::NEEDLESS_OPTION_TAKE,
     methods::NEEDLESS_SPLITN,
     methods::NEW_RET_NO_SELF,
+    methods::NO_EFFECT_REPLACE,
     methods::OK_EXPECT,
     methods::OPTION_AS_REF_DEREF,
     methods::OPTION_FILTER_MAP,
@@ -377,6 +383,7 @@ store.register_lints(&[
     misc_early::UNNEEDED_WILDCARD_PATTERN,
     misc_early::UNSEPARATED_LITERAL_SUFFIX,
     misc_early::ZERO_PREFIXED_LITERAL,
+    mismatching_type_param_order::MISMATCHING_TYPE_PARAM_ORDER,
     missing_const_for_fn::MISSING_CONST_FOR_FN,
     missing_doc::MISSING_DOCS_IN_PRIVATE_ITEMS,
     missing_enforced_import_rename::MISSING_ENFORCED_IMPORT_RENAMES,
@@ -418,6 +425,8 @@ store.register_lints(&[
     non_octal_unix_permissions::NON_OCTAL_UNIX_PERMISSIONS,
     non_send_fields_in_send_ty::NON_SEND_FIELDS_IN_SEND_TY,
     nonstandard_macro_braces::NONSTANDARD_MACRO_BRACES,
+    numeric_arithmetic::FLOAT_ARITHMETIC,
+    numeric_arithmetic::INTEGER_ARITHMETIC,
     octal_escapes::OCTAL_ESCAPES,
     only_used_in_recursion::ONLY_USED_IN_RECURSION,
     open_options::NONSENSICAL_OPEN_OPTIONS,
@@ -473,7 +482,6 @@ store.register_lints(&[
     shadow::SHADOW_REUSE,
     shadow::SHADOW_SAME,
     shadow::SHADOW_UNRELATED,
-    significant_drop_in_scrutinee::SIGNIFICANT_DROP_IN_SCRUTINEE,
     single_char_lifetime_names::SINGLE_CHAR_LIFETIME_NAMES,
     single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS,
     size_of_in_element_count::SIZE_OF_IN_ELEMENT_COUNT,
@@ -493,6 +501,7 @@ store.register_lints(&[
     suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL,
     swap::ALMOST_SWAPPED,
     swap::MANUAL_SWAP,
+    swap_ptr_to_ref::SWAP_PTR_TO_REF,
     tabs_in_doc_comments::TABS_IN_DOC_COMMENTS,
     temporary_assignment::TEMPORARY_ASSIGNMENT,
     to_digit_is_some::TO_DIGIT_IS_SOME,
@@ -514,7 +523,6 @@ store.register_lints(&[
     transmute::USELESS_TRANSMUTE,
     transmute::WRONG_TRANSMUTE,
     transmuting_null::TRANSMUTING_NULL,
-    try_err::TRY_ERR,
     types::BORROWED_BOX,
     types::BOX_COLLECTION,
     types::LINKEDLIST,
@@ -544,6 +552,7 @@ store.register_lints(&[
     unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME,
     unused_async::UNUSED_ASYNC,
     unused_io_amount::UNUSED_IO_AMOUNT,
+    unused_rounding::UNUSED_ROUNDING,
     unused_self::UNUSED_SELF,
     unused_unit::UNUSED_UNIT,
     unwrap::PANICKING_UNWRAP,
diff --git a/src/tools/clippy/clippy_lints/src/lib.register_nursery.rs b/src/tools/clippy/clippy_lints/src/lib.register_nursery.rs
index 34d1555049d..642d629971d 100644
--- a/src/tools/clippy/clippy_lints/src/lib.register_nursery.rs
+++ b/src/tools/clippy/clippy_lints/src/lib.register_nursery.rs
@@ -25,11 +25,10 @@ store.register_group(true, "clippy::nursery", Some("clippy_nursery"), vec![
     LintId::of(path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE),
     LintId::of(redundant_pub_crate::REDUNDANT_PUB_CRATE),
     LintId::of(regex::TRIVIAL_REGEX),
-    LintId::of(significant_drop_in_scrutinee::SIGNIFICANT_DROP_IN_SCRUTINEE),
     LintId::of(strings::STRING_LIT_AS_BYTES),
     LintId::of(suspicious_operation_groupings::SUSPICIOUS_OPERATION_GROUPINGS),
     LintId::of(trailing_empty_array::TRAILING_EMPTY_ARRAY),
     LintId::of(transmute::TRANSMUTE_UNDEFINED_REPR),
-    LintId::of(transmute::USELESS_TRANSMUTE),
+    LintId::of(unused_rounding::UNUSED_ROUNDING),
     LintId::of(use_self::USE_SELF),
 ])
diff --git a/src/tools/clippy/clippy_lints/src/lib.register_pedantic.rs b/src/tools/clippy/clippy_lints/src/lib.register_pedantic.rs
index 63232fd4113..48de92ae945 100644
--- a/src/tools/clippy/clippy_lints/src/lib.register_pedantic.rs
+++ b/src/tools/clippy/clippy_lints/src/lib.register_pedantic.rs
@@ -26,6 +26,7 @@ store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), vec![
     LintId::of(doc::DOC_MARKDOWN),
     LintId::of(doc::MISSING_ERRORS_DOC),
     LintId::of(doc::MISSING_PANICS_DOC),
+    LintId::of(doc_link_with_quotes::DOC_LINK_WITH_QUOTES),
     LintId::of(empty_enum::EMPTY_ENUM),
     LintId::of(enum_variants::MODULE_NAME_REPETITIONS),
     LintId::of(eta_reduction::REDUNDANT_CLOSURE_FOR_METHOD_CALLS),
@@ -50,8 +51,8 @@ store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), vec![
     LintId::of(macro_use::MACRO_USE_IMPORTS),
     LintId::of(manual_assert::MANUAL_ASSERT),
     LintId::of(manual_ok_or::MANUAL_OK_OR),
-    LintId::of(match_on_vec_items::MATCH_ON_VEC_ITEMS),
     LintId::of(matches::MATCH_BOOL),
+    LintId::of(matches::MATCH_ON_VEC_ITEMS),
     LintId::of(matches::MATCH_SAME_ARMS),
     LintId::of(matches::MATCH_WILDCARD_FOR_SINGLE_VARIANTS),
     LintId::of(matches::MATCH_WILD_ERR_ARM),
@@ -66,6 +67,7 @@ store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), vec![
     LintId::of(methods::UNNECESSARY_JOIN),
     LintId::of(misc::FLOAT_CMP),
     LintId::of(misc::USED_UNDERSCORE_BINDING),
+    LintId::of(mismatching_type_param_order::MISMATCHING_TYPE_PARAM_ORDER),
     LintId::of(mut_mut::MUT_MUT),
     LintId::of(needless_bitwise_bool::NEEDLESS_BITWISE_BOOL),
     LintId::of(needless_continue::NEEDLESS_CONTINUE),
diff --git a/src/tools/clippy/clippy_lints/src/lib.register_restriction.rs b/src/tools/clippy/clippy_lints/src/lib.register_restriction.rs
index a6d3a06dc16..3695012f552 100644
--- a/src/tools/clippy/clippy_lints/src/lib.register_restriction.rs
+++ b/src/tools/clippy/clippy_lints/src/lib.register_restriction.rs
@@ -3,9 +3,8 @@
 // Manual edits will be overwritten.
 
 store.register_group(true, "clippy::restriction", Some("clippy_restriction"), vec![
-    LintId::of(arithmetic::FLOAT_ARITHMETIC),
-    LintId::of(arithmetic::INTEGER_ARITHMETIC),
     LintId::of(as_conversions::AS_CONVERSIONS),
+    LintId::of(as_underscore::AS_UNDERSCORE),
     LintId::of(asm_syntax::INLINE_ASM_X86_ATT_SYNTAX),
     LintId::of(asm_syntax::INLINE_ASM_X86_INTEL_SYNTAX),
     LintId::of(attrs::ALLOW_ATTRIBUTES_WITHOUT_REASON),
@@ -32,6 +31,7 @@ store.register_group(true, "clippy::restriction", Some("clippy_restriction"), ve
     LintId::of(literal_representation::DECIMAL_LITERAL_REPRESENTATION),
     LintId::of(map_err_ignore::MAP_ERR_IGNORE),
     LintId::of(matches::REST_PAT_IN_FULLY_BOUND_STRUCTS),
+    LintId::of(matches::TRY_ERR),
     LintId::of(matches::WILDCARD_ENUM_MATCH_ARM),
     LintId::of(mem_forget::MEM_FORGET),
     LintId::of(methods::CLONE_ON_REF_PTR),
@@ -50,6 +50,8 @@ store.register_group(true, "clippy::restriction", Some("clippy_restriction"), ve
     LintId::of(module_style::MOD_MODULE_FILES),
     LintId::of(module_style::SELF_NAMED_MODULE_FILES),
     LintId::of(modulo_arithmetic::MODULO_ARITHMETIC),
+    LintId::of(numeric_arithmetic::FLOAT_ARITHMETIC),
+    LintId::of(numeric_arithmetic::INTEGER_ARITHMETIC),
     LintId::of(panic_in_result_fn::PANIC_IN_RESULT_FN),
     LintId::of(panic_unimplemented::PANIC),
     LintId::of(panic_unimplemented::TODO),
@@ -67,7 +69,6 @@ store.register_group(true, "clippy::restriction", Some("clippy_restriction"), ve
     LintId::of(strings::STRING_SLICE),
     LintId::of(strings::STRING_TO_STRING),
     LintId::of(strings::STR_TO_STRING),
-    LintId::of(try_err::TRY_ERR),
     LintId::of(types::RC_BUFFER),
     LintId::of(types::RC_MUTEX),
     LintId::of(undocumented_unsafe_blocks::UNDOCUMENTED_UNSAFE_BLOCKS),
diff --git a/src/tools/clippy/clippy_lints/src/lib.register_style.rs b/src/tools/clippy/clippy_lints/src/lib.register_style.rs
index 62f26d821a0..35575351784 100644
--- a/src/tools/clippy/clippy_lints/src/lib.register_style.rs
+++ b/src/tools/clippy/clippy_lints/src/lib.register_style.rs
@@ -12,7 +12,6 @@ store.register_group(true, "clippy::style", Some("clippy_style"), vec![
     LintId::of(casts::FN_TO_NUMERIC_CAST_WITH_TRUNCATION),
     LintId::of(collapsible_if::COLLAPSIBLE_ELSE_IF),
     LintId::of(collapsible_if::COLLAPSIBLE_IF),
-    LintId::of(collapsible_match::COLLAPSIBLE_MATCH),
     LintId::of(comparison_chain::COMPARISON_CHAIN),
     LintId::of(default::FIELD_REASSIGN_WITH_DEFAULT),
     LintId::of(dereference::NEEDLESS_BORROW),
@@ -31,6 +30,7 @@ store.register_group(true, "clippy::style", Some("clippy_style"), vec![
     LintId::of(functions::DOUBLE_MUST_USE),
     LintId::of(functions::MUST_USE_UNIT),
     LintId::of(functions::RESULT_UNIT_ERR),
+    LintId::of(get_first::GET_FIRST),
     LintId::of(inherent_to_string::INHERENT_TO_STRING),
     LintId::of(init_numbered_fields::INIT_NUMBERED_FIELDS),
     LintId::of(len_zero::COMPARISON_TO_EMPTY),
@@ -45,11 +45,12 @@ store.register_group(true, "clippy::style", Some("clippy_style"), vec![
     LintId::of(main_recursion::MAIN_RECURSION),
     LintId::of(manual_async_fn::MANUAL_ASYNC_FN),
     LintId::of(manual_bits::MANUAL_BITS),
-    LintId::of(manual_map::MANUAL_MAP),
     LintId::of(manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE),
     LintId::of(map_clone::MAP_CLONE),
     LintId::of(match_result_ok::MATCH_RESULT_OK),
+    LintId::of(matches::COLLAPSIBLE_MATCH),
     LintId::of(matches::INFALLIBLE_DESTRUCTURING_MATCH),
+    LintId::of(matches::MANUAL_MAP),
     LintId::of(matches::MATCH_LIKE_MATCHES_MACRO),
     LintId::of(matches::MATCH_OVERLAPPING_ARM),
     LintId::of(matches::MATCH_REF_PATS),
diff --git a/src/tools/clippy/clippy_lints/src/lib.register_suspicious.rs b/src/tools/clippy/clippy_lints/src/lib.register_suspicious.rs
index 2de49f1624a..7b13713c36e 100644
--- a/src/tools/clippy/clippy_lints/src/lib.register_suspicious.rs
+++ b/src/tools/clippy/clippy_lints/src/lib.register_suspicious.rs
@@ -3,6 +3,7 @@
 // Manual edits will be overwritten.
 
 store.register_group(true, "clippy::suspicious", Some("clippy_suspicious"), vec![
+    LintId::of(almost_complete_letter_range::ALMOST_COMPLETE_LETTER_RANGE),
     LintId::of(assign_ops::MISREFACTORED_ASSIGN_OP),
     LintId::of(attrs::BLANKET_CLIPPY_RESTRICTION_LINTS),
     LintId::of(await_holding_invalid::AWAIT_HOLDING_INVALID_TYPE),
@@ -23,11 +24,13 @@ store.register_group(true, "clippy::suspicious", Some("clippy_suspicious"), vec!
     LintId::of(loops::EMPTY_LOOP),
     LintId::of(loops::FOR_LOOPS_OVER_FALLIBLES),
     LintId::of(loops::MUT_RANGE_BOUND),
+    LintId::of(matches::SIGNIFICANT_DROP_IN_SCRUTINEE),
+    LintId::of(methods::NO_EFFECT_REPLACE),
     LintId::of(methods::SUSPICIOUS_MAP),
     LintId::of(mut_key::MUTABLE_KEY_TYPE),
     LintId::of(octal_escapes::OCTAL_ESCAPES),
     LintId::of(rc_clone_in_vec_init::RC_CLONE_IN_VEC_INIT),
-    LintId::of(significant_drop_in_scrutinee::SIGNIFICANT_DROP_IN_SCRUTINEE),
     LintId::of(suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL),
     LintId::of(suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL),
+    LintId::of(swap_ptr_to_ref::SWAP_PTR_TO_REF),
 ])
diff --git a/src/tools/clippy/clippy_lints/src/lib.rs b/src/tools/clippy/clippy_lints/src/lib.rs
index 4ac834f7240..ee0416fc0ff 100644
--- a/src/tools/clippy/clippy_lints/src/lib.rs
+++ b/src/tools/clippy/clippy_lints/src/lib.rs
@@ -168,9 +168,10 @@ mod renamed_lints;
 
 // begin lints modules, do not remove this comment, it’s used in `update_lints`
 mod absurd_extreme_comparisons;
+mod almost_complete_letter_range;
 mod approx_const;
-mod arithmetic;
 mod as_conversions;
+mod as_underscore;
 mod asm_syntax;
 mod assertions_on_constants;
 mod assign_ops;
@@ -183,6 +184,7 @@ mod blocks_in_if_conditions;
 mod bool_assert_comparison;
 mod booleans;
 mod borrow_as_ptr;
+mod borrow_deref_ref;
 mod bytecount;
 mod bytes_count_to_len;
 mod cargo;
@@ -191,7 +193,6 @@ mod casts;
 mod checked_conversions;
 mod cognitive_complexity;
 mod collapsible_if;
-mod collapsible_match;
 mod comparison_chain;
 mod copies;
 mod copy_iterator;
@@ -208,6 +209,7 @@ mod disallowed_methods;
 mod disallowed_script_idents;
 mod disallowed_types;
 mod doc;
+mod doc_link_with_quotes;
 mod double_comparison;
 mod double_parens;
 mod drop_forget_ref;
@@ -242,7 +244,7 @@ mod from_over_into;
 mod from_str_radix_10;
 mod functions;
 mod future_not_send;
-mod get_last_with_len;
+mod get_first;
 mod identity_op;
 mod if_let_mutex;
 mod if_not_else;
@@ -278,17 +280,13 @@ mod main_recursion;
 mod manual_assert;
 mod manual_async_fn;
 mod manual_bits;
-mod manual_map;
 mod manual_non_exhaustive;
 mod manual_ok_or;
 mod manual_strip;
-mod manual_unwrap_or;
 mod map_clone;
 mod map_err_ignore;
 mod map_unit_fn;
-mod match_on_vec_items;
 mod match_result_ok;
-mod match_str_case_mismatch;
 mod matches;
 mod mem_forget;
 mod mem_replace;
@@ -296,6 +294,7 @@ mod methods;
 mod minmax;
 mod misc;
 mod misc_early;
+mod mismatching_type_param_order;
 mod missing_const_for_fn;
 mod missing_doc;
 mod missing_enforced_import_rename;
@@ -328,6 +327,7 @@ mod non_expressive_names;
 mod non_octal_unix_permissions;
 mod non_send_fields_in_send_ty;
 mod nonstandard_macro_braces;
+mod numeric_arithmetic;
 mod octal_escapes;
 mod only_used_in_recursion;
 mod open_options;
@@ -367,7 +367,6 @@ mod self_named_constructors;
 mod semicolon_if_nothing_returned;
 mod serde_api;
 mod shadow;
-mod significant_drop_in_scrutinee;
 mod single_char_lifetime_names;
 mod single_component_path_imports;
 mod size_of_in_element_count;
@@ -378,6 +377,7 @@ mod strlen_on_c_strings;
 mod suspicious_operation_groupings;
 mod suspicious_trait_impl;
 mod swap;
+mod swap_ptr_to_ref;
 mod tabs_in_doc_comments;
 mod temporary_assignment;
 mod to_digit_is_some;
@@ -385,7 +385,6 @@ mod trailing_empty_array;
 mod trait_bounds;
 mod transmute;
 mod transmuting_null;
-mod try_err;
 mod types;
 mod undocumented_unsafe_blocks;
 mod unicode;
@@ -402,6 +401,7 @@ mod unnested_or_patterns;
 mod unsafe_removed_from_name;
 mod unused_async;
 mod unused_io_amount;
+mod unused_rounding;
 mod unused_self;
 mod unused_unit;
 mod unwrap;
@@ -562,7 +562,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
     store.register_late_pass(|| Box::new(len_zero::LenZero));
     store.register_late_pass(|| Box::new(attrs::Attributes));
     store.register_late_pass(|| Box::new(blocks_in_if_conditions::BlocksInIfConditions));
-    store.register_late_pass(|| Box::new(collapsible_match::CollapsibleMatch));
     store.register_late_pass(|| Box::new(unicode::Unicode));
     store.register_late_pass(|| Box::new(uninit_vec::UninitVec));
     store.register_late_pass(|| Box::new(unit_hash::UnitHash));
@@ -636,6 +635,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
     store.register_late_pass(|| Box::new(mutex_atomic::Mutex));
     store.register_late_pass(|| Box::new(needless_update::NeedlessUpdate));
     store.register_late_pass(|| Box::new(needless_borrowed_ref::NeedlessBorrowedRef));
+    store.register_late_pass(|| Box::new(borrow_deref_ref::BorrowDerefRef));
     store.register_late_pass(|| Box::new(no_effect::NoEffect));
     store.register_late_pass(|| Box::new(temporary_assignment::TemporaryAssignment));
     store.register_late_pass(|| Box::new(transmute::Transmute));
@@ -652,7 +652,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
     store.register_late_pass(|| Box::new(strings::StringLitAsBytes));
     store.register_late_pass(|| Box::new(derive::Derive));
     store.register_late_pass(|| Box::new(derivable_impls::DerivableImpls));
-    store.register_late_pass(|| Box::new(get_last_with_len::GetLastWithLen));
     store.register_late_pass(|| Box::new(drop_forget_ref::DropForgetRef));
     store.register_late_pass(|| Box::new(empty_enum::EmptyEnum));
     store.register_late_pass(|| Box::new(absurd_extreme_comparisons::AbsurdExtremeComparisons));
@@ -678,7 +677,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
     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_forget::MemForget));
-    store.register_late_pass(|| Box::new(arithmetic::Arithmetic::default()));
+    store.register_late_pass(|| Box::new(numeric_arithmetic::NumericArithmetic::default()));
     store.register_late_pass(|| Box::new(assign_ops::AssignOps));
     store.register_late_pass(|| Box::new(let_if_seq::LetIfSeq));
     store.register_late_pass(|| Box::new(mixed_read_write_in_expression::EvalOrderDependence));
@@ -700,7 +699,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
     );
     store.register_late_pass(move || Box::new(pass_by_ref_or_value));
     store.register_late_pass(|| Box::new(ref_option_ref::RefOptionRef));
-    store.register_late_pass(|| Box::new(try_err::TryErr));
     store.register_late_pass(|| Box::new(bytecount::ByteCount));
     store.register_late_pass(|| Box::new(infinite_iter::InfiniteIter));
     store.register_late_pass(|| Box::new(inline_fn_without_body::InlineFnWithoutBody));
@@ -812,7 +810,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
     store.register_late_pass(|| Box::new(if_not_else::IfNotElse));
     store.register_late_pass(|| Box::new(equatable_if_let::PatternEquality));
     store.register_late_pass(|| Box::new(mut_mutex_lock::MutMutexLock));
-    store.register_late_pass(|| Box::new(match_on_vec_items::MatchOnVecItems));
     store.register_late_pass(|| Box::new(manual_async_fn::ManualAsyncFn));
     store.register_late_pass(|| Box::new(vec_resize_to_zero::VecResizeToZero));
     store.register_late_pass(|| Box::new(panic_in_result_fn::PanicInResultFn));
@@ -830,7 +827,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
     store.register_late_pass(|| Box::new(repeat_once::RepeatOnce));
     store.register_late_pass(|| Box::new(unwrap_in_result::UnwrapInResult));
     store.register_late_pass(|| Box::new(self_assignment::SelfAssignment));
-    store.register_late_pass(|| Box::new(manual_unwrap_or::ManualUnwrapOr));
     store.register_late_pass(|| Box::new(manual_ok_or::ManualOkOr));
     store.register_late_pass(|| Box::new(float_equality_without_abs::FloatEqualityWithoutAbs));
     store.register_late_pass(|| Box::new(semicolon_if_nothing_returned::SemicolonIfNothingReturned));
@@ -849,7 +845,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
     });
     store.register_late_pass(|| Box::new(redundant_slicing::RedundantSlicing));
     store.register_late_pass(|| Box::new(from_str_radix_10::FromStrRadix10));
-    store.register_late_pass(|| Box::new(manual_map::ManualMap));
     store.register_late_pass(move || Box::new(if_then_some_else_none::IfThenSomeElseNone::new(msrv)));
     store.register_late_pass(|| Box::new(bool_assert_comparison::BoolAssertComparison));
     store.register_early_pass(move || Box::new(module_style::ModStyle));
@@ -875,7 +870,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
         ))
     });
     store.register_late_pass(move || Box::new(undocumented_unsafe_blocks::UndocumentedUnsafeBlocks));
-    store.register_late_pass(|| Box::new(match_str_case_mismatch::MatchStrCaseMismatch));
     store.register_late_pass(move || Box::new(format_args::FormatArgs));
     store.register_late_pass(|| Box::new(trailing_empty_array::TrailingEmptyArray));
     store.register_early_pass(|| Box::new(octal_escapes::OctalEscapes));
@@ -886,9 +880,10 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
     store.register_late_pass(move || Box::new(borrow_as_ptr::BorrowAsPtr::new(msrv)));
     store.register_late_pass(move || Box::new(manual_bits::ManualBits::new(msrv)));
     store.register_late_pass(|| Box::new(default_union_representation::DefaultUnionRepresentation));
+    store.register_early_pass(|| Box::new(doc_link_with_quotes::DocLinkWithQuotes));
     store.register_late_pass(|| Box::new(only_used_in_recursion::OnlyUsedInRecursion));
-    store.register_late_pass(|| Box::new(significant_drop_in_scrutinee::SignificantDropInScrutinee));
-    store.register_late_pass(|| Box::new(dbg_macro::DbgMacro));
+    let allow_dbg_in_tests = conf.allow_dbg_in_tests;
+    store.register_late_pass(move || Box::new(dbg_macro::DbgMacro::new(allow_dbg_in_tests)));
     let cargo_ignore_publish = conf.cargo_ignore_publish;
     store.register_late_pass(move || {
         Box::new(cargo::Cargo {
@@ -906,6 +901,12 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
     store.register_late_pass(|| Box::new(strings::TrimSplitWhitespace));
     store.register_late_pass(|| Box::new(rc_clone_in_vec_init::RcCloneInVecInit));
     store.register_early_pass(|| Box::new(duplicate_mod::DuplicateMod::default()));
+    store.register_late_pass(|| Box::new(get_first::GetFirst));
+    store.register_early_pass(|| Box::new(unused_rounding::UnusedRounding));
+    store.register_early_pass(move || Box::new(almost_complete_letter_range::AlmostCompleteLetterRange::new(msrv)));
+    store.register_late_pass(|| Box::new(swap_ptr_to_ref::SwapPtrToRef));
+    store.register_late_pass(|| Box::new(mismatching_type_param_order::TypeParamMismatch));
+    store.register_late_pass(|| Box::new(as_underscore::AsUnderscore));
     // add lints here, do not remove this comment, it's used in `new_lint`
 }
 
diff --git a/src/tools/clippy/clippy_lints/src/lifetimes.rs b/src/tools/clippy/clippy_lints/src/lifetimes.rs
index 51d5b510ab9..070c7e59142 100644
--- a/src/tools/clippy/clippy_lints/src/lifetimes.rs
+++ b/src/tools/clippy/clippy_lints/src/lifetimes.rs
@@ -371,7 +371,7 @@ impl<'a, 'tcx> RefVisitor<'a, 'tcx> {
         if let Some(ref lt) = *lifetime {
             if lt.name == LifetimeName::Static {
                 self.lts.push(RefLt::Static);
-            } else if let LifetimeName::Param(ParamName::Fresh(_)) = lt.name {
+            } else if let LifetimeName::Param(_, ParamName::Fresh) = lt.name {
                 // Fresh lifetimes generated should be ignored.
             } else if lt.is_elided() {
                 self.lts.push(RefLt::Unnamed);
diff --git a/src/tools/clippy/clippy_lints/src/loops/mod.rs b/src/tools/clippy/clippy_lints/src/loops/mod.rs
index 75d771f992a..d61be78895f 100644
--- a/src/tools/clippy/clippy_lints/src/loops/mod.rs
+++ b/src/tools/clippy/clippy_lints/src/loops/mod.rs
@@ -180,29 +180,24 @@ declare_clippy_lint! {
     /// ### Example
     /// ```rust
     /// # let opt = Some(1);
-    ///
-    /// // Bad
+    /// # let res: Result<i32, std::io::Error> = Ok(1);
     /// for x in opt {
     ///     // ..
     /// }
     ///
-    /// // Good
-    /// if let Some(x) = opt {
+    /// for x in &res {
     ///     // ..
     /// }
     /// ```
     ///
-    /// // or
-    ///
+    /// Use instead:
     /// ```rust
+    /// # let opt = Some(1);
     /// # let res: Result<i32, std::io::Error> = Ok(1);
-    ///
-    /// // Bad
-    /// for x in &res {
+    /// if let Some(x) = opt {
     ///     // ..
     /// }
     ///
-    /// // Good
     /// if let Ok(x) = res {
     ///     // ..
     /// }
diff --git a/src/tools/clippy/clippy_lints/src/loops/needless_range_loop.rs b/src/tools/clippy/clippy_lints/src/loops/needless_range_loop.rs
index 4f85364965b..a348bb465c8 100644
--- a/src/tools/clippy/clippy_lints/src/loops/needless_range_loop.rs
+++ b/src/tools/clippy/clippy_lints/src/loops/needless_range_loop.rs
@@ -3,9 +3,7 @@ use clippy_utils::diagnostics::{multispan_sugg, span_lint_and_then};
 use clippy_utils::source::snippet;
 use clippy_utils::ty::has_iter_method;
 use clippy_utils::visitors::is_local_used;
-use clippy_utils::{
-    contains_name, higher, is_integer_const, match_trait_method, paths, sugg, SpanlessEq,
-};
+use clippy_utils::{contains_name, higher, is_integer_const, match_trait_method, paths, sugg, SpanlessEq};
 use if_chain::if_chain;
 use rustc_ast::ast;
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
@@ -29,7 +27,12 @@ pub(super) fn check<'tcx>(
     body: &'tcx Expr<'_>,
     expr: &'tcx Expr<'_>,
 ) {
-    if let Some(higher::Range { start: Some(start), ref end, limits }) = higher::Range::hir(arg) {
+    if let Some(higher::Range {
+        start: Some(start),
+        ref end,
+        limits,
+    }) = higher::Range::hir(arg)
+    {
         // the var must be a single name
         if let PatKind::Binding(_, canonical_id, ident, _) = pat.kind {
             let mut visitor = VarVisitor {
@@ -104,22 +107,19 @@ pub(super) fn check<'tcx>(
                         }
                     }
 
-                    if is_len_call(end, indexed) || is_end_eq_array_len(cx, end, limits, indexed_ty)
-                    {
+                    if is_len_call(end, indexed) || is_end_eq_array_len(cx, end, limits, indexed_ty) {
                         String::new()
-                    } else if visitor.indexed_mut.contains(&indexed)
-                        && contains_name(indexed, take_expr)
-                    {
+                    } else if visitor.indexed_mut.contains(&indexed) && contains_name(indexed, take_expr) {
                         return;
                     } else {
                         match limits {
                             ast::RangeLimits::Closed => {
                                 let take_expr = sugg::Sugg::hir(cx, take_expr, "<count>");
                                 format!(".take({})", take_expr + sugg::ONE)
-                            }
+                            },
                             ast::RangeLimits::HalfOpen => {
                                 format!(".take({})", snippet(cx, take_expr.span, ".."))
-                            }
+                            },
                         }
                     }
                 } else {
@@ -145,10 +145,7 @@ pub(super) fn check<'tcx>(
                         cx,
                         NEEDLESS_RANGE_LOOP,
                         arg.span,
-                        &format!(
-                            "the loop variable `{}` is used to index `{}`",
-                            ident.name, indexed
-                        ),
+                        &format!("the loop variable `{}` is used to index `{}`", ident.name, indexed),
                         |diag| {
                             multispan_sugg(
                                 diag,
@@ -157,10 +154,7 @@ pub(super) fn check<'tcx>(
                                     (pat.span, format!("({}, <item>)", ident.name)),
                                     (
                                         arg.span,
-                                        format!(
-                                            "{}.{}().enumerate(){}{}",
-                                            indexed, method, method_1, method_2
-                                        ),
+                                        format!("{}.{}().enumerate(){}{}", indexed, method, method_1, method_2),
                                     ),
                                 ],
                             );
@@ -177,10 +171,7 @@ pub(super) fn check<'tcx>(
                         cx,
                         NEEDLESS_RANGE_LOOP,
                         arg.span,
-                        &format!(
-                            "the loop variable `{}` is only used to index `{}`",
-                            ident.name, indexed
-                        ),
+                        &format!("the loop variable `{}` is only used to index `{}`", ident.name, indexed),
                         |diag| {
                             multispan_sugg(
                                 diag,
@@ -257,12 +248,7 @@ struct VarVisitor<'a, 'tcx> {
 }
 
 impl<'a, 'tcx> VarVisitor<'a, 'tcx> {
-    fn check(
-        &mut self,
-        idx: &'tcx Expr<'_>,
-        seqexpr: &'tcx Expr<'_>,
-        expr: &'tcx Expr<'_>,
-    ) -> bool {
+    fn check(&mut self, idx: &'tcx Expr<'_>, seqexpr: &'tcx Expr<'_>, expr: &'tcx Expr<'_>) -> bool {
         if_chain! {
             // the indexed container is referenced by a name
             if let ExprKind::Path(ref seqpath) = seqexpr.kind;
@@ -351,13 +337,13 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
                 self.visit_expr(lhs);
                 self.prefer_mutable = false;
                 self.visit_expr(rhs);
-            }
+            },
             ExprKind::AddrOf(BorrowKind::Ref, mutbl, expr) => {
                 if mutbl == Mutability::Mut {
                     self.prefer_mutable = true;
                 }
                 self.visit_expr(expr);
-            }
+            },
             ExprKind::Call(f, args) => {
                 self.visit_expr(f);
                 for expr in args {
@@ -370,11 +356,10 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
                     }
                     self.visit_expr(expr);
                 }
-            }
+            },
             ExprKind::MethodCall(_, args, _) => {
                 let def_id = self.cx.typeck_results().type_dependent_def_id(expr.hir_id).unwrap();
-                for (ty, expr) in iter::zip(self.cx.tcx.fn_sig(def_id).inputs().skip_binder(), args)
-                {
+                for (ty, expr) in iter::zip(self.cx.tcx.fn_sig(def_id).inputs().skip_binder(), args) {
                     self.prefer_mutable = false;
                     if let ty::Ref(_, _, mutbl) = *ty.kind() {
                         if mutbl == Mutability::Mut {
@@ -383,11 +368,11 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
                     }
                     self.visit_expr(expr);
                 }
-            }
+            },
             ExprKind::Closure(_, _, body_id, ..) => {
                 let body = self.cx.tcx.hir().body(body_id);
                 self.visit_expr(&body.value);
-            }
+            },
             _ => walk_expr(self, expr),
         }
         self.prefer_mutable = old;
diff --git a/src/tools/clippy/clippy_lints/src/loops/never_loop.rs b/src/tools/clippy/clippy_lints/src/loops/never_loop.rs
index 70a118d6b35..c025f5972d5 100644
--- a/src/tools/clippy/clippy_lints/src/loops/never_loop.rs
+++ b/src/tools/clippy/clippy_lints/src/loops/never_loop.rs
@@ -146,7 +146,7 @@ fn never_loop_expr(expr: &Expr<'_>, main_loop_id: HirId) -> NeverLoopResult {
             if arms.is_empty() {
                 e
             } else {
-                let arms = never_loop_expr_branch(&mut arms.iter().map(|a| &*a.body), main_loop_id);
+                let arms = never_loop_expr_branch(&mut arms.iter().map(|a| a.body), main_loop_id);
                 combine_seq(e, arms)
             }
         },
diff --git a/src/tools/clippy/clippy_lints/src/manual_map.rs b/src/tools/clippy/clippy_lints/src/manual_map.rs
deleted file mode 100644
index 230ae029ed9..00000000000
--- a/src/tools/clippy/clippy_lints/src/manual_map.rs
+++ /dev/null
@@ -1,316 +0,0 @@
-use crate::{map_unit_fn::OPTION_MAP_UNIT_FN, matches::MATCH_AS_REF};
-use clippy_utils::diagnostics::span_lint_and_sugg;
-use clippy_utils::higher::IfLetOrMatch;
-use clippy_utils::source::{snippet_with_applicability, snippet_with_context};
-use clippy_utils::ty::{is_type_diagnostic_item, peel_mid_ty_refs_is_mutable, type_is_unsafe_function};
-use clippy_utils::{
-    can_move_expr_to_closure, in_constant, is_else_clause, is_lang_ctor, is_lint_allowed, path_to_local_id,
-    peel_blocks, peel_hir_expr_refs, peel_hir_expr_while, CaptureKind,
-};
-use rustc_ast::util::parser::PREC_POSTFIX;
-use rustc_errors::Applicability;
-use rustc_hir::LangItem::{OptionNone, OptionSome};
-use rustc_hir::{
-    def::Res, Arm, BindingAnnotation, Block, BlockCheckMode, Expr, ExprKind, HirId, Mutability, Pat, PatKind, Path,
-    QPath, UnsafeSource,
-};
-use rustc_lint::{LateContext, LateLintPass, LintContext};
-use rustc_middle::lint::in_external_macro;
-use rustc_session::{declare_lint_pass, declare_tool_lint};
-use rustc_span::{sym, SyntaxContext};
-
-declare_clippy_lint! {
-    /// ### What it does
-    /// Checks for usages of `match` which could be implemented using `map`
-    ///
-    /// ### Why is this bad?
-    /// Using the `map` method is clearer and more concise.
-    ///
-    /// ### Example
-    /// ```rust
-    /// match Some(0) {
-    ///     Some(x) => Some(x + 1),
-    ///     None => None,
-    /// };
-    /// ```
-    /// Use instead:
-    /// ```rust
-    /// Some(0).map(|x| x + 1);
-    /// ```
-    #[clippy::version = "1.52.0"]
-    pub MANUAL_MAP,
-    style,
-    "reimplementation of `map`"
-}
-
-declare_lint_pass!(ManualMap => [MANUAL_MAP]);
-
-impl<'tcx> LateLintPass<'tcx> for ManualMap {
-    #[expect(clippy::too_many_lines)]
-    fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
-        let (scrutinee, then_pat, then_body, else_pat, else_body) = match IfLetOrMatch::parse(cx, expr) {
-            Some(IfLetOrMatch::IfLet(scrutinee, pat, body, Some(r#else))) => (scrutinee, pat, body, None, r#else),
-            Some(IfLetOrMatch::Match(
-                scrutinee,
-                [arm1 @ Arm { guard: None, .. }, arm2 @ Arm { guard: None, .. }],
-                _,
-            )) => (scrutinee, arm1.pat, arm1.body, Some(arm2.pat), arm2.body),
-            _ => return,
-        };
-        if in_external_macro(cx.sess(), expr.span) || in_constant(cx, expr.hir_id) {
-            return;
-        }
-
-        let (scrutinee_ty, ty_ref_count, ty_mutability) =
-            peel_mid_ty_refs_is_mutable(cx.typeck_results().expr_ty(scrutinee));
-        if !(is_type_diagnostic_item(cx, scrutinee_ty, sym::Option)
-            && is_type_diagnostic_item(cx, cx.typeck_results().expr_ty(expr), sym::Option))
-        {
-            return;
-        }
-
-        let expr_ctxt = expr.span.ctxt();
-        let (some_expr, some_pat, pat_ref_count, is_wild_none) = match (
-            try_parse_pattern(cx, then_pat, expr_ctxt),
-            else_pat.map_or(Some(OptionPat::Wild), |p| try_parse_pattern(cx, p, expr_ctxt)),
-        ) {
-            (Some(OptionPat::Wild), Some(OptionPat::Some { pattern, ref_count })) if is_none_expr(cx, then_body) => {
-                (else_body, pattern, ref_count, true)
-            },
-            (Some(OptionPat::None), Some(OptionPat::Some { pattern, ref_count })) if is_none_expr(cx, then_body) => {
-                (else_body, pattern, ref_count, false)
-            },
-            (Some(OptionPat::Some { pattern, ref_count }), Some(OptionPat::Wild)) if is_none_expr(cx, else_body) => {
-                (then_body, pattern, ref_count, true)
-            },
-            (Some(OptionPat::Some { pattern, ref_count }), Some(OptionPat::None)) if is_none_expr(cx, else_body) => {
-                (then_body, pattern, ref_count, false)
-            },
-            _ => return,
-        };
-
-        // Top level or patterns aren't allowed in closures.
-        if matches!(some_pat.kind, PatKind::Or(_)) {
-            return;
-        }
-
-        let some_expr = match get_some_expr(cx, some_expr, false, expr_ctxt) {
-            Some(expr) => expr,
-            None => return,
-        };
-
-        // These two lints will go back and forth with each other.
-        if cx.typeck_results().expr_ty(some_expr.expr) == cx.tcx.types.unit
-            && !is_lint_allowed(cx, OPTION_MAP_UNIT_FN, expr.hir_id)
-        {
-            return;
-        }
-
-        // `map` won't perform any adjustments.
-        if !cx.typeck_results().expr_adjustments(some_expr.expr).is_empty() {
-            return;
-        }
-
-        // Determine which binding mode to use.
-        let explicit_ref = some_pat.contains_explicit_ref_binding();
-        let binding_ref = explicit_ref.or_else(|| (ty_ref_count != pat_ref_count).then(|| ty_mutability));
-
-        let as_ref_str = match binding_ref {
-            Some(Mutability::Mut) => ".as_mut()",
-            Some(Mutability::Not) => ".as_ref()",
-            None => "",
-        };
-
-        match can_move_expr_to_closure(cx, some_expr.expr) {
-            Some(captures) => {
-                // Check if captures the closure will need conflict with borrows made in the scrutinee.
-                // TODO: check all the references made in the scrutinee expression. This will require interacting
-                // with the borrow checker. Currently only `<local>[.<field>]*` is checked for.
-                if let Some(binding_ref_mutability) = binding_ref {
-                    let e = peel_hir_expr_while(scrutinee, |e| match e.kind {
-                        ExprKind::Field(e, _) | ExprKind::AddrOf(_, _, e) => Some(e),
-                        _ => None,
-                    });
-                    if let ExprKind::Path(QPath::Resolved(None, Path { res: Res::Local(l), .. })) = e.kind {
-                        match captures.get(l) {
-                            Some(CaptureKind::Value | CaptureKind::Ref(Mutability::Mut)) => return,
-                            Some(CaptureKind::Ref(Mutability::Not)) if binding_ref_mutability == Mutability::Mut => {
-                                return;
-                            },
-                            Some(CaptureKind::Ref(Mutability::Not)) | None => (),
-                        }
-                    }
-                }
-            },
-            None => return,
-        };
-
-        let mut app = Applicability::MachineApplicable;
-
-        // Remove address-of expressions from the scrutinee. Either `as_ref` will be called, or
-        // it's being passed by value.
-        let scrutinee = peel_hir_expr_refs(scrutinee).0;
-        let (scrutinee_str, _) = snippet_with_context(cx, scrutinee.span, expr_ctxt, "..", &mut app);
-        let scrutinee_str =
-            if scrutinee.span.ctxt() == expr.span.ctxt() && scrutinee.precedence().order() < PREC_POSTFIX {
-                format!("({})", scrutinee_str)
-            } else {
-                scrutinee_str.into()
-            };
-
-        let body_str = if let PatKind::Binding(annotation, id, some_binding, None) = some_pat.kind {
-            if_chain! {
-                if !some_expr.needs_unsafe_block;
-                if let Some(func) = can_pass_as_func(cx, id, some_expr.expr);
-                if func.span.ctxt() == some_expr.expr.span.ctxt();
-                then {
-                    snippet_with_applicability(cx, func.span, "..", &mut app).into_owned()
-                } else {
-                    if path_to_local_id(some_expr.expr, id)
-                        && !is_lint_allowed(cx, MATCH_AS_REF, expr.hir_id)
-                        && binding_ref.is_some()
-                    {
-                        return;
-                    }
-
-                    // `ref` and `ref mut` annotations were handled earlier.
-                    let annotation = if matches!(annotation, BindingAnnotation::Mutable) {
-                        "mut "
-                    } else {
-                        ""
-                    };
-                    let expr_snip = snippet_with_context(cx, some_expr.expr.span, expr_ctxt, "..", &mut app).0;
-                    if some_expr.needs_unsafe_block {
-                        format!("|{}{}| unsafe {{ {} }}", annotation, some_binding, expr_snip)
-                    } else {
-                        format!("|{}{}| {}", annotation, some_binding, expr_snip)
-                    }
-                }
-            }
-        } else if !is_wild_none && explicit_ref.is_none() {
-            // TODO: handle explicit reference annotations.
-            let pat_snip = snippet_with_context(cx, some_pat.span, expr_ctxt, "..", &mut app).0;
-            let expr_snip = snippet_with_context(cx, some_expr.expr.span, expr_ctxt, "..", &mut app).0;
-            if some_expr.needs_unsafe_block {
-                format!("|{}| unsafe {{ {} }}", pat_snip, expr_snip)
-            } else {
-                format!("|{}| {}", pat_snip, expr_snip)
-            }
-        } else {
-            // Refutable bindings and mixed reference annotations can't be handled by `map`.
-            return;
-        };
-
-        span_lint_and_sugg(
-            cx,
-            MANUAL_MAP,
-            expr.span,
-            "manual implementation of `Option::map`",
-            "try this",
-            if else_pat.is_none() && is_else_clause(cx.tcx, expr) {
-                format!("{{ {}{}.map({}) }}", scrutinee_str, as_ref_str, body_str)
-            } else {
-                format!("{}{}.map({})", scrutinee_str, as_ref_str, body_str)
-            },
-            app,
-        );
-    }
-}
-
-// Checks whether the expression could be passed as a function, or whether a closure is needed.
-// Returns the function to be passed to `map` if it exists.
-fn can_pass_as_func<'tcx>(cx: &LateContext<'tcx>, binding: HirId, expr: &'tcx Expr<'_>) -> Option<&'tcx Expr<'tcx>> {
-    match expr.kind {
-        ExprKind::Call(func, [arg])
-            if path_to_local_id(arg, binding)
-                && cx.typeck_results().expr_adjustments(arg).is_empty()
-                && !type_is_unsafe_function(cx, cx.typeck_results().expr_ty(func).peel_refs()) =>
-        {
-            Some(func)
-        },
-        _ => None,
-    }
-}
-
-enum OptionPat<'a> {
-    Wild,
-    None,
-    Some {
-        // The pattern contained in the `Some` tuple.
-        pattern: &'a Pat<'a>,
-        // The number of references before the `Some` tuple.
-        // e.g. `&&Some(_)` has a ref count of 2.
-        ref_count: usize,
-    },
-}
-
-struct SomeExpr<'tcx> {
-    expr: &'tcx Expr<'tcx>,
-    needs_unsafe_block: bool,
-}
-
-// Try to parse into a recognized `Option` pattern.
-// i.e. `_`, `None`, `Some(..)`, or a reference to any of those.
-fn try_parse_pattern<'tcx>(cx: &LateContext<'tcx>, pat: &'tcx Pat<'_>, ctxt: SyntaxContext) -> Option<OptionPat<'tcx>> {
-    fn f<'tcx>(
-        cx: &LateContext<'tcx>,
-        pat: &'tcx Pat<'_>,
-        ref_count: usize,
-        ctxt: SyntaxContext,
-    ) -> Option<OptionPat<'tcx>> {
-        match pat.kind {
-            PatKind::Wild => Some(OptionPat::Wild),
-            PatKind::Ref(pat, _) => f(cx, pat, ref_count + 1, ctxt),
-            PatKind::Path(ref qpath) if is_lang_ctor(cx, qpath, OptionNone) => Some(OptionPat::None),
-            PatKind::TupleStruct(ref qpath, [pattern], _)
-                if is_lang_ctor(cx, qpath, OptionSome) && pat.span.ctxt() == ctxt =>
-            {
-                Some(OptionPat::Some { pattern, ref_count })
-            },
-            _ => None,
-        }
-    }
-    f(cx, pat, 0, ctxt)
-}
-
-// Checks for an expression wrapped by the `Some` constructor. Returns the contained expression.
-fn get_some_expr<'tcx>(
-    cx: &LateContext<'tcx>,
-    expr: &'tcx Expr<'_>,
-    needs_unsafe_block: bool,
-    ctxt: SyntaxContext,
-) -> Option<SomeExpr<'tcx>> {
-    // TODO: Allow more complex expressions.
-    match expr.kind {
-        ExprKind::Call(
-            Expr {
-                kind: ExprKind::Path(ref qpath),
-                ..
-            },
-            [arg],
-        ) if ctxt == expr.span.ctxt() && is_lang_ctor(cx, qpath, OptionSome) => Some(SomeExpr {
-            expr: arg,
-            needs_unsafe_block,
-        }),
-        ExprKind::Block(
-            Block {
-                stmts: [],
-                expr: Some(expr),
-                rules,
-                ..
-            },
-            _,
-        ) => get_some_expr(
-            cx,
-            expr,
-            needs_unsafe_block || *rules == BlockCheckMode::UnsafeBlock(UnsafeSource::UserProvided),
-            ctxt,
-        ),
-        _ => None,
-    }
-}
-
-// Checks for the `None` value.
-fn is_none_expr(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
-    matches!(peel_blocks(expr).kind, ExprKind::Path(ref qpath) if is_lang_ctor(cx, qpath, OptionNone))
-}
diff --git a/src/tools/clippy/clippy_lints/src/manual_non_exhaustive.rs b/src/tools/clippy/clippy_lints/src/manual_non_exhaustive.rs
index 80845ace3f9..14f5faafd7c 100644
--- a/src/tools/clippy/clippy_lints/src/manual_non_exhaustive.rs
+++ b/src/tools/clippy/clippy_lints/src/manual_non_exhaustive.rs
@@ -113,7 +113,7 @@ impl EarlyLintPass for ManualNonExhaustiveStruct {
             let mut iter = fields.iter().filter_map(|f| match f.vis.kind {
                 VisibilityKind::Public => None,
                 VisibilityKind::Inherited => Some(Ok(f)),
-                _ => Some(Err(())),
+                VisibilityKind::Restricted { .. } => Some(Err(())),
             });
             if let Some(Ok(field)) = iter.next()
                 && iter.next().is_none()
diff --git a/src/tools/clippy/clippy_lints/src/manual_unwrap_or.rs b/src/tools/clippy/clippy_lints/src/manual_unwrap_or.rs
deleted file mode 100644
index b3a91d9f18f..00000000000
--- a/src/tools/clippy/clippy_lints/src/manual_unwrap_or.rs
+++ /dev/null
@@ -1,123 +0,0 @@
-use clippy_utils::consts::constant_simple;
-use clippy_utils::diagnostics::span_lint_and_sugg;
-use clippy_utils::source::{indent_of, reindent_multiline, snippet_opt};
-use clippy_utils::ty::is_type_diagnostic_item;
-use clippy_utils::usage::contains_return_break_continue_macro;
-use clippy_utils::{in_constant, is_lang_ctor, path_to_local_id, sugg};
-use if_chain::if_chain;
-use rustc_errors::Applicability;
-use rustc_hir::LangItem::{OptionNone, OptionSome, ResultErr, ResultOk};
-use rustc_hir::{Arm, Expr, ExprKind, PatKind};
-use rustc_lint::LintContext;
-use rustc_lint::{LateContext, LateLintPass};
-use rustc_middle::lint::in_external_macro;
-use rustc_session::{declare_lint_pass, declare_tool_lint};
-use rustc_span::sym;
-
-declare_clippy_lint! {
-    /// ### What it does
-    /// Finds patterns that reimplement `Option::unwrap_or` or `Result::unwrap_or`.
-    ///
-    /// ### Why is this bad?
-    /// Concise code helps focusing on behavior instead of boilerplate.
-    ///
-    /// ### Example
-    /// ```rust
-    /// let foo: Option<i32> = None;
-    /// match foo {
-    ///     Some(v) => v,
-    ///     None => 1,
-    /// };
-    /// ```
-    ///
-    /// Use instead:
-    /// ```rust
-    /// let foo: Option<i32> = None;
-    /// foo.unwrap_or(1);
-    /// ```
-    #[clippy::version = "1.49.0"]
-    pub MANUAL_UNWRAP_OR,
-    complexity,
-    "finds patterns that can be encoded more concisely with `Option::unwrap_or` or `Result::unwrap_or`"
-}
-
-declare_lint_pass!(ManualUnwrapOr => [MANUAL_UNWRAP_OR]);
-
-impl<'tcx> LateLintPass<'tcx> for ManualUnwrapOr {
-    fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
-        if in_external_macro(cx.sess(), expr.span) || in_constant(cx, expr.hir_id) {
-            return;
-        }
-        lint_manual_unwrap_or(cx, expr);
-    }
-}
-
-fn lint_manual_unwrap_or<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
-    fn applicable_or_arm<'a>(cx: &LateContext<'_>, arms: &'a [Arm<'a>]) -> Option<&'a Arm<'a>> {
-        if_chain! {
-            if arms.len() == 2;
-            if arms.iter().all(|arm| arm.guard.is_none());
-            if let Some((idx, or_arm)) = arms.iter().enumerate().find(|(_, arm)| {
-                match arm.pat.kind {
-                    PatKind::Path(ref qpath) => is_lang_ctor(cx, qpath, OptionNone),
-                    PatKind::TupleStruct(ref qpath, [pat], _) =>
-                        matches!(pat.kind, PatKind::Wild) && is_lang_ctor(cx, qpath, ResultErr),
-                    _ => false,
-                }
-            });
-            let unwrap_arm = &arms[1 - idx];
-            if let PatKind::TupleStruct(ref qpath, [unwrap_pat], _) = unwrap_arm.pat.kind;
-            if is_lang_ctor(cx, qpath, OptionSome) || is_lang_ctor(cx, qpath, ResultOk);
-            if let PatKind::Binding(_, binding_hir_id, ..) = unwrap_pat.kind;
-            if path_to_local_id(unwrap_arm.body, binding_hir_id);
-            if cx.typeck_results().expr_adjustments(unwrap_arm.body).is_empty();
-            if !contains_return_break_continue_macro(or_arm.body);
-            then {
-                Some(or_arm)
-            } else {
-                None
-            }
-        }
-    }
-
-    if_chain! {
-        if let ExprKind::Match(scrutinee, match_arms, _) = expr.kind;
-        let ty = cx.typeck_results().expr_ty(scrutinee);
-        if let Some(ty_name) = if is_type_diagnostic_item(cx, ty, sym::Option) {
-            Some("Option")
-        } else if is_type_diagnostic_item(cx, ty, sym::Result) {
-            Some("Result")
-        } else {
-            None
-        };
-        if let Some(or_arm) = applicable_or_arm(cx, match_arms);
-        if let Some(or_body_snippet) = snippet_opt(cx, or_arm.body.span);
-        if let Some(indent) = indent_of(cx, expr.span);
-        if constant_simple(cx, cx.typeck_results(), or_arm.body).is_some();
-        then {
-            let reindented_or_body =
-                reindent_multiline(or_body_snippet.into(), true, Some(indent));
-
-            let suggestion = if scrutinee.span.from_expansion() {
-                    // we don't want parentheses around macro, e.g. `(some_macro!()).unwrap_or(0)`
-                    sugg::Sugg::hir_with_macro_callsite(cx, scrutinee, "..")
-                }
-                else {
-                    sugg::Sugg::hir(cx, scrutinee, "..").maybe_par()
-                };
-
-            span_lint_and_sugg(
-                cx,
-                MANUAL_UNWRAP_OR, expr.span,
-                &format!("this pattern reimplements `{}::unwrap_or`", ty_name),
-                "replace with",
-                format!(
-                    "{}.unwrap_or({})",
-                    suggestion,
-                    reindented_or_body,
-                ),
-                Applicability::MachineApplicable,
-            );
-        }
-    }
-}
diff --git a/src/tools/clippy/clippy_lints/src/match_on_vec_items.rs b/src/tools/clippy/clippy_lints/src/match_on_vec_items.rs
deleted file mode 100644
index 583b577ffe2..00000000000
--- a/src/tools/clippy/clippy_lints/src/match_on_vec_items.rs
+++ /dev/null
@@ -1,104 +0,0 @@
-use clippy_utils::diagnostics::span_lint_and_sugg;
-use clippy_utils::source::snippet;
-use clippy_utils::ty::{is_type_diagnostic_item, is_type_lang_item};
-use if_chain::if_chain;
-use rustc_errors::Applicability;
-use rustc_hir::{Expr, ExprKind, LangItem, MatchSource};
-use rustc_lint::{LateContext, LateLintPass, LintContext};
-use rustc_middle::lint::in_external_macro;
-use rustc_session::{declare_lint_pass, declare_tool_lint};
-use rustc_span::sym;
-
-declare_clippy_lint! {
-    /// ### What it does
-    /// Checks for `match vec[idx]` or `match vec[n..m]`.
-    ///
-    /// ### Why is this bad?
-    /// This can panic at runtime.
-    ///
-    /// ### Example
-    /// ```rust, no_run
-    /// let arr = vec![0, 1, 2, 3];
-    /// let idx = 1;
-    ///
-    /// // Bad
-    /// match arr[idx] {
-    ///     0 => println!("{}", 0),
-    ///     1 => println!("{}", 3),
-    ///     _ => {},
-    /// }
-    /// ```
-    /// Use instead:
-    /// ```rust, no_run
-    /// let arr = vec![0, 1, 2, 3];
-    /// let idx = 1;
-    ///
-    /// // Good
-    /// match arr.get(idx) {
-    ///     Some(0) => println!("{}", 0),
-    ///     Some(1) => println!("{}", 3),
-    ///     _ => {},
-    /// }
-    /// ```
-    #[clippy::version = "1.45.0"]
-    pub MATCH_ON_VEC_ITEMS,
-    pedantic,
-    "matching on vector elements can panic"
-}
-
-declare_lint_pass!(MatchOnVecItems => [MATCH_ON_VEC_ITEMS]);
-
-impl<'tcx> LateLintPass<'tcx> for MatchOnVecItems {
-    fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
-        if_chain! {
-            if !in_external_macro(cx.sess(), expr.span);
-            if let ExprKind::Match(match_expr, _, MatchSource::Normal) = expr.kind;
-            if let Some(idx_expr) = is_vec_indexing(cx, match_expr);
-            if let ExprKind::Index(vec, idx) = idx_expr.kind;
-
-            then {
-                // FIXME: could be improved to suggest surrounding every pattern with Some(_),
-                // but only when `or_patterns` are stabilized.
-                span_lint_and_sugg(
-                    cx,
-                    MATCH_ON_VEC_ITEMS,
-                    match_expr.span,
-                    "indexing into a vector may panic",
-                    "try this",
-                    format!(
-                        "{}.get({})",
-                        snippet(cx, vec.span, ".."),
-                        snippet(cx, idx.span, "..")
-                    ),
-                    Applicability::MaybeIncorrect
-                );
-            }
-        }
-    }
-}
-
-fn is_vec_indexing<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> Option<&'tcx Expr<'tcx>> {
-    if_chain! {
-        if let ExprKind::Index(array, index) = expr.kind;
-        if is_vector(cx, array);
-        if !is_full_range(cx, index);
-
-        then {
-            return Some(expr);
-        }
-    }
-
-    None
-}
-
-fn is_vector(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
-    let ty = cx.typeck_results().expr_ty(expr);
-    let ty = ty.peel_refs();
-    is_type_diagnostic_item(cx, ty, sym::Vec)
-}
-
-fn is_full_range(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
-    let ty = cx.typeck_results().expr_ty(expr);
-    let ty = ty.peel_refs();
-    is_type_lang_item(cx, ty, LangItem::RangeFull)
-}
diff --git a/src/tools/clippy/clippy_lints/src/collapsible_match.rs b/src/tools/clippy/clippy_lints/src/matches/collapsible_match.rs
index ec55009f347..07021f1bcad 100644
--- a/src/tools/clippy/clippy_lints/src/collapsible_match.rs
+++ b/src/tools/clippy/clippy_lints/src/matches/collapsible_match.rs
@@ -6,68 +6,28 @@ use if_chain::if_chain;
 use rustc_errors::MultiSpan;
 use rustc_hir::LangItem::OptionNone;
 use rustc_hir::{Arm, Expr, Guard, HirId, Let, Pat, PatKind};
-use rustc_lint::{LateContext, LateLintPass};
-use rustc_session::{declare_lint_pass, declare_tool_lint};
+use rustc_lint::LateContext;
 use rustc_span::Span;
 
-declare_clippy_lint! {
-    /// ### What it does
-    /// Finds nested `match` or `if let` expressions where the patterns may be "collapsed" together
-    /// without adding any branches.
-    ///
-    /// Note that this lint is not intended to find _all_ cases where nested match patterns can be merged, but only
-    /// cases where merging would most likely make the code more readable.
-    ///
-    /// ### Why is this bad?
-    /// It is unnecessarily verbose and complex.
-    ///
-    /// ### Example
-    /// ```rust
-    /// fn func(opt: Option<Result<u64, String>>) {
-    ///     let n = match opt {
-    ///         Some(n) => match n {
-    ///             Ok(n) => n,
-    ///             _ => return,
-    ///         }
-    ///         None => return,
-    ///     };
-    /// }
-    /// ```
-    /// Use instead:
-    /// ```rust
-    /// fn func(opt: Option<Result<u64, String>>) {
-    ///     let n = match opt {
-    ///         Some(Ok(n)) => n,
-    ///         _ => return,
-    ///     };
-    /// }
-    /// ```
-    #[clippy::version = "1.50.0"]
-    pub COLLAPSIBLE_MATCH,
-    style,
-    "Nested `match` or `if let` expressions where the patterns may be \"collapsed\" together."
-}
-
-declare_lint_pass!(CollapsibleMatch => [COLLAPSIBLE_MATCH]);
+use super::COLLAPSIBLE_MATCH;
 
-impl<'tcx> LateLintPass<'tcx> for CollapsibleMatch {
-    fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'tcx>) {
-        match IfLetOrMatch::parse(cx, expr) {
-            Some(IfLetOrMatch::Match(_, arms, _)) => {
-                if let Some(els_arm) = arms.iter().rfind(|arm| arm_is_wild_like(cx, arm)) {
-                    for arm in arms {
-                        check_arm(cx, true, arm.pat, arm.body, arm.guard.as_ref(), Some(els_arm.body));
-                    }
-                }
-            },
-            Some(IfLetOrMatch::IfLet(_, pat, body, els)) => {
-                check_arm(cx, false, pat, body, None, els);
-            },
-            None => {},
+pub(super) fn check_match<'tcx>(cx: &LateContext<'tcx>, arms: &'tcx [Arm<'_>]) {
+    if let Some(els_arm) = arms.iter().rfind(|arm| arm_is_wild_like(cx, arm)) {
+        for arm in arms {
+            check_arm(cx, true, arm.pat, arm.body, arm.guard.as_ref(), Some(els_arm.body));
         }
     }
 }
 
+pub(super) fn check_if_let<'tcx>(
+    cx: &LateContext<'tcx>,
+    pat: &'tcx Pat<'_>,
+    body: &'tcx Expr<'_>,
+    else_expr: Option<&'tcx Expr<'_>>,
+) {
+    check_arm(cx, false, pat, body, None, else_expr);
+}
+
 fn check_arm<'tcx>(
     cx: &LateContext<'tcx>,
     outer_is_match: bool,
diff --git a/src/tools/clippy/clippy_lints/src/matches/manual_map.rs b/src/tools/clippy/clippy_lints/src/matches/manual_map.rs
new file mode 100644
index 00000000000..542905a2d76
--- /dev/null
+++ b/src/tools/clippy/clippy_lints/src/matches/manual_map.rs
@@ -0,0 +1,306 @@
+use crate::{map_unit_fn::OPTION_MAP_UNIT_FN, matches::MATCH_AS_REF};
+use clippy_utils::diagnostics::span_lint_and_sugg;
+use clippy_utils::source::{snippet_with_applicability, snippet_with_context};
+use clippy_utils::ty::{is_type_diagnostic_item, peel_mid_ty_refs_is_mutable, type_is_unsafe_function};
+use clippy_utils::{
+    can_move_expr_to_closure, is_else_clause, is_lang_ctor, is_lint_allowed, path_to_local_id, peel_blocks,
+    peel_hir_expr_refs, peel_hir_expr_while, CaptureKind,
+};
+use rustc_ast::util::parser::PREC_POSTFIX;
+use rustc_errors::Applicability;
+use rustc_hir::LangItem::{OptionNone, OptionSome};
+use rustc_hir::{
+    def::Res, Arm, BindingAnnotation, Block, BlockCheckMode, Expr, ExprKind, HirId, Mutability, Pat, PatKind, Path,
+    QPath, UnsafeSource,
+};
+use rustc_lint::LateContext;
+use rustc_span::{sym, SyntaxContext};
+
+use super::MANUAL_MAP;
+
+pub(super) fn check_match<'tcx>(
+    cx: &LateContext<'tcx>,
+    expr: &'tcx Expr<'_>,
+    scrutinee: &'tcx Expr<'_>,
+    arms: &'tcx [Arm<'_>],
+) {
+    if let [arm1, arm2] = arms
+        && arm1.guard.is_none()
+        && arm2.guard.is_none()
+    {
+        check(cx, expr, scrutinee, arm1.pat, arm1.body, Some(arm2.pat), arm2.body);
+    }
+}
+
+pub(super) fn check_if_let<'tcx>(
+    cx: &LateContext<'tcx>,
+    expr: &'tcx Expr<'_>,
+    let_pat: &'tcx Pat<'_>,
+    let_expr: &'tcx Expr<'_>,
+    then_expr: &'tcx Expr<'_>,
+    else_expr: &'tcx Expr<'_>,
+) {
+    check(cx, expr, let_expr, let_pat, then_expr, None, else_expr);
+}
+
+#[expect(clippy::too_many_lines)]
+fn check<'tcx>(
+    cx: &LateContext<'tcx>,
+    expr: &'tcx Expr<'_>,
+    scrutinee: &'tcx Expr<'_>,
+    then_pat: &'tcx Pat<'_>,
+    then_body: &'tcx Expr<'_>,
+    else_pat: Option<&'tcx Pat<'_>>,
+    else_body: &'tcx Expr<'_>,
+) {
+    let (scrutinee_ty, ty_ref_count, ty_mutability) =
+        peel_mid_ty_refs_is_mutable(cx.typeck_results().expr_ty(scrutinee));
+    if !(is_type_diagnostic_item(cx, scrutinee_ty, sym::Option)
+        && is_type_diagnostic_item(cx, cx.typeck_results().expr_ty(expr), sym::Option))
+    {
+        return;
+    }
+
+    let expr_ctxt = expr.span.ctxt();
+    let (some_expr, some_pat, pat_ref_count, is_wild_none) = match (
+        try_parse_pattern(cx, then_pat, expr_ctxt),
+        else_pat.map_or(Some(OptionPat::Wild), |p| try_parse_pattern(cx, p, expr_ctxt)),
+    ) {
+        (Some(OptionPat::Wild), Some(OptionPat::Some { pattern, ref_count })) if is_none_expr(cx, then_body) => {
+            (else_body, pattern, ref_count, true)
+        },
+        (Some(OptionPat::None), Some(OptionPat::Some { pattern, ref_count })) if is_none_expr(cx, then_body) => {
+            (else_body, pattern, ref_count, false)
+        },
+        (Some(OptionPat::Some { pattern, ref_count }), Some(OptionPat::Wild)) if is_none_expr(cx, else_body) => {
+            (then_body, pattern, ref_count, true)
+        },
+        (Some(OptionPat::Some { pattern, ref_count }), Some(OptionPat::None)) if is_none_expr(cx, else_body) => {
+            (then_body, pattern, ref_count, false)
+        },
+        _ => return,
+    };
+
+    // Top level or patterns aren't allowed in closures.
+    if matches!(some_pat.kind, PatKind::Or(_)) {
+        return;
+    }
+
+    let some_expr = match get_some_expr(cx, some_expr, false, expr_ctxt) {
+        Some(expr) => expr,
+        None => return,
+    };
+
+    // These two lints will go back and forth with each other.
+    if cx.typeck_results().expr_ty(some_expr.expr) == cx.tcx.types.unit
+        && !is_lint_allowed(cx, OPTION_MAP_UNIT_FN, expr.hir_id)
+    {
+        return;
+    }
+
+    // `map` won't perform any adjustments.
+    if !cx.typeck_results().expr_adjustments(some_expr.expr).is_empty() {
+        return;
+    }
+
+    // Determine which binding mode to use.
+    let explicit_ref = some_pat.contains_explicit_ref_binding();
+    let binding_ref = explicit_ref.or_else(|| (ty_ref_count != pat_ref_count).then(|| ty_mutability));
+
+    let as_ref_str = match binding_ref {
+        Some(Mutability::Mut) => ".as_mut()",
+        Some(Mutability::Not) => ".as_ref()",
+        None => "",
+    };
+
+    match can_move_expr_to_closure(cx, some_expr.expr) {
+        Some(captures) => {
+            // Check if captures the closure will need conflict with borrows made in the scrutinee.
+            // TODO: check all the references made in the scrutinee expression. This will require interacting
+            // with the borrow checker. Currently only `<local>[.<field>]*` is checked for.
+            if let Some(binding_ref_mutability) = binding_ref {
+                let e = peel_hir_expr_while(scrutinee, |e| match e.kind {
+                    ExprKind::Field(e, _) | ExprKind::AddrOf(_, _, e) => Some(e),
+                    _ => None,
+                });
+                if let ExprKind::Path(QPath::Resolved(None, Path { res: Res::Local(l), .. })) = e.kind {
+                    match captures.get(l) {
+                        Some(CaptureKind::Value | CaptureKind::Ref(Mutability::Mut)) => return,
+                        Some(CaptureKind::Ref(Mutability::Not)) if binding_ref_mutability == Mutability::Mut => {
+                            return;
+                        },
+                        Some(CaptureKind::Ref(Mutability::Not)) | None => (),
+                    }
+                }
+            }
+        },
+        None => return,
+    };
+
+    let mut app = Applicability::MachineApplicable;
+
+    // Remove address-of expressions from the scrutinee. Either `as_ref` will be called, or
+    // it's being passed by value.
+    let scrutinee = peel_hir_expr_refs(scrutinee).0;
+    let (scrutinee_str, _) = snippet_with_context(cx, scrutinee.span, expr_ctxt, "..", &mut app);
+    let scrutinee_str = if scrutinee.span.ctxt() == expr.span.ctxt() && scrutinee.precedence().order() < PREC_POSTFIX {
+        format!("({})", scrutinee_str)
+    } else {
+        scrutinee_str.into()
+    };
+
+    let body_str = if let PatKind::Binding(annotation, id, some_binding, None) = some_pat.kind {
+        if_chain! {
+            if !some_expr.needs_unsafe_block;
+            if let Some(func) = can_pass_as_func(cx, id, some_expr.expr);
+            if func.span.ctxt() == some_expr.expr.span.ctxt();
+            then {
+                snippet_with_applicability(cx, func.span, "..", &mut app).into_owned()
+            } else {
+                if path_to_local_id(some_expr.expr, id)
+                    && !is_lint_allowed(cx, MATCH_AS_REF, expr.hir_id)
+                    && binding_ref.is_some()
+                {
+                    return;
+                }
+
+                // `ref` and `ref mut` annotations were handled earlier.
+                let annotation = if matches!(annotation, BindingAnnotation::Mutable) {
+                    "mut "
+                } else {
+                    ""
+                };
+                let expr_snip = snippet_with_context(cx, some_expr.expr.span, expr_ctxt, "..", &mut app).0;
+                if some_expr.needs_unsafe_block {
+                    format!("|{}{}| unsafe {{ {} }}", annotation, some_binding, expr_snip)
+                } else {
+                    format!("|{}{}| {}", annotation, some_binding, expr_snip)
+                }
+            }
+        }
+    } else if !is_wild_none && explicit_ref.is_none() {
+        // TODO: handle explicit reference annotations.
+        let pat_snip = snippet_with_context(cx, some_pat.span, expr_ctxt, "..", &mut app).0;
+        let expr_snip = snippet_with_context(cx, some_expr.expr.span, expr_ctxt, "..", &mut app).0;
+        if some_expr.needs_unsafe_block {
+            format!("|{}| unsafe {{ {} }}", pat_snip, expr_snip)
+        } else {
+            format!("|{}| {}", pat_snip, expr_snip)
+        }
+    } else {
+        // Refutable bindings and mixed reference annotations can't be handled by `map`.
+        return;
+    };
+
+    span_lint_and_sugg(
+        cx,
+        MANUAL_MAP,
+        expr.span,
+        "manual implementation of `Option::map`",
+        "try this",
+        if else_pat.is_none() && is_else_clause(cx.tcx, expr) {
+            format!("{{ {}{}.map({}) }}", scrutinee_str, as_ref_str, body_str)
+        } else {
+            format!("{}{}.map({})", scrutinee_str, as_ref_str, body_str)
+        },
+        app,
+    );
+}
+
+// Checks whether the expression could be passed as a function, or whether a closure is needed.
+// Returns the function to be passed to `map` if it exists.
+fn can_pass_as_func<'tcx>(cx: &LateContext<'tcx>, binding: HirId, expr: &'tcx Expr<'_>) -> Option<&'tcx Expr<'tcx>> {
+    match expr.kind {
+        ExprKind::Call(func, [arg])
+            if path_to_local_id(arg, binding)
+                && cx.typeck_results().expr_adjustments(arg).is_empty()
+                && !type_is_unsafe_function(cx, cx.typeck_results().expr_ty(func).peel_refs()) =>
+        {
+            Some(func)
+        },
+        _ => None,
+    }
+}
+
+enum OptionPat<'a> {
+    Wild,
+    None,
+    Some {
+        // The pattern contained in the `Some` tuple.
+        pattern: &'a Pat<'a>,
+        // The number of references before the `Some` tuple.
+        // e.g. `&&Some(_)` has a ref count of 2.
+        ref_count: usize,
+    },
+}
+
+struct SomeExpr<'tcx> {
+    expr: &'tcx Expr<'tcx>,
+    needs_unsafe_block: bool,
+}
+
+// Try to parse into a recognized `Option` pattern.
+// i.e. `_`, `None`, `Some(..)`, or a reference to any of those.
+fn try_parse_pattern<'tcx>(cx: &LateContext<'tcx>, pat: &'tcx Pat<'_>, ctxt: SyntaxContext) -> Option<OptionPat<'tcx>> {
+    fn f<'tcx>(
+        cx: &LateContext<'tcx>,
+        pat: &'tcx Pat<'_>,
+        ref_count: usize,
+        ctxt: SyntaxContext,
+    ) -> Option<OptionPat<'tcx>> {
+        match pat.kind {
+            PatKind::Wild => Some(OptionPat::Wild),
+            PatKind::Ref(pat, _) => f(cx, pat, ref_count + 1, ctxt),
+            PatKind::Path(ref qpath) if is_lang_ctor(cx, qpath, OptionNone) => Some(OptionPat::None),
+            PatKind::TupleStruct(ref qpath, [pattern], _)
+                if is_lang_ctor(cx, qpath, OptionSome) && pat.span.ctxt() == ctxt =>
+            {
+                Some(OptionPat::Some { pattern, ref_count })
+            },
+            _ => None,
+        }
+    }
+    f(cx, pat, 0, ctxt)
+}
+
+// Checks for an expression wrapped by the `Some` constructor. Returns the contained expression.
+fn get_some_expr<'tcx>(
+    cx: &LateContext<'tcx>,
+    expr: &'tcx Expr<'_>,
+    needs_unsafe_block: bool,
+    ctxt: SyntaxContext,
+) -> Option<SomeExpr<'tcx>> {
+    // TODO: Allow more complex expressions.
+    match expr.kind {
+        ExprKind::Call(
+            Expr {
+                kind: ExprKind::Path(ref qpath),
+                ..
+            },
+            [arg],
+        ) if ctxt == expr.span.ctxt() && is_lang_ctor(cx, qpath, OptionSome) => Some(SomeExpr {
+            expr: arg,
+            needs_unsafe_block,
+        }),
+        ExprKind::Block(
+            Block {
+                stmts: [],
+                expr: Some(expr),
+                rules,
+                ..
+            },
+            _,
+        ) => get_some_expr(
+            cx,
+            expr,
+            needs_unsafe_block || *rules == BlockCheckMode::UnsafeBlock(UnsafeSource::UserProvided),
+            ctxt,
+        ),
+        _ => None,
+    }
+}
+
+// Checks for the `None` value.
+fn is_none_expr(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
+    matches!(peel_blocks(expr).kind, ExprKind::Path(ref qpath) if is_lang_ctor(cx, qpath, OptionNone))
+}
diff --git a/src/tools/clippy/clippy_lints/src/matches/manual_unwrap_or.rs b/src/tools/clippy/clippy_lints/src/matches/manual_unwrap_or.rs
new file mode 100644
index 00000000000..e1111c80f2f
--- /dev/null
+++ b/src/tools/clippy/clippy_lints/src/matches/manual_unwrap_or.rs
@@ -0,0 +1,83 @@
+use clippy_utils::consts::constant_simple;
+use clippy_utils::diagnostics::span_lint_and_sugg;
+use clippy_utils::source::{indent_of, reindent_multiline, snippet_opt};
+use clippy_utils::ty::is_type_diagnostic_item;
+use clippy_utils::usage::contains_return_break_continue_macro;
+use clippy_utils::{is_lang_ctor, path_to_local_id, sugg};
+use if_chain::if_chain;
+use rustc_errors::Applicability;
+use rustc_hir::LangItem::{OptionNone, OptionSome, ResultErr, ResultOk};
+use rustc_hir::{Arm, Expr, PatKind};
+use rustc_lint::LateContext;
+use rustc_span::sym;
+
+use super::MANUAL_UNWRAP_OR;
+
+pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'tcx>, scrutinee: &'tcx Expr<'_>, arms: &'tcx [Arm<'_>]) {
+    let ty = cx.typeck_results().expr_ty(scrutinee);
+    if_chain! {
+        if let Some(ty_name) = if is_type_diagnostic_item(cx, ty, sym::Option) {
+            Some("Option")
+        } else if is_type_diagnostic_item(cx, ty, sym::Result) {
+            Some("Result")
+        } else {
+            None
+        };
+        if let Some(or_arm) = applicable_or_arm(cx, arms);
+        if let Some(or_body_snippet) = snippet_opt(cx, or_arm.body.span);
+        if let Some(indent) = indent_of(cx, expr.span);
+        if constant_simple(cx, cx.typeck_results(), or_arm.body).is_some();
+        then {
+            let reindented_or_body =
+                reindent_multiline(or_body_snippet.into(), true, Some(indent));
+
+            let suggestion = if scrutinee.span.from_expansion() {
+                    // we don't want parentheses around macro, e.g. `(some_macro!()).unwrap_or(0)`
+                    sugg::Sugg::hir_with_macro_callsite(cx, scrutinee, "..")
+                }
+                else {
+                    sugg::Sugg::hir(cx, scrutinee, "..").maybe_par()
+                };
+
+            span_lint_and_sugg(
+                cx,
+                MANUAL_UNWRAP_OR, expr.span,
+                &format!("this pattern reimplements `{}::unwrap_or`", ty_name),
+                "replace with",
+                format!(
+                    "{}.unwrap_or({})",
+                    suggestion,
+                    reindented_or_body,
+                ),
+                Applicability::MachineApplicable,
+            );
+        }
+    }
+}
+
+fn applicable_or_arm<'a>(cx: &LateContext<'_>, arms: &'a [Arm<'a>]) -> Option<&'a Arm<'a>> {
+    if_chain! {
+        if arms.len() == 2;
+        if arms.iter().all(|arm| arm.guard.is_none());
+        if let Some((idx, or_arm)) = arms.iter().enumerate().find(|(_, arm)| {
+            match arm.pat.kind {
+                PatKind::Path(ref qpath) => is_lang_ctor(cx, qpath, OptionNone),
+                PatKind::TupleStruct(ref qpath, [pat], _) =>
+                    matches!(pat.kind, PatKind::Wild) && is_lang_ctor(cx, qpath, ResultErr),
+                _ => false,
+            }
+        });
+        let unwrap_arm = &arms[1 - idx];
+        if let PatKind::TupleStruct(ref qpath, [unwrap_pat], _) = unwrap_arm.pat.kind;
+        if is_lang_ctor(cx, qpath, OptionSome) || is_lang_ctor(cx, qpath, ResultOk);
+        if let PatKind::Binding(_, binding_hir_id, ..) = unwrap_pat.kind;
+        if path_to_local_id(unwrap_arm.body, binding_hir_id);
+        if cx.typeck_results().expr_adjustments(unwrap_arm.body).is_empty();
+        if !contains_return_break_continue_macro(or_arm.body);
+        then {
+            Some(or_arm)
+        } else {
+            None
+        }
+    }
+}
diff --git a/src/tools/clippy/clippy_lints/src/matches/match_bool.rs b/src/tools/clippy/clippy_lints/src/matches/match_bool.rs
index 90c50b994d2..1c216e13570 100644
--- a/src/tools/clippy/clippy_lints/src/matches/match_bool.rs
+++ b/src/tools/clippy/clippy_lints/src/matches/match_bool.rs
@@ -24,8 +24,8 @@ pub(crate) fn check(cx: &LateContext<'_>, ex: &Expr<'_>, arms: &[Arm<'_>], expr:
                     let exprs = if let PatKind::Lit(arm_bool) = arms[0].pat.kind {
                         if let ExprKind::Lit(ref lit) = arm_bool.kind {
                             match lit.node {
-                                LitKind::Bool(true) => Some((&*arms[0].body, &*arms[1].body)),
-                                LitKind::Bool(false) => Some((&*arms[1].body, &*arms[0].body)),
+                                LitKind::Bool(true) => Some((arms[0].body, arms[1].body)),
+                                LitKind::Bool(false) => Some((arms[1].body, arms[0].body)),
                                 _ => None,
                             }
                         } else {
diff --git a/src/tools/clippy/clippy_lints/src/matches/match_like_matches.rs b/src/tools/clippy/clippy_lints/src/matches/match_like_matches.rs
index 2e1f7646eb4..a68eec842ab 100644
--- a/src/tools/clippy/clippy_lints/src/matches/match_like_matches.rs
+++ b/src/tools/clippy/clippy_lints/src/matches/match_like_matches.rs
@@ -1,6 +1,6 @@
 use clippy_utils::diagnostics::span_lint_and_sugg;
+use clippy_utils::is_wild;
 use clippy_utils::source::snippet_with_applicability;
-use clippy_utils::{higher, is_wild};
 use rustc_ast::{Attribute, LitKind};
 use rustc_errors::Applicability;
 use rustc_hir::{Arm, BorrowKind, Expr, ExprKind, Guard, Pat};
@@ -11,22 +11,24 @@ use rustc_span::source_map::Spanned;
 use super::MATCH_LIKE_MATCHES_MACRO;
 
 /// Lint a `match` or `if let .. { .. } else { .. }` expr that could be replaced by `matches!`
-pub(crate) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
-    if let Some(higher::IfLet {
-        let_pat,
+pub(crate) fn check_if_let<'tcx>(
+    cx: &LateContext<'tcx>,
+    expr: &'tcx Expr<'_>,
+    let_pat: &'tcx Pat<'_>,
+    let_expr: &'tcx Expr<'_>,
+    then_expr: &'tcx Expr<'_>,
+    else_expr: &'tcx Expr<'_>,
+) {
+    find_matches_sugg(
+        cx,
         let_expr,
-        if_then,
-        if_else: Some(if_else),
-    }) = higher::IfLet::hir(cx, expr)
-    {
-        find_matches_sugg(
-            cx,
-            let_expr,
-            IntoIterator::into_iter([(&[][..], Some(let_pat), if_then, None), (&[][..], None, if_else, None)]),
-            expr,
-            true,
-        );
-    }
+        IntoIterator::into_iter([
+            (&[][..], Some(let_pat), then_expr, None),
+            (&[][..], None, else_expr, None),
+        ]),
+        expr,
+        true,
+    );
 }
 
 pub(super) fn check_match<'tcx>(
diff --git a/src/tools/clippy/clippy_lints/src/matches/match_on_vec_items.rs b/src/tools/clippy/clippy_lints/src/matches/match_on_vec_items.rs
new file mode 100644
index 00000000000..2917f85c45f
--- /dev/null
+++ b/src/tools/clippy/clippy_lints/src/matches/match_on_vec_items.rs
@@ -0,0 +1,61 @@
+use clippy_utils::diagnostics::span_lint_and_sugg;
+use clippy_utils::source::snippet;
+use clippy_utils::ty::{is_type_diagnostic_item, is_type_lang_item};
+use if_chain::if_chain;
+use rustc_errors::Applicability;
+use rustc_hir::{Expr, ExprKind, LangItem};
+use rustc_lint::LateContext;
+use rustc_span::sym;
+
+use super::MATCH_ON_VEC_ITEMS;
+
+pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, scrutinee: &'tcx Expr<'_>) {
+    if_chain! {
+        if let Some(idx_expr) = is_vec_indexing(cx, scrutinee);
+        if let ExprKind::Index(vec, idx) = idx_expr.kind;
+
+        then {
+            // FIXME: could be improved to suggest surrounding every pattern with Some(_),
+            // but only when `or_patterns` are stabilized.
+            span_lint_and_sugg(
+                cx,
+                MATCH_ON_VEC_ITEMS,
+                scrutinee.span,
+                "indexing into a vector may panic",
+                "try this",
+                format!(
+                    "{}.get({})",
+                    snippet(cx, vec.span, ".."),
+                    snippet(cx, idx.span, "..")
+                ),
+                Applicability::MaybeIncorrect
+            );
+        }
+    }
+}
+
+fn is_vec_indexing<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> Option<&'tcx Expr<'tcx>> {
+    if_chain! {
+        if let ExprKind::Index(array, index) = expr.kind;
+        if is_vector(cx, array);
+        if !is_full_range(cx, index);
+
+        then {
+            return Some(expr);
+        }
+    }
+
+    None
+}
+
+fn is_vector(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
+    let ty = cx.typeck_results().expr_ty(expr);
+    let ty = ty.peel_refs();
+    is_type_diagnostic_item(cx, ty, sym::Vec)
+}
+
+fn is_full_range(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
+    let ty = cx.typeck_results().expr_ty(expr);
+    let ty = ty.peel_refs();
+    is_type_lang_item(cx, ty, LangItem::RangeFull)
+}
diff --git a/src/tools/clippy/clippy_lints/src/match_str_case_mismatch.rs b/src/tools/clippy/clippy_lints/src/matches/match_str_case_mismatch.rs
index 85aec93670b..8302ce426e5 100644
--- a/src/tools/clippy/clippy_lints/src/match_str_case_mismatch.rs
+++ b/src/tools/clippy/clippy_lints/src/matches/match_str_case_mismatch.rs
@@ -3,48 +3,13 @@ use clippy_utils::ty::is_type_diagnostic_item;
 use rustc_ast::ast::LitKind;
 use rustc_errors::Applicability;
 use rustc_hir::intravisit::{walk_expr, Visitor};
-use rustc_hir::{Arm, Expr, ExprKind, MatchSource, PatKind};
-use rustc_lint::{LateContext, LateLintPass};
-use rustc_middle::lint::in_external_macro;
+use rustc_hir::{Arm, Expr, ExprKind, PatKind};
+use rustc_lint::LateContext;
 use rustc_middle::ty;
-use rustc_session::{declare_lint_pass, declare_tool_lint};
 use rustc_span::symbol::Symbol;
 use rustc_span::{sym, Span};
 
-declare_clippy_lint! {
-    /// ### What it does
-    /// Checks for `match` expressions modifying the case of a string with non-compliant arms
-    ///
-    /// ### Why is this bad?
-    /// The arm is unreachable, which is likely a mistake
-    ///
-    /// ### Example
-    /// ```rust
-    /// # let text = "Foo";
-    ///
-    /// match &*text.to_ascii_lowercase() {
-    ///     "foo" => {},
-    ///     "Bar" => {},
-    ///     _ => {},
-    /// }
-    /// ```
-    /// Use instead:
-    /// ```rust
-    /// # let text = "Foo";
-    ///
-    /// match &*text.to_ascii_lowercase() {
-    ///     "foo" => {},
-    ///     "bar" => {},
-    ///     _ => {},
-    /// }
-    /// ```
-    #[clippy::version = "1.58.0"]
-    pub MATCH_STR_CASE_MISMATCH,
-    correctness,
-    "creation of a case altering match expression with non-compliant arms"
-}
-
-declare_lint_pass!(MatchStrCaseMismatch => [MATCH_STR_CASE_MISMATCH]);
+use super::MATCH_STR_CASE_MISMATCH;
 
 #[derive(Debug)]
 enum CaseMethod {
@@ -54,25 +19,21 @@ enum CaseMethod {
     AsciiUppercase,
 }
 
-impl<'tcx> LateLintPass<'tcx> for MatchStrCaseMismatch {
-    fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
-        if_chain! {
-            if !in_external_macro(cx.tcx.sess, expr.span);
-            if let ExprKind::Match(match_expr, arms, MatchSource::Normal) = expr.kind;
-            if let ty::Ref(_, ty, _) = cx.typeck_results().expr_ty(match_expr).kind();
-            if let ty::Str = ty.kind();
-            then {
-                let mut visitor = MatchExprVisitor {
-                    cx,
-                    case_method: None,
-                };
-
-                visitor.visit_expr(match_expr);
-
-                if let Some(case_method) = visitor.case_method {
-                    if let Some((bad_case_span, bad_case_sym)) = verify_case(&case_method, arms) {
-                        lint(cx, &case_method, bad_case_span, bad_case_sym.as_str());
-                    }
+pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, scrutinee: &'tcx Expr<'_>, arms: &'tcx [Arm<'_>]) {
+    if_chain! {
+        if let ty::Ref(_, ty, _) = cx.typeck_results().expr_ty(scrutinee).kind();
+        if let ty::Str = ty.kind();
+        then {
+            let mut visitor = MatchExprVisitor {
+                cx,
+                case_method: None,
+            };
+
+            visitor.visit_expr(scrutinee);
+
+            if let Some(case_method) = visitor.case_method {
+                if let Some((bad_case_span, bad_case_sym)) = verify_case(&case_method, arms) {
+                    lint(cx, &case_method, bad_case_span, bad_case_sym.as_str());
                 }
             }
         }
diff --git a/src/tools/clippy/clippy_lints/src/matches/mod.rs b/src/tools/clippy/clippy_lints/src/matches/mod.rs
index 3d8391bce2b..d1e42f39e47 100644
--- a/src/tools/clippy/clippy_lints/src/matches/mod.rs
+++ b/src/tools/clippy/clippy_lints/src/matches/mod.rs
@@ -1,26 +1,34 @@
 use clippy_utils::source::{snippet_opt, span_starts_with, walk_span_to_context};
-use clippy_utils::{meets_msrv, msrvs};
+use clippy_utils::{higher, in_constant, meets_msrv, msrvs};
 use rustc_hir::{Arm, Expr, ExprKind, Local, MatchSource, Pat};
 use rustc_lexer::{tokenize, TokenKind};
-use rustc_lint::{LateContext, LateLintPass};
+use rustc_lint::{LateContext, LateLintPass, LintContext};
+use rustc_middle::lint::in_external_macro;
 use rustc_semver::RustcVersion;
 use rustc_session::{declare_tool_lint, impl_lint_pass};
 use rustc_span::{Span, SpanData, SyntaxContext};
 
+mod collapsible_match;
 mod infallible_destructuring_match;
+mod manual_map;
+mod manual_unwrap_or;
 mod match_as_ref;
 mod match_bool;
 mod match_like_matches;
+mod match_on_vec_items;
 mod match_ref_pats;
 mod match_same_arms;
 mod match_single_binding;
+mod match_str_case_mismatch;
 mod match_wild_enum;
 mod match_wild_err_arm;
 mod needless_match;
 mod overlapping_arms;
 mod redundant_pattern_match;
 mod rest_pat_in_fully_bound_struct;
+mod significant_drop_in_scrutinee;
 mod single_match;
+mod try_err;
 mod wild_in_or_pats;
 
 declare_clippy_lint! {
@@ -610,6 +618,274 @@ declare_clippy_lint! {
     "`match` or match-like `if let` that are unnecessary"
 }
 
+declare_clippy_lint! {
+    /// ### What it does
+    /// Finds nested `match` or `if let` expressions where the patterns may be "collapsed" together
+    /// without adding any branches.
+    ///
+    /// Note that this lint is not intended to find _all_ cases where nested match patterns can be merged, but only
+    /// cases where merging would most likely make the code more readable.
+    ///
+    /// ### Why is this bad?
+    /// It is unnecessarily verbose and complex.
+    ///
+    /// ### Example
+    /// ```rust
+    /// fn func(opt: Option<Result<u64, String>>) {
+    ///     let n = match opt {
+    ///         Some(n) => match n {
+    ///             Ok(n) => n,
+    ///             _ => return,
+    ///         }
+    ///         None => return,
+    ///     };
+    /// }
+    /// ```
+    /// Use instead:
+    /// ```rust
+    /// fn func(opt: Option<Result<u64, String>>) {
+    ///     let n = match opt {
+    ///         Some(Ok(n)) => n,
+    ///         _ => return,
+    ///     };
+    /// }
+    /// ```
+    #[clippy::version = "1.50.0"]
+    pub COLLAPSIBLE_MATCH,
+    style,
+    "Nested `match` or `if let` expressions where the patterns may be \"collapsed\" together."
+}
+
+declare_clippy_lint! {
+    /// ### What it does
+    /// Finds patterns that reimplement `Option::unwrap_or` or `Result::unwrap_or`.
+    ///
+    /// ### Why is this bad?
+    /// Concise code helps focusing on behavior instead of boilerplate.
+    ///
+    /// ### Example
+    /// ```rust
+    /// let foo: Option<i32> = None;
+    /// match foo {
+    ///     Some(v) => v,
+    ///     None => 1,
+    /// };
+    /// ```
+    ///
+    /// Use instead:
+    /// ```rust
+    /// let foo: Option<i32> = None;
+    /// foo.unwrap_or(1);
+    /// ```
+    #[clippy::version = "1.49.0"]
+    pub MANUAL_UNWRAP_OR,
+    complexity,
+    "finds patterns that can be encoded more concisely with `Option::unwrap_or` or `Result::unwrap_or`"
+}
+
+declare_clippy_lint! {
+    /// ### What it does
+    /// Checks for `match vec[idx]` or `match vec[n..m]`.
+    ///
+    /// ### Why is this bad?
+    /// This can panic at runtime.
+    ///
+    /// ### Example
+    /// ```rust, no_run
+    /// let arr = vec![0, 1, 2, 3];
+    /// let idx = 1;
+    ///
+    /// // Bad
+    /// match arr[idx] {
+    ///     0 => println!("{}", 0),
+    ///     1 => println!("{}", 3),
+    ///     _ => {},
+    /// }
+    /// ```
+    /// Use instead:
+    /// ```rust, no_run
+    /// let arr = vec![0, 1, 2, 3];
+    /// let idx = 1;
+    ///
+    /// // Good
+    /// match arr.get(idx) {
+    ///     Some(0) => println!("{}", 0),
+    ///     Some(1) => println!("{}", 3),
+    ///     _ => {},
+    /// }
+    /// ```
+    #[clippy::version = "1.45.0"]
+    pub MATCH_ON_VEC_ITEMS,
+    pedantic,
+    "matching on vector elements can panic"
+}
+
+declare_clippy_lint! {
+    /// ### What it does
+    /// Checks for `match` expressions modifying the case of a string with non-compliant arms
+    ///
+    /// ### Why is this bad?
+    /// The arm is unreachable, which is likely a mistake
+    ///
+    /// ### Example
+    /// ```rust
+    /// # let text = "Foo";
+    /// match &*text.to_ascii_lowercase() {
+    ///     "foo" => {},
+    ///     "Bar" => {},
+    ///     _ => {},
+    /// }
+    /// ```
+    /// Use instead:
+    /// ```rust
+    /// # let text = "Foo";
+    /// match &*text.to_ascii_lowercase() {
+    ///     "foo" => {},
+    ///     "bar" => {},
+    ///     _ => {},
+    /// }
+    /// ```
+    #[clippy::version = "1.58.0"]
+    pub MATCH_STR_CASE_MISMATCH,
+    correctness,
+    "creation of a case altering match expression with non-compliant arms"
+}
+
+declare_clippy_lint! {
+    /// ### What it does
+    /// Check for temporaries returned from function calls in a match scrutinee that have the
+    /// `clippy::has_significant_drop` attribute.
+    ///
+    /// ### Why is this bad?
+    /// The `clippy::has_significant_drop` attribute can be added to types whose Drop impls have
+    /// an important side-effect, such as unlocking a mutex, making it important for users to be
+    /// able to accurately understand their lifetimes. When a temporary is returned in a function
+    /// call in a match scrutinee, its lifetime lasts until the end of the match block, which may
+    /// be surprising.
+    ///
+    /// For `Mutex`es this can lead to a deadlock. This happens when the match scrutinee uses a
+    /// function call that returns a `MutexGuard` and then tries to lock again in one of the match
+    /// arms. In that case the `MutexGuard` in the scrutinee will not be dropped until the end of
+    /// the match block and thus will not unlock.
+    ///
+    /// ### Example
+    /// ```rust.ignore
+    /// # use std::sync::Mutex;
+    ///
+    /// # struct State {}
+    ///
+    /// # impl State {
+    /// #     fn foo(&self) -> bool {
+    /// #         true
+    /// #     }
+    ///
+    /// #     fn bar(&self) {}
+    /// # }
+    ///
+    ///
+    /// let mutex = Mutex::new(State {});
+    ///
+    /// match mutex.lock().unwrap().foo() {
+    ///     true => {
+    ///         mutex.lock().unwrap().bar(); // Deadlock!
+    ///     }
+    ///     false => {}
+    /// };
+    ///
+    /// println!("All done!");
+    ///
+    /// ```
+    /// Use instead:
+    /// ```rust
+    /// # use std::sync::Mutex;
+    ///
+    /// # struct State {}
+    ///
+    /// # impl State {
+    /// #     fn foo(&self) -> bool {
+    /// #         true
+    /// #     }
+    ///
+    /// #     fn bar(&self) {}
+    /// # }
+    ///
+    /// let mutex = Mutex::new(State {});
+    ///
+    /// let is_foo = mutex.lock().unwrap().foo();
+    /// match is_foo {
+    ///     true => {
+    ///         mutex.lock().unwrap().bar();
+    ///     }
+    ///     false => {}
+    /// };
+    ///
+    /// println!("All done!");
+    /// ```
+    #[clippy::version = "1.60.0"]
+    pub SIGNIFICANT_DROP_IN_SCRUTINEE,
+    suspicious,
+    "warns when a temporary of a type with a drop with a significant side-effect might have a surprising lifetime"
+}
+
+declare_clippy_lint! {
+    /// ### What it does
+    /// Checks for usages of `Err(x)?`.
+    ///
+    /// ### Why is this bad?
+    /// The `?` operator is designed to allow calls that
+    /// can fail to be easily chained. For example, `foo()?.bar()` or
+    /// `foo(bar()?)`. Because `Err(x)?` can't be used that way (it will
+    /// always return), it is more clear to write `return Err(x)`.
+    ///
+    /// ### Example
+    /// ```rust
+    /// fn foo(fail: bool) -> Result<i32, String> {
+    ///     if fail {
+    ///       Err("failed")?;
+    ///     }
+    ///     Ok(0)
+    /// }
+    /// ```
+    /// Could be written:
+    ///
+    /// ```rust
+    /// fn foo(fail: bool) -> Result<i32, String> {
+    ///     if fail {
+    ///       return Err("failed".into());
+    ///     }
+    ///     Ok(0)
+    /// }
+    /// ```
+    #[clippy::version = "1.38.0"]
+    pub TRY_ERR,
+    restriction,
+    "return errors explicitly rather than hiding them behind a `?`"
+}
+
+declare_clippy_lint! {
+    /// ### What it does
+    /// Checks for usages of `match` which could be implemented using `map`
+    ///
+    /// ### Why is this bad?
+    /// Using the `map` method is clearer and more concise.
+    ///
+    /// ### Example
+    /// ```rust
+    /// match Some(0) {
+    ///     Some(x) => Some(x + 1),
+    ///     None => None,
+    /// };
+    /// ```
+    /// Use instead:
+    /// ```rust
+    /// Some(0).map(|x| x + 1);
+    /// ```
+    #[clippy::version = "1.52.0"]
+    pub MANUAL_MAP,
+    style,
+    "reimplementation of `map`"
+}
+
 #[derive(Default)]
 pub struct Matches {
     msrv: Option<RustcVersion>,
@@ -644,19 +920,42 @@ impl_lint_pass!(Matches => [
     MATCH_LIKE_MATCHES_MACRO,
     MATCH_SAME_ARMS,
     NEEDLESS_MATCH,
+    COLLAPSIBLE_MATCH,
+    MANUAL_UNWRAP_OR,
+    MATCH_ON_VEC_ITEMS,
+    MATCH_STR_CASE_MISMATCH,
+    SIGNIFICANT_DROP_IN_SCRUTINEE,
+    TRY_ERR,
+    MANUAL_MAP,
 ]);
 
 impl<'tcx> LateLintPass<'tcx> for Matches {
     fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
-        if expr.span.from_expansion() {
+        if in_external_macro(cx.sess(), expr.span) {
             return;
         }
+        let from_expansion = expr.span.from_expansion();
 
         if let ExprKind::Match(ex, arms, source) = expr.kind {
-            if !span_starts_with(cx, expr.span, "match") {
+            if source == MatchSource::Normal && !span_starts_with(cx, expr.span, "match") {
                 return;
             }
-            if !contains_cfg_arm(cx, expr, ex, arms) {
+            if matches!(source, MatchSource::Normal | MatchSource::ForLoopDesugar) {
+                significant_drop_in_scrutinee::check(cx, expr, ex, source);
+            }
+
+            collapsible_match::check_match(cx, arms);
+            if !from_expansion {
+                // These don't depend on a relationship between multiple arms
+                match_wild_err_arm::check(cx, ex, arms);
+                wild_in_or_pats::check(cx, arms);
+            }
+
+            if source == MatchSource::TryDesugar {
+                try_err::check(cx, expr, ex);
+            }
+
+            if !from_expansion && !contains_cfg_arm(cx, expr, ex, arms) {
                 if source == MatchSource::Normal {
                     if !(meets_msrv(self.msrv, msrvs::MATCHES_MACRO)
                         && match_like_matches::check_match(cx, expr, ex, arms))
@@ -671,6 +970,13 @@ impl<'tcx> LateLintPass<'tcx> for Matches {
                     match_wild_enum::check(cx, ex, arms);
                     match_as_ref::check(cx, ex, arms, expr);
                     needless_match::check_match(cx, ex, arms, expr);
+                    match_on_vec_items::check(cx, ex);
+                    match_str_case_mismatch::check(cx, ex, arms);
+
+                    if !in_constant(cx, expr.hir_id) {
+                        manual_unwrap_or::check(cx, expr, ex, arms);
+                        manual_map::check_match(cx, expr, ex, arms);
+                    }
 
                     if self.infallible_destructuring_match_linted {
                         self.infallible_destructuring_match_linted = false;
@@ -680,16 +986,35 @@ impl<'tcx> LateLintPass<'tcx> for Matches {
                 }
                 match_ref_pats::check(cx, ex, arms.iter().map(|el| el.pat), expr);
             }
-
-            // These don't depend on a relationship between multiple arms
-            match_wild_err_arm::check(cx, ex, arms);
-            wild_in_or_pats::check(cx, arms);
-        } else {
-            if meets_msrv(self.msrv, msrvs::MATCHES_MACRO) {
-                match_like_matches::check(cx, expr);
+        } else if let Some(if_let) = higher::IfLet::hir(cx, expr) {
+            collapsible_match::check_if_let(cx, if_let.let_pat, if_let.if_then, if_let.if_else);
+            if !from_expansion {
+                if let Some(else_expr) = if_let.if_else {
+                    if meets_msrv(self.msrv, msrvs::MATCHES_MACRO) {
+                        match_like_matches::check_if_let(
+                            cx,
+                            expr,
+                            if_let.let_pat,
+                            if_let.let_expr,
+                            if_let.if_then,
+                            else_expr,
+                        );
+                    }
+                    if !in_constant(cx, expr.hir_id) {
+                        manual_map::check_if_let(cx, expr, if_let.let_pat, if_let.let_expr, if_let.if_then, else_expr);
+                    }
+                }
+                redundant_pattern_match::check_if_let(
+                    cx,
+                    expr,
+                    if_let.let_pat,
+                    if_let.let_expr,
+                    if_let.if_else.is_some(),
+                );
+                needless_match::check_if_let(cx, expr, &if_let);
             }
+        } else if !from_expansion {
             redundant_pattern_match::check(cx, expr);
-            needless_match::check(cx, expr);
         }
     }
 
diff --git a/src/tools/clippy/clippy_lints/src/matches/needless_match.rs b/src/tools/clippy/clippy_lints/src/matches/needless_match.rs
index f920ad4651f..fa19cddd35e 100644
--- a/src/tools/clippy/clippy_lints/src/matches/needless_match.rs
+++ b/src/tools/clippy/clippy_lints/src/matches/needless_match.rs
@@ -47,20 +47,18 @@ pub(crate) fn check_match(cx: &LateContext<'_>, ex: &Expr<'_>, arms: &[Arm<'_>],
 ///     some_enum
 /// }
 /// ```
-pub(crate) fn check(cx: &LateContext<'_>, ex: &Expr<'_>) {
-    if let Some(ref if_let) = higher::IfLet::hir(cx, ex) {
-        if !is_else_clause(cx.tcx, ex) && expr_ty_matches_p_ty(cx, if_let.let_expr, ex) && check_if_let(cx, if_let) {
-            let mut applicability = Applicability::MachineApplicable;
-            span_lint_and_sugg(
-                cx,
-                NEEDLESS_MATCH,
-                ex.span,
-                "this if-let expression is unnecessary",
-                "replace it with",
-                snippet_with_applicability(cx, if_let.let_expr.span, "..", &mut applicability).to_string(),
-                applicability,
-            );
-        }
+pub(crate) fn check_if_let<'tcx>(cx: &LateContext<'tcx>, ex: &Expr<'_>, if_let: &higher::IfLet<'tcx>) {
+    if !is_else_clause(cx.tcx, ex) && expr_ty_matches_p_ty(cx, if_let.let_expr, ex) && check_if_let_inner(cx, if_let) {
+        let mut applicability = Applicability::MachineApplicable;
+        span_lint_and_sugg(
+            cx,
+            NEEDLESS_MATCH,
+            ex.span,
+            "this if-let expression is unnecessary",
+            "replace it with",
+            snippet_with_applicability(cx, if_let.let_expr.span, "..", &mut applicability).to_string(),
+            applicability,
+        );
     }
 }
 
@@ -77,7 +75,7 @@ fn check_all_arms(cx: &LateContext<'_>, match_expr: &Expr<'_>, arms: &[Arm<'_>])
     true
 }
 
-fn check_if_let(cx: &LateContext<'_>, if_let: &higher::IfLet<'_>) -> bool {
+fn check_if_let_inner(cx: &LateContext<'_>, if_let: &higher::IfLet<'_>) -> bool {
     if let Some(if_else) = if_let.if_else {
         if !pat_same_as_expr(if_let.let_pat, peel_blocks_with_stmt(if_let.if_then)) {
             return false;
@@ -85,7 +83,7 @@ fn check_if_let(cx: &LateContext<'_>, if_let: &higher::IfLet<'_>) -> bool {
 
         // Recursively check for each `else if let` phrase,
         if let Some(ref nested_if_let) = higher::IfLet::hir(cx, if_else) {
-            return check_if_let(cx, nested_if_let);
+            return check_if_let_inner(cx, nested_if_let);
         }
 
         if matches!(if_else.kind, ExprKind::Block(..)) {
diff --git a/src/tools/clippy/clippy_lints/src/matches/redundant_pattern_match.rs b/src/tools/clippy/clippy_lints/src/matches/redundant_pattern_match.rs
index 1a8b9d15f37..0ea3f3b673b 100644
--- a/src/tools/clippy/clippy_lints/src/matches/redundant_pattern_match.rs
+++ b/src/tools/clippy/clippy_lints/src/matches/redundant_pattern_match.rs
@@ -18,19 +18,21 @@ use rustc_middle::ty::{self, subst::GenericArgKind, DefIdTree, Ty};
 use rustc_span::sym;
 
 pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
-    if let Some(higher::IfLet {
-        if_else,
-        let_pat,
-        let_expr,
-        ..
-    }) = higher::IfLet::hir(cx, expr)
-    {
-        find_sugg_for_if_let(cx, expr, let_pat, let_expr, "if", if_else.is_some());
-    } else if let Some(higher::WhileLet { let_pat, let_expr, .. }) = higher::WhileLet::hir(expr) {
+    if let Some(higher::WhileLet { let_pat, let_expr, .. }) = higher::WhileLet::hir(expr) {
         find_sugg_for_if_let(cx, expr, let_pat, let_expr, "while", false);
     }
 }
 
+pub(super) fn check_if_let<'tcx>(
+    cx: &LateContext<'tcx>,
+    expr: &'tcx Expr<'_>,
+    pat: &'tcx Pat<'_>,
+    scrutinee: &'tcx Expr<'_>,
+    has_else: bool,
+) {
+    find_sugg_for_if_let(cx, expr, pat, scrutinee, "if", has_else);
+}
+
 // Extract the generic arguments out of a type
 fn try_get_generic_ty(ty: Ty<'_>, index: usize) -> Option<Ty<'_>> {
     if_chain! {
@@ -68,7 +70,7 @@ fn temporaries_need_ordered_drop<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<
                         }
                     }
                 },
-                // the base type is alway taken by reference.
+                // the base type is always taken by reference.
                 // e.g. In `(vec![0])[0]` the vector is a temporary value.
                 ExprKind::Index(base, index) => {
                     if !matches!(base.kind, ExprKind::Path(_)) {
diff --git a/src/tools/clippy/clippy_lints/src/significant_drop_in_scrutinee.rs b/src/tools/clippy/clippy_lints/src/matches/significant_drop_in_scrutinee.rs
index 424b361a905..a211dc18f9e 100644
--- a/src/tools/clippy/clippy_lints/src/significant_drop_in_scrutinee.rs
+++ b/src/tools/clippy/clippy_lints/src/matches/significant_drop_in_scrutinee.rs
@@ -4,103 +4,25 @@ use clippy_utils::get_attr;
 use clippy_utils::source::{indent_of, snippet};
 use rustc_errors::{Applicability, Diagnostic};
 use rustc_hir::intravisit::{walk_expr, Visitor};
-use rustc_hir::{Expr, ExprKind};
-use rustc_lint::{LateContext, LateLintPass, LintContext};
+use rustc_hir::{Expr, ExprKind, MatchSource};
+use rustc_lint::{LateContext, LintContext};
 use rustc_middle::ty::subst::GenericArgKind;
 use rustc_middle::ty::{Ty, TypeAndMut};
-use rustc_session::{declare_lint_pass, declare_tool_lint};
 use rustc_span::Span;
 
-declare_clippy_lint! {
-    /// ### What it does
-    /// Check for temporaries returned from function calls in a match scrutinee that have the
-    /// `clippy::has_significant_drop` attribute.
-    ///
-    /// ### Why is this bad?
-    /// The `clippy::has_significant_drop` attribute can be added to types whose Drop impls have
-    /// an important side-effect, such as unlocking a mutex, making it important for users to be
-    /// able to accurately understand their lifetimes. When a temporary is returned in a function
-    /// call in a match scrutinee, its lifetime lasts until the end of the match block, which may
-    /// be surprising.
-    ///
-    /// For `Mutex`es this can lead to a deadlock. This happens when the match scrutinee uses a
-    /// function call that returns a `MutexGuard` and then tries to lock again in one of the match
-    /// arms. In that case the `MutexGuard` in the scrutinee will not be dropped until the end of
-    /// the match block and thus will not unlock.
-    ///
-    /// ### Example
-    /// ```rust.ignore
-    /// # use std::sync::Mutex;
-    ///
-    /// # struct State {}
-    ///
-    /// # impl State {
-    /// #     fn foo(&self) -> bool {
-    /// #         true
-    /// #     }
-    ///
-    /// #     fn bar(&self) {}
-    /// # }
-    ///
-    ///
-    /// let mutex = Mutex::new(State {});
-    ///
-    /// match mutex.lock().unwrap().foo() {
-    ///     true => {
-    ///         mutex.lock().unwrap().bar(); // Deadlock!
-    ///     }
-    ///     false => {}
-    /// };
-    ///
-    /// println!("All done!");
-    ///
-    /// ```
-    /// Use instead:
-    /// ```rust
-    /// # use std::sync::Mutex;
-    ///
-    /// # struct State {}
-    ///
-    /// # impl State {
-    /// #     fn foo(&self) -> bool {
-    /// #         true
-    /// #     }
-    ///
-    /// #     fn bar(&self) {}
-    /// # }
-    ///
-    /// let mutex = Mutex::new(State {});
-    ///
-    /// let is_foo = mutex.lock().unwrap().foo();
-    /// match is_foo {
-    ///     true => {
-    ///         mutex.lock().unwrap().bar();
-    ///     }
-    ///     false => {}
-    /// };
-    ///
-    /// println!("All done!");
-    /// ```
-    #[clippy::version = "1.60.0"]
-    pub SIGNIFICANT_DROP_IN_SCRUTINEE,
-    suspicious,
-    "warns when a temporary of a type with a drop with a significant side-effect might have a surprising lifetime"
-}
-
-declare_lint_pass!(SignificantDropInScrutinee => [SIGNIFICANT_DROP_IN_SCRUTINEE]);
+use super::SIGNIFICANT_DROP_IN_SCRUTINEE;
 
-impl<'tcx> LateLintPass<'tcx> for SignificantDropInScrutinee {
-    fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
-        if let Some(suggestions) = has_significant_drop_in_scrutinee(cx, expr) {
-            for found in suggestions {
-                span_lint_and_then(
-                    cx,
-                    SIGNIFICANT_DROP_IN_SCRUTINEE,
-                    found.found_span,
-                    "temporary with significant drop in match scrutinee",
-                    |diag| set_diagnostic(diag, cx, expr, found),
-                );
-            }
+pub(super) fn check<'tcx>(
+    cx: &LateContext<'tcx>,
+    expr: &'tcx Expr<'tcx>,
+    scrutinee: &'tcx Expr<'_>,
+    source: MatchSource,
+) {
+    if let Some((suggestions, message)) = has_significant_drop_in_scrutinee(cx, scrutinee, source) {
+        for found in suggestions {
+            span_lint_and_then(cx, SIGNIFICANT_DROP_IN_SCRUTINEE, found.found_span, message, |diag| {
+                set_diagnostic(diag, cx, expr, found);
+            });
         }
     }
 }
@@ -152,13 +74,18 @@ fn set_diagnostic<'tcx>(diag: &mut Diagnostic, cx: &LateContext<'tcx>, expr: &'t
 /// may have a surprising lifetime.
 fn has_significant_drop_in_scrutinee<'tcx, 'a>(
     cx: &'a LateContext<'tcx>,
-    expr: &'tcx Expr<'tcx>,
-) -> Option<Vec<FoundSigDrop>> {
+    scrutinee: &'tcx Expr<'tcx>,
+    source: MatchSource,
+) -> Option<(Vec<FoundSigDrop>, &'static str)> {
     let mut helper = SigDropHelper::new(cx);
-    match expr.kind {
-        ExprKind::Match(match_expr, _, _) => helper.find_sig_drop(match_expr),
-        _ => None,
-    }
+    helper.find_sig_drop(scrutinee).map(|drops| {
+        let message = if source == MatchSource::Normal {
+            "temporary with significant drop in match scrutinee"
+        } else {
+            "temporary with significant drop in for loop"
+        };
+        (drops, message)
+    })
 }
 
 struct SigDropHelper<'a, 'tcx> {
@@ -213,6 +140,19 @@ impl<'a, 'tcx> SigDropHelper<'a, 'tcx> {
         self.sig_drop_spans.take()
     }
 
+    fn replace_current_sig_drop(
+        &mut self,
+        found_span: Span,
+        is_unit_return_val: bool,
+        lint_suggestion: LintSuggestion,
+    ) {
+        self.current_sig_drop.replace(FoundSigDrop {
+            found_span,
+            is_unit_return_val,
+            lint_suggestion,
+        });
+    }
+
     /// This will try to set the current suggestion (so it can be moved into the suggestions vec
     /// later). If `allow_move_and_clone` is false, the suggestion *won't* be set -- this gives us
     /// an opportunity to look for another type in the chain that will be trivially copyable.
@@ -229,25 +169,15 @@ impl<'a, 'tcx> SigDropHelper<'a, 'tcx> {
             // but let's avoid any chance of an ICE
             if let Some(TypeAndMut { ty, .. }) = ty.builtin_deref(true) {
                 if ty.is_trivially_pure_clone_copy() {
-                    self.current_sig_drop.replace(FoundSigDrop {
-                        found_span: expr.span,
-                        is_unit_return_val: false,
-                        lint_suggestion: LintSuggestion::MoveAndDerefToCopy,
-                    });
+                    self.replace_current_sig_drop(expr.span, false, LintSuggestion::MoveAndDerefToCopy);
                 } else if allow_move_and_clone {
-                    self.current_sig_drop.replace(FoundSigDrop {
-                        found_span: expr.span,
-                        is_unit_return_val: false,
-                        lint_suggestion: LintSuggestion::MoveAndClone,
-                    });
+                    self.replace_current_sig_drop(expr.span, false, LintSuggestion::MoveAndClone);
                 }
             }
         } else if ty.is_trivially_pure_clone_copy() {
-            self.current_sig_drop.replace(FoundSigDrop {
-                found_span: expr.span,
-                is_unit_return_val: false,
-                lint_suggestion: LintSuggestion::MoveOnly,
-            });
+            self.replace_current_sig_drop(expr.span, false, LintSuggestion::MoveOnly);
+        } else if allow_move_and_clone {
+            self.replace_current_sig_drop(expr.span, false, LintSuggestion::MoveAndClone);
         }
     }
 
@@ -279,11 +209,7 @@ impl<'a, 'tcx> SigDropHelper<'a, 'tcx> {
         // If either side had a significant drop, suggest moving the entire scrutinee to avoid
         // unnecessary copies and to simplify cases where both sides have significant drops.
         if self.has_significant_drop {
-            self.current_sig_drop.replace(FoundSigDrop {
-                found_span: span,
-                is_unit_return_val,
-                lint_suggestion: LintSuggestion::MoveOnly,
-            });
+            self.replace_current_sig_drop(span, is_unit_return_val, LintSuggestion::MoveOnly);
         }
 
         self.special_handling_for_binary_op = false;
@@ -363,34 +289,34 @@ impl<'a, 'tcx> Visitor<'tcx> for SigDropHelper<'a, 'tcx> {
                 }
             }
             ExprKind::Box(..) |
-                ExprKind::Array(..) |
-                ExprKind::Call(..) |
-                ExprKind::Unary(..) |
-                ExprKind::If(..) |
-                ExprKind::Match(..) |
-                ExprKind::Field(..) |
-                ExprKind::Index(..) |
-                ExprKind::Ret(..) |
-                ExprKind::Repeat(..) |
-                ExprKind::Yield(..) |
-                ExprKind::MethodCall(..) => walk_expr(self, ex),
+            ExprKind::Array(..) |
+            ExprKind::Call(..) |
+            ExprKind::Unary(..) |
+            ExprKind::If(..) |
+            ExprKind::Match(..) |
+            ExprKind::Field(..) |
+            ExprKind::Index(..) |
+            ExprKind::Ret(..) |
+            ExprKind::Repeat(..) |
+            ExprKind::Yield(..) |
+            ExprKind::MethodCall(..) => walk_expr(self, ex),
             ExprKind::AddrOf(_, _, _) |
-                ExprKind::Block(_, _) |
-                ExprKind::Break(_, _) |
-                ExprKind::Cast(_, _) |
-                // Don't want to check the closure itself, only invocation, which is covered by MethodCall
-                ExprKind::Closure(_, _, _, _, _) |
-                ExprKind::ConstBlock(_) |
-                ExprKind::Continue(_) |
-                ExprKind::DropTemps(_) |
-                ExprKind::Err |
-                ExprKind::InlineAsm(_) |
-                ExprKind::Let(_) |
-                ExprKind::Lit(_) |
-                ExprKind::Loop(_, _, _, _) |
-                ExprKind::Path(_) |
-                ExprKind::Struct(_, _, _) |
-                ExprKind::Type(_, _) => {
+            ExprKind::Block(_, _) |
+            ExprKind::Break(_, _) |
+            ExprKind::Cast(_, _) |
+            // Don't want to check the closure itself, only invocation, which is covered by MethodCall
+            ExprKind::Closure(_, _, _, _, _) |
+            ExprKind::ConstBlock(_) |
+            ExprKind::Continue(_) |
+            ExprKind::DropTemps(_) |
+            ExprKind::Err |
+            ExprKind::InlineAsm(_) |
+            ExprKind::Let(_) |
+            ExprKind::Lit(_) |
+            ExprKind::Loop(_, _, _, _) |
+            ExprKind::Path(_) |
+            ExprKind::Struct(_, _, _) |
+            ExprKind::Type(_, _) => {
                 return;
             }
         }
diff --git a/src/tools/clippy/clippy_lints/src/matches/try_err.rs b/src/tools/clippy/clippy_lints/src/matches/try_err.rs
new file mode 100644
index 00000000000..0491a0679f3
--- /dev/null
+++ b/src/tools/clippy/clippy_lints/src/matches/try_err.rs
@@ -0,0 +1,145 @@
+use clippy_utils::diagnostics::span_lint_and_sugg;
+use clippy_utils::source::snippet_with_applicability;
+use clippy_utils::ty::is_type_diagnostic_item;
+use clippy_utils::{get_parent_expr, is_lang_ctor, match_def_path, paths};
+use if_chain::if_chain;
+use rustc_errors::Applicability;
+use rustc_hir::LangItem::ResultErr;
+use rustc_hir::{Expr, ExprKind, LangItem, MatchSource, QPath};
+use rustc_lint::LateContext;
+use rustc_middle::ty::{self, Ty};
+use rustc_span::{hygiene, sym};
+
+use super::TRY_ERR;
+
+pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, scrutinee: &'tcx Expr<'_>) {
+    // Looks for a structure like this:
+    // match ::std::ops::Try::into_result(Err(5)) {
+    //     ::std::result::Result::Err(err) =>
+    //         #[allow(unreachable_code)]
+    //         return ::std::ops::Try::from_error(::std::convert::From::from(err)),
+    //     ::std::result::Result::Ok(val) =>
+    //         #[allow(unreachable_code)]
+    //         val,
+    // };
+    if_chain! {
+        if let ExprKind::Call(match_fun, try_args) = scrutinee.kind;
+        if let ExprKind::Path(ref match_fun_path) = match_fun.kind;
+        if matches!(match_fun_path, QPath::LangItem(LangItem::TryTraitBranch, ..));
+        if let Some(try_arg) = try_args.get(0);
+        if let ExprKind::Call(err_fun, err_args) = try_arg.kind;
+        if let Some(err_arg) = err_args.get(0);
+        if let ExprKind::Path(ref err_fun_path) = err_fun.kind;
+        if is_lang_ctor(cx, err_fun_path, ResultErr);
+        if let Some(return_ty) = find_return_type(cx, &expr.kind);
+        then {
+            let prefix;
+            let suffix;
+            let err_ty;
+
+            if let Some(ty) = result_error_type(cx, return_ty) {
+                prefix = "Err(";
+                suffix = ")";
+                err_ty = ty;
+            } else if let Some(ty) = poll_result_error_type(cx, return_ty) {
+                prefix = "Poll::Ready(Err(";
+                suffix = "))";
+                err_ty = ty;
+            } else if let Some(ty) = poll_option_result_error_type(cx, return_ty) {
+                prefix = "Poll::Ready(Some(Err(";
+                suffix = ")))";
+                err_ty = ty;
+            } else {
+                return;
+            };
+
+            let expr_err_ty = cx.typeck_results().expr_ty(err_arg);
+            let span = hygiene::walk_chain(err_arg.span, try_arg.span.ctxt());
+            let mut applicability = Applicability::MachineApplicable;
+            let origin_snippet = snippet_with_applicability(cx, span, "_", &mut applicability);
+            let ret_prefix = if get_parent_expr(cx, expr).map_or(false, |e| matches!(e.kind, ExprKind::Ret(_))) {
+                "" // already returns
+            } else {
+                "return "
+            };
+            let suggestion = if err_ty == expr_err_ty {
+                format!("{}{}{}{}", ret_prefix, prefix, origin_snippet, suffix)
+            } else {
+                format!("{}{}{}.into(){}", ret_prefix, prefix, origin_snippet, suffix)
+            };
+
+            span_lint_and_sugg(
+                cx,
+                TRY_ERR,
+                expr.span,
+                "returning an `Err(_)` with the `?` operator",
+                "try this",
+                suggestion,
+                applicability,
+            );
+        }
+    }
+}
+
+/// Finds function return type by examining return expressions in match arms.
+fn find_return_type<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx ExprKind<'_>) -> Option<Ty<'tcx>> {
+    if let ExprKind::Match(_, arms, MatchSource::TryDesugar) = expr {
+        for arm in arms.iter() {
+            if let ExprKind::Ret(Some(ret)) = arm.body.kind {
+                return Some(cx.typeck_results().expr_ty(ret));
+            }
+        }
+    }
+    None
+}
+
+/// Extracts the error type from Result<T, E>.
+fn result_error_type<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option<Ty<'tcx>> {
+    if_chain! {
+        if let ty::Adt(_, subst) = ty.kind();
+        if is_type_diagnostic_item(cx, ty, sym::Result);
+        then {
+            Some(subst.type_at(1))
+        } else {
+            None
+        }
+    }
+}
+
+/// Extracts the error type from Poll<Result<T, E>>.
+fn poll_result_error_type<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option<Ty<'tcx>> {
+    if_chain! {
+        if let ty::Adt(def, subst) = ty.kind();
+        if match_def_path(cx, def.did(), &paths::POLL);
+        let ready_ty = subst.type_at(0);
+
+        if let ty::Adt(ready_def, ready_subst) = ready_ty.kind();
+        if cx.tcx.is_diagnostic_item(sym::Result, ready_def.did());
+        then {
+            Some(ready_subst.type_at(1))
+        } else {
+            None
+        }
+    }
+}
+
+/// Extracts the error type from Poll<Option<Result<T, E>>>.
+fn poll_option_result_error_type<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option<Ty<'tcx>> {
+    if_chain! {
+        if let ty::Adt(def, subst) = ty.kind();
+        if match_def_path(cx, def.did(), &paths::POLL);
+        let ready_ty = subst.type_at(0);
+
+        if let ty::Adt(ready_def, ready_subst) = ready_ty.kind();
+        if cx.tcx.is_diagnostic_item(sym::Option, ready_def.did());
+        let some_ty = ready_subst.type_at(0);
+
+        if let ty::Adt(some_def, some_subst) = some_ty.kind();
+        if cx.tcx.is_diagnostic_item(sym::Result, some_def.did());
+        then {
+            Some(some_subst.type_at(1))
+        } else {
+            None
+        }
+    }
+}
diff --git a/src/tools/clippy/clippy_lints/src/methods/get_last_with_len.rs b/src/tools/clippy/clippy_lints/src/methods/get_last_with_len.rs
new file mode 100644
index 00000000000..23368238ef5
--- /dev/null
+++ b/src/tools/clippy/clippy_lints/src/methods/get_last_with_len.rs
@@ -0,0 +1,55 @@
+use clippy_utils::diagnostics::span_lint_and_sugg;
+use clippy_utils::source::snippet_with_applicability;
+use clippy_utils::SpanlessEq;
+use rustc_ast::LitKind;
+use rustc_errors::Applicability;
+use rustc_hir::{BinOpKind, Expr, ExprKind};
+use rustc_lint::LateContext;
+use rustc_middle::ty;
+use rustc_span::source_map::Spanned;
+use rustc_span::sym;
+
+use super::GET_LAST_WITH_LEN;
+
+pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, recv: &Expr<'_>, arg: &Expr<'_>) {
+    // Argument to "get" is a subtraction
+    if let ExprKind::Binary(
+        Spanned {
+            node: BinOpKind::Sub, ..
+        },
+        lhs,
+        rhs,
+    ) = arg.kind
+
+        // LHS of subtraction is "x.len()"
+        && let ExprKind::MethodCall(lhs_path, [lhs_recv], _) = &lhs.kind
+        && lhs_path.ident.name == sym::len
+
+        // RHS of subtraction is 1
+        && let ExprKind::Lit(rhs_lit) = &rhs.kind
+        && let LitKind::Int(1, ..) = rhs_lit.node
+
+        // check that recv == lhs_recv `recv.get(lhs_recv.len() - 1)`
+        && SpanlessEq::new(cx).eq_expr(recv, lhs_recv)
+        && !recv.can_have_side_effects()
+    {
+        let method = match cx.typeck_results().expr_ty_adjusted(recv).peel_refs().kind() {
+            ty::Adt(def, _) if cx.tcx.is_diagnostic_item(sym::VecDeque, def.did()) => "back",
+            ty::Slice(_) => "last",
+            _ => return,
+        };
+
+        let mut applicability = Applicability::MachineApplicable;
+        let recv_snippet = snippet_with_applicability(cx, recv.span, "_", &mut applicability);
+
+        span_lint_and_sugg(
+            cx,
+            GET_LAST_WITH_LEN,
+            expr.span,
+            &format!("accessing last element with `{recv_snippet}.get({recv_snippet}.len() - 1)`"),
+            "try",
+            format!("{recv_snippet}.{method}()"),
+            applicability,
+        );
+    }
+}
diff --git a/src/tools/clippy/clippy_lints/src/methods/iter_next_slice.rs b/src/tools/clippy/clippy_lints/src/methods/iter_next_slice.rs
index d053ff56756..b8d1dabe007 100644
--- a/src/tools/clippy/clippy_lints/src/methods/iter_next_slice.rs
+++ b/src/tools/clippy/clippy_lints/src/methods/iter_next_slice.rs
@@ -34,13 +34,18 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>, cal
             if let ast::LitKind::Int(start_idx, _) = start_lit.node;
             then {
                 let mut applicability = Applicability::MachineApplicable;
+                let suggest = if start_idx == 0 {
+                    format!("{}.first()", snippet_with_applicability(cx, caller_var.span, "..", &mut applicability))
+                } else {
+                    format!("{}.get({})", snippet_with_applicability(cx, caller_var.span, "..", &mut applicability), start_idx)
+                };
                 span_lint_and_sugg(
                     cx,
                     ITER_NEXT_SLICE,
                     expr.span,
                     "using `.iter().next()` on a Slice without end index",
                     "try calling",
-                    format!("{}.get({})", snippet_with_applicability(cx, caller_var.span, "..", &mut applicability), start_idx),
+                    suggest,
                     applicability,
                 );
             }
@@ -55,7 +60,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>, cal
             "using `.iter().next()` on an array",
             "try calling",
             format!(
-                "{}.get(0)",
+                "{}.first()",
                 snippet_with_applicability(cx, caller_expr.span, "..", &mut applicability)
             ),
             applicability,
diff --git a/src/tools/clippy/clippy_lints/src/methods/mod.rs b/src/tools/clippy/clippy_lints/src/methods/mod.rs
index 3bf48e18019..7308e74c323 100644
--- a/src/tools/clippy/clippy_lints/src/methods/mod.rs
+++ b/src/tools/clippy/clippy_lints/src/methods/mod.rs
@@ -21,6 +21,7 @@ mod filter_next;
 mod flat_map_identity;
 mod flat_map_option;
 mod from_iter_instead_of_collect;
+mod get_last_with_len;
 mod get_unwrap;
 mod implicit_clone;
 mod inefficient_to_string;
@@ -44,6 +45,7 @@ mod map_identity;
 mod map_unwrap_or;
 mod needless_option_as_deref;
 mod needless_option_take;
+mod no_effect_replace;
 mod ok_expect;
 mod option_as_ref_deref;
 mod option_map_or_none;
@@ -192,25 +194,18 @@ declare_clippy_lint! {
     ///
     /// ### Examples
     /// ```rust
-    /// # let opt = Some(1);
-    ///
-    /// // Bad
-    /// opt.unwrap();
-    ///
-    /// // Good
-    /// opt.expect("more helpful message");
+    /// # let option = Some(1);
+    /// # let result: Result<usize, ()> = Ok(1);
+    /// option.unwrap();
+    /// result.unwrap();
     /// ```
     ///
-    /// // or
-    ///
+    /// Use instead:
     /// ```rust
-    /// # let res: Result<usize, ()> = Ok(1);
-    ///
-    /// // Bad
-    /// res.unwrap();
-    ///
-    /// // Good
-    /// res.expect("more helpful message");
+    /// # let option = Some(1);
+    /// # let result: Result<usize, ()> = Ok(1);
+    /// option.expect("more helpful message");
+    /// result.expect("more helpful message");
     /// ```
     #[clippy::version = "1.45.0"]
     pub UNWRAP_USED,
@@ -233,27 +228,21 @@ declare_clippy_lint! {
     ///
     /// ### Examples
     /// ```rust,ignore
-    /// # let opt = Some(1);
-    ///
-    /// // Bad
-    /// opt.expect("one");
-    ///
-    /// // Good
-    /// let opt = Some(1);
-    /// opt?;
+    /// # let option = Some(1);
+    /// # let result: Result<usize, ()> = Ok(1);
+    /// option.expect("one");
+    /// result.expect("one");
     /// ```
     ///
-    /// // or
-    ///
-    /// ```rust
-    /// # let res: Result<usize, ()> = Ok(1);
+    /// Use instead:
+    /// ```rust,ignore
+    /// # let option = Some(1);
+    /// # let result: Result<usize, ()> = Ok(1);
+    /// option?;
     ///
-    /// // Bad
-    /// res.expect("one");
+    /// // or
     ///
-    /// // Good
-    /// res?;
-    /// # Ok::<(), ()>(())
+    /// result?;
     /// ```
     #[clippy::version = "1.45.0"]
     pub EXPECT_USED,
@@ -429,26 +418,20 @@ declare_clippy_lint! {
     ///
     /// ### Examples
     /// ```rust
-    /// # let x = Some(1);
-    ///
-    /// // Bad
-    /// x.map(|a| a + 1).unwrap_or(0);
-    ///
-    /// // Good
-    /// x.map_or(0, |a| a + 1);
+    /// # let option = Some(1);
+    /// # let result: Result<usize, ()> = Ok(1);
+    /// # fn some_function(foo: ()) -> usize { 1 }
+    /// option.map(|a| a + 1).unwrap_or(0);
+    /// result.map(|a| a + 1).unwrap_or_else(some_function);
     /// ```
     ///
-    /// // or
-    ///
+    /// Use instead:
     /// ```rust
-    /// # let x: Result<usize, ()> = Ok(1);
+    /// # let option = Some(1);
+    /// # let result: Result<usize, ()> = Ok(1);
     /// # fn some_function(foo: ()) -> usize { 1 }
-    ///
-    /// // Bad
-    /// x.map(|a| a + 1).unwrap_or_else(some_function);
-    ///
-    /// // Good
-    /// x.map_or_else(some_function, |a| a + 1);
+    /// option.map_or(0, |a| a + 1);
+    /// result.map_or_else(some_function, |a| a + 1);
     /// ```
     #[clippy::version = "1.45.0"]
     pub MAP_UNWRAP_OR,
@@ -791,13 +774,14 @@ declare_clippy_lint! {
     /// # let foo = Some(String::new());
     /// foo.unwrap_or(String::new());
     /// ```
-    /// this can instead be written:
+    ///
+    /// Use instead:
     /// ```rust
     /// # let foo = Some(String::new());
     /// foo.unwrap_or_else(String::new);
-    /// ```
-    /// or
-    /// ```rust
+    ///
+    /// // or
+    ///
     /// # let foo = Some(String::new());
     /// foo.unwrap_or_default();
     /// ```
@@ -861,15 +845,14 @@ declare_clippy_lint! {
     /// # let err_code = "418";
     /// # let err_msg = "I'm a teapot";
     /// foo.expect(&format!("Err {}: {}", err_code, err_msg));
-    /// ```
-    /// or
-    /// ```rust
+    ///
+    /// // or
+    ///
     /// # let foo = Some(String::new());
-    /// # let err_code = "418";
-    /// # let err_msg = "I'm a teapot";
     /// foo.expect(format!("Err {}: {}", err_code, err_msg).as_str());
     /// ```
-    /// this can instead be written:
+    ///
+    /// Use instead:
     /// ```rust
     /// # let foo = Some(String::new());
     /// # let err_code = "418";
@@ -1211,6 +1194,38 @@ declare_clippy_lint! {
 
 declare_clippy_lint! {
     /// ### What it does
+    /// Checks for using `x.get(x.len() - 1)` instead of
+    /// `x.last()`.
+    ///
+    /// ### Why is this bad?
+    /// Using `x.last()` is easier to read and has the same
+    /// result.
+    ///
+    /// Note that using `x[x.len() - 1]` is semantically different from
+    /// `x.last()`.  Indexing into the array will panic on out-of-bounds
+    /// accesses, while `x.get()` and `x.last()` will return `None`.
+    ///
+    /// There is another lint (get_unwrap) that covers the case of using
+    /// `x.get(index).unwrap()` instead of `x[index]`.
+    ///
+    /// ### Example
+    /// ```rust
+    /// // Bad
+    /// let x = vec![2, 3, 5];
+    /// let last_element = x.get(x.len() - 1);
+    ///
+    /// // Good
+    /// let x = vec![2, 3, 5];
+    /// let last_element = x.last();
+    /// ```
+    #[clippy::version = "1.37.0"]
+    pub GET_LAST_WITH_LEN,
+    complexity,
+    "Using `x.get(x.len() - 1)` when `x.last()` is correct and simpler"
+}
+
+declare_clippy_lint! {
+    /// ### What it does
     /// Checks for use of `.get().unwrap()` (or
     /// `.get_mut().unwrap`) on a standard library type which implements `Index`
     ///
@@ -2195,6 +2210,24 @@ declare_clippy_lint! {
     "using `.as_ref().take()` on a temporary value"
 }
 
+declare_clippy_lint! {
+    /// ### What it does
+    /// Checks for `replace` statements which have no effect.
+    ///
+    /// ### Why is this bad?
+    /// It's either a mistake or confusing.
+    ///
+    /// ### Example
+    /// ```rust
+    /// "1234".replace("12", "12");
+    /// "1234".replacen("12", "12", 1);
+    /// ```
+    #[clippy::version = "1.62.0"]
+    pub NO_EFFECT_REPLACE,
+    suspicious,
+    "replace with no effect"
+}
+
 pub struct Methods {
     avoid_breaking_exported_api: bool,
     msrv: Option<RustcVersion>,
@@ -2264,6 +2297,7 @@ impl_lint_pass!(Methods => [
     BYTES_NTH,
     ITER_SKIP_NEXT,
     GET_UNWRAP,
+    GET_LAST_WITH_LEN,
     STRING_EXTEND_CHARS,
     ITER_CLONED_COLLECT,
     ITER_WITH_DRAIN,
@@ -2294,6 +2328,7 @@ impl_lint_pass!(Methods => [
     NEEDLESS_OPTION_AS_DEREF,
     IS_DIGIT_ASCII_RADIX,
     NEEDLESS_OPTION_TAKE,
+    NO_EFFECT_REPLACE,
 ]);
 
 /// Extracts a method call name, args, and `Span` of the method name.
@@ -2590,6 +2625,7 @@ impl Methods {
                         inspect_for_each::check(cx, expr, span2);
                     }
                 },
+                ("get", [arg]) => get_last_with_len::check(cx, expr, recv, arg),
                 ("get_or_insert_with", [arg]) => unnecessary_lazy_eval::check(cx, expr, recv, arg, "get_or_insert"),
                 ("is_file", []) => filetype_is_file::check(cx, expr, recv),
                 ("is_digit", [radix]) => is_digit_ascii_radix::check(cx, expr, recv, radix, self.msrv),
@@ -2705,6 +2741,9 @@ impl Methods {
                         unnecessary_lazy_eval::check(cx, expr, recv, u_arg, "unwrap_or");
                     },
                 },
+                ("replace" | "replacen", [arg1, arg2] | [arg1, arg2, _]) => {
+                    no_effect_replace::check(cx, expr, arg1, arg2);
+                },
                 _ => {},
             }
         }
diff --git a/src/tools/clippy/clippy_lints/src/methods/no_effect_replace.rs b/src/tools/clippy/clippy_lints/src/methods/no_effect_replace.rs
new file mode 100644
index 00000000000..a76341855b6
--- /dev/null
+++ b/src/tools/clippy/clippy_lints/src/methods/no_effect_replace.rs
@@ -0,0 +1,47 @@
+use clippy_utils::diagnostics::span_lint;
+use clippy_utils::ty::is_type_diagnostic_item;
+use clippy_utils::SpanlessEq;
+use if_chain::if_chain;
+use rustc_ast::LitKind;
+use rustc_hir::ExprKind;
+use rustc_lint::LateContext;
+use rustc_span::sym;
+
+use super::NO_EFFECT_REPLACE;
+
+pub(super) fn check<'tcx>(
+    cx: &LateContext<'tcx>,
+    expr: &'tcx rustc_hir::Expr<'_>,
+    arg1: &'tcx rustc_hir::Expr<'_>,
+    arg2: &'tcx rustc_hir::Expr<'_>,
+) {
+    let ty = cx.typeck_results().expr_ty(expr).peel_refs();
+    if !(ty.is_str() || is_type_diagnostic_item(cx, ty, sym::String)) {
+        return;
+    }
+
+    if_chain! {
+        if let ExprKind::Lit(spanned) = &arg1.kind;
+        if let Some(param1) = lit_string_value(&spanned.node);
+
+        if let ExprKind::Lit(spanned) = &arg2.kind;
+        if let LitKind::Str(param2, _) = &spanned.node;
+        if param1 == param2.as_str();
+
+        then {
+            span_lint(cx, NO_EFFECT_REPLACE, expr.span, "replacing text with itself");
+        }
+    }
+
+    if SpanlessEq::new(cx).eq_expr(arg1, arg2) {
+        span_lint(cx, NO_EFFECT_REPLACE, expr.span, "replacing text with itself");
+    }
+}
+
+fn lit_string_value(node: &LitKind) -> Option<String> {
+    match node {
+        LitKind::Char(value) => Some(value.to_string()),
+        LitKind::Str(value, _) => Some(value.as_str().to_owned()),
+        _ => None,
+    }
+}
diff --git a/src/tools/clippy/clippy_lints/src/methods/option_map_or_none.rs b/src/tools/clippy/clippy_lints/src/methods/option_map_or_none.rs
index 76bc9466ed8..8989db54f6c 100644
--- a/src/tools/clippy/clippy_lints/src/methods/option_map_or_none.rs
+++ b/src/tools/clippy/clippy_lints/src/methods/option_map_or_none.rs
@@ -97,7 +97,7 @@ pub(super) fn check<'tcx>(
         let func_snippet = snippet(cx, map_arg.span, "..");
         let msg = "called `map_or(None, ..)` on an `Option` value. This can be done more directly by calling \
                        `and_then(..)` instead";
-        return span_lint_and_sugg(
+        span_lint_and_sugg(
             cx,
             OPTION_MAP_OR_NONE,
             expr.span,
@@ -110,7 +110,7 @@ pub(super) fn check<'tcx>(
         let msg = "called `map_or(None, Some)` on a `Result` value. This can be done more directly by calling \
                        `ok()` instead";
         let self_snippet = snippet(cx, recv.span, "..");
-        return span_lint_and_sugg(
+        span_lint_and_sugg(
             cx,
             RESULT_MAP_OR_INTO_OPTION,
             expr.span,
diff --git a/src/tools/clippy/clippy_lints/src/methods/unnecessary_to_owned.rs b/src/tools/clippy/clippy_lints/src/methods/unnecessary_to_owned.rs
index 97c4feb3122..b4c6bfb31ed 100644
--- a/src/tools/clippy/clippy_lints/src/methods/unnecessary_to_owned.rs
+++ b/src/tools/clippy/clippy_lints/src/methods/unnecessary_to_owned.rs
@@ -415,7 +415,7 @@ fn is_cloned_or_copied(cx: &LateContext<'_>, method_name: Symbol, method_def_id:
 /// Returns true if the named method can be used to convert the receiver to its "owned"
 /// representation.
 fn is_to_owned_like(cx: &LateContext<'_>, method_name: Symbol, method_def_id: DefId) -> bool {
-    is_clone_like(cx, &*method_name.as_str(), method_def_id)
+    is_clone_like(cx, method_name.as_str(), method_def_id)
         || is_cow_into_owned(cx, method_name, method_def_id)
         || is_to_string(cx, method_name, method_def_id)
 }
diff --git a/src/tools/clippy/clippy_lints/src/minmax.rs b/src/tools/clippy/clippy_lints/src/minmax.rs
index 65d1f440b76..a081cde8572 100644
--- a/src/tools/clippy/clippy_lints/src/minmax.rs
+++ b/src/tools/clippy/clippy_lints/src/minmax.rs
@@ -18,11 +18,11 @@ declare_clippy_lint! {
     /// the least it hurts readability of the code.
     ///
     /// ### Example
-    /// ```ignore
+    /// ```rust,ignore
     /// min(0, max(100, x))
-    /// ```
-    /// or
-    /// ```ignore
+    ///
+    /// // or
+    ///
     /// x.max(100).min(0)
     /// ```
     /// It will always be equal to `0`. Probably the author meant to clamp the value
diff --git a/src/tools/clippy/clippy_lints/src/misc.rs b/src/tools/clippy/clippy_lints/src/misc.rs
index 7fdc28c5a06..55665699453 100644
--- a/src/tools/clippy/clippy_lints/src/misc.rs
+++ b/src/tools/clippy/clippy_lints/src/misc.rs
@@ -103,11 +103,14 @@ declare_clippy_lint! {
     /// let x = 1.2331f64;
     /// let y = 1.2332f64;
     ///
-    /// // Bad
     /// if y == 1.23f64 { }
     /// if y != x {} // where both are floats
+    /// ```
     ///
-    /// // Good
+    /// Use instead:
+    /// ```rust
+    /// # let x = 1.2331f64;
+    /// # let y = 1.2332f64;
     /// let error_margin = f64::EPSILON; // Use an epsilon for comparison
     /// // Or, if Rust <= 1.42, use `std::f64::EPSILON` constant instead.
     /// // let error_margin = std::f64::EPSILON;
@@ -258,10 +261,13 @@ declare_clippy_lint! {
     /// let x: f64 = 1.0;
     /// const ONE: f64 = 1.00;
     ///
-    /// // Bad
     /// if x == ONE { } // where both are floats
+    /// ```
     ///
-    /// // Good
+    /// Use instead:
+    /// ```rust
+    /// # let x: f64 = 1.0;
+    /// # const ONE: f64 = 1.00;
     /// let error_margin = f64::EPSILON; // Use an epsilon for comparison
     /// // Or, if Rust <= 1.42, use `std::f64::EPSILON` constant instead.
     /// // let error_margin = std::f64::EPSILON;
diff --git a/src/tools/clippy/clippy_lints/src/mismatching_type_param_order.rs b/src/tools/clippy/clippy_lints/src/mismatching_type_param_order.rs
new file mode 100644
index 00000000000..d466d54a6ba
--- /dev/null
+++ b/src/tools/clippy/clippy_lints/src/mismatching_type_param_order.rs
@@ -0,0 +1,116 @@
+use clippy_utils::diagnostics::span_lint_and_help;
+use rustc_data_structures::fx::FxHashMap;
+use rustc_hir::def::{DefKind, Res};
+use rustc_hir::{GenericArg, Item, ItemKind, QPath, Ty, TyKind};
+use rustc_lint::{LateContext, LateLintPass};
+use rustc_middle::ty::GenericParamDefKind;
+use rustc_session::{declare_lint_pass, declare_tool_lint};
+
+declare_clippy_lint! {
+    /// ### What it does
+    /// Checks for type parameters which are positioned inconsistently between
+    /// a type definition and impl block. Specifically, a paramater in an impl
+    /// block which has the same name as a parameter in the type def, but is in
+    /// a different place.
+    ///
+    /// ### Why is this bad?
+    /// Type parameters are determined by their position rather than name.
+    /// Naming type parameters inconsistently may cause you to refer to the
+    /// wrong type parameter.
+    ///
+    /// ### Example
+    /// ```rust
+    /// struct Foo<A, B> {
+    ///     x: A,
+    ///     y: B,
+    /// }
+    /// // inside the impl, B refers to Foo::A
+    /// impl<B, A> Foo<B, A> {}
+    /// ```
+    /// Use instead:
+    /// ```rust
+    /// struct Foo<A, B> {
+    ///     x: A,
+    ///     y: B,
+    /// }
+    /// impl<A, B> Foo<A, B> {}
+    /// ```
+    #[clippy::version = "1.62.0"]
+    pub MISMATCHING_TYPE_PARAM_ORDER,
+    pedantic,
+    "type parameter positioned inconsistently between type def and impl block"
+}
+declare_lint_pass!(TypeParamMismatch => [MISMATCHING_TYPE_PARAM_ORDER]);
+
+impl<'tcx> LateLintPass<'tcx> for TypeParamMismatch {
+    fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) {
+        if_chain! {
+            if !item.span.from_expansion();
+            if let ItemKind::Impl(imp) = &item.kind;
+            if let TyKind::Path(QPath::Resolved(_, path)) = &imp.self_ty.kind;
+            if let Some(segment) = path.segments.iter().next();
+            if let Some(generic_args) = segment.args;
+            if !generic_args.args.is_empty();
+            then {
+                // get the name and span of the generic parameters in the Impl
+                let impl_params = generic_args.args.iter()
+                .filter_map(|p|
+                    match p {
+                        GenericArg::Type(Ty {kind: TyKind::Path(QPath::Resolved(_, path)), ..}) =>
+                            Some((path.segments[0].ident.to_string(), path.span)),
+                        _ => None,
+                    }
+                );
+
+                // find the type that the Impl is for
+                // only lint on struct/enum/union for now
+                let defid = match path.res {
+                    Res::Def(DefKind::Struct | DefKind::Enum | DefKind::Union, defid) => defid,
+                    _ => return,
+                };
+
+                // get the names of the generic parameters in the type
+                let type_params = &cx.tcx.generics_of(defid).params;
+                let type_param_names: Vec<_> = type_params.iter()
+                .filter_map(|p|
+                    match p.kind {
+                        GenericParamDefKind::Type {..} => Some(p.name.to_string()),
+                        _ => None,
+                    }
+                ).collect();
+                // hashmap of name -> index for mismatch_param_name
+                let type_param_names_hashmap: FxHashMap<&String, usize> =
+                    type_param_names.iter().enumerate().map(|(i, param)| (param, i)).collect();
+
+                let type_name = segment.ident;
+                for (i, (impl_param_name, impl_param_span)) in impl_params.enumerate() {
+                    if mismatch_param_name(i, &impl_param_name, &type_param_names_hashmap) {
+                        let msg = format!("`{}` has a similarly named generic type parameter `{}` in its declaration, but in a different order",
+                                          type_name, impl_param_name);
+                        let help = format!("try `{}`, or a name that does not conflict with `{}`'s generic params",
+                                           type_param_names[i], type_name);
+                        span_lint_and_help(
+                            cx,
+                            MISMATCHING_TYPE_PARAM_ORDER,
+                            impl_param_span,
+                            &msg,
+                            None,
+                            &help
+                        );
+                    }
+                }
+            }
+        }
+    }
+}
+
+// Checks if impl_param_name is the same as one of type_param_names,
+// and is in a different position
+fn mismatch_param_name(i: usize, impl_param_name: &String, type_param_names: &FxHashMap<&String, usize>) -> bool {
+    if let Some(j) = type_param_names.get(impl_param_name) {
+        if i != *j {
+            return true;
+        }
+    }
+    false
+}
diff --git a/src/tools/clippy/clippy_lints/src/mixed_read_write_in_expression.rs b/src/tools/clippy/clippy_lints/src/mixed_read_write_in_expression.rs
index 405fc23e8de..024bd076071 100644
--- a/src/tools/clippy/clippy_lints/src/mixed_read_write_in_expression.rs
+++ b/src/tools/clippy/clippy_lints/src/mixed_read_write_in_expression.rs
@@ -120,7 +120,7 @@ impl<'a, 'tcx> DivergenceVisitor<'a, 'tcx> {
                         self.visit_expr(if_expr);
                     }
                     // make sure top level arm expressions aren't linted
-                    self.maybe_walk_expr(&*arm.body);
+                    self.maybe_walk_expr(arm.body);
                 }
             },
             _ => walk_expr(self, e),
diff --git a/src/tools/clippy/clippy_lints/src/mut_key.rs b/src/tools/clippy/clippy_lints/src/mut_key.rs
index cba54e14212..7e2531c7ca5 100644
--- a/src/tools/clippy/clippy_lints/src/mut_key.rs
+++ b/src/tools/clippy/clippy_lints/src/mut_key.rs
@@ -105,7 +105,7 @@ impl<'tcx> LateLintPass<'tcx> for MutableKeyType {
         if let hir::PatKind::Wild = local.pat.kind {
             return;
         }
-        check_ty(cx, local.span, cx.typeck_results().pat_ty(&*local.pat));
+        check_ty(cx, local.span, cx.typeck_results().pat_ty(local.pat));
     }
 }
 
diff --git a/src/tools/clippy/clippy_lints/src/mutable_debug_assertion.rs b/src/tools/clippy/clippy_lints/src/mutable_debug_assertion.rs
index bb6d820b08c..44fdf84c6df 100644
--- a/src/tools/clippy/clippy_lints/src/mutable_debug_assertion.rs
+++ b/src/tools/clippy/clippy_lints/src/mutable_debug_assertion.rs
@@ -22,9 +22,12 @@ declare_clippy_lint! {
     /// ### Example
     /// ```rust,ignore
     /// debug_assert_eq!(vec![3].pop(), Some(3));
+    ///
     /// // or
-    /// fn take_a_mut_parameter(_: &mut u32) -> bool { unimplemented!() }
-    /// debug_assert!(take_a_mut_parameter(&mut 5));
+    ///
+    /// # let mut x = 5;
+    /// # fn takes_a_mut_parameter(_: &mut u32) -> bool { unimplemented!() }
+    /// debug_assert!(takes_a_mut_parameter(&mut x));
     /// ```
     #[clippy::version = "1.40.0"]
     pub DEBUG_ASSERT_WITH_MUT_CALL,
diff --git a/src/tools/clippy/clippy_lints/src/needless_late_init.rs b/src/tools/clippy/clippy_lints/src/needless_late_init.rs
index b70871b38be..26c694a71fe 100644
--- a/src/tools/clippy/clippy_lints/src/needless_late_init.rs
+++ b/src/tools/clippy/clippy_lints/src/needless_late_init.rs
@@ -194,14 +194,15 @@ fn assignment_suggestions<'tcx>(
         }))
         .collect::<Option<Vec<(Span, String)>>>()?;
 
-    let applicability = if suggestions.len() > 1 {
+    match suggestions.len() {
+        // All of `exprs` are never types
+        // https://github.com/rust-lang/rust-clippy/issues/8911
+        0 => None,
+        1 => Some((Applicability::MachineApplicable, suggestions)),
         // multiple suggestions don't work with rustfix in multipart_suggest
         // https://github.com/rust-lang/rustfix/issues/141
-        Applicability::Unspecified
-    } else {
-        Applicability::MachineApplicable
-    };
-    Some((applicability, suggestions))
+        _ => Some((Applicability::Unspecified, suggestions)),
+    }
 }
 
 struct Usage<'tcx> {
diff --git a/src/tools/clippy/clippy_lints/src/arithmetic.rs b/src/tools/clippy/clippy_lints/src/numeric_arithmetic.rs
index c5948707c81..5c4de338149 100644
--- a/src/tools/clippy/clippy_lints/src/arithmetic.rs
+++ b/src/tools/clippy/clippy_lints/src/numeric_arithmetic.rs
@@ -51,16 +51,16 @@ declare_clippy_lint! {
 }
 
 #[derive(Copy, Clone, Default)]
-pub struct Arithmetic {
+pub struct NumericArithmetic {
     expr_span: Option<Span>,
     /// This field is used to check whether expressions are constants, such as in enum discriminants
     /// and consts
     const_span: Option<Span>,
 }
 
-impl_lint_pass!(Arithmetic => [INTEGER_ARITHMETIC, FLOAT_ARITHMETIC]);
+impl_lint_pass!(NumericArithmetic => [INTEGER_ARITHMETIC, FLOAT_ARITHMETIC]);
 
-impl<'tcx> LateLintPass<'tcx> for Arithmetic {
+impl<'tcx> LateLintPass<'tcx> for NumericArithmetic {
     fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) {
         if self.expr_span.is_some() {
             return;
diff --git a/src/tools/clippy/clippy_lints/src/panic_in_result_fn.rs b/src/tools/clippy/clippy_lints/src/panic_in_result_fn.rs
index b7a56970b33..21acf003d92 100644
--- a/src/tools/clippy/clippy_lints/src/panic_in_result_fn.rs
+++ b/src/tools/clippy/clippy_lints/src/panic_in_result_fn.rs
@@ -61,7 +61,7 @@ fn lint_impl_body<'tcx>(cx: &LateContext<'tcx>, impl_span: Span, body: &'tcx hir
     expr_visitor_no_bodies(|expr| {
         let Some(macro_call) = root_macro_call_first_node(cx, expr) else { return true };
         if matches!(
-            &*cx.tcx.item_name(macro_call.def_id).as_str(),
+            cx.tcx.item_name(macro_call.def_id).as_str(),
             "unimplemented" | "unreachable" | "panic" | "todo" | "assert" | "assert_eq" | "assert_ne"
         ) {
             panics.push(macro_call.span);
diff --git a/src/tools/clippy/clippy_lints/src/pass_by_ref_or_value.rs b/src/tools/clippy/clippy_lints/src/pass_by_ref_or_value.rs
index e3ded716341..5a93431f25a 100644
--- a/src/tools/clippy/clippy_lints/src/pass_by_ref_or_value.rs
+++ b/src/tools/clippy/clippy_lints/src/pass_by_ref_or_value.rs
@@ -233,7 +233,7 @@ impl<'tcx> LateLintPass<'tcx> for PassByRefOrValue {
         }
 
         if let hir::TraitItemKind::Fn(method_sig, _) = &item.kind {
-            self.check_poly_fn(cx, item.def_id, &*method_sig.decl, None);
+            self.check_poly_fn(cx, item.def_id, method_sig.decl, None);
         }
     }
 
diff --git a/src/tools/clippy/clippy_lints/src/ptr.rs b/src/tools/clippy/clippy_lints/src/ptr.rs
index 548f7b2528b..0b96f6ff683 100644
--- a/src/tools/clippy/clippy_lints/src/ptr.rs
+++ b/src/tools/clippy/clippy_lints/src/ptr.rs
@@ -343,7 +343,7 @@ impl fmt::Display for RefPrefix {
         use fmt::Write;
         f.write_char('&')?;
         match self.lt {
-            LifetimeName::Param(ParamName::Plain(name)) => {
+            LifetimeName::Param(_, ParamName::Plain(name)) => {
                 name.fmt(f)?;
                 f.write_char(' ')?;
             },
diff --git a/src/tools/clippy/clippy_lints/src/ranges.rs b/src/tools/clippy/clippy_lints/src/ranges.rs
index 26dc88a406e..eea036178b8 100644
--- a/src/tools/clippy/clippy_lints/src/ranges.rs
+++ b/src/tools/clippy/clippy_lints/src/ranges.rs
@@ -194,7 +194,7 @@ impl<'tcx> LateLintPass<'tcx> for Ranges {
             },
             ExprKind::Binary(ref op, l, r) => {
                 if meets_msrv(self.msrv, msrvs::RANGE_CONTAINS) {
-                    check_possible_range_contains(cx, op.node, l, r, expr);
+                    check_possible_range_contains(cx, op.node, l, r, expr, expr.span);
                 }
             },
             _ => {},
@@ -213,12 +213,12 @@ fn check_possible_range_contains(
     left: &Expr<'_>,
     right: &Expr<'_>,
     expr: &Expr<'_>,
+    span: Span,
 ) {
     if in_constant(cx, expr.hir_id) {
         return;
     }
 
-    let span = expr.span;
     let combine_and = match op {
         BinOpKind::And | BinOpKind::BitAnd => true,
         BinOpKind::Or | BinOpKind::BitOr => false,
@@ -294,6 +294,20 @@ fn check_possible_range_contains(
             );
         }
     }
+
+    // If the LHS is the same operator, we have to recurse to get the "real" RHS, since they have
+    // the same operator precedence
+    if_chain! {
+        if let ExprKind::Binary(ref lhs_op, _left, new_lhs) = left.kind;
+        if op == lhs_op.node;
+        let new_span = Span::new(new_lhs.span.lo(), right.span.hi(), expr.span.ctxt(), expr.span.parent());
+        if let Some(snip) = &snippet_opt(cx, new_span);
+        // Do not continue if we have mismatched number of parens, otherwise the suggestion is wrong
+        if snip.matches('(').count() == snip.matches(')').count();
+        then {
+            check_possible_range_contains(cx, op, new_lhs, right, expr, new_span);
+        }
+    }
 }
 
 struct RangeBounds<'a> {
diff --git a/src/tools/clippy/clippy_lints/src/rc_clone_in_vec_init.rs b/src/tools/clippy/clippy_lints/src/rc_clone_in_vec_init.rs
index 110f58f3734..8db8c4e9b78 100644
--- a/src/tools/clippy/clippy_lints/src/rc_clone_in_vec_init.rs
+++ b/src/tools/clippy/clippy_lints/src/rc_clone_in_vec_init.rs
@@ -2,7 +2,9 @@ use clippy_utils::diagnostics::span_lint_and_then;
 use clippy_utils::higher::VecArgs;
 use clippy_utils::last_path_segment;
 use clippy_utils::macros::root_macro_call_first_node;
+use clippy_utils::paths;
 use clippy_utils::source::{indent_of, snippet};
+use clippy_utils::ty::match_type;
 use rustc_errors::Applicability;
 use rustc_hir::{Expr, ExprKind, QPath, TyKind};
 use rustc_lint::{LateContext, LateLintPass};
@@ -11,10 +13,11 @@ use rustc_span::{sym, Span, Symbol};
 
 declare_clippy_lint! {
     /// ### What it does
-    /// Checks for `Arc::new` or `Rc::new` in `vec![elem; len]`
+    /// Checks for reference-counted pointers (`Arc`, `Rc`, `rc::Weak`, and `sync::Weak`)
+    /// in `vec![elem; len]`
     ///
     /// ### Why is this bad?
-    /// This will create `elem` once and clone it `len` times - doing so with `Arc` or `Rc`
+    /// This will create `elem` once and clone it `len` times - doing so with `Arc`/`Rc`/`Weak`
     /// is a bit misleading, as it will create references to the same pointer, rather
     /// than different instances.
     ///
@@ -26,7 +29,6 @@ declare_clippy_lint! {
     /// ```
     /// Use instead:
     /// ```rust
-    ///
     /// // Initialize each value separately:
     /// let mut data = Vec::with_capacity(100);
     /// for _ in 0..100 {
@@ -42,7 +44,7 @@ declare_clippy_lint! {
     #[clippy::version = "1.62.0"]
     pub RC_CLONE_IN_VEC_INIT,
     suspicious,
-    "initializing `Arc` or `Rc` in `vec![elem; len]`"
+    "initializing reference-counted pointer in `vec![elem; len]`"
 }
 declare_lint_pass!(RcCloneInVecInit => [RC_CLONE_IN_VEC_INIT]);
 
@@ -50,26 +52,12 @@ impl LateLintPass<'_> for RcCloneInVecInit {
     fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
         let Some(macro_call) = root_macro_call_first_node(cx, expr) else { return; };
         let Some(VecArgs::Repeat(elem, len)) = VecArgs::hir(cx, expr) else { return; };
-        let Some(symbol) = new_reference_call(cx, elem) else { return; };
+        let Some((symbol, func_span)) = ref_init(cx, elem) else { return; };
 
-        emit_lint(cx, symbol, macro_call.span, elem, len);
+        emit_lint(cx, symbol, macro_call.span, elem, len, func_span);
     }
 }
 
-fn elem_snippet(cx: &LateContext<'_>, elem: &Expr<'_>, symbol_name: &str) -> String {
-    let elem_snippet = snippet(cx, elem.span, "..").to_string();
-    if elem_snippet.contains('\n') {
-        // This string must be found in `elem_snippet`, otherwise we won't be constructing
-        // the snippet in the first place.
-        let reference_creation = format!("{symbol_name}::new");
-        let (code_until_reference_creation, _right) = elem_snippet.split_once(&reference_creation).unwrap();
-
-        return format!("{code_until_reference_creation}{reference_creation}(..)");
-    }
-
-    elem_snippet
-}
-
 fn loop_init_suggestion(elem: &str, len: &str, indent: &str) -> String {
     format!(
         r#"{{
@@ -89,17 +77,17 @@ fn extract_suggestion(elem: &str, len: &str, indent: &str) -> String {
     )
 }
 
-fn emit_lint(cx: &LateContext<'_>, symbol: Symbol, lint_span: Span, elem: &Expr<'_>, len: &Expr<'_>) {
+fn emit_lint(cx: &LateContext<'_>, symbol: Symbol, lint_span: Span, elem: &Expr<'_>, len: &Expr<'_>, func_span: Span) {
     let symbol_name = symbol.as_str();
 
     span_lint_and_then(
         cx,
         RC_CLONE_IN_VEC_INIT,
         lint_span,
-        &format!("calling `{symbol_name}::new` in `vec![elem; len]`"),
+        "initializing a reference-counted pointer in `vec![elem; len]`",
         |diag| {
             let len_snippet = snippet(cx, len.span, "..");
-            let elem_snippet = elem_snippet(cx, elem, symbol_name);
+            let elem_snippet = format!("{}(..)", snippet(cx, elem.span.with_hi(func_span.hi()), ".."));
             let indentation = " ".repeat(indent_of(cx, lint_span).unwrap_or(0));
             let loop_init_suggestion = loop_init_suggestion(&elem_snippet, len_snippet.as_ref(), &indentation);
             let extract_suggestion = extract_suggestion(&elem_snippet, len_snippet.as_ref(), &indentation);
@@ -109,7 +97,7 @@ fn emit_lint(cx: &LateContext<'_>, symbol: Symbol, lint_span: Span, elem: &Expr<
                 lint_span,
                 format!("consider initializing each `{symbol_name}` element individually"),
                 loop_init_suggestion,
-                Applicability::Unspecified,
+                Applicability::HasPlaceholders,
             );
             diag.span_suggestion(
                 lint_span,
@@ -117,23 +105,33 @@ fn emit_lint(cx: &LateContext<'_>, symbol: Symbol, lint_span: Span, elem: &Expr<
                     "or if this is intentional, consider extracting the `{symbol_name}` initialization to a variable"
                 ),
                 extract_suggestion,
-                Applicability::Unspecified,
+                Applicability::HasPlaceholders,
             );
         },
     );
 }
 
-/// Checks whether the given `expr` is a call to `Arc::new` or `Rc::new`
-fn new_reference_call(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option<Symbol> {
+/// Checks whether the given `expr` is a call to `Arc::new`, `Rc::new`, or evaluates to a `Weak`
+fn ref_init(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option<(Symbol, Span)> {
     if_chain! {
         if let ExprKind::Call(func, _args) = expr.kind;
         if let ExprKind::Path(ref func_path @ QPath::TypeRelative(ty, _)) = func.kind;
         if let TyKind::Path(ref ty_path) = ty.kind;
         if let Some(def_id) = cx.qpath_res(ty_path, ty.hir_id).opt_def_id();
-        if last_path_segment(func_path).ident.name == sym::new;
 
         then {
-            return cx.tcx.get_diagnostic_name(def_id).filter(|symbol| symbol == &sym::Arc || symbol == &sym::Rc);
+            if last_path_segment(func_path).ident.name == sym::new
+                && let Some(symbol) = cx
+                    .tcx
+                    .get_diagnostic_name(def_id)
+                    .filter(|symbol| symbol == &sym::Arc || symbol == &sym::Rc) {
+                return Some((symbol, func.span));
+            }
+
+            let ty_path = cx.typeck_results().expr_ty(expr);
+            if match_type(cx, ty_path, &paths::WEAK_RC) || match_type(cx, ty_path, &paths::WEAK_ARC) {
+                return Some((Symbol::intern("Weak"), func.span));
+            }
         }
     }
 
diff --git a/src/tools/clippy/clippy_lints/src/redundant_clone.rs b/src/tools/clippy/clippy_lints/src/redundant_clone.rs
index ab16fe47d4d..249f11f9850 100644
--- a/src/tools/clippy/clippy_lints/src/redundant_clone.rs
+++ b/src/tools/clippy/clippy_lints/src/redundant_clone.rs
@@ -288,8 +288,8 @@ fn is_call_with_ref_arg<'tcx>(
         if let mir::TerminatorKind::Call { func, args, destination, .. } = kind;
         if args.len() == 1;
         if let mir::Operand::Move(mir::Place { local, .. }) = &args[0];
-        if let ty::FnDef(def_id, _) = *func.ty(&*mir, cx.tcx).kind();
-        if let (inner_ty, 1) = walk_ptrs_ty_depth(args[0].ty(&*mir, cx.tcx));
+        if let ty::FnDef(def_id, _) = *func.ty(mir, cx.tcx).kind();
+        if let (inner_ty, 1) = walk_ptrs_ty_depth(args[0].ty(mir, cx.tcx));
         if !is_copy(cx, inner_ty);
         then {
             Some((def_id, *local, inner_ty, destination.as_local()?))
@@ -318,7 +318,7 @@ fn find_stmt_assigns_to<'tcx>(
         None
     })?;
 
-    match (by_ref, &*rvalue) {
+    match (by_ref, rvalue) {
         (true, mir::Rvalue::Ref(_, _, place)) | (false, mir::Rvalue::Use(mir::Operand::Copy(place))) => {
             Some(base_local_and_movability(cx, mir, *place))
         },
diff --git a/src/tools/clippy/clippy_lints/src/redundant_static_lifetimes.rs b/src/tools/clippy/clippy_lints/src/redundant_static_lifetimes.rs
index 2d26c49252f..0825f00f421 100644
--- a/src/tools/clippy/clippy_lints/src/redundant_static_lifetimes.rs
+++ b/src/tools/clippy/clippy_lints/src/redundant_static_lifetimes.rs
@@ -51,12 +51,12 @@ impl RedundantStaticLifetimes {
     fn visit_type(&mut self, ty: &Ty, cx: &EarlyContext<'_>, reason: &str) {
         match ty.kind {
             // Be careful of nested structures (arrays and tuples)
-            TyKind::Array(ref ty, _) => {
-                self.visit_type(&*ty, cx, reason);
+            TyKind::Array(ref ty, _) | TyKind::Slice(ref ty) => {
+                self.visit_type(ty, cx, reason);
             },
             TyKind::Tup(ref tup) => {
                 for tup_ty in tup {
-                    self.visit_type(&*tup_ty, cx, reason);
+                    self.visit_type(tup_ty, cx, reason);
                 }
             },
             // This is what we are looking for !
@@ -89,9 +89,6 @@ impl RedundantStaticLifetimes {
                 }
                 self.visit_type(&*borrow_type.ty, cx, reason);
             },
-            TyKind::Slice(ref ty) => {
-                self.visit_type(ty, cx, reason);
-            },
             _ => {},
         }
     }
diff --git a/src/tools/clippy/clippy_lints/src/returns.rs b/src/tools/clippy/clippy_lints/src/returns.rs
index 8068fa22d9c..e525eba53e2 100644
--- a/src/tools/clippy/clippy_lints/src/returns.rs
+++ b/src/tools/clippy/clippy_lints/src/returns.rs
@@ -1,5 +1,5 @@
 use clippy_utils::diagnostics::{span_lint_and_sugg, span_lint_and_then};
-use clippy_utils::source::snippet_opt;
+use clippy_utils::source::{snippet_opt, snippet_with_context};
 use clippy_utils::{fn_def_id, path_to_local_id};
 use if_chain::if_chain;
 use rustc_ast::ast::Attribute;
@@ -226,14 +226,10 @@ fn emit_return_lint(cx: &LateContext<'_>, ret_span: Span, inner_span: Option<Spa
     }
     match inner_span {
         Some(inner_span) => {
-            if in_external_macro(cx.tcx.sess, inner_span) || inner_span.from_expansion() {
-                return;
-            }
-
+            let mut applicability = Applicability::MachineApplicable;
             span_lint_and_then(cx, NEEDLESS_RETURN, ret_span, "unneeded `return` statement", |diag| {
-                if let Some(snippet) = snippet_opt(cx, inner_span) {
-                    diag.span_suggestion(ret_span, "remove `return`", snippet, Applicability::MachineApplicable);
-                }
+                let (snippet, _) = snippet_with_context(cx, inner_span, ret_span.ctxt(), "..", &mut applicability);
+                diag.span_suggestion(ret_span, "remove `return`", snippet, applicability);
             });
         },
         None => match replacement {
@@ -287,7 +283,7 @@ struct BorrowVisitor<'a, 'tcx> {
 
 impl<'tcx> Visitor<'tcx> for BorrowVisitor<'_, 'tcx> {
     fn visit_expr(&mut self, expr: &'tcx Expr<'_>) {
-        if self.borrows {
+        if self.borrows || expr.span.from_expansion() {
             return;
         }
 
diff --git a/src/tools/clippy/clippy_lints/src/shadow.rs b/src/tools/clippy/clippy_lints/src/shadow.rs
index 2a80e6f918d..4f74c1e44c2 100644
--- a/src/tools/clippy/clippy_lints/src/shadow.rs
+++ b/src/tools/clippy/clippy_lints/src/shadow.rs
@@ -5,9 +5,7 @@ use rustc_data_structures::fx::FxHashMap;
 use rustc_hir::def::Res;
 use rustc_hir::def_id::LocalDefId;
 use rustc_hir::hir_id::ItemLocalId;
-use rustc_hir::{
-    Block, Body, BodyOwnerKind, Expr, ExprKind, HirId, Let, Node, Pat, PatKind, QPath, UnOp,
-};
+use rustc_hir::{Block, Body, BodyOwnerKind, Expr, ExprKind, HirId, Let, Node, Pat, PatKind, QPath, UnOp};
 use rustc_lint::{LateContext, LateLintPass};
 use rustc_session::{declare_tool_lint, impl_lint_pass};
 use rustc_span::{Span, Symbol};
@@ -141,31 +139,34 @@ impl<'tcx> LateLintPass<'tcx> for Shadow {
 
     fn check_body(&mut self, cx: &LateContext<'_>, body: &Body<'_>) {
         let hir = cx.tcx.hir();
-        if !matches!(hir.body_owner_kind(hir.body_owner_def_id(body.id())), BodyOwnerKind::Closure)
-        {
+        if !matches!(
+            hir.body_owner_kind(hir.body_owner_def_id(body.id())),
+            BodyOwnerKind::Closure
+        ) {
             self.bindings.push(FxHashMap::default());
         }
     }
 
     fn check_body_post(&mut self, cx: &LateContext<'_>, body: &Body<'_>) {
         let hir = cx.tcx.hir();
-        if !matches!(hir.body_owner_kind(hir.body_owner_def_id(body.id())), BodyOwnerKind::Closure)
-        {
+        if !matches!(
+            hir.body_owner_kind(hir.body_owner_def_id(body.id())),
+            BodyOwnerKind::Closure
+        ) {
             self.bindings.pop();
         }
     }
 }
 
-fn is_shadow(
-    cx: &LateContext<'_>,
-    owner: LocalDefId,
-    first: ItemLocalId,
-    second: ItemLocalId,
-) -> bool {
-    let scope_tree = cx.tcx.region_scope_tree(owner);
-    let first_scope = scope_tree.var_scope(first).unwrap();
-    let second_scope = scope_tree.var_scope(second).unwrap();
-    scope_tree.is_subscope_of(second_scope, first_scope)
+fn is_shadow(cx: &LateContext<'_>, owner: LocalDefId, first: ItemLocalId, second: ItemLocalId) -> bool {
+    let scope_tree = cx.tcx.region_scope_tree(owner.to_def_id());
+    if let Some(first_scope) = scope_tree.var_scope(first) {
+        if let Some(second_scope) = scope_tree.var_scope(second) {
+            return scope_tree.is_subscope_of(second_scope, first_scope);
+        }
+    }
+
+    false
 }
 
 fn lint_shadow(cx: &LateContext<'_>, pat: &Pat<'_>, shadowed: HirId, span: Span) {
@@ -177,16 +178,15 @@ fn lint_shadow(cx: &LateContext<'_>, pat: &Pat<'_>, shadowed: HirId, span: Span)
                 snippet(cx, expr.span, "..")
             );
             (SHADOW_SAME, msg)
-        }
+        },
         Some(expr) if is_local_used(cx, expr, shadowed) => {
             let msg = format!("`{}` is shadowed", snippet(cx, pat.span, "_"));
             (SHADOW_REUSE, msg)
-        }
+        },
         _ => {
-            let msg =
-                format!("`{}` shadows a previous, unrelated binding", snippet(cx, pat.span, "_"));
+            let msg = format!("`{}` shadows a previous, unrelated binding", snippet(cx, pat.span, "_"));
             (SHADOW_UNRELATED, msg)
-        }
+        },
     };
     span_lint_and_note(
         cx,
@@ -215,7 +215,14 @@ fn is_self_shadow(cx: &LateContext<'_>, pat: &Pat<'_>, mut expr: &Expr<'_>, hir_
         expr = match expr.kind {
             ExprKind::Box(e)
             | ExprKind::AddrOf(_, _, e)
-            | ExprKind::Block(&Block { stmts: [], expr: Some(e), .. }, _)
+            | ExprKind::Block(
+                &Block {
+                    stmts: [],
+                    expr: Some(e),
+                    ..
+                },
+                _,
+            )
             | ExprKind::Unary(UnOp::Deref, e) => e,
             ExprKind::Path(QPath::Resolved(None, path)) => break path.res == Res::Local(hir_id),
             _ => break false,
diff --git a/src/tools/clippy/clippy_lints/src/size_of_in_element_count.rs b/src/tools/clippy/clippy_lints/src/size_of_in_element_count.rs
index 3d7dc49b406..bfb9f0d01e1 100644
--- a/src/tools/clippy/clippy_lints/src/size_of_in_element_count.rs
+++ b/src/tools/clippy/clippy_lints/src/size_of_in_element_count.rs
@@ -110,7 +110,7 @@ fn get_pointee_ty_and_count_expr<'tcx>(
         // Find calls to copy_{from,to}{,_nonoverlapping} and write_bytes methods
         if let ExprKind::MethodCall(method_path, [ptr_self, .., count], _) = expr.kind;
         let method_ident = method_path.ident.as_str();
-        if METHODS.iter().any(|m| *m == &*method_ident);
+        if METHODS.iter().any(|m| *m == method_ident);
 
         // Get the pointee type
         if let ty::RawPtr(TypeAndMut { ty: pointee_ty, .. }) =
diff --git a/src/tools/clippy/clippy_lints/src/swap_ptr_to_ref.rs b/src/tools/clippy/clippy_lints/src/swap_ptr_to_ref.rs
new file mode 100644
index 00000000000..75d3b040c96
--- /dev/null
+++ b/src/tools/clippy/clippy_lints/src/swap_ptr_to_ref.rs
@@ -0,0 +1,80 @@
+use clippy_utils::diagnostics::span_lint_and_then;
+use clippy_utils::source::snippet_with_context;
+use clippy_utils::{match_def_path, path_def_id, paths};
+use rustc_errors::Applicability;
+use rustc_hir::{BorrowKind, Expr, ExprKind, Mutability, UnOp};
+use rustc_lint::{LateContext, LateLintPass};
+use rustc_session::{declare_lint_pass, declare_tool_lint};
+use rustc_span::{Span, SyntaxContext};
+
+declare_clippy_lint! {
+    /// ### What it does
+    /// Checks for calls to `core::mem::swap` where either parameter is derived from a pointer
+    ///
+    /// ### Why is this bad?
+    /// When at least one parameter to `swap` is derived from a pointer it may overlap with the
+    /// other. This would then lead to undefined behavior.
+    ///
+    /// ### Example
+    /// ```rust
+    /// unsafe fn swap(x: &[*mut u32], y: &[*mut u32]) {
+    ///     for (&x, &y) in x.iter().zip(y) {
+    ///         core::mem::swap(&mut *x, &mut *y);
+    ///     }
+    /// }
+    /// ```
+    /// Use instead:
+    /// ```rust
+    /// unsafe fn swap(x: &[*mut u32], y: &[*mut u32]) {
+    ///     for (&x, &y) in x.iter().zip(y) {
+    ///         core::ptr::swap(x, y);
+    ///     }
+    /// }
+    /// ```
+    #[clippy::version = "1.63.0"]
+    pub SWAP_PTR_TO_REF,
+    suspicious,
+    "call to `mem::swap` using pointer derived references"
+}
+declare_lint_pass!(SwapPtrToRef => [SWAP_PTR_TO_REF]);
+
+impl LateLintPass<'_> for SwapPtrToRef {
+    fn check_expr(&mut self, cx: &LateContext<'_>, e: &Expr<'_>) {
+        if let ExprKind::Call(fn_expr, [arg1, arg2]) = e.kind
+            && let Some(fn_id) = path_def_id(cx, fn_expr)
+            && match_def_path(cx, fn_id, &paths::MEM_SWAP)
+            && let ctxt = e.span.ctxt()
+            && let (from_ptr1, arg1_span) = is_ptr_to_ref(cx, arg1, ctxt)
+            && let (from_ptr2, arg2_span) = is_ptr_to_ref(cx, arg2, ctxt)
+            && (from_ptr1 || from_ptr2)
+        {
+            span_lint_and_then(
+                cx,
+                SWAP_PTR_TO_REF,
+                e.span,
+                "call to `core::mem::swap` with a parameter derived from a raw pointer",
+                |diag| {
+                    if !((from_ptr1 && arg1_span.is_none()) || (from_ptr2 && arg2_span.is_none())) {
+                        let mut app = Applicability::MachineApplicable;
+                        let snip1 = snippet_with_context(cx, arg1_span.unwrap_or(arg1.span), ctxt, "..", &mut app).0;
+                        let snip2 = snippet_with_context(cx, arg2_span.unwrap_or(arg2.span), ctxt, "..", &mut app).0;
+                        diag.span_suggestion(e.span, "use ptr::swap", format!("core::ptr::swap({}, {})", snip1, snip2), app);
+                    }
+                }
+            );
+        }
+    }
+}
+
+/// Checks if the expression converts a mutable pointer to a mutable reference. If it is, also
+/// returns the span of the pointer expression if it's suitable for making a suggestion.
+fn is_ptr_to_ref(cx: &LateContext<'_>, e: &Expr<'_>, ctxt: SyntaxContext) -> (bool, Option<Span>) {
+    if let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Mut, borrowed_expr) = e.kind
+        && let ExprKind::Unary(UnOp::Deref, derefed_expr) = borrowed_expr.kind
+        && cx.typeck_results().expr_ty(derefed_expr).is_unsafe_ptr()
+    {
+        (true, (borrowed_expr.span.ctxt() == ctxt || derefed_expr.span.ctxt() == ctxt).then(|| derefed_expr.span))
+    } else {
+        (false, None)
+    }
+}
diff --git a/src/tools/clippy/clippy_lints/src/trait_bounds.rs b/src/tools/clippy/clippy_lints/src/trait_bounds.rs
index 911da3997ae..1e5b646f5f0 100644
--- a/src/tools/clippy/clippy_lints/src/trait_bounds.rs
+++ b/src/tools/clippy/clippy_lints/src/trait_bounds.rs
@@ -54,14 +54,14 @@ declare_clippy_lint! {
     /// fn func<T: Clone + Default>(arg: T) where T: Clone + Default {}
     /// ```
     ///
-    /// Could be written as:
-    ///
+    /// Use instead:
     /// ```rust
+    /// # mod hidden {
     /// fn func<T: Clone + Default>(arg: T) {}
-    /// ```
-    /// or
+    /// # }
+    ///
+    /// // or
     ///
-    /// ```rust
     /// fn func<T>(arg: T) where T: Clone + Default {}
     /// ```
     #[clippy::version = "1.47.0"]
diff --git a/src/tools/clippy/clippy_lints/src/transmute/mod.rs b/src/tools/clippy/clippy_lints/src/transmute/mod.rs
index d2a040beb0c..cbe1406728b 100644
--- a/src/tools/clippy/clippy_lints/src/transmute/mod.rs
+++ b/src/tools/clippy/clippy_lints/src/transmute/mod.rs
@@ -59,7 +59,7 @@ declare_clippy_lint! {
     /// ```
     #[clippy::version = "pre 1.29.0"]
     pub USELESS_TRANSMUTE,
-    nursery,
+    complexity,
     "transmutes that have the same to and from types or could be a cast/coercion"
 }
 
diff --git a/src/tools/clippy/clippy_lints/src/transmute/useless_transmute.rs b/src/tools/clippy/clippy_lints/src/transmute/useless_transmute.rs
index 3cc3d40a143..a0d104e2390 100644
--- a/src/tools/clippy/clippy_lints/src/transmute/useless_transmute.rs
+++ b/src/tools/clippy/clippy_lints/src/transmute/useless_transmute.rs
@@ -4,7 +4,7 @@ use clippy_utils::sugg;
 use rustc_errors::Applicability;
 use rustc_hir::Expr;
 use rustc_lint::LateContext;
-use rustc_middle::ty::{self, Ty};
+use rustc_middle::ty::{self, Ty, TypeFoldable};
 
 /// Checks for `useless_transmute` lint.
 /// Returns `true` if it's triggered, otherwise returns `false`.
@@ -16,7 +16,7 @@ pub(super) fn check<'tcx>(
     arg: &'tcx Expr<'_>,
 ) -> bool {
     match (&from_ty.kind(), &to_ty.kind()) {
-        _ if from_ty == to_ty => {
+        _ if from_ty == to_ty && !from_ty.has_erased_regions() => {
             span_lint(
                 cx,
                 USELESS_TRANSMUTE,
@@ -26,28 +26,31 @@ pub(super) fn check<'tcx>(
             true
         },
         (ty::Ref(_, rty, rty_mutbl), ty::RawPtr(ptr_ty)) => {
-            span_lint_and_then(
-                cx,
-                USELESS_TRANSMUTE,
-                e.span,
-                "transmute from a reference to a pointer",
-                |diag| {
-                    if let Some(arg) = sugg::Sugg::hir_opt(cx, arg) {
-                        let rty_and_mut = ty::TypeAndMut {
-                            ty: *rty,
-                            mutbl: *rty_mutbl,
-                        };
+            // No way to give the correct suggestion here. Avoid linting for now.
+            if !rty.has_erased_regions() {
+                span_lint_and_then(
+                    cx,
+                    USELESS_TRANSMUTE,
+                    e.span,
+                    "transmute from a reference to a pointer",
+                    |diag| {
+                        if let Some(arg) = sugg::Sugg::hir_opt(cx, arg) {
+                            let rty_and_mut = ty::TypeAndMut {
+                                ty: *rty,
+                                mutbl: *rty_mutbl,
+                            };
 
-                        let sugg = if *ptr_ty == rty_and_mut {
-                            arg.as_ty(to_ty)
-                        } else {
-                            arg.as_ty(cx.tcx.mk_ptr(rty_and_mut)).as_ty(to_ty)
-                        };
+                            let sugg = if *ptr_ty == rty_and_mut {
+                                arg.as_ty(to_ty)
+                            } else {
+                                arg.as_ty(cx.tcx.mk_ptr(rty_and_mut)).as_ty(to_ty)
+                            };
 
-                        diag.span_suggestion(e.span, "try", sugg.to_string(), Applicability::Unspecified);
-                    }
-                },
-            );
+                            diag.span_suggestion(e.span, "try", sugg.to_string(), Applicability::Unspecified);
+                        }
+                    },
+                );
+            }
             true
         },
         (ty::Int(_) | ty::Uint(_), ty::RawPtr(_)) => {
diff --git a/src/tools/clippy/clippy_lints/src/try_err.rs b/src/tools/clippy/clippy_lints/src/try_err.rs
deleted file mode 100644
index e108f7be12e..00000000000
--- a/src/tools/clippy/clippy_lints/src/try_err.rs
+++ /dev/null
@@ -1,186 +0,0 @@
-use clippy_utils::diagnostics::span_lint_and_sugg;
-use clippy_utils::source::snippet_with_applicability;
-use clippy_utils::ty::is_type_diagnostic_item;
-use clippy_utils::{get_parent_expr, is_lang_ctor, match_def_path, paths};
-use if_chain::if_chain;
-use rustc_errors::Applicability;
-use rustc_hir::LangItem::ResultErr;
-use rustc_hir::{Expr, ExprKind, LangItem, MatchSource, QPath};
-use rustc_lint::{LateContext, LateLintPass};
-use rustc_middle::lint::in_external_macro;
-use rustc_middle::ty::{self, Ty};
-use rustc_session::{declare_lint_pass, declare_tool_lint};
-use rustc_span::{hygiene, sym};
-
-declare_clippy_lint! {
-    /// ### What it does
-    /// Checks for usages of `Err(x)?`.
-    ///
-    /// ### Why is this bad?
-    /// The `?` operator is designed to allow calls that
-    /// can fail to be easily chained. For example, `foo()?.bar()` or
-    /// `foo(bar()?)`. Because `Err(x)?` can't be used that way (it will
-    /// always return), it is more clear to write `return Err(x)`.
-    ///
-    /// ### Example
-    /// ```rust
-    /// fn foo(fail: bool) -> Result<i32, String> {
-    ///     if fail {
-    ///       Err("failed")?;
-    ///     }
-    ///     Ok(0)
-    /// }
-    /// ```
-    /// Could be written:
-    ///
-    /// ```rust
-    /// fn foo(fail: bool) -> Result<i32, String> {
-    ///     if fail {
-    ///       return Err("failed".into());
-    ///     }
-    ///     Ok(0)
-    /// }
-    /// ```
-    #[clippy::version = "1.38.0"]
-    pub TRY_ERR,
-    restriction,
-    "return errors explicitly rather than hiding them behind a `?`"
-}
-
-declare_lint_pass!(TryErr => [TRY_ERR]);
-
-impl<'tcx> LateLintPass<'tcx> for TryErr {
-    fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
-        // Looks for a structure like this:
-        // match ::std::ops::Try::into_result(Err(5)) {
-        //     ::std::result::Result::Err(err) =>
-        //         #[allow(unreachable_code)]
-        //         return ::std::ops::Try::from_error(::std::convert::From::from(err)),
-        //     ::std::result::Result::Ok(val) =>
-        //         #[allow(unreachable_code)]
-        //         val,
-        // };
-        if_chain! {
-            if !in_external_macro(cx.tcx.sess, expr.span);
-            if let ExprKind::Match(match_arg, _, MatchSource::TryDesugar) = expr.kind;
-            if let ExprKind::Call(match_fun, try_args) = match_arg.kind;
-            if let ExprKind::Path(ref match_fun_path) = match_fun.kind;
-            if matches!(match_fun_path, QPath::LangItem(LangItem::TryTraitBranch, ..));
-            if let Some(try_arg) = try_args.get(0);
-            if let ExprKind::Call(err_fun, err_args) = try_arg.kind;
-            if let Some(err_arg) = err_args.get(0);
-            if let ExprKind::Path(ref err_fun_path) = err_fun.kind;
-            if is_lang_ctor(cx, err_fun_path, ResultErr);
-            if let Some(return_ty) = find_return_type(cx, &expr.kind);
-            then {
-                let prefix;
-                let suffix;
-                let err_ty;
-
-                if let Some(ty) = result_error_type(cx, return_ty) {
-                    prefix = "Err(";
-                    suffix = ")";
-                    err_ty = ty;
-                } else if let Some(ty) = poll_result_error_type(cx, return_ty) {
-                    prefix = "Poll::Ready(Err(";
-                    suffix = "))";
-                    err_ty = ty;
-                } else if let Some(ty) = poll_option_result_error_type(cx, return_ty) {
-                    prefix = "Poll::Ready(Some(Err(";
-                    suffix = ")))";
-                    err_ty = ty;
-                } else {
-                    return;
-                };
-
-                let expr_err_ty = cx.typeck_results().expr_ty(err_arg);
-                let span = hygiene::walk_chain(err_arg.span, try_arg.span.ctxt());
-                let mut applicability = Applicability::MachineApplicable;
-                let origin_snippet = snippet_with_applicability(cx, span, "_", &mut applicability);
-                let ret_prefix = if get_parent_expr(cx, expr).map_or(false, |e| matches!(e.kind, ExprKind::Ret(_))) {
-                    "" // already returns
-                } else {
-                    "return "
-                };
-                let suggestion = if err_ty == expr_err_ty {
-                    format!("{}{}{}{}", ret_prefix, prefix, origin_snippet, suffix)
-                } else {
-                    format!("{}{}{}.into(){}", ret_prefix, prefix, origin_snippet, suffix)
-                };
-
-                span_lint_and_sugg(
-                    cx,
-                    TRY_ERR,
-                    expr.span,
-                    "returning an `Err(_)` with the `?` operator",
-                    "try this",
-                    suggestion,
-                    applicability,
-                );
-            }
-        }
-    }
-}
-
-/// Finds function return type by examining return expressions in match arms.
-fn find_return_type<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx ExprKind<'_>) -> Option<Ty<'tcx>> {
-    if let ExprKind::Match(_, arms, MatchSource::TryDesugar) = expr {
-        for arm in arms.iter() {
-            if let ExprKind::Ret(Some(ret)) = arm.body.kind {
-                return Some(cx.typeck_results().expr_ty(ret));
-            }
-        }
-    }
-    None
-}
-
-/// Extracts the error type from Result<T, E>.
-fn result_error_type<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option<Ty<'tcx>> {
-    if_chain! {
-        if let ty::Adt(_, subst) = ty.kind();
-        if is_type_diagnostic_item(cx, ty, sym::Result);
-        then {
-            Some(subst.type_at(1))
-        } else {
-            None
-        }
-    }
-}
-
-/// Extracts the error type from Poll<Result<T, E>>.
-fn poll_result_error_type<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option<Ty<'tcx>> {
-    if_chain! {
-        if let ty::Adt(def, subst) = ty.kind();
-        if match_def_path(cx, def.did(), &paths::POLL);
-        let ready_ty = subst.type_at(0);
-
-        if let ty::Adt(ready_def, ready_subst) = ready_ty.kind();
-        if cx.tcx.is_diagnostic_item(sym::Result, ready_def.did());
-        then {
-            Some(ready_subst.type_at(1))
-        } else {
-            None
-        }
-    }
-}
-
-/// Extracts the error type from Poll<Option<Result<T, E>>>.
-fn poll_option_result_error_type<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option<Ty<'tcx>> {
-    if_chain! {
-        if let ty::Adt(def, subst) = ty.kind();
-        if match_def_path(cx, def.did(), &paths::POLL);
-        let ready_ty = subst.type_at(0);
-
-        if let ty::Adt(ready_def, ready_subst) = ready_ty.kind();
-        if cx.tcx.is_diagnostic_item(sym::Option, ready_def.did());
-        let some_ty = ready_subst.type_at(0);
-
-        if let ty::Adt(some_def, some_subst) = some_ty.kind();
-        if cx.tcx.is_diagnostic_item(sym::Result, some_def.did());
-        then {
-            Some(some_subst.type_at(1))
-        } else {
-            None
-        }
-    }
-}
diff --git a/src/tools/clippy/clippy_lints/src/unused_rounding.rs b/src/tools/clippy/clippy_lints/src/unused_rounding.rs
new file mode 100644
index 00000000000..306afe44148
--- /dev/null
+++ b/src/tools/clippy/clippy_lints/src/unused_rounding.rs
@@ -0,0 +1,69 @@
+use clippy_utils::diagnostics::span_lint_and_sugg;
+use rustc_ast::ast::{Expr, ExprKind, LitFloatType, LitKind};
+use rustc_errors::Applicability;
+use rustc_lint::{EarlyContext, EarlyLintPass};
+use rustc_session::{declare_lint_pass, declare_tool_lint};
+
+declare_clippy_lint! {
+    /// ### What it does
+    ///
+    /// Detects cases where a whole-number literal float is being rounded, using
+    /// the `floor`, `ceil`, or `round` methods.
+    ///
+    /// ### Why is this bad?
+    ///
+    /// This is unnecessary and confusing to the reader. Doing this is probably a mistake.
+    ///
+    /// ### Example
+    /// ```rust
+    /// let x = 1f32.ceil();
+    /// ```
+    /// Use instead:
+    /// ```rust
+    /// let x = 1f32;
+    /// ```
+    #[clippy::version = "1.62.0"]
+    pub UNUSED_ROUNDING,
+    nursery,
+    "Uselessly rounding a whole number floating-point literal"
+}
+declare_lint_pass!(UnusedRounding => [UNUSED_ROUNDING]);
+
+fn is_useless_rounding(expr: &Expr) -> Option<(&str, String)> {
+    if let ExprKind::MethodCall(name_ident, args, _) = &expr.kind
+        && let method_name = name_ident.ident.name.as_str()
+        && (method_name == "ceil" || method_name == "round" || method_name == "floor")
+        && !args.is_empty()
+        && let ExprKind::Lit(spanned) = &args[0].kind
+        && let LitKind::Float(symbol, ty) = spanned.kind {
+            let f = symbol.as_str().parse::<f64>().unwrap();
+            let f_str = symbol.to_string() + if let LitFloatType::Suffixed(ty) = ty {
+                ty.name_str()
+            } else {
+                ""
+            };
+            if f.fract() == 0.0 {
+                Some((method_name, f_str))
+            } else {
+                None
+            }
+        } else {
+            None
+        }
+}
+
+impl EarlyLintPass for UnusedRounding {
+    fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) {
+        if let Some((method_name, float)) = is_useless_rounding(expr) {
+            span_lint_and_sugg(
+                cx,
+                UNUSED_ROUNDING,
+                expr.span,
+                &format!("used the `{}` method with a whole number float", method_name),
+                &format!("remove the `{}` method call", method_name),
+                float,
+                Applicability::MachineApplicable,
+            );
+        }
+    }
+}
diff --git a/src/tools/clippy/clippy_lints/src/use_self.rs b/src/tools/clippy/clippy_lints/src/use_self.rs
index 66f7748e9e0..486ea5e5ccf 100644
--- a/src/tools/clippy/clippy_lints/src/use_self.rs
+++ b/src/tools/clippy/clippy_lints/src/use_self.rs
@@ -258,13 +258,21 @@ impl<'tcx> LateLintPass<'tcx> for UseSelf {
             if !pat.span.from_expansion();
             if meets_msrv(self.msrv, msrvs::TYPE_ALIAS_ENUM_VARIANTS);
             if let Some(&StackItem::Check { impl_id, .. }) = self.stack.last();
-            if let PatKind::Path(QPath::Resolved(_, path)) = pat.kind;
-            if !matches!(path.res, Res::SelfTy { .. } | Res::Def(DefKind::TyParam, _));
+            // get the path from the pattern
+            if let PatKind::Path(QPath::Resolved(_, path))
+                 | PatKind::TupleStruct(QPath::Resolved(_, path), _, _)
+                 | PatKind::Struct(QPath::Resolved(_, path), _, _) = pat.kind;
             if cx.typeck_results().pat_ty(pat) == cx.tcx.type_of(impl_id);
-            if let [first, ..] = path.segments;
-            if let Some(hir_id) = first.hir_id;
             then {
-                span_lint(cx, cx.tcx.hir().span(hir_id));
+                match path.res {
+                    Res::Def(DefKind::Ctor(ctor_of, _), ..) => match ctor_of {
+                            CtorOf::Variant => lint_path_to_variant(cx, path),
+                            CtorOf::Struct => span_lint(cx, path.span),
+                    },
+                    Res::Def(DefKind::Variant, ..) => lint_path_to_variant(cx, path),
+                    Res::Def(DefKind::Struct, ..) => span_lint(cx, path.span),
+                    _ => ()
+                }
             }
         }
     }
diff --git a/src/tools/clippy/clippy_lints/src/utils/conf.rs b/src/tools/clippy/clippy_lints/src/utils/conf.rs
index cd4d16fe95f..b5c5d35135f 100644
--- a/src/tools/clippy/clippy_lints/src/utils/conf.rs
+++ b/src/tools/clippy/clippy_lints/src/utils/conf.rs
@@ -340,6 +340,10 @@ define_Conf! {
     ///
     /// Whether `unwrap` should be allowed in test functions
     (allow_unwrap_in_tests: bool = false),
+    /// Lint: DBG_MACRO.
+    ///
+    /// Whether `dbg!` should be allowed in test functions
+    (allow_dbg_in_tests: bool = false),
 }
 
 /// Search for the configuration file.
diff --git a/src/tools/clippy/clippy_lints/src/utils/internal_lints.rs b/src/tools/clippy/clippy_lints/src/utils/internal_lints.rs
index 0e8f40e9210..60f98876994 100644
--- a/src/tools/clippy/clippy_lints/src/utils/internal_lints.rs
+++ b/src/tools/clippy/clippy_lints/src/utils/internal_lints.rs
@@ -422,7 +422,7 @@ impl<'tcx> LateLintPass<'tcx> for LintWithoutLintPass {
             }
         } else if let Some(macro_call) = root_macro_call_first_node(cx, item) {
             if !matches!(
-                &*cx.tcx.item_name(macro_call.def_id).as_str(),
+                cx.tcx.item_name(macro_call.def_id).as_str(),
                 "impl_lint_pass" | "declare_lint_pass"
             ) {
                 return;
@@ -504,7 +504,7 @@ fn check_invalid_clippy_version_attribute(cx: &LateContext<'_>, item: &'_ Item<'
             return;
         }
 
-        if RustcVersion::parse(&*value.as_str()).is_err() {
+        if RustcVersion::parse(value.as_str()).is_err() {
             span_lint_and_help(
                 cx,
                 INVALID_CLIPPY_VERSION_ATTRIBUTE,
@@ -595,7 +595,7 @@ impl<'tcx> LateLintPass<'tcx> for CompilerLintFunctions {
         if_chain! {
             if let ExprKind::MethodCall(path, [self_arg, ..], _) = &expr.kind;
             let fn_name = path.ident;
-            if let Some(sugg) = self.map.get(&*fn_name.as_str());
+            if let Some(sugg) = self.map.get(fn_name.as_str());
             let ty = cx.typeck_results().expr_ty(self_arg).peel_refs();
             if match_type(cx, ty, &paths::EARLY_CONTEXT)
                 || match_type(cx, ty, &paths::LATE_CONTEXT);
@@ -679,7 +679,7 @@ impl<'tcx> LateLintPass<'tcx> for CollapsibleCalls {
             then {
                 let and_then_snippets = get_and_then_snippets(cx, and_then_args);
                 let mut sle = SpanlessEq::new(cx).deny_side_effects();
-                match &*ps.ident.as_str() {
+                match ps.ident.as_str() {
                     "span_suggestion" if sle.eq_expr(&and_then_args[2], &span_call_args[1]) => {
                         suggest_suggestion(cx, expr, &and_then_snippets, &span_suggestion_snippets(cx, span_call_args));
                     },
diff --git a/src/tools/clippy/clippy_lints/src/utils/internal_lints/metadata_collector.rs b/src/tools/clippy/clippy_lints/src/utils/internal_lints/metadata_collector.rs
index 8c1910b3b2a..cf2de6a42af 100644
--- a/src/tools/clippy/clippy_lints/src/utils/internal_lints/metadata_collector.rs
+++ b/src/tools/clippy/clippy_lints/src/utils/internal_lints/metadata_collector.rs
@@ -7,6 +7,7 @@
 //! during any comparison or mapping. (Please take care of this, it's not fun to spend time on such
 //! a simple mistake)
 
+use crate::renamed_lints::RENAMED_LINTS;
 use crate::utils::internal_lints::{extract_clippy_version_value, is_lint_ref_type};
 
 use clippy_utils::diagnostics::span_lint;
@@ -26,6 +27,7 @@ use rustc_span::{sym, Loc, Span, Symbol};
 use serde::{ser::SerializeStruct, Serialize, Serializer};
 use std::collections::BinaryHeap;
 use std::fmt;
+use std::fmt::Write as _;
 use std::fs::{self, OpenOptions};
 use std::io::prelude::*;
 use std::path::Path;
@@ -85,6 +87,21 @@ macro_rules! CONFIGURATION_VALUE_TEMPLATE {
     };
 }
 
+macro_rules! RENAMES_SECTION_TEMPLATE {
+    () => {
+        r#"
+### Past names
+
+{names}
+"#
+    };
+}
+macro_rules! RENAME_VALUE_TEMPLATE {
+    () => {
+        "* `{name}`\n"
+    };
+}
+
 const LINT_EMISSION_FUNCTIONS: [&[&str]; 8] = [
     &["clippy_utils", "diagnostics", "span_lint"],
     &["clippy_utils", "diagnostics", "span_lint_and_help"],
@@ -198,9 +215,10 @@ impl Drop for MetadataCollector {
 
         // Mapping the final data
         let mut lints = std::mem::take(&mut self.lints).into_sorted_vec();
-        lints
-            .iter_mut()
-            .for_each(|x| x.applicability = Some(applicability_info.remove(&x.id).unwrap_or_default()));
+        collect_renames(&mut lints);
+        for x in &mut lints {
+            x.applicability = Some(applicability_info.remove(&x.id).unwrap_or_default());
+        }
 
         // Outputting
         if Path::new(OUTPUT_FILE).exists() {
@@ -527,12 +545,11 @@ fn extract_attr_docs_or_lint(cx: &LateContext<'_>, item: &Item<'_>) -> Option<St
 fn extract_attr_docs(cx: &LateContext<'_>, item: &Item<'_>) -> Option<String> {
     let attrs = cx.tcx.hir().attrs(item.hir_id());
     let mut lines = attrs.iter().filter_map(ast::Attribute::doc_str);
-    let mut docs = String::from(&*lines.next()?.as_str());
+    let mut docs = String::from(lines.next()?.as_str());
     let mut in_code_block = false;
     let mut is_code_block_rust = false;
     for line in lines {
         let line = line.as_str();
-        let line = &*line;
 
         // Rustdoc hides code lines starting with `# ` and this removes them from Clippy's lint list :)
         if is_code_block_rust && line.trim_start().starts_with("# ") {
@@ -643,6 +660,37 @@ fn is_deprecated_lint(cx: &LateContext<'_>, ty: &hir::Ty<'_>) -> bool {
     false
 }
 
+fn collect_renames(lints: &mut Vec<LintMetadata>) {
+    for lint in lints {
+        let mut collected = String::new();
+        let mut names = vec![lint.id.clone()];
+
+        loop {
+            if let Some(lint_name) = names.pop() {
+                for (k, v) in RENAMED_LINTS {
+                    if_chain! {
+                        if let Some(name) = v.strip_prefix(CLIPPY_LINT_GROUP_PREFIX);
+                        if name == lint_name;
+                        if let Some(past_name) = k.strip_prefix(CLIPPY_LINT_GROUP_PREFIX);
+                        then {
+                            write!(collected, RENAME_VALUE_TEMPLATE!(), name = past_name).unwrap();
+                            names.push(past_name.to_string());
+                        }
+                    }
+                }
+
+                continue;
+            }
+
+            break;
+        }
+
+        if !collected.is_empty() {
+            write!(&mut lint.docs, RENAMES_SECTION_TEMPLATE!(), names = collected).unwrap();
+        }
+    }
+}
+
 // ==================================================================
 // Lint emission
 // ==================================================================
diff --git a/src/tools/clippy/clippy_utils/src/consts.rs b/src/tools/clippy/clippy_utils/src/consts.rs
index 9f162a117b2..d487868cafe 100644
--- a/src/tools/clippy/clippy_utils/src/consts.rs
+++ b/src/tools/clippy/clippy_utils/src/consts.rs
@@ -478,7 +478,7 @@ impl<'a, 'tcx> ConstEvalLateContext<'a, 'tcx> {
     fn ifthenelse(&mut self, cond: &Expr<'_>, then: &Expr<'_>, otherwise: Option<&Expr<'_>>) -> Option<Constant> {
         if let Some(Constant::Bool(b)) = self.expr(cond) {
             if b {
-                self.expr(&*then)
+                self.expr(then)
             } else {
                 otherwise.as_ref().and_then(|expr| self.expr(expr))
             }
diff --git a/src/tools/clippy/clippy_utils/src/higher.rs b/src/tools/clippy/clippy_utils/src/higher.rs
index 1e0fc789af2..4604ae5c2c7 100644
--- a/src/tools/clippy/clippy_utils/src/higher.rs
+++ b/src/tools/clippy/clippy_utils/src/higher.rs
@@ -35,7 +35,7 @@ impl<'tcx> ForLoop<'tcx> {
             if let hir::ExprKind::Match(iterexpr, [arm], hir::MatchSource::ForLoopDesugar) = e.kind;
             if let hir::ExprKind::Call(_, [arg]) = iterexpr.kind;
             if let hir::ExprKind::Loop(block, ..) = arm.body.kind;
-            if let [stmt] = &*block.stmts;
+            if let [stmt] = block.stmts;
             if let hir::StmtKind::Expr(e) = stmt.kind;
             if let hir::ExprKind::Match(_, [_, some_arm], _) = e.kind;
             if let hir::PatKind::Struct(_, [field], _) = some_arm.pat.kind;
diff --git a/src/tools/clippy/clippy_utils/src/hir_utils.rs b/src/tools/clippy/clippy_utils/src/hir_utils.rs
index c440793b90e..0603471c343 100644
--- a/src/tools/clippy/clippy_utils/src/hir_utils.rs
+++ b/src/tools/clippy/clippy_utils/src/hir_utils.rs
@@ -411,10 +411,10 @@ impl HirEqInterExpr<'_, '_, '_> {
             (&TyKind::Slice(l_vec), &TyKind::Slice(r_vec)) => self.eq_ty(l_vec, r_vec),
             (&TyKind::Array(lt, ll), &TyKind::Array(rt, rl)) => self.eq_ty(lt, rt) && self.eq_array_length(ll, rl),
             (&TyKind::Ptr(ref l_mut), &TyKind::Ptr(ref r_mut)) => {
-                l_mut.mutbl == r_mut.mutbl && self.eq_ty(&*l_mut.ty, &*r_mut.ty)
+                l_mut.mutbl == r_mut.mutbl && self.eq_ty(l_mut.ty, r_mut.ty)
             },
             (&TyKind::Rptr(_, ref l_rmut), &TyKind::Rptr(_, ref r_rmut)) => {
-                l_rmut.mutbl == r_rmut.mutbl && self.eq_ty(&*l_rmut.ty, &*r_rmut.ty)
+                l_rmut.mutbl == r_rmut.mutbl && self.eq_ty(l_rmut.ty, r_rmut.ty)
             },
             (&TyKind::Path(ref l), &TyKind::Path(ref r)) => self.eq_qpath(l, r),
             (&TyKind::Tup(l), &TyKind::Tup(r)) => over(l, r, |l, r| self.eq_ty(l, r)),
@@ -608,7 +608,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
                     self.hash_name(i.ident.name);
                 }
                 if let Some(j) = *j {
-                    self.hash_expr(&*j);
+                    self.hash_expr(j);
                 }
             },
             ExprKind::Box(e) | ExprKind::DropTemps(e) | ExprKind::Yield(e, _) => {
@@ -902,16 +902,14 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
 
     pub fn hash_lifetime(&mut self, lifetime: Lifetime) {
         std::mem::discriminant(&lifetime.name).hash(&mut self.s);
-        if let LifetimeName::Param(ref name) = lifetime.name {
+        if let LifetimeName::Param(param_id, ref name) = lifetime.name {
             std::mem::discriminant(name).hash(&mut self.s);
+            param_id.hash(&mut self.s);
             match name {
                 ParamName::Plain(ref ident) => {
                     ident.name.hash(&mut self.s);
                 },
-                ParamName::Fresh(ref size) => {
-                    size.hash(&mut self.s);
-                },
-                ParamName::Error => {},
+                ParamName::Fresh | ParamName::Error => {},
             }
         }
     }
diff --git a/src/tools/clippy/clippy_utils/src/lib.rs b/src/tools/clippy/clippy_utils/src/lib.rs
index 833f8cde63a..5f051e3f444 100644
--- a/src/tools/clippy/clippy_utils/src/lib.rs
+++ b/src/tools/clippy/clippy_utils/src/lib.rs
@@ -1443,7 +1443,7 @@ pub fn is_refutable(cx: &LateContext<'_>, pat: &Pat<'_>) -> bool {
         },
         PatKind::Tuple(pats, _) => are_refutable(cx, pats),
         PatKind::Struct(ref qpath, fields, _) => {
-            is_enum_variant(cx, qpath, pat.hir_id) || are_refutable(cx, fields.iter().map(|field| &*field.pat))
+            is_enum_variant(cx, qpath, pat.hir_id) || are_refutable(cx, fields.iter().map(|field| field.pat))
         },
         PatKind::TupleStruct(ref qpath, pats, _) => is_enum_variant(cx, qpath, pat.hir_id) || are_refutable(cx, pats),
         PatKind::Slice(head, middle, tail) => {
@@ -1658,7 +1658,7 @@ pub fn if_sequence<'tcx>(mut expr: &'tcx Expr<'tcx>) -> (Vec<&'tcx Expr<'tcx>>,
     let mut blocks: Vec<&Block<'_>> = Vec::new();
 
     while let Some(higher::IfOrIfLet { cond, then, r#else }) = higher::IfOrIfLet::hir(expr) {
-        conds.push(&*cond);
+        conds.push(cond);
         if let ExprKind::Block(block, _) = then.kind {
             blocks.push(block);
         } else {
@@ -1916,7 +1916,17 @@ pub fn fn_def_id(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option<DefId> {
                 ..
             },
             ..,
-        ) => cx.typeck_results().qpath_res(qpath, *path_hir_id).opt_def_id(),
+        ) => {
+            // Only return Fn-like DefIds, not the DefIds of statics/consts/etc that contain or
+            // deref to fn pointers, dyn Fn, impl Fn - #8850
+            if let Res::Def(DefKind::Fn | DefKind::Ctor(..) | DefKind::AssocFn, id) =
+                cx.typeck_results().qpath_res(qpath, *path_hir_id)
+            {
+                Some(id)
+            } else {
+                None
+            }
+        },
         _ => None,
     }
 }
@@ -2073,7 +2083,8 @@ static TEST_ITEM_NAMES_CACHE: SyncOnceCell<Mutex<FxHashMap<LocalDefId, Vec<Symbo
 fn with_test_item_names<'tcx>(tcx: TyCtxt<'tcx>, module: LocalDefId, f: impl Fn(&[Symbol]) -> bool) -> bool {
     let cache = TEST_ITEM_NAMES_CACHE.get_or_init(|| Mutex::new(FxHashMap::default()));
     let mut map: MutexGuard<'_, FxHashMap<LocalDefId, Vec<Symbol>>> = cache.lock().unwrap();
-    match map.entry(module) {
+    let value = map.entry(module);
+    match value {
         Entry::Occupied(entry) => f(entry.get()),
         Entry::Vacant(entry) => {
             let mut names = Vec::new();
diff --git a/src/tools/clippy/clippy_utils/src/msrvs.rs b/src/tools/clippy/clippy_utils/src/msrvs.rs
index 134fd1ce505..b9ec2c19fdd 100644
--- a/src/tools/clippy/clippy_utils/src/msrvs.rs
+++ b/src/tools/clippy/clippy_utils/src/msrvs.rs
@@ -30,6 +30,7 @@ msrv_aliases! {
     1,34,0 { TRY_FROM }
     1,30,0 { ITERATOR_FIND_MAP, TOOL_ATTRIBUTES }
     1,28,0 { FROM_BOOL }
+    1,26,0 { RANGE_INCLUSIVE }
     1,17,0 { FIELD_INIT_SHORTHAND, STATIC_IN_CONST, EXPECT_ERR }
     1,16,0 { STR_REPEAT }
     1,24,0 { IS_ASCII_DIGIT }
diff --git a/src/tools/clippy/clippy_utils/src/paths.rs b/src/tools/clippy/clippy_utils/src/paths.rs
index 9b9cbff2d14..89789c3d851 100644
--- a/src/tools/clippy/clippy_utils/src/paths.rs
+++ b/src/tools/clippy/clippy_utils/src/paths.rs
@@ -73,6 +73,7 @@ pub const LATE_CONTEXT: [&str; 2] = ["rustc_lint", "LateContext"];
 pub const LATE_LINT_PASS: [&str; 3] = ["rustc_lint", "passes", "LateLintPass"];
 #[cfg(feature = "internal")]
 pub const LINT: [&str; 2] = ["rustc_lint_defs", "Lint"];
+pub const MEM_SWAP: [&str; 3] = ["core", "mem", "swap"];
 pub const MUTEX_GUARD: [&str; 4] = ["std", "sync", "mutex", "MutexGuard"];
 pub const OPEN_OPTIONS: [&str; 3] = ["std", "fs", "OpenOptions"];
 /// Preferably use the diagnostic item `sym::Option` where possible
@@ -141,6 +142,7 @@ pub const SERDE_DESERIALIZE: [&str; 3] = ["serde", "de", "Deserialize"];
 pub const SERDE_DE_VISITOR: [&str; 3] = ["serde", "de", "Visitor"];
 pub const SLICE_FROM_RAW_PARTS: [&str; 4] = ["core", "slice", "raw", "from_raw_parts"];
 pub const SLICE_FROM_RAW_PARTS_MUT: [&str; 4] = ["core", "slice", "raw", "from_raw_parts_mut"];
+pub const SLICE_GET: [&str; 4] = ["core", "slice", "<impl [T]>", "get"];
 pub const SLICE_INTO_VEC: [&str; 4] = ["alloc", "slice", "<impl [T]>", "into_vec"];
 pub const SLICE_ITER: [&str; 4] = ["core", "slice", "iter", "Iter"];
 pub const STDERR: [&str; 4] = ["std", "io", "stdio", "stderr"];
diff --git a/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs b/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs
index 58abef38ea8..498dcbb8900 100644
--- a/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs
+++ b/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs
@@ -121,24 +121,18 @@ fn check_rvalue<'tcx>(
 ) -> McfResult {
     match rvalue {
         Rvalue::ThreadLocalRef(_) => Err((span, "cannot access thread local storage in const fn".into())),
-        Rvalue::Repeat(operand, _) | Rvalue::Use(operand) => check_operand(tcx, operand, span, body),
         Rvalue::Len(place) | Rvalue::Discriminant(place) | Rvalue::Ref(_, _, place) | Rvalue::AddressOf(_, place) => {
             check_place(tcx, *place, span, body)
         },
-        Rvalue::Cast(CastKind::PointerExposeAddress, _, _) => {
-            Err((span, "casting pointers to ints is unstable in const fn".into()))
-        },
-        Rvalue::Cast(CastKind::Misc, operand, _) => {
-            check_operand(tcx, operand, span, body)
-        },
-        Rvalue::Cast(
+        Rvalue::Repeat(operand, _)
+        | Rvalue::Use(operand)
+        | Rvalue::Cast(
             CastKind::PointerFromExposedAddress
+            | CastKind::Misc
             | CastKind::Pointer(PointerCast::MutToConstPointer | PointerCast::ArrayToPointer),
             operand,
-            _
-        ) => {
-            check_operand(tcx, operand, span, body)
-        },
+            _,
+        ) => check_operand(tcx, operand, span, body),
         Rvalue::Cast(
             CastKind::Pointer(
                 PointerCast::UnsafeFnPointer | PointerCast::ClosureFnPointer(_) | PointerCast::ReifyFnPointer,
@@ -163,6 +157,9 @@ fn check_rvalue<'tcx>(
                 Err((span, "unsizing casts are not allowed in const fn".into()))
             }
         },
+        Rvalue::Cast(CastKind::PointerExposeAddress, _, _) => {
+            Err((span, "casting pointers to ints is unstable in const fn".into()))
+        },
         // binops are fine on integers
         Rvalue::BinaryOp(_, box (lhs, rhs)) | Rvalue::CheckedBinaryOp(_, box (lhs, rhs)) => {
             check_operand(tcx, lhs, span, body)?;
diff --git a/src/tools/clippy/clippy_utils/src/source.rs b/src/tools/clippy/clippy_utils/src/source.rs
index 04ef2f57447..f88a92fb11c 100644
--- a/src/tools/clippy/clippy_utils/src/source.rs
+++ b/src/tools/clippy/clippy_utils/src/source.rs
@@ -8,7 +8,7 @@ use rustc_hir::{Expr, ExprKind};
 use rustc_lint::{LateContext, LintContext};
 use rustc_span::hygiene;
 use rustc_span::source_map::SourceMap;
-use rustc_span::{BytePos, Pos, Span, SyntaxContext};
+use rustc_span::{BytePos, Pos, Span, SpanData, SyntaxContext};
 use std::borrow::Cow;
 
 /// Checks if the span starts with the given text. This will return false if the span crosses
@@ -389,6 +389,27 @@ pub fn without_block_comments(lines: Vec<&str>) -> Vec<&str> {
     without
 }
 
+/// Trims the whitespace from the start and the end of the span.
+pub fn trim_span(sm: &SourceMap, span: Span) -> Span {
+    let data = span.data();
+    let sf: &_ = &sm.lookup_source_file(data.lo);
+    let Some(src) = sf.src.as_deref() else {
+        return span;
+    };
+    let Some(snip) = &src.get((data.lo - sf.start_pos).to_usize()..(data.hi - sf.start_pos).to_usize()) else {
+        return span;
+    };
+    let trim_start = snip.len() - snip.trim_start().len();
+    let trim_end = snip.len() - snip.trim_end().len();
+    SpanData {
+        lo: data.lo + BytePos::from_usize(trim_start),
+        hi: data.hi - BytePos::from_usize(trim_end),
+        ctxt: data.ctxt,
+        parent: data.parent,
+    }
+    .span()
+}
+
 #[cfg(test)]
 mod test {
     use super::{reindent_multiline, without_block_comments};
diff --git a/src/tools/clippy/clippy_utils/src/ty.rs b/src/tools/clippy/clippy_utils/src/ty.rs
index 75d27d3b594..a10515d2fec 100644
--- a/src/tools/clippy/clippy_utils/src/ty.rs
+++ b/src/tools/clippy/clippy_utils/src/ty.rs
@@ -13,7 +13,8 @@ use rustc_lint::LateContext;
 use rustc_middle::mir::interpret::{ConstValue, Scalar};
 use rustc_middle::ty::subst::{GenericArg, GenericArgKind, Subst};
 use rustc_middle::ty::{
-    self, AdtDef, Binder, FnSig, IntTy, Predicate, PredicateKind, Ty, TyCtxt, TypeFoldable, UintTy, VariantDiscr,
+    self, AdtDef, Binder, FnSig, IntTy, ParamEnv, Predicate, PredicateKind, Ty, TyCtxt, TypeFoldable, UintTy,
+    VariantDiscr,
 };
 use rustc_span::symbol::Ident;
 use rustc_span::{sym, Span, Symbol, DUMMY_SP};
@@ -152,17 +153,28 @@ pub fn implements_trait<'tcx>(
     trait_id: DefId,
     ty_params: &[GenericArg<'tcx>],
 ) -> bool {
+    implements_trait_with_env(cx.tcx, cx.param_env, ty, trait_id, ty_params)
+}
+
+/// Same as `implements_trait` but allows using a `ParamEnv` different from the lint context.
+pub fn implements_trait_with_env<'tcx>(
+    tcx: TyCtxt<'tcx>,
+    param_env: ParamEnv<'tcx>,
+    ty: Ty<'tcx>,
+    trait_id: DefId,
+    ty_params: &[GenericArg<'tcx>],
+) -> bool {
     // Clippy shouldn't have infer types
     assert!(!ty.needs_infer());
 
-    let ty = cx.tcx.erase_regions(ty);
+    let ty = tcx.erase_regions(ty);
     if ty.has_escaping_bound_vars() {
         return false;
     }
-    let ty_params = cx.tcx.mk_substs(ty_params.iter());
-    cx.tcx.infer_ctxt().enter(|infcx| {
+    let ty_params = tcx.mk_substs(ty_params.iter());
+    tcx.infer_ctxt().enter(|infcx| {
         infcx
-            .type_implements_trait(trait_id, ty, ty_params, cx.param_env)
+            .type_implements_trait(trait_id, ty, ty_params, param_env)
             .must_apply_modulo_regions()
     })
 }
diff --git a/src/tools/clippy/doc/adding_lints.md b/src/tools/clippy/doc/adding_lints.md
index e8f0c338fd5..3e0b1c5c4f7 100644
--- a/src/tools/clippy/doc/adding_lints.md
+++ b/src/tools/clippy/doc/adding_lints.md
@@ -516,11 +516,12 @@ declare_clippy_lint! {
     /// ### Example
     ///
     /// ```rust,ignore
-    /// // Bad
-    /// Insert a short example of code that triggers the lint
-    ///
-    /// // Good
-    /// Insert a short example of improved code that doesn't trigger the lint
+    /// // A short example of code that triggers the lint
+    /// ```
+    /// 
+    /// Use instead:
+    /// ```rust,ignore
+    /// // A short example of improved code that doesn't trigger the lint
     /// ```
     #[clippy::version = "1.29.0"]
     pub FOO_FUNCTIONS,
diff --git a/src/tools/clippy/doc/common_tools_writing_lints.md b/src/tools/clippy/doc/common_tools_writing_lints.md
index 131ac3c3611..1d1aee0da2c 100644
--- a/src/tools/clippy/doc/common_tools_writing_lints.md
+++ b/src/tools/clippy/doc/common_tools_writing_lints.md
@@ -159,7 +159,8 @@ A list of defined paths for Clippy can be found in [paths.rs][paths]
 To check if our type defines a method called `some_method`:
 
 ```rust
-use clippy_utils::{is_type_diagnostic_item, return_ty};
+use clippy_utils::ty::is_type_diagnostic_item;
+use clippy_utils::return_ty;
 
 impl<'tcx> LateLintPass<'tcx> for MyTypeImpl {
     fn check_impl_item(&mut self, cx: &LateContext<'tcx>, impl_item: &'tcx ImplItem<'_>) {
diff --git a/src/tools/clippy/lintcheck/Cargo.toml b/src/tools/clippy/lintcheck/Cargo.toml
index e63f65ce2f7..504d58b5197 100644
--- a/src/tools/clippy/lintcheck/Cargo.toml
+++ b/src/tools/clippy/lintcheck/Cargo.toml
@@ -11,7 +11,7 @@ publish = false
 
 [dependencies]
 cargo_metadata = "0.14"
-clap = "2.33"
+clap = "3.1"
 flate2 = "1.0"
 rayon = "1.5.1"
 serde = { version = "1.0", features = ["derive"] }
diff --git a/src/tools/clippy/lintcheck/src/config.rs b/src/tools/clippy/lintcheck/src/config.rs
index de32b484360..a6f93d2a1c0 100644
--- a/src/tools/clippy/lintcheck/src/config.rs
+++ b/src/tools/clippy/lintcheck/src/config.rs
@@ -1,47 +1,47 @@
-use clap::{App, Arg, ArgMatches};
+use clap::{Arg, ArgMatches, Command};
 use std::env;
 use std::path::PathBuf;
 
-fn get_clap_config<'a>() -> ArgMatches<'a> {
-    App::new("lintcheck")
+fn get_clap_config() -> ArgMatches {
+    Command::new("lintcheck")
         .about("run clippy on a set of crates and check output")
         .arg(
-            Arg::with_name("only")
+            Arg::new("only")
                 .takes_value(true)
                 .value_name("CRATE")
                 .long("only")
                 .help("Only process a single crate of the list"),
         )
         .arg(
-            Arg::with_name("crates-toml")
+            Arg::new("crates-toml")
                 .takes_value(true)
                 .value_name("CRATES-SOURCES-TOML-PATH")
                 .long("crates-toml")
                 .help("Set the path for a crates.toml where lintcheck should read the sources from"),
         )
         .arg(
-            Arg::with_name("threads")
+            Arg::new("threads")
                 .takes_value(true)
                 .value_name("N")
-                .short("j")
+                .short('j')
                 .long("jobs")
                 .help("Number of threads to use, 0 automatic choice"),
         )
         .arg(
-            Arg::with_name("fix")
+            Arg::new("fix")
                 .long("--fix")
                 .help("Runs cargo clippy --fix and checks if all suggestions apply"),
         )
         .arg(
-            Arg::with_name("filter")
+            Arg::new("filter")
                 .long("--filter")
                 .takes_value(true)
-                .multiple(true)
+                .multiple_occurrences(true)
                 .value_name("clippy_lint_name")
                 .help("Apply a filter to only collect specified lints, this also overrides `allow` attributes"),
         )
         .arg(
-            Arg::with_name("markdown")
+            Arg::new("markdown")
                 .long("--markdown")
                 .help("Change the reports table to use markdown links"),
         )
diff --git a/src/tools/clippy/rust-toolchain b/src/tools/clippy/rust-toolchain
index 997e7ba9382..2386a751f04 100644
--- a/src/tools/clippy/rust-toolchain
+++ b/src/tools/clippy/rust-toolchain
@@ -1,3 +1,3 @@
 [toolchain]
-channel = "nightly-2022-05-19"
+channel = "nightly-2022-06-04"
 components = ["cargo", "llvm-tools-preview", "rust-src", "rust-std", "rustc", "rustc-dev", "rustfmt"]
diff --git a/src/tools/clippy/tests/compile-test.rs b/src/tools/clippy/tests/compile-test.rs
index c9710e3db8e..04c2eeff08b 100644
--- a/src/tools/clippy/tests/compile-test.rs
+++ b/src/tools/clippy/tests/compile-test.rs
@@ -1,5 +1,6 @@
 #![feature(test)] // compiletest_rs requires this attribute
 #![feature(once_cell)]
+#![feature(is_sorted)]
 #![cfg_attr(feature = "deny-warnings", deny(warnings))]
 #![warn(rust_2018_idioms, unused_lifetimes)]
 
@@ -109,8 +110,9 @@ static EXTERN_FLAGS: SyncLazy<String> = SyncLazy::new(|| {
         not_found.is_empty(),
         "dependencies not found in depinfo: {:?}\n\
         help: Make sure the `-Z binary-dep-depinfo` rust flag is enabled\n\
-        help: Try adding to dev-dependencies in Cargo.toml",
-        not_found
+        help: Try adding to dev-dependencies in Cargo.toml\n\
+        help: Be sure to also add `extern crate ...;` to tests/compile-test.rs",
+        not_found,
     );
     crates
         .into_iter()
@@ -162,7 +164,8 @@ fn base_config(test_dir: &str) -> compiletest::Config {
 }
 
 fn run_ui() {
-    let config = base_config("ui");
+    let mut config = base_config("ui");
+    config.rustfix_coverage = true;
     // use tests/clippy.toml
     let _g = VarGuard::set("CARGO_MANIFEST_DIR", fs::canonicalize("tests").unwrap());
     let _threads = VarGuard::set(
@@ -175,6 +178,7 @@ fn run_ui() {
         }),
     );
     compiletest::run_tests(&config);
+    check_rustfix_coverage();
 }
 
 fn run_internal_tests() {
@@ -337,6 +341,88 @@ fn compile_test() {
     run_internal_tests();
 }
 
+const RUSTFIX_COVERAGE_KNOWN_EXCEPTIONS: &[&str] = &[
+    "assign_ops2.rs",
+    "borrow_deref_ref_unfixable.rs",
+    "cast_size_32bit.rs",
+    "char_lit_as_u8.rs",
+    "cmp_owned/without_suggestion.rs",
+    "dbg_macro.rs",
+    "deref_addrof_double_trigger.rs",
+    "doc/unbalanced_ticks.rs",
+    "eprint_with_newline.rs",
+    "explicit_counter_loop.rs",
+    "iter_skip_next_unfixable.rs",
+    "let_and_return.rs",
+    "literals.rs",
+    "map_flatten.rs",
+    "map_unwrap_or.rs",
+    "match_bool.rs",
+    "mem_replace_macro.rs",
+    "needless_arbitrary_self_type_unfixable.rs",
+    "needless_borrow_pat.rs",
+    "needless_for_each_unfixable.rs",
+    "nonminimal_bool.rs",
+    "print_literal.rs",
+    "print_with_newline.rs",
+    "redundant_static_lifetimes_multiple.rs",
+    "ref_binding_to_reference.rs",
+    "repl_uninit.rs",
+    "result_map_unit_fn_unfixable.rs",
+    "search_is_some.rs",
+    "single_component_path_imports_nested_first.rs",
+    "string_add.rs",
+    "toplevel_ref_arg_non_rustfix.rs",
+    "unit_arg.rs",
+    "unnecessary_clone.rs",
+    "unnecessary_lazy_eval_unfixable.rs",
+    "write_literal.rs",
+    "write_literal_2.rs",
+    "write_with_newline.rs",
+];
+
+fn check_rustfix_coverage() {
+    let missing_coverage_path = Path::new("target/debug/test/ui/rustfix_missing_coverage.txt");
+
+    if let Ok(missing_coverage_contents) = std::fs::read_to_string(missing_coverage_path) {
+        assert!(RUSTFIX_COVERAGE_KNOWN_EXCEPTIONS.iter().is_sorted_by_key(Path::new));
+
+        for rs_path in missing_coverage_contents.lines() {
+            if Path::new(rs_path).starts_with("tests/ui/crashes") {
+                continue;
+            }
+            let filename = Path::new(rs_path).strip_prefix("tests/ui/").unwrap();
+            assert!(
+                RUSTFIX_COVERAGE_KNOWN_EXCEPTIONS
+                    .binary_search_by_key(&filename, Path::new)
+                    .is_ok(),
+                "`{}` runs `MachineApplicable` diagnostics but is missing a `run-rustfix` annotation. \
+                Please either add `// run-rustfix` at the top of the file or add the file to \
+                `RUSTFIX_COVERAGE_KNOWN_EXCEPTIONS` in `tests/compile-test.rs`.",
+                rs_path,
+            );
+        }
+    }
+}
+
+#[test]
+fn rustfix_coverage_known_exceptions_accuracy() {
+    for filename in RUSTFIX_COVERAGE_KNOWN_EXCEPTIONS {
+        let rs_path = Path::new("tests/ui").join(filename);
+        assert!(
+            rs_path.exists(),
+            "`{}` does not exists",
+            rs_path.strip_prefix(env!("CARGO_MANIFEST_DIR")).unwrap().display()
+        );
+        let fixed_path = rs_path.with_extension("fixed");
+        assert!(
+            !fixed_path.exists(),
+            "`{}` exists",
+            fixed_path.strip_prefix(env!("CARGO_MANIFEST_DIR")).unwrap().display()
+        );
+    }
+}
+
 /// Restores an env var on drop
 #[must_use]
 struct VarGuard {
diff --git a/src/tools/clippy/tests/ui-internal/unnecessary_symbol_str.fixed b/src/tools/clippy/tests/ui-internal/unnecessary_symbol_str.fixed
index 4f5336663a8..6033d06e4f6 100644
--- a/src/tools/clippy/tests/ui-internal/unnecessary_symbol_str.fixed
+++ b/src/tools/clippy/tests/ui-internal/unnecessary_symbol_str.fixed
@@ -2,6 +2,7 @@
 #![feature(rustc_private)]
 #![deny(clippy::internal)]
 #![allow(
+    clippy::borrow_deref_ref,
     clippy::unnecessary_operation,
     unused_must_use,
     clippy::missing_clippy_version_attribute
diff --git a/src/tools/clippy/tests/ui-internal/unnecessary_symbol_str.rs b/src/tools/clippy/tests/ui-internal/unnecessary_symbol_str.rs
index 894aa1d3bc6..1bb5d55f0b6 100644
--- a/src/tools/clippy/tests/ui-internal/unnecessary_symbol_str.rs
+++ b/src/tools/clippy/tests/ui-internal/unnecessary_symbol_str.rs
@@ -2,6 +2,7 @@
 #![feature(rustc_private)]
 #![deny(clippy::internal)]
 #![allow(
+    clippy::borrow_deref_ref,
     clippy::unnecessary_operation,
     unused_must_use,
     clippy::missing_clippy_version_attribute
diff --git a/src/tools/clippy/tests/ui-internal/unnecessary_symbol_str.stderr b/src/tools/clippy/tests/ui-internal/unnecessary_symbol_str.stderr
index 75367bf4bc5..a1f507f331d 100644
--- a/src/tools/clippy/tests/ui-internal/unnecessary_symbol_str.stderr
+++ b/src/tools/clippy/tests/ui-internal/unnecessary_symbol_str.stderr
@@ -1,5 +1,5 @@
 error: unnecessary `Symbol` to string conversion
-  --> $DIR/unnecessary_symbol_str.rs:15:5
+  --> $DIR/unnecessary_symbol_str.rs:16:5
    |
 LL |     Symbol::intern("foo").as_str() == "clippy";
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Symbol::intern("foo") == rustc_span::sym::clippy`
@@ -12,25 +12,25 @@ LL | #![deny(clippy::internal)]
    = note: `#[deny(clippy::unnecessary_symbol_str)]` implied by `#[deny(clippy::internal)]`
 
 error: unnecessary `Symbol` to string conversion
-  --> $DIR/unnecessary_symbol_str.rs:16:5
+  --> $DIR/unnecessary_symbol_str.rs:17:5
    |
 LL |     Symbol::intern("foo").to_string() == "self";
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Symbol::intern("foo") == rustc_span::symbol::kw::SelfLower`
 
 error: unnecessary `Symbol` to string conversion
-  --> $DIR/unnecessary_symbol_str.rs:17:5
+  --> $DIR/unnecessary_symbol_str.rs:18:5
    |
 LL |     Symbol::intern("foo").to_ident_string() != "Self";
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Symbol::intern("foo") != rustc_span::symbol::kw::SelfUpper`
 
 error: unnecessary `Symbol` to string conversion
-  --> $DIR/unnecessary_symbol_str.rs:18:5
+  --> $DIR/unnecessary_symbol_str.rs:19:5
    |
 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:19:5
+  --> $DIR/unnecessary_symbol_str.rs:20:5
    |
 LL |     "clippy" == Ident::empty().to_string();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `rustc_span::sym::clippy == Ident::empty().name`
diff --git a/src/tools/clippy/tests/ui-toml/dbg_macro/clippy.toml b/src/tools/clippy/tests/ui-toml/dbg_macro/clippy.toml
new file mode 100644
index 00000000000..4296655a040
--- /dev/null
+++ b/src/tools/clippy/tests/ui-toml/dbg_macro/clippy.toml
@@ -0,0 +1 @@
+allow-dbg-in-tests = true
diff --git a/src/tools/clippy/tests/ui-toml/dbg_macro/dbg_macro.rs b/src/tools/clippy/tests/ui-toml/dbg_macro/dbg_macro.rs
new file mode 100644
index 00000000000..5d9ce18f631
--- /dev/null
+++ b/src/tools/clippy/tests/ui-toml/dbg_macro/dbg_macro.rs
@@ -0,0 +1,39 @@
+// compile-flags: --test
+#![warn(clippy::dbg_macro)]
+
+fn foo(n: u32) -> u32 {
+    if let Some(n) = dbg!(n.checked_sub(4)) { n } else { n }
+}
+
+fn factorial(n: u32) -> u32 {
+    if dbg!(n <= 1) {
+        dbg!(1)
+    } else {
+        dbg!(n * factorial(n - 1))
+    }
+}
+
+fn main() {
+    dbg!(42);
+    dbg!(dbg!(dbg!(42)));
+    foo(3) + dbg!(factorial(4));
+    dbg!(1, 2, dbg!(3, 4));
+    dbg!(1, 2, 3, 4, 5);
+}
+
+#[test]
+pub fn issue8481() {
+    dbg!(1);
+}
+
+#[cfg(test)]
+fn foo2() {
+    dbg!(1);
+}
+
+#[cfg(test)]
+mod mod1 {
+    fn func() {
+        dbg!(1);
+    }
+}
diff --git a/src/tools/clippy/tests/ui-toml/dbg_macro/dbg_macro.stderr b/src/tools/clippy/tests/ui-toml/dbg_macro/dbg_macro.stderr
new file mode 100644
index 00000000000..46efb86dcfc
--- /dev/null
+++ b/src/tools/clippy/tests/ui-toml/dbg_macro/dbg_macro.stderr
@@ -0,0 +1,102 @@
+error: `dbg!` macro is intended as a debugging tool
+  --> $DIR/dbg_macro.rs:5:22
+   |
+LL |     if let Some(n) = dbg!(n.checked_sub(4)) { n } else { n }
+   |                      ^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: `-D clippy::dbg-macro` implied by `-D warnings`
+help: ensure to avoid having uses of it in version control
+   |
+LL |     if let Some(n) = n.checked_sub(4) { n } else { n }
+   |                      ~~~~~~~~~~~~~~~~
+
+error: `dbg!` macro is intended as a debugging tool
+  --> $DIR/dbg_macro.rs:9:8
+   |
+LL |     if dbg!(n <= 1) {
+   |        ^^^^^^^^^^^^
+   |
+help: ensure to avoid having uses of it in version control
+   |
+LL |     if n <= 1 {
+   |        ~~~~~~
+
+error: `dbg!` macro is intended as a debugging tool
+  --> $DIR/dbg_macro.rs:10:9
+   |
+LL |         dbg!(1)
+   |         ^^^^^^^
+   |
+help: ensure to avoid having uses of it in version control
+   |
+LL |         1
+   |
+
+error: `dbg!` macro is intended as a debugging tool
+  --> $DIR/dbg_macro.rs:12:9
+   |
+LL |         dbg!(n * factorial(n - 1))
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: ensure to avoid having uses of it in version control
+   |
+LL |         n * factorial(n - 1)
+   |
+
+error: `dbg!` macro is intended as a debugging tool
+  --> $DIR/dbg_macro.rs:17:5
+   |
+LL |     dbg!(42);
+   |     ^^^^^^^^
+   |
+help: ensure to avoid having uses of it in version control
+   |
+LL |     42;
+   |     ~~
+
+error: `dbg!` macro is intended as a debugging tool
+  --> $DIR/dbg_macro.rs:18:5
+   |
+LL |     dbg!(dbg!(dbg!(42)));
+   |     ^^^^^^^^^^^^^^^^^^^^
+   |
+help: ensure to avoid having uses of it in version control
+   |
+LL |     dbg!(dbg!(42));
+   |     ~~~~~~~~~~~~~~
+
+error: `dbg!` macro is intended as a debugging tool
+  --> $DIR/dbg_macro.rs:19:14
+   |
+LL |     foo(3) + dbg!(factorial(4));
+   |              ^^^^^^^^^^^^^^^^^^
+   |
+help: ensure to avoid having uses of it in version control
+   |
+LL |     foo(3) + factorial(4);
+   |              ~~~~~~~~~~~~
+
+error: `dbg!` macro is intended as a debugging tool
+  --> $DIR/dbg_macro.rs:20:5
+   |
+LL |     dbg!(1, 2, dbg!(3, 4));
+   |     ^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: ensure to avoid having uses of it in version control
+   |
+LL |     (1, 2, dbg!(3, 4));
+   |     ~~~~~~~~~~~~~~~~~~
+
+error: `dbg!` macro is intended as a debugging tool
+  --> $DIR/dbg_macro.rs:21:5
+   |
+LL |     dbg!(1, 2, 3, 4, 5);
+   |     ^^^^^^^^^^^^^^^^^^^
+   |
+help: ensure to avoid having uses of it in version control
+   |
+LL |     (1, 2, 3, 4, 5);
+   |     ~~~~~~~~~~~~~~~
+
+error: aborting due to 9 previous errors
+
diff --git a/src/tools/clippy/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr b/src/tools/clippy/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr
index 92838aa57df..1d87fd91a25 100644
--- a/src/tools/clippy/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr
+++ b/src/tools/clippy/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr
@@ -1,4 +1,5 @@
 error: error reading Clippy's configuration file `$DIR/clippy.toml`: unknown field `foobar`, expected one of
+           allow-dbg-in-tests
            allow-expect-in-tests
            allow-unwrap-in-tests
            allowed-scripts
diff --git a/src/tools/clippy/tests/ui-toml/unwrap_used/unwrap_used.rs b/src/tools/clippy/tests/ui-toml/unwrap_used/unwrap_used.rs
index 74d0d7c2650..0e82fb20e45 100644
--- a/src/tools/clippy/tests/ui-toml/unwrap_used/unwrap_used.rs
+++ b/src/tools/clippy/tests/ui-toml/unwrap_used/unwrap_used.rs
@@ -1,6 +1,6 @@
 // compile-flags: --test
 
-#![allow(unused_mut, clippy::from_iter_instead_of_collect)]
+#![allow(unused_mut, clippy::get_first, clippy::from_iter_instead_of_collect)]
 #![warn(clippy::unwrap_used)]
 #![deny(clippy::get_unwrap)]
 
diff --git a/src/tools/clippy/tests/ui/almost_complete_letter_range.fixed b/src/tools/clippy/tests/ui/almost_complete_letter_range.fixed
new file mode 100644
index 00000000000..39f8f0c2949
--- /dev/null
+++ b/src/tools/clippy/tests/ui/almost_complete_letter_range.fixed
@@ -0,0 +1,66 @@
+// run-rustfix
+// edition:2018
+
+#![feature(custom_inner_attributes)]
+#![feature(exclusive_range_pattern)]
+#![feature(stmt_expr_attributes)]
+#![warn(clippy::almost_complete_letter_range)]
+#![allow(ellipsis_inclusive_range_patterns)]
+
+macro_rules! a {
+    () => {
+        'a'
+    };
+}
+
+fn main() {
+    #[rustfmt::skip]
+    {
+        let _ = ('a') ..='z';
+        let _ = 'A' ..= ('Z');
+    }
+
+    let _ = 'b'..'z';
+    let _ = 'B'..'Z';
+
+    let _ = (b'a')..=(b'z');
+    let _ = b'A'..=b'Z';
+
+    let _ = b'b'..b'z';
+    let _ = b'B'..b'Z';
+
+    let _ = a!()..='z';
+
+    let _ = match 0u8 {
+        b'a'..=b'z' if true => 1,
+        b'A'..=b'Z' if true => 2,
+        b'b'..b'z' => 3,
+        b'B'..b'Z' => 4,
+        _ => 5,
+    };
+
+    let _ = match 'x' {
+        'a'..='z' if true => 1,
+        'A'..='Z' if true => 2,
+        'b'..'z' => 3,
+        'B'..'Z' => 4,
+        _ => 5,
+    };
+}
+
+fn _under_msrv() {
+    #![clippy::msrv = "1.25"]
+    let _ = match 'a' {
+        'a'...'z' => 1,
+        _ => 2,
+    };
+}
+
+fn _meets_msrv() {
+    #![clippy::msrv = "1.26"]
+    let _ = 'a'..='z';
+    let _ = match 'a' {
+        'a'..='z' => 1,
+        _ => 2,
+    };
+}
diff --git a/src/tools/clippy/tests/ui/almost_complete_letter_range.rs b/src/tools/clippy/tests/ui/almost_complete_letter_range.rs
new file mode 100644
index 00000000000..3dc02199257
--- /dev/null
+++ b/src/tools/clippy/tests/ui/almost_complete_letter_range.rs
@@ -0,0 +1,66 @@
+// run-rustfix
+// edition:2018
+
+#![feature(custom_inner_attributes)]
+#![feature(exclusive_range_pattern)]
+#![feature(stmt_expr_attributes)]
+#![warn(clippy::almost_complete_letter_range)]
+#![allow(ellipsis_inclusive_range_patterns)]
+
+macro_rules! a {
+    () => {
+        'a'
+    };
+}
+
+fn main() {
+    #[rustfmt::skip]
+    {
+        let _ = ('a') ..'z';
+        let _ = 'A' .. ('Z');
+    }
+
+    let _ = 'b'..'z';
+    let _ = 'B'..'Z';
+
+    let _ = (b'a')..(b'z');
+    let _ = b'A'..b'Z';
+
+    let _ = b'b'..b'z';
+    let _ = b'B'..b'Z';
+
+    let _ = a!()..'z';
+
+    let _ = match 0u8 {
+        b'a'..b'z' if true => 1,
+        b'A'..b'Z' if true => 2,
+        b'b'..b'z' => 3,
+        b'B'..b'Z' => 4,
+        _ => 5,
+    };
+
+    let _ = match 'x' {
+        'a'..'z' if true => 1,
+        'A'..'Z' if true => 2,
+        'b'..'z' => 3,
+        'B'..'Z' => 4,
+        _ => 5,
+    };
+}
+
+fn _under_msrv() {
+    #![clippy::msrv = "1.25"]
+    let _ = match 'a' {
+        'a'..'z' => 1,
+        _ => 2,
+    };
+}
+
+fn _meets_msrv() {
+    #![clippy::msrv = "1.26"]
+    let _ = 'a'..'z';
+    let _ = match 'a' {
+        'a'..'z' => 1,
+        _ => 2,
+    };
+}
diff --git a/src/tools/clippy/tests/ui/almost_complete_letter_range.stderr b/src/tools/clippy/tests/ui/almost_complete_letter_range.stderr
new file mode 100644
index 00000000000..74980ec1a92
--- /dev/null
+++ b/src/tools/clippy/tests/ui/almost_complete_letter_range.stderr
@@ -0,0 +1,100 @@
+error: almost complete ascii letter range
+  --> $DIR/almost_complete_letter_range.rs:19:17
+   |
+LL |         let _ = ('a') ..'z';
+   |                 ^^^^^^--^^^
+   |                       |
+   |                       help: use an inclusive range: `..=`
+   |
+   = note: `-D clippy::almost-complete-letter-range` implied by `-D warnings`
+
+error: almost complete ascii letter range
+  --> $DIR/almost_complete_letter_range.rs:20:17
+   |
+LL |         let _ = 'A' .. ('Z');
+   |                 ^^^^--^^^^^^
+   |                     |
+   |                     help: use an inclusive range: `..=`
+
+error: almost complete ascii letter range
+  --> $DIR/almost_complete_letter_range.rs:26:13
+   |
+LL |     let _ = (b'a')..(b'z');
+   |             ^^^^^^--^^^^^^
+   |                   |
+   |                   help: use an inclusive range: `..=`
+
+error: almost complete ascii letter range
+  --> $DIR/almost_complete_letter_range.rs:27:13
+   |
+LL |     let _ = b'A'..b'Z';
+   |             ^^^^--^^^^
+   |                 |
+   |                 help: use an inclusive range: `..=`
+
+error: almost complete ascii letter range
+  --> $DIR/almost_complete_letter_range.rs:32:13
+   |
+LL |     let _ = a!()..'z';
+   |             ^^^^--^^^
+   |                 |
+   |                 help: use an inclusive range: `..=`
+
+error: almost complete ascii letter range
+  --> $DIR/almost_complete_letter_range.rs:35:9
+   |
+LL |         b'a'..b'z' if true => 1,
+   |         ^^^^--^^^^
+   |             |
+   |             help: use an inclusive range: `..=`
+
+error: almost complete ascii letter range
+  --> $DIR/almost_complete_letter_range.rs:36:9
+   |
+LL |         b'A'..b'Z' if true => 2,
+   |         ^^^^--^^^^
+   |             |
+   |             help: use an inclusive range: `..=`
+
+error: almost complete ascii letter range
+  --> $DIR/almost_complete_letter_range.rs:43:9
+   |
+LL |         'a'..'z' if true => 1,
+   |         ^^^--^^^
+   |            |
+   |            help: use an inclusive range: `..=`
+
+error: almost complete ascii letter range
+  --> $DIR/almost_complete_letter_range.rs:44:9
+   |
+LL |         'A'..'Z' if true => 2,
+   |         ^^^--^^^
+   |            |
+   |            help: use an inclusive range: `..=`
+
+error: almost complete ascii letter range
+  --> $DIR/almost_complete_letter_range.rs:54:9
+   |
+LL |         'a'..'z' => 1,
+   |         ^^^--^^^
+   |            |
+   |            help: use an inclusive range: `...`
+
+error: almost complete ascii letter range
+  --> $DIR/almost_complete_letter_range.rs:61:13
+   |
+LL |     let _ = 'a'..'z';
+   |             ^^^--^^^
+   |                |
+   |                help: use an inclusive range: `..=`
+
+error: almost complete ascii letter range
+  --> $DIR/almost_complete_letter_range.rs:63:9
+   |
+LL |         'a'..'z' => 1,
+   |         ^^^--^^^
+   |            |
+   |            help: use an inclusive range: `..=`
+
+error: aborting due to 12 previous errors
+
diff --git a/src/tools/clippy/tests/ui/as_underscore.fixed b/src/tools/clippy/tests/ui/as_underscore.fixed
new file mode 100644
index 00000000000..948f6d8e6b1
--- /dev/null
+++ b/src/tools/clippy/tests/ui/as_underscore.fixed
@@ -0,0 +1,13 @@
+// run-rustfix
+
+#![warn(clippy::as_underscore)]
+
+fn foo(_n: usize) {}
+
+fn main() {
+    let n: u16 = 256;
+    foo(n as usize);
+
+    let n = 0_u128;
+    let _n: u8 = n as u8;
+}
diff --git a/src/tools/clippy/tests/ui/as_underscore.rs b/src/tools/clippy/tests/ui/as_underscore.rs
new file mode 100644
index 00000000000..97785ed08a8
--- /dev/null
+++ b/src/tools/clippy/tests/ui/as_underscore.rs
@@ -0,0 +1,13 @@
+// run-rustfix
+
+#![warn(clippy::as_underscore)]
+
+fn foo(_n: usize) {}
+
+fn main() {
+    let n: u16 = 256;
+    foo(n as _);
+
+    let n = 0_u128;
+    let _n: u8 = n as _;
+}
diff --git a/src/tools/clippy/tests/ui/as_underscore.stderr b/src/tools/clippy/tests/ui/as_underscore.stderr
new file mode 100644
index 00000000000..d7cd58d965a
--- /dev/null
+++ b/src/tools/clippy/tests/ui/as_underscore.stderr
@@ -0,0 +1,20 @@
+error: using `as _` conversion
+  --> $DIR/as_underscore.rs:9:9
+   |
+LL |     foo(n as _);
+   |         ^^^^^-
+   |              |
+   |              help: consider giving the type explicitly: `usize`
+   |
+   = note: `-D clippy::as-underscore` implied by `-D warnings`
+
+error: using `as _` conversion
+  --> $DIR/as_underscore.rs:12:18
+   |
+LL |     let _n: u8 = n as _;
+   |                  ^^^^^-
+   |                       |
+   |                       help: consider giving the type explicitly: `u8`
+
+error: aborting due to 2 previous errors
+
diff --git a/src/tools/clippy/tests/ui/auxiliary/proc_macro_attr.rs b/src/tools/clippy/tests/ui/auxiliary/proc_macro_attr.rs
index e370a98df1a..ae2cc2492f4 100644
--- a/src/tools/clippy/tests/ui/auxiliary/proc_macro_attr.rs
+++ b/src/tools/clippy/tests/ui/auxiliary/proc_macro_attr.rs
@@ -20,6 +20,11 @@ use syn::{
 };
 
 #[proc_macro_attribute]
+pub fn dummy(_args: TokenStream, input: TokenStream) -> TokenStream {
+    input
+}
+
+#[proc_macro_attribute]
 pub fn fake_async_trait(_args: TokenStream, input: TokenStream) -> TokenStream {
     let mut item = parse_macro_input!(input as ItemTrait);
     for inner in &mut item.items {
diff --git a/src/tools/clippy/tests/ui/bind_instead_of_map_multipart.fixed b/src/tools/clippy/tests/ui/bind_instead_of_map_multipart.fixed
new file mode 100644
index 00000000000..e1589843226
--- /dev/null
+++ b/src/tools/clippy/tests/ui/bind_instead_of_map_multipart.fixed
@@ -0,0 +1,62 @@
+// run-rustfix
+#![deny(clippy::bind_instead_of_map)]
+#![allow(clippy::blocks_in_if_conditions)]
+
+pub fn main() {
+    let _ = Some("42").map(|s| if s.len() < 42 { 0 } else { s.len() });
+    let _ = Some("42").and_then(|s| if s.len() < 42 { None } else { Some(s.len()) });
+
+    let _ = Ok::<_, ()>("42").map(|s| if s.len() < 42 { 0 } else { s.len() });
+    let _ = Ok::<_, ()>("42").and_then(|s| if s.len() < 42 { Err(()) } else { Ok(s.len()) });
+
+    let _ = Err::<(), _>("42").map_err(|s| if s.len() < 42 { s.len() + 20 } else { s.len() });
+    let _ = Err::<(), _>("42").or_else(|s| if s.len() < 42 { Ok(()) } else { Err(s.len()) });
+
+    hard_example();
+    macro_example();
+}
+
+fn hard_example() {
+    Some("42").map(|s| {
+        if {
+            if s == "43" {
+                return 43;
+            }
+            s == "42"
+        } {
+            return 45;
+        }
+        match s.len() {
+            10 => 2,
+            20 => {
+                if foo() {
+                    return {
+                        if foo() {
+                            return 20;
+                        }
+                        println!("foo");
+                        3
+                    };
+                }
+                20
+            },
+            40 => 30,
+            _ => 1,
+        }
+    });
+}
+
+fn foo() -> bool {
+    true
+}
+
+macro_rules! m {
+    () => {
+        Some(10)
+    };
+}
+
+fn macro_example() {
+    let _ = Some("").and_then(|s| if s.len() == 20 { m!() } else { Some(20) });
+    let _ = Some("").map(|s| if s.len() == 20 { m!() } else { Some(20) });
+}
diff --git a/src/tools/clippy/tests/ui/bind_instead_of_map_multipart.rs b/src/tools/clippy/tests/ui/bind_instead_of_map_multipart.rs
index 91d9d11e3c1..49944403f6d 100644
--- a/src/tools/clippy/tests/ui/bind_instead_of_map_multipart.rs
+++ b/src/tools/clippy/tests/ui/bind_instead_of_map_multipart.rs
@@ -1,3 +1,4 @@
+// run-rustfix
 #![deny(clippy::bind_instead_of_map)]
 #![allow(clippy::blocks_in_if_conditions)]
 
diff --git a/src/tools/clippy/tests/ui/bind_instead_of_map_multipart.stderr b/src/tools/clippy/tests/ui/bind_instead_of_map_multipart.stderr
index e4f605a4de3..f822b6f49fa 100644
--- a/src/tools/clippy/tests/ui/bind_instead_of_map_multipart.stderr
+++ b/src/tools/clippy/tests/ui/bind_instead_of_map_multipart.stderr
@@ -1,11 +1,11 @@
 error: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
-  --> $DIR/bind_instead_of_map_multipart.rs:5:13
+  --> $DIR/bind_instead_of_map_multipart.rs:6:13
    |
 LL |     let _ = Some("42").and_then(|s| if s.len() < 42 { Some(0) } else { Some(s.len()) });
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: the lint level is defined here
-  --> $DIR/bind_instead_of_map_multipart.rs:1:9
+  --> $DIR/bind_instead_of_map_multipart.rs:2:9
    |
 LL | #![deny(clippy::bind_instead_of_map)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -15,7 +15,7 @@ LL |     let _ = Some("42").map(|s| if s.len() < 42 { 0 } else { s.len() });
    |                        ~~~                       ~          ~~~~~~~
 
 error: using `Result.and_then(|x| Ok(y))`, which is more succinctly expressed as `map(|x| y)`
-  --> $DIR/bind_instead_of_map_multipart.rs:8:13
+  --> $DIR/bind_instead_of_map_multipart.rs:9:13
    |
 LL |     let _ = Ok::<_, ()>("42").and_then(|s| if s.len() < 42 { Ok(0) } else { Ok(s.len()) });
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -26,7 +26,7 @@ LL |     let _ = Ok::<_, ()>("42").map(|s| if s.len() < 42 { 0 } else { s.len()
    |                               ~~~                       ~          ~~~~~~~
 
 error: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)`
-  --> $DIR/bind_instead_of_map_multipart.rs:11:13
+  --> $DIR/bind_instead_of_map_multipart.rs:12:13
    |
 LL |     let _ = Err::<(), _>("42").or_else(|s| if s.len() < 42 { Err(s.len() + 20) } else { Err(s.len()) });
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -37,7 +37,7 @@ LL |     let _ = Err::<(), _>("42").map_err(|s| if s.len() < 42 { s.len() + 20 }
    |                                ~~~~~~~                       ~~~~~~~~~~~~          ~~~~~~~
 
 error: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
-  --> $DIR/bind_instead_of_map_multipart.rs:19:5
+  --> $DIR/bind_instead_of_map_multipart.rs:20:5
    |
 LL | /     Some("42").and_then(|s| {
 LL | |         if {
@@ -59,7 +59,7 @@ LL |             s == "42"
  ...
 
 error: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
-  --> $DIR/bind_instead_of_map_multipart.rs:60:13
+  --> $DIR/bind_instead_of_map_multipart.rs:61:13
    |
 LL |     let _ = Some("").and_then(|s| if s.len() == 20 { Some(m!()) } else { Some(Some(20)) });
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/clippy/tests/ui/borrow_deref_ref.fixed b/src/tools/clippy/tests/ui/borrow_deref_ref.fixed
new file mode 100644
index 00000000000..bf4691c5bc9
--- /dev/null
+++ b/src/tools/clippy/tests/ui/borrow_deref_ref.fixed
@@ -0,0 +1,59 @@
+// run-rustfix
+
+#![allow(dead_code, unused_variables)]
+
+fn main() {}
+
+mod should_lint {
+    fn one_help() {
+        let a = &12;
+        let b = a;
+
+        let b = &mut bar(&12);
+    }
+
+    fn bar(x: &u32) -> &u32 {
+        x
+    }
+}
+
+// this mod explains why we should not lint `&mut &* (&T)`
+mod should_not_lint1 {
+    fn foo(x: &mut &u32) {
+        *x = &1;
+    }
+
+    fn main() {
+        let mut x = &0;
+        foo(&mut &*x); // should not lint
+        assert_eq!(*x, 0);
+
+        foo(&mut x);
+        assert_eq!(*x, 1);
+    }
+}
+
+// similar to should_not_lint1
+mod should_not_lint2 {
+    struct S<'a> {
+        a: &'a u32,
+        b: u32,
+    }
+
+    fn main() {
+        let s = S { a: &1, b: 1 };
+        let x = &mut &*s.a;
+        *x = &2;
+    }
+}
+
+// this mod explains why we should not lint `& &* (&T)`
+mod false_negative {
+    fn foo() {
+        let x = &12;
+        let addr_x = &x as *const _ as usize;
+        let addr_y = &x as *const _ as usize; // assert ok
+        // let addr_y = &x as *const _ as usize; // assert fail
+        assert_ne!(addr_x, addr_y);
+    }
+}
diff --git a/src/tools/clippy/tests/ui/borrow_deref_ref.rs b/src/tools/clippy/tests/ui/borrow_deref_ref.rs
new file mode 100644
index 00000000000..28c005fdbef
--- /dev/null
+++ b/src/tools/clippy/tests/ui/borrow_deref_ref.rs
@@ -0,0 +1,59 @@
+// run-rustfix
+
+#![allow(dead_code, unused_variables)]
+
+fn main() {}
+
+mod should_lint {
+    fn one_help() {
+        let a = &12;
+        let b = &*a;
+
+        let b = &mut &*bar(&12);
+    }
+
+    fn bar(x: &u32) -> &u32 {
+        x
+    }
+}
+
+// this mod explains why we should not lint `&mut &* (&T)`
+mod should_not_lint1 {
+    fn foo(x: &mut &u32) {
+        *x = &1;
+    }
+
+    fn main() {
+        let mut x = &0;
+        foo(&mut &*x); // should not lint
+        assert_eq!(*x, 0);
+
+        foo(&mut x);
+        assert_eq!(*x, 1);
+    }
+}
+
+// similar to should_not_lint1
+mod should_not_lint2 {
+    struct S<'a> {
+        a: &'a u32,
+        b: u32,
+    }
+
+    fn main() {
+        let s = S { a: &1, b: 1 };
+        let x = &mut &*s.a;
+        *x = &2;
+    }
+}
+
+// this mod explains why we should not lint `& &* (&T)`
+mod false_negative {
+    fn foo() {
+        let x = &12;
+        let addr_x = &x as *const _ as usize;
+        let addr_y = &&*x as *const _ as usize; // assert ok
+        // let addr_y = &x as *const _ as usize; // assert fail
+        assert_ne!(addr_x, addr_y);
+    }
+}
diff --git a/src/tools/clippy/tests/ui/borrow_deref_ref.stderr b/src/tools/clippy/tests/ui/borrow_deref_ref.stderr
new file mode 100644
index 00000000000..d72de37c69f
--- /dev/null
+++ b/src/tools/clippy/tests/ui/borrow_deref_ref.stderr
@@ -0,0 +1,22 @@
+error: deref on an immutable reference
+  --> $DIR/borrow_deref_ref.rs:10:17
+   |
+LL |         let b = &*a;
+   |                 ^^^ help: if you would like to reborrow, try removing `&*`: `a`
+   |
+   = note: `-D clippy::borrow-deref-ref` implied by `-D warnings`
+
+error: deref on an immutable reference
+  --> $DIR/borrow_deref_ref.rs:12:22
+   |
+LL |         let b = &mut &*bar(&12);
+   |                      ^^^^^^^^^^ help: if you would like to reborrow, try removing `&*`: `bar(&12)`
+
+error: deref on an immutable reference
+  --> $DIR/borrow_deref_ref.rs:55:23
+   |
+LL |         let addr_y = &&*x as *const _ as usize; // assert ok
+   |                       ^^^ help: if you would like to reborrow, try removing `&*`: `x`
+
+error: aborting due to 3 previous errors
+
diff --git a/src/tools/clippy/tests/ui/borrow_deref_ref_unfixable.rs b/src/tools/clippy/tests/ui/borrow_deref_ref_unfixable.rs
new file mode 100644
index 00000000000..a8e2bbfef0f
--- /dev/null
+++ b/src/tools/clippy/tests/ui/borrow_deref_ref_unfixable.rs
@@ -0,0 +1,10 @@
+#![allow(dead_code, unused_variables)]
+
+fn main() {}
+
+mod should_lint {
+    fn two_helps() {
+        let s = &String::new();
+        let x: &str = &*s;
+    }
+}
diff --git a/src/tools/clippy/tests/ui/borrow_deref_ref_unfixable.stderr b/src/tools/clippy/tests/ui/borrow_deref_ref_unfixable.stderr
new file mode 100644
index 00000000000..738b01e7ec1
--- /dev/null
+++ b/src/tools/clippy/tests/ui/borrow_deref_ref_unfixable.stderr
@@ -0,0 +1,18 @@
+error: deref on an immutable reference
+  --> $DIR/borrow_deref_ref_unfixable.rs:8:23
+   |
+LL |         let x: &str = &*s;
+   |                       ^^^
+   |
+   = note: `-D clippy::borrow-deref-ref` implied by `-D warnings`
+help: if you would like to reborrow, try removing `&*`
+   |
+LL |         let x: &str = s;
+   |                       ~
+help: if you would like to deref, try using `&**`
+   |
+LL |         let x: &str = &**s;
+   |                       ~~~~
+
+error: aborting due to previous error
+
diff --git a/src/tools/clippy/tests/ui/cast_abs_to_unsigned.fixed b/src/tools/clippy/tests/ui/cast_abs_to_unsigned.fixed
index 4ec2465be06..a68b32b097e 100644
--- a/src/tools/clippy/tests/ui/cast_abs_to_unsigned.fixed
+++ b/src/tools/clippy/tests/ui/cast_abs_to_unsigned.fixed
@@ -5,4 +5,25 @@ fn main() {
     let x: i32 = -42;
     let y: u32 = x.unsigned_abs();
     println!("The absolute value of {} is {}", x, y);
+
+    let a: i32 = -3;
+    let _: usize = a.unsigned_abs() as usize;
+    let _: usize = a.unsigned_abs() as _;
+    let _ = a.unsigned_abs() as usize;
+
+    let a: i64 = -3;
+    let _ = a.unsigned_abs() as usize;
+    let _ = a.unsigned_abs() as u8;
+    let _ = a.unsigned_abs() as u16;
+    let _ = a.unsigned_abs() as u32;
+    let _ = a.unsigned_abs();
+    let _ = a.unsigned_abs() as u128;
+
+    let a: isize = -3;
+    let _ = a.unsigned_abs();
+    let _ = a.unsigned_abs() as u8;
+    let _ = a.unsigned_abs() as u16;
+    let _ = a.unsigned_abs() as u32;
+    let _ = a.unsigned_abs() as u64;
+    let _ = a.unsigned_abs() as u128;
 }
diff --git a/src/tools/clippy/tests/ui/cast_abs_to_unsigned.rs b/src/tools/clippy/tests/ui/cast_abs_to_unsigned.rs
index 59b9c8c3678..110fbc6c2df 100644
--- a/src/tools/clippy/tests/ui/cast_abs_to_unsigned.rs
+++ b/src/tools/clippy/tests/ui/cast_abs_to_unsigned.rs
@@ -5,4 +5,25 @@ fn main() {
     let x: i32 = -42;
     let y: u32 = x.abs() as u32;
     println!("The absolute value of {} is {}", x, y);
+
+    let a: i32 = -3;
+    let _: usize = a.abs() as usize;
+    let _: usize = a.abs() as _;
+    let _ = a.abs() as usize;
+
+    let a: i64 = -3;
+    let _ = a.abs() as usize;
+    let _ = a.abs() as u8;
+    let _ = a.abs() as u16;
+    let _ = a.abs() as u32;
+    let _ = a.abs() as u64;
+    let _ = a.abs() as u128;
+
+    let a: isize = -3;
+    let _ = a.abs() as usize;
+    let _ = a.abs() as u8;
+    let _ = a.abs() as u16;
+    let _ = a.abs() as u32;
+    let _ = a.abs() as u64;
+    let _ = a.abs() as u128;
 }
diff --git a/src/tools/clippy/tests/ui/cast_abs_to_unsigned.stderr b/src/tools/clippy/tests/ui/cast_abs_to_unsigned.stderr
index eb12857357a..02c24e10659 100644
--- a/src/tools/clippy/tests/ui/cast_abs_to_unsigned.stderr
+++ b/src/tools/clippy/tests/ui/cast_abs_to_unsigned.stderr
@@ -6,5 +6,95 @@ LL |     let y: u32 = x.abs() as u32;
    |
    = note: `-D clippy::cast-abs-to-unsigned` implied by `-D warnings`
 
-error: aborting due to previous error
+error: casting the result of `i32::abs()` to usize
+  --> $DIR/cast_abs_to_unsigned.rs:10:20
+   |
+LL |     let _: usize = a.abs() as usize;
+   |                    ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `i32::abs()` to usize
+  --> $DIR/cast_abs_to_unsigned.rs:11:20
+   |
+LL |     let _: usize = a.abs() as _;
+   |                    ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `i32::abs()` to usize
+  --> $DIR/cast_abs_to_unsigned.rs:12:13
+   |
+LL |     let _ = a.abs() as usize;
+   |             ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `i64::abs()` to usize
+  --> $DIR/cast_abs_to_unsigned.rs:15:13
+   |
+LL |     let _ = a.abs() as usize;
+   |             ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `i64::abs()` to u8
+  --> $DIR/cast_abs_to_unsigned.rs:16:13
+   |
+LL |     let _ = a.abs() as u8;
+   |             ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `i64::abs()` to u16
+  --> $DIR/cast_abs_to_unsigned.rs:17:13
+   |
+LL |     let _ = a.abs() as u16;
+   |             ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `i64::abs()` to u32
+  --> $DIR/cast_abs_to_unsigned.rs:18:13
+   |
+LL |     let _ = a.abs() as u32;
+   |             ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `i64::abs()` to u64
+  --> $DIR/cast_abs_to_unsigned.rs:19:13
+   |
+LL |     let _ = a.abs() as u64;
+   |             ^^^^^^^^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `i64::abs()` to u128
+  --> $DIR/cast_abs_to_unsigned.rs:20:13
+   |
+LL |     let _ = a.abs() as u128;
+   |             ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `isize::abs()` to usize
+  --> $DIR/cast_abs_to_unsigned.rs:23:13
+   |
+LL |     let _ = a.abs() as usize;
+   |             ^^^^^^^^^^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `isize::abs()` to u8
+  --> $DIR/cast_abs_to_unsigned.rs:24:13
+   |
+LL |     let _ = a.abs() as u8;
+   |             ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `isize::abs()` to u16
+  --> $DIR/cast_abs_to_unsigned.rs:25:13
+   |
+LL |     let _ = a.abs() as u16;
+   |             ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `isize::abs()` to u32
+  --> $DIR/cast_abs_to_unsigned.rs:26:13
+   |
+LL |     let _ = a.abs() as u32;
+   |             ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `isize::abs()` to u64
+  --> $DIR/cast_abs_to_unsigned.rs:27:13
+   |
+LL |     let _ = a.abs() as u64;
+   |             ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `isize::abs()` to u128
+  --> $DIR/cast_abs_to_unsigned.rs:28:13
+   |
+LL |     let _ = a.abs() as u128;
+   |             ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: aborting due to 16 previous errors
 
diff --git a/src/tools/clippy/tests/ui/collapsible_match2.rs b/src/tools/clippy/tests/ui/collapsible_match2.rs
index 542e6948427..c8fb0a39e95 100644
--- a/src/tools/clippy/tests/ui/collapsible_match2.rs
+++ b/src/tools/clippy/tests/ui/collapsible_match2.rs
@@ -57,7 +57,7 @@ fn lint_cases(opt_opt: Option<Option<u32>>, res_opt: Result<Option<u32>, String>
 
     // ref pattern and deref
     match Some(&[1]) {
-        Some(ref s) => match &*s {
+        Some(ref s) => match s {
             [n] => foo(n),
             _ => (),
         },
diff --git a/src/tools/clippy/tests/ui/collapsible_match2.stderr b/src/tools/clippy/tests/ui/collapsible_match2.stderr
index 46b645aea13..fe64e469379 100644
--- a/src/tools/clippy/tests/ui/collapsible_match2.stderr
+++ b/src/tools/clippy/tests/ui/collapsible_match2.stderr
@@ -78,7 +78,7 @@ LL |             [n] => foo(n),
 error: this `match` can be collapsed into the outer `match`
   --> $DIR/collapsible_match2.rs:60:24
    |
-LL |           Some(ref s) => match &*s {
+LL |           Some(ref s) => match s {
    |  ________________________^
 LL | |             [n] => foo(n),
 LL | |             _ => (),
@@ -88,7 +88,7 @@ LL | |         },
 help: the outer pattern can be modified to include the inner pattern
   --> $DIR/collapsible_match2.rs:60:14
    |
-LL |         Some(ref s) => match &*s {
+LL |         Some(ref s) => match s {
    |              ^^^^^ replace this binding
 LL |             [n] => foo(n),
    |             ^^^ with this pattern
diff --git a/src/tools/clippy/tests/ui/crashes/ice-6256.stderr b/src/tools/clippy/tests/ui/crashes/ice-6256.stderr
index ae4e6cad332..9cfcccf1e3c 100644
--- a/src/tools/clippy/tests/ui/crashes/ice-6256.stderr
+++ b/src/tools/clippy/tests/ui/crashes/ice-6256.stderr
@@ -1,18 +1,14 @@
-error[E0308]: mismatched types
-  --> $DIR/ice-6256.rs:13:28
+error[E0521]: borrowed data escapes outside of closure
+  --> $DIR/ice-6256.rs:13:26
    |
 LL |     let f = |x: &dyn TT| x.func(); //[default]~ ERROR: mismatched types
-   |                            ^^^^ lifetime mismatch
-   |
-   = note: expected reference `&(dyn TT + 'static)`
-              found reference `&dyn TT`
-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
-   |             ^^^^^^^^^^^^^^^^^^^^^
-   = note: ...does not necessarily outlive the static lifetime
+   |              -  -        ^^^^^^^^
+   |              |  |        |
+   |              |  |        `x` escapes the closure body here
+   |              |  |        argument requires that `'1` must outlive `'static`
+   |              |  let's call the lifetime of this reference `'1`
+   |              `x` is a reference that is only valid in the closure body
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0308`.
+For more information about this error, try `rustc --explain E0521`.
diff --git a/src/tools/clippy/tests/ui/crashes/ice-8850.rs b/src/tools/clippy/tests/ui/crashes/ice-8850.rs
new file mode 100644
index 00000000000..f2747ab2239
--- /dev/null
+++ b/src/tools/clippy/tests/ui/crashes/ice-8850.rs
@@ -0,0 +1,27 @@
+fn fn_pointer_static() -> usize {
+    static FN: fn() -> usize = || 1;
+    let res = FN() + 1;
+    res
+}
+
+fn fn_pointer_const() -> usize {
+    const FN: fn() -> usize = || 1;
+    let res = FN() + 1;
+    res
+}
+
+fn deref_to_dyn_fn() -> usize {
+    struct Derefs;
+    impl std::ops::Deref for Derefs {
+        type Target = dyn Fn() -> usize;
+
+        fn deref(&self) -> &Self::Target {
+            &|| 2
+        }
+    }
+    static FN: Derefs = Derefs;
+    let res = FN() + 1;
+    res
+}
+
+fn main() {}
diff --git a/src/tools/clippy/tests/ui/crashes/ice-8850.stderr b/src/tools/clippy/tests/ui/crashes/ice-8850.stderr
new file mode 100644
index 00000000000..620fd1edaf7
--- /dev/null
+++ b/src/tools/clippy/tests/ui/crashes/ice-8850.stderr
@@ -0,0 +1,45 @@
+error: returning the result of a `let` binding from a block
+  --> $DIR/ice-8850.rs:4:5
+   |
+LL |     let res = FN() + 1;
+   |     ------------------- unnecessary `let` binding
+LL |     res
+   |     ^^^
+   |
+   = note: `-D clippy::let-and-return` implied by `-D warnings`
+help: return the expression directly
+   |
+LL ~     
+LL ~     FN() + 1
+   |
+
+error: returning the result of a `let` binding from a block
+  --> $DIR/ice-8850.rs:10:5
+   |
+LL |     let res = FN() + 1;
+   |     ------------------- unnecessary `let` binding
+LL |     res
+   |     ^^^
+   |
+help: return the expression directly
+   |
+LL ~     
+LL ~     FN() + 1
+   |
+
+error: returning the result of a `let` binding from a block
+  --> $DIR/ice-8850.rs:24:5
+   |
+LL |     let res = FN() + 1;
+   |     ------------------- unnecessary `let` binding
+LL |     res
+   |     ^^^
+   |
+help: return the expression directly
+   |
+LL ~     
+LL ~     FN() + 1
+   |
+
+error: aborting due to 3 previous errors
+
diff --git a/src/tools/clippy/tests/ui/dbg_macro.stderr b/src/tools/clippy/tests/ui/dbg_macro.stderr
index a3e7a7162e5..e6a65b46d97 100644
--- a/src/tools/clippy/tests/ui/dbg_macro.stderr
+++ b/src/tools/clippy/tests/ui/dbg_macro.stderr
@@ -109,5 +109,38 @@ help: ensure to avoid having uses of it in version control
 LL |         2;
    |         ~
 
-error: aborting due to 10 previous errors
+error: `dbg!` macro is intended as a debugging tool
+  --> $DIR/dbg_macro.rs:47:5
+   |
+LL |     dbg!(1);
+   |     ^^^^^^^
+   |
+help: ensure to avoid having uses of it in version control
+   |
+LL |     1;
+   |     ~
+
+error: `dbg!` macro is intended as a debugging tool
+  --> $DIR/dbg_macro.rs:52:5
+   |
+LL |     dbg!(1);
+   |     ^^^^^^^
+   |
+help: ensure to avoid having uses of it in version control
+   |
+LL |     1;
+   |     ~
+
+error: `dbg!` macro is intended as a debugging tool
+  --> $DIR/dbg_macro.rs:58:9
+   |
+LL |         dbg!(1);
+   |         ^^^^^^^
+   |
+help: ensure to avoid having uses of it in version control
+   |
+LL |         1;
+   |         ~
+
+error: aborting due to 13 previous errors
 
diff --git a/src/tools/clippy/tests/ui/debug_assert_with_mut_call.rs b/src/tools/clippy/tests/ui/debug_assert_with_mut_call.rs
index c5de4125565..46faa0a7b91 100644
--- a/src/tools/clippy/tests/ui/debug_assert_with_mut_call.rs
+++ b/src/tools/clippy/tests/ui/debug_assert_with_mut_call.rs
@@ -1,7 +1,7 @@
 #![feature(custom_inner_attributes)]
 #![rustfmt::skip]
 #![warn(clippy::debug_assert_with_mut_call)]
-#![allow(clippy::redundant_closure_call)]
+#![allow(clippy::redundant_closure_call, clippy::get_first)]
 
 
 struct S;
diff --git a/src/tools/clippy/tests/ui/deref_by_slicing.fixed b/src/tools/clippy/tests/ui/deref_by_slicing.fixed
index b26276218b7..257393e56ff 100644
--- a/src/tools/clippy/tests/ui/deref_by_slicing.fixed
+++ b/src/tools/clippy/tests/ui/deref_by_slicing.fixed
@@ -1,6 +1,7 @@
 // run-rustfix
 
 #![warn(clippy::deref_by_slicing)]
+#![allow(clippy::borrow_deref_ref)]
 
 use std::io::Read;
 
diff --git a/src/tools/clippy/tests/ui/deref_by_slicing.rs b/src/tools/clippy/tests/ui/deref_by_slicing.rs
index 6aa1408ba17..e288046f927 100644
--- a/src/tools/clippy/tests/ui/deref_by_slicing.rs
+++ b/src/tools/clippy/tests/ui/deref_by_slicing.rs
@@ -1,6 +1,7 @@
 // run-rustfix
 
 #![warn(clippy::deref_by_slicing)]
+#![allow(clippy::borrow_deref_ref)]
 
 use std::io::Read;
 
diff --git a/src/tools/clippy/tests/ui/deref_by_slicing.stderr b/src/tools/clippy/tests/ui/deref_by_slicing.stderr
index ffd76de378d..8f042ef47eb 100644
--- a/src/tools/clippy/tests/ui/deref_by_slicing.stderr
+++ b/src/tools/clippy/tests/ui/deref_by_slicing.stderr
@@ -1,5 +1,5 @@
 error: slicing when dereferencing would work
-  --> $DIR/deref_by_slicing.rs:9:13
+  --> $DIR/deref_by_slicing.rs:10:13
    |
 LL |     let _ = &vec[..];
    |             ^^^^^^^^ help: dereference the original value instead: `&*vec`
@@ -7,49 +7,49 @@ LL |     let _ = &vec[..];
    = note: `-D clippy::deref-by-slicing` implied by `-D warnings`
 
 error: slicing when dereferencing would work
-  --> $DIR/deref_by_slicing.rs:10:13
+  --> $DIR/deref_by_slicing.rs:11:13
    |
 LL |     let _ = &mut vec[..];
    |             ^^^^^^^^^^^^ help: dereference the original value instead: `&mut *vec`
 
 error: slicing when dereferencing would work
-  --> $DIR/deref_by_slicing.rs:13:13
+  --> $DIR/deref_by_slicing.rs:14:13
    |
 LL |     let _ = &ref_vec[..];
    |             ^^^^^^^^^^^^ help: dereference the original value instead: `&**ref_vec`
 
 error: slicing when dereferencing would work
-  --> $DIR/deref_by_slicing.rs:14:21
+  --> $DIR/deref_by_slicing.rs:15:21
    |
 LL |     let mut_slice = &mut ref_vec[..];
    |                     ^^^^^^^^^^^^^^^^ help: dereference the original value instead: `&mut **ref_vec`
 
 error: slicing when dereferencing would work
-  --> $DIR/deref_by_slicing.rs:15:13
+  --> $DIR/deref_by_slicing.rs:16:13
    |
 LL |     let _ = &mut mut_slice[..]; // Err, re-borrows slice
    |             ^^^^^^^^^^^^^^^^^^ help: reborrow the original value instead: `&mut *mut_slice`
 
 error: slicing when dereferencing would work
-  --> $DIR/deref_by_slicing.rs:18:13
+  --> $DIR/deref_by_slicing.rs:19:13
    |
 LL |     let _ = &s[..];
    |             ^^^^^^ help: dereference the original value instead: `&*s`
 
 error: slicing when dereferencing would work
-  --> $DIR/deref_by_slicing.rs:21:18
+  --> $DIR/deref_by_slicing.rs:22:18
    |
 LL |     let _ = &mut &S[..]; // Err, re-borrows slice
    |                  ^^^^^^ help: reborrow the original value instead: `&*S`
 
 error: slicing when dereferencing would work
-  --> $DIR/deref_by_slicing.rs:25:13
+  --> $DIR/deref_by_slicing.rs:26:13
    |
 LL |     let _ = &slice_ref[..]; // Err, derefs slice
    |             ^^^^^^^^^^^^^^ help: dereference the original value instead: `*slice_ref`
 
 error: slicing when dereferencing would work
-  --> $DIR/deref_by_slicing.rs:28:13
+  --> $DIR/deref_by_slicing.rs:29:13
    |
 LL |     let _ = (&bytes[..]).read_to_end(&mut vec![]).unwrap(); // Err, re-borrows slice
    |             ^^^^^^^^^^^^ help: reborrow the original value instead: `(&*bytes)`
diff --git a/src/tools/clippy/tests/ui/derive_partial_eq_without_eq.fixed b/src/tools/clippy/tests/ui/derive_partial_eq_without_eq.fixed
index 7d4d1b3b649..012780258fc 100644
--- a/src/tools/clippy/tests/ui/derive_partial_eq_without_eq.fixed
+++ b/src/tools/clippy/tests/ui/derive_partial_eq_without_eq.fixed
@@ -95,4 +95,10 @@ enum EnumNotEq {
 #[derive(Debug, PartialEq, Eq, Clone)]
 struct RustFixWithOtherDerives;
 
+#[derive(PartialEq)]
+struct Generic<T>(T);
+
+#[derive(PartialEq, Eq)]
+struct GenericPhantom<T>(core::marker::PhantomData<T>);
+
 fn main() {}
diff --git a/src/tools/clippy/tests/ui/derive_partial_eq_without_eq.rs b/src/tools/clippy/tests/ui/derive_partial_eq_without_eq.rs
index ab4e1df1ca4..fc8285b0c6b 100644
--- a/src/tools/clippy/tests/ui/derive_partial_eq_without_eq.rs
+++ b/src/tools/clippy/tests/ui/derive_partial_eq_without_eq.rs
@@ -95,4 +95,10 @@ enum EnumNotEq {
 #[derive(Debug, PartialEq, Clone)]
 struct RustFixWithOtherDerives;
 
+#[derive(PartialEq)]
+struct Generic<T>(T);
+
+#[derive(PartialEq, Eq)]
+struct GenericPhantom<T>(core::marker::PhantomData<T>);
+
 fn main() {}
diff --git a/src/tools/clippy/tests/ui/doc_link_with_quotes.rs b/src/tools/clippy/tests/ui/doc_link_with_quotes.rs
new file mode 100644
index 00000000000..ab52fb1a4a6
--- /dev/null
+++ b/src/tools/clippy/tests/ui/doc_link_with_quotes.rs
@@ -0,0 +1,12 @@
+#![warn(clippy::doc_link_with_quotes)]
+
+fn main() {
+    foo()
+}
+
+/// Calls ['bar']
+pub fn foo() {
+    bar()
+}
+
+pub fn bar() {}
diff --git a/src/tools/clippy/tests/ui/doc_link_with_quotes.stderr b/src/tools/clippy/tests/ui/doc_link_with_quotes.stderr
new file mode 100644
index 00000000000..bf6d57d8afe
--- /dev/null
+++ b/src/tools/clippy/tests/ui/doc_link_with_quotes.stderr
@@ -0,0 +1,10 @@
+error: possible intra-doc link using quotes instead of backticks
+  --> $DIR/doc_link_with_quotes.rs:7:1
+   |
+LL | /// Calls ['bar']
+   | ^^^^^^^^^^^^^^^^^
+   |
+   = note: `-D clippy::doc-link-with-quotes` implied by `-D warnings`
+
+error: aborting due to previous error
+
diff --git a/src/tools/clippy/tests/ui/empty_line_after_outer_attribute.rs b/src/tools/clippy/tests/ui/empty_line_after_outer_attribute.rs
index 3e92bca986a..697412c0027 100644
--- a/src/tools/clippy/tests/ui/empty_line_after_outer_attribute.rs
+++ b/src/tools/clippy/tests/ui/empty_line_after_outer_attribute.rs
@@ -110,4 +110,11 @@ pub trait Bazz {
     }
 }
 
+#[derive(Clone, Copy)]
+#[dummy(string = "first line
+
+second line
+")]
+pub struct Args;
+
 fn main() {}
diff --git a/src/tools/clippy/tests/ui/explicit_deref_methods.fixed b/src/tools/clippy/tests/ui/explicit_deref_methods.fixed
index 3de2a51ffa5..92f27e68549 100644
--- a/src/tools/clippy/tests/ui/explicit_deref_methods.fixed
+++ b/src/tools/clippy/tests/ui/explicit_deref_methods.fixed
@@ -1,6 +1,11 @@
 // run-rustfix
 
-#![allow(unused_variables, clippy::clone_double_ref, clippy::needless_borrow)]
+#![allow(
+    unused_variables,
+    clippy::clone_double_ref,
+    clippy::needless_borrow,
+    clippy::borrow_deref_ref
+)]
 #![warn(clippy::explicit_deref_methods)]
 
 use std::ops::{Deref, DerefMut};
diff --git a/src/tools/clippy/tests/ui/explicit_deref_methods.rs b/src/tools/clippy/tests/ui/explicit_deref_methods.rs
index a08d7596422..d118607f992 100644
--- a/src/tools/clippy/tests/ui/explicit_deref_methods.rs
+++ b/src/tools/clippy/tests/ui/explicit_deref_methods.rs
@@ -1,6 +1,11 @@
 // run-rustfix
 
-#![allow(unused_variables, clippy::clone_double_ref, clippy::needless_borrow)]
+#![allow(
+    unused_variables,
+    clippy::clone_double_ref,
+    clippy::needless_borrow,
+    clippy::borrow_deref_ref
+)]
 #![warn(clippy::explicit_deref_methods)]
 
 use std::ops::{Deref, DerefMut};
diff --git a/src/tools/clippy/tests/ui/explicit_deref_methods.stderr b/src/tools/clippy/tests/ui/explicit_deref_methods.stderr
index 8035d77d18d..8e8b358972b 100644
--- a/src/tools/clippy/tests/ui/explicit_deref_methods.stderr
+++ b/src/tools/clippy/tests/ui/explicit_deref_methods.stderr
@@ -1,5 +1,5 @@
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:30:19
+  --> $DIR/explicit_deref_methods.rs:35:19
    |
 LL |     let b: &str = a.deref();
    |                   ^^^^^^^^^ help: try this: `&*a`
@@ -7,67 +7,67 @@ LL |     let b: &str = a.deref();
    = note: `-D clippy::explicit-deref-methods` implied by `-D warnings`
 
 error: explicit `deref_mut` method call
-  --> $DIR/explicit_deref_methods.rs:32:23
+  --> $DIR/explicit_deref_methods.rs:37:23
    |
 LL |     let b: &mut str = a.deref_mut();
    |                       ^^^^^^^^^^^^^ help: try this: `&mut **a`
 
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:35:39
+  --> $DIR/explicit_deref_methods.rs:40:39
    |
 LL |     let b: String = format!("{}, {}", a.deref(), a.deref());
    |                                       ^^^^^^^^^ help: try this: `&*a`
 
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:35:50
+  --> $DIR/explicit_deref_methods.rs:40:50
    |
 LL |     let b: String = format!("{}, {}", a.deref(), a.deref());
    |                                                  ^^^^^^^^^ help: try this: `&*a`
 
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:37:20
+  --> $DIR/explicit_deref_methods.rs:42:20
    |
 LL |     println!("{}", a.deref());
    |                    ^^^^^^^^^ help: try this: `&*a`
 
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:40:11
+  --> $DIR/explicit_deref_methods.rs:45:11
    |
 LL |     match a.deref() {
    |           ^^^^^^^^^ help: try this: `&*a`
 
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:44:28
+  --> $DIR/explicit_deref_methods.rs:49:28
    |
 LL |     let b: String = concat(a.deref());
    |                            ^^^^^^^^^ help: try this: `&*a`
 
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:46:13
+  --> $DIR/explicit_deref_methods.rs:51:13
    |
 LL |     let b = just_return(a).deref();
    |             ^^^^^^^^^^^^^^^^^^^^^^ help: try this: `just_return(a)`
 
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:48:28
+  --> $DIR/explicit_deref_methods.rs:53:28
    |
 LL |     let b: String = concat(just_return(a).deref());
    |                            ^^^^^^^^^^^^^^^^^^^^^^ help: try this: `just_return(a)`
 
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:50:19
+  --> $DIR/explicit_deref_methods.rs:55:19
    |
 LL |     let b: &str = a.deref().deref();
    |                   ^^^^^^^^^^^^^^^^^ help: try this: `&**a`
 
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:53:13
+  --> $DIR/explicit_deref_methods.rs:58:13
    |
 LL |     let b = opt_a.unwrap().deref();
    |             ^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&*opt_a.unwrap()`
 
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:79:31
+  --> $DIR/explicit_deref_methods.rs:84:31
    |
 LL |     let b: &str = expr_deref!(a.deref());
    |                               ^^^^^^^^^ help: try this: `&*a`
diff --git a/src/tools/clippy/tests/ui/forget_ref.rs b/src/tools/clippy/tests/ui/forget_ref.rs
index 6c8c4c9c0ed..031b415f56f 100644
--- a/src/tools/clippy/tests/ui/forget_ref.rs
+++ b/src/tools/clippy/tests/ui/forget_ref.rs
@@ -1,6 +1,7 @@
 #![warn(clippy::forget_ref)]
 #![allow(clippy::toplevel_ref_arg)]
 #![allow(clippy::unnecessary_wraps, clippy::forget_non_drop)]
+#![allow(clippy::borrow_deref_ref)]
 
 use std::mem::forget;
 
diff --git a/src/tools/clippy/tests/ui/forget_ref.stderr b/src/tools/clippy/tests/ui/forget_ref.stderr
index 73409388ed1..df5cd8cacdb 100644
--- a/src/tools/clippy/tests/ui/forget_ref.stderr
+++ b/src/tools/clippy/tests/ui/forget_ref.stderr
@@ -1,108 +1,108 @@
 error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing
-  --> $DIR/forget_ref.rs:10:5
+  --> $DIR/forget_ref.rs:11:5
    |
 LL |     forget(&SomeStruct);
    |     ^^^^^^^^^^^^^^^^^^^
    |
    = note: `-D clippy::forget-ref` implied by `-D warnings`
 note: argument has type `&SomeStruct`
-  --> $DIR/forget_ref.rs:10:12
+  --> $DIR/forget_ref.rs:11:12
    |
 LL |     forget(&SomeStruct);
    |            ^^^^^^^^^^^
 
 error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing
-  --> $DIR/forget_ref.rs:13:5
+  --> $DIR/forget_ref.rs:14:5
    |
 LL |     forget(&owned);
    |     ^^^^^^^^^^^^^^
    |
 note: argument has type `&SomeStruct`
-  --> $DIR/forget_ref.rs:13:12
+  --> $DIR/forget_ref.rs:14:12
    |
 LL |     forget(&owned);
    |            ^^^^^^
 
 error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing
-  --> $DIR/forget_ref.rs:14:5
+  --> $DIR/forget_ref.rs:15:5
    |
 LL |     forget(&&owned);
    |     ^^^^^^^^^^^^^^^
    |
 note: argument has type `&&SomeStruct`
-  --> $DIR/forget_ref.rs:14:12
+  --> $DIR/forget_ref.rs:15:12
    |
 LL |     forget(&&owned);
    |            ^^^^^^^
 
 error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing
-  --> $DIR/forget_ref.rs:15:5
+  --> $DIR/forget_ref.rs:16:5
    |
 LL |     forget(&mut owned);
    |     ^^^^^^^^^^^^^^^^^^
    |
 note: argument has type `&mut SomeStruct`
-  --> $DIR/forget_ref.rs:15:12
+  --> $DIR/forget_ref.rs:16:12
    |
 LL |     forget(&mut owned);
    |            ^^^^^^^^^^
 
 error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing
-  --> $DIR/forget_ref.rs:19:5
+  --> $DIR/forget_ref.rs:20:5
    |
 LL |     forget(&*reference1);
    |     ^^^^^^^^^^^^^^^^^^^^
    |
 note: argument has type `&SomeStruct`
-  --> $DIR/forget_ref.rs:19:12
+  --> $DIR/forget_ref.rs:20:12
    |
 LL |     forget(&*reference1);
    |            ^^^^^^^^^^^^
 
 error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing
-  --> $DIR/forget_ref.rs:22:5
+  --> $DIR/forget_ref.rs:23:5
    |
 LL |     forget(reference2);
    |     ^^^^^^^^^^^^^^^^^^
    |
 note: argument has type `&mut SomeStruct`
-  --> $DIR/forget_ref.rs:22:12
+  --> $DIR/forget_ref.rs:23:12
    |
 LL |     forget(reference2);
    |            ^^^^^^^^^^
 
 error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing
-  --> $DIR/forget_ref.rs:25:5
+  --> $DIR/forget_ref.rs:26:5
    |
 LL |     forget(reference3);
    |     ^^^^^^^^^^^^^^^^^^
    |
 note: argument has type `&SomeStruct`
-  --> $DIR/forget_ref.rs:25:12
+  --> $DIR/forget_ref.rs:26:12
    |
 LL |     forget(reference3);
    |            ^^^^^^^^^^
 
 error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing
-  --> $DIR/forget_ref.rs:30:5
+  --> $DIR/forget_ref.rs:31:5
    |
 LL |     forget(&val);
    |     ^^^^^^^^^^^^
    |
 note: argument has type `&T`
-  --> $DIR/forget_ref.rs:30:12
+  --> $DIR/forget_ref.rs:31:12
    |
 LL |     forget(&val);
    |            ^^^^
 
 error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing
-  --> $DIR/forget_ref.rs:38:5
+  --> $DIR/forget_ref.rs:39:5
    |
 LL |     std::mem::forget(&SomeStruct);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: argument has type `&SomeStruct`
-  --> $DIR/forget_ref.rs:38:22
+  --> $DIR/forget_ref.rs:39:22
    |
 LL |     std::mem::forget(&SomeStruct);
    |                      ^^^^^^^^^^^
diff --git a/src/tools/clippy/tests/ui/get_first.fixed b/src/tools/clippy/tests/ui/get_first.fixed
new file mode 100644
index 00000000000..def58afa4fb
--- /dev/null
+++ b/src/tools/clippy/tests/ui/get_first.fixed
@@ -0,0 +1,42 @@
+// run-rustfix
+#![warn(clippy::get_first)]
+use std::collections::BTreeMap;
+use std::collections::HashMap;
+use std::collections::VecDeque;
+
+struct Bar {
+    arr: [u32; 3],
+}
+
+impl Bar {
+    fn get(&self, pos: usize) -> Option<&u32> {
+        self.arr.get(pos)
+    }
+}
+
+fn main() {
+    let x = vec![2, 3, 5];
+    let _ = x.first(); // Use x.first()
+    let _ = x.get(1);
+    let _ = x[0];
+
+    let y = [2, 3, 5];
+    let _ = y.first(); // Use y.first()
+    let _ = y.get(1);
+    let _ = y[0];
+
+    let z = &[2, 3, 5];
+    let _ = z.first(); // Use z.first()
+    let _ = z.get(1);
+    let _ = z[0];
+
+    let vecdeque: VecDeque<_> = x.iter().cloned().collect();
+    let hashmap: HashMap<u8, char> = HashMap::from_iter(vec![(0, 'a'), (1, 'b')]);
+    let btreemap: BTreeMap<u8, char> = BTreeMap::from_iter(vec![(0, 'a'), (1, 'b')]);
+    let _ = vecdeque.get(0); // Do not lint, because VecDeque is not slice.
+    let _ = hashmap.get(&0); // Do not lint, because HashMap is not slice.
+    let _ = btreemap.get(&0); // Do not lint, because BTreeMap is not slice.
+
+    let bar = Bar { arr: [0, 1, 2] };
+    let _ = bar.get(0); // Do not lint, because Bar is struct.
+}
diff --git a/src/tools/clippy/tests/ui/get_first.rs b/src/tools/clippy/tests/ui/get_first.rs
new file mode 100644
index 00000000000..85a381854cd
--- /dev/null
+++ b/src/tools/clippy/tests/ui/get_first.rs
@@ -0,0 +1,42 @@
+// run-rustfix
+#![warn(clippy::get_first)]
+use std::collections::BTreeMap;
+use std::collections::HashMap;
+use std::collections::VecDeque;
+
+struct Bar {
+    arr: [u32; 3],
+}
+
+impl Bar {
+    fn get(&self, pos: usize) -> Option<&u32> {
+        self.arr.get(pos)
+    }
+}
+
+fn main() {
+    let x = vec![2, 3, 5];
+    let _ = x.get(0); // Use x.first()
+    let _ = x.get(1);
+    let _ = x[0];
+
+    let y = [2, 3, 5];
+    let _ = y.get(0); // Use y.first()
+    let _ = y.get(1);
+    let _ = y[0];
+
+    let z = &[2, 3, 5];
+    let _ = z.get(0); // Use z.first()
+    let _ = z.get(1);
+    let _ = z[0];
+
+    let vecdeque: VecDeque<_> = x.iter().cloned().collect();
+    let hashmap: HashMap<u8, char> = HashMap::from_iter(vec![(0, 'a'), (1, 'b')]);
+    let btreemap: BTreeMap<u8, char> = BTreeMap::from_iter(vec![(0, 'a'), (1, 'b')]);
+    let _ = vecdeque.get(0); // Do not lint, because VecDeque is not slice.
+    let _ = hashmap.get(&0); // Do not lint, because HashMap is not slice.
+    let _ = btreemap.get(&0); // Do not lint, because BTreeMap is not slice.
+
+    let bar = Bar { arr: [0, 1, 2] };
+    let _ = bar.get(0); // Do not lint, because Bar is struct.
+}
diff --git a/src/tools/clippy/tests/ui/get_first.stderr b/src/tools/clippy/tests/ui/get_first.stderr
new file mode 100644
index 00000000000..466beff9c92
--- /dev/null
+++ b/src/tools/clippy/tests/ui/get_first.stderr
@@ -0,0 +1,22 @@
+error: accessing first element with `x.get(0)`
+  --> $DIR/get_first.rs:19:13
+   |
+LL |     let _ = x.get(0); // Use x.first()
+   |             ^^^^^^^^ help: try: `x.first()`
+   |
+   = note: `-D clippy::get-first` implied by `-D warnings`
+
+error: accessing first element with `y.get(0)`
+  --> $DIR/get_first.rs:24:13
+   |
+LL |     let _ = y.get(0); // Use y.first()
+   |             ^^^^^^^^ help: try: `y.first()`
+
+error: accessing first element with `z.get(0)`
+  --> $DIR/get_first.rs:29:13
+   |
+LL |     let _ = z.get(0); // Use z.first()
+   |             ^^^^^^^^ help: try: `z.first()`
+
+error: aborting due to 3 previous errors
+
diff --git a/src/tools/clippy/tests/ui/get_last_with_len.fixed b/src/tools/clippy/tests/ui/get_last_with_len.fixed
index c8b363f9c38..1e90b37687a 100644
--- a/src/tools/clippy/tests/ui/get_last_with_len.fixed
+++ b/src/tools/clippy/tests/ui/get_last_with_len.fixed
@@ -1,10 +1,13 @@
 // run-rustfix
 
 #![warn(clippy::get_last_with_len)]
+#![allow(unused)]
+
+use std::collections::VecDeque;
 
 fn dont_use_last() {
     let x = vec![2, 3, 5];
-    let _ = x.last(); // ~ERROR Use x.last()
+    let _ = x.last();
 }
 
 fn indexing_two_from_end() {
@@ -23,9 +26,24 @@ fn use_last_with_different_vec_length() {
     let _ = x.get(y.len() - 1);
 }
 
+struct S {
+    field: Vec<usize>,
+}
+
+fn in_field(s: &S) {
+    let _ = s.field.last();
+}
+
 fn main() {
-    dont_use_last();
-    indexing_two_from_end();
-    index_into_last();
-    use_last_with_different_vec_length();
+    let slice = &[1, 2, 3];
+    let _ = slice.last();
+
+    let array = [4, 5, 6];
+    let _ = array.last();
+
+    let deq = VecDeque::from([7, 8, 9]);
+    let _ = deq.back();
+
+    let nested = [[1]];
+    let _ = nested[0].last();
 }
diff --git a/src/tools/clippy/tests/ui/get_last_with_len.rs b/src/tools/clippy/tests/ui/get_last_with_len.rs
index bf9cb2d7e0c..d63a731bd52 100644
--- a/src/tools/clippy/tests/ui/get_last_with_len.rs
+++ b/src/tools/clippy/tests/ui/get_last_with_len.rs
@@ -1,10 +1,13 @@
 // run-rustfix
 
 #![warn(clippy::get_last_with_len)]
+#![allow(unused)]
+
+use std::collections::VecDeque;
 
 fn dont_use_last() {
     let x = vec![2, 3, 5];
-    let _ = x.get(x.len() - 1); // ~ERROR Use x.last()
+    let _ = x.get(x.len() - 1);
 }
 
 fn indexing_two_from_end() {
@@ -23,9 +26,24 @@ fn use_last_with_different_vec_length() {
     let _ = x.get(y.len() - 1);
 }
 
+struct S {
+    field: Vec<usize>,
+}
+
+fn in_field(s: &S) {
+    let _ = s.field.get(s.field.len() - 1);
+}
+
 fn main() {
-    dont_use_last();
-    indexing_two_from_end();
-    index_into_last();
-    use_last_with_different_vec_length();
+    let slice = &[1, 2, 3];
+    let _ = slice.get(slice.len() - 1);
+
+    let array = [4, 5, 6];
+    let _ = array.get(array.len() - 1);
+
+    let deq = VecDeque::from([7, 8, 9]);
+    let _ = deq.get(deq.len() - 1);
+
+    let nested = [[1]];
+    let _ = nested[0].get(nested[0].len() - 1);
 }
diff --git a/src/tools/clippy/tests/ui/get_last_with_len.stderr b/src/tools/clippy/tests/ui/get_last_with_len.stderr
index 55baf87384a..ac8dd6c2e41 100644
--- a/src/tools/clippy/tests/ui/get_last_with_len.stderr
+++ b/src/tools/clippy/tests/ui/get_last_with_len.stderr
@@ -1,10 +1,40 @@
 error: accessing last element with `x.get(x.len() - 1)`
-  --> $DIR/get_last_with_len.rs:7:13
+  --> $DIR/get_last_with_len.rs:10:13
    |
-LL |     let _ = x.get(x.len() - 1); // ~ERROR Use x.last()
+LL |     let _ = x.get(x.len() - 1);
    |             ^^^^^^^^^^^^^^^^^^ help: try: `x.last()`
    |
    = note: `-D clippy::get-last-with-len` implied by `-D warnings`
 
-error: aborting due to previous error
+error: accessing last element with `s.field.get(s.field.len() - 1)`
+  --> $DIR/get_last_with_len.rs:34:13
+   |
+LL |     let _ = s.field.get(s.field.len() - 1);
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `s.field.last()`
+
+error: accessing last element with `slice.get(slice.len() - 1)`
+  --> $DIR/get_last_with_len.rs:39:13
+   |
+LL |     let _ = slice.get(slice.len() - 1);
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `slice.last()`
+
+error: accessing last element with `array.get(array.len() - 1)`
+  --> $DIR/get_last_with_len.rs:42:13
+   |
+LL |     let _ = array.get(array.len() - 1);
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `array.last()`
+
+error: accessing last element with `deq.get(deq.len() - 1)`
+  --> $DIR/get_last_with_len.rs:45:13
+   |
+LL |     let _ = deq.get(deq.len() - 1);
+   |             ^^^^^^^^^^^^^^^^^^^^^^ help: try: `deq.back()`
+
+error: accessing last element with `nested[0].get(nested[0].len() - 1)`
+  --> $DIR/get_last_with_len.rs:48:13
+   |
+LL |     let _ = nested[0].get(nested[0].len() - 1);
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `nested[0].last()`
+
+error: aborting due to 6 previous errors
 
diff --git a/src/tools/clippy/tests/ui/get_unwrap.fixed b/src/tools/clippy/tests/ui/get_unwrap.fixed
index 8f165d67589..5827fc7d76e 100644
--- a/src/tools/clippy/tests/ui/get_unwrap.fixed
+++ b/src/tools/clippy/tests/ui/get_unwrap.fixed
@@ -1,6 +1,6 @@
 // run-rustfix
 
-#![allow(unused_mut, clippy::from_iter_instead_of_collect)]
+#![allow(unused_mut, clippy::from_iter_instead_of_collect, clippy::get_first)]
 #![warn(clippy::unwrap_used)]
 #![deny(clippy::get_unwrap)]
 
diff --git a/src/tools/clippy/tests/ui/get_unwrap.rs b/src/tools/clippy/tests/ui/get_unwrap.rs
index 786749daa74..a2a323c14fb 100644
--- a/src/tools/clippy/tests/ui/get_unwrap.rs
+++ b/src/tools/clippy/tests/ui/get_unwrap.rs
@@ -1,6 +1,6 @@
 // run-rustfix
 
-#![allow(unused_mut, clippy::from_iter_instead_of_collect)]
+#![allow(unused_mut, clippy::from_iter_instead_of_collect, clippy::get_first)]
 #![warn(clippy::unwrap_used)]
 #![deny(clippy::get_unwrap)]
 
diff --git a/src/tools/clippy/tests/ui/identity_op.fixed b/src/tools/clippy/tests/ui/identity_op.fixed
new file mode 100644
index 00000000000..5f9cebe212a
--- /dev/null
+++ b/src/tools/clippy/tests/ui/identity_op.fixed
@@ -0,0 +1,119 @@
+// run-rustfix
+
+#![warn(clippy::identity_op)]
+#![allow(
+    clippy::eq_op,
+    clippy::no_effect,
+    clippy::unnecessary_operation,
+    clippy::op_ref,
+    clippy::double_parens,
+    unused
+)]
+
+use std::fmt::Write as _;
+
+const ONE: i64 = 1;
+const NEG_ONE: i64 = -1;
+const ZERO: i64 = 0;
+
+struct A(String);
+
+impl std::ops::Shl<i32> for A {
+    type Output = A;
+    fn shl(mut self, other: i32) -> Self {
+        let _ = write!(self.0, "{}", other);
+        self
+    }
+}
+
+struct Length(u8);
+struct Meter;
+
+impl core::ops::Mul<Meter> for u8 {
+    type Output = Length;
+    fn mul(self, _: Meter) -> Length {
+        Length(self)
+    }
+}
+
+#[rustfmt::skip]
+fn main() {
+    let x = 0;
+
+    x;
+    x;
+    x + 1;
+    x;
+    1 + x;
+    x - ZERO; //no error, as we skip lookups (for now)
+    x;
+    ((ZERO)) | x; //no error, as we skip lookups (for now)
+
+    x;
+    x;
+    x / ONE; //no error, as we skip lookups (for now)
+
+    x / 2; //no false positive
+
+    x & NEG_ONE; //no error, as we skip lookups (for now)
+    x;
+
+    let u: u8 = 0;
+    u;
+
+    1 << 0; // no error, this case is allowed, see issue 3430
+    42;
+    1;
+    42;
+    &x;
+    x;
+
+    let mut a = A("".into());
+    let b = a << 0; // no error: non-integer
+
+    1 * Meter; // no error: non-integer
+
+    2;
+    -2;
+    2 + x;
+    -2 + x;
+    x + 1;
+    (x + 1) % 3; // no error
+    4 % 3; // no error
+    4 % -3; // no error
+
+    // See #8724
+    let a = 0;
+    let b = true;
+    (if b { 1 } else { 2 });
+    (if b { 1 } else { 2 }) + if b { 3 } else { 4 };
+    (match a { 0 => 10, _ => 20 });
+    (match a { 0 => 10, _ => 20 }) + match a { 0 => 30, _ => 40 };
+    (if b { 1 } else { 2 }) + match a { 0 => 30, _ => 40 };
+    (match a { 0 => 10, _ => 20 }) + if b { 3 } else { 4 };
+    (if b { 1 } else { 2 });
+
+    ({ a }) + 3;
+    ({ a } * 2);
+    (loop { let mut c = 0; if c == 10 { break c; } c += 1; }) + { a * 2 };
+
+    fn f(_: i32) {
+        todo!();
+    }
+    f(a + { 8 * 5 });
+    f(if b { 1 } else { 2 } + 3);
+    const _: i32 = { 2 * 4 } + 3;
+    const _: i32 = { 1 + 2 * 3 } + 3;
+
+    a as usize;
+    let _ = a as usize;
+    ({ a } as usize);
+
+    2 * { a };
+    (({ a } + 4));
+    1;
+}
+
+pub fn decide(a: bool, b: bool) -> u32 {
+    (if a { 1 } else { 2 }) + if b { 3 } else { 5 }
+}
diff --git a/src/tools/clippy/tests/ui/identity_op.rs b/src/tools/clippy/tests/ui/identity_op.rs
index fec54d00ccb..ca799c9cfac 100644
--- a/src/tools/clippy/tests/ui/identity_op.rs
+++ b/src/tools/clippy/tests/ui/identity_op.rs
@@ -1,3 +1,15 @@
+// run-rustfix
+
+#![warn(clippy::identity_op)]
+#![allow(
+    clippy::eq_op,
+    clippy::no_effect,
+    clippy::unnecessary_operation,
+    clippy::op_ref,
+    clippy::double_parens,
+    unused
+)]
+
 use std::fmt::Write as _;
 
 const ONE: i64 = 1;
@@ -24,14 +36,6 @@ impl core::ops::Mul<Meter> for u8 {
     }
 }
 
-#[allow(
-    clippy::eq_op,
-    clippy::no_effect,
-    clippy::unnecessary_operation,
-    clippy::op_ref,
-    clippy::double_parens
-)]
-#[warn(clippy::identity_op)]
 #[rustfmt::skip]
 fn main() {
     let x = 0;
@@ -82,29 +86,34 @@ fn main() {
     let a = 0;
     let b = true;
     0 + if b { 1 } else { 2 };
-    0 + if b { 1 } else { 2 } + if b { 3 } else { 4 }; // no error
+    0 + if b { 1 } else { 2 } + if b { 3 } else { 4 };
     0 + match a { 0 => 10, _ => 20 };
-    0 + match a { 0 => 10, _ => 20 } + match a { 0 => 30, _ => 40 }; // no error
-    0 + if b { 1 } else { 2 } + match a { 0 => 30, _ => 40 }; // no error
-    0 + match a { 0 => 10, _ => 20 } + if b { 3 } else { 4 }; // no error
-    
-    0 + if b { 0 + 1 } else { 2 };
-    0 + match a { 0 =>  0 + 10, _ => 20 };
-    0 + if b { 0 + 1 } else { 2 } + match a { 0 => 0 + 30, _ => 40 };
-
-    let _ = 0 + if 0 + 1 > 0 { 1 } else { 2 } + if 0 + 1 > 0 { 3 } else { 4 };
-    let _ = 0 + match 0 + 1 { 0 => 10, _ => 20 } + match 0 + 1  { 0 => 30, _ => 40 };
-
-    0 + if b { 1 } else { 2 } + if b { 3 } else { 4 } + 0;
-    
-    0 + { a } + 3; // no error
-    0 + loop { let mut c = 0; if c == 10 { break c; } c += 1; } + { a * 2 }; // no error
-    
+    0 + match a { 0 => 10, _ => 20 } + match a { 0 => 30, _ => 40 };
+    0 + if b { 1 } else { 2 } + match a { 0 => 30, _ => 40 };
+    0 + match a { 0 => 10, _ => 20 } + if b { 3 } else { 4 };
+    (if b { 1 } else { 2 }) + 0;
+
+    0 + { a } + 3;
+    0 + { a } * 2;
+    0 + loop { let mut c = 0; if c == 10 { break c; } c += 1; } + { a * 2 };
+
     fn f(_: i32) {
         todo!();
     }
     f(1 * a + { 8 * 5 });
-    f(0 + if b { 1 } else { 2 } + 3); // no error
+    f(0 + if b { 1 } else { 2 } + 3);
     const _: i32 = { 2 * 4 } + 0 + 3;
-    const _: i32 = 0 + { 1 + 2 * 3 } + 3; // no error
+    const _: i32 = 0 + { 1 + 2 * 3 } + 3;
+
+    0 + a as usize;
+    let _ = 0 + a as usize;
+    0 + { a } as usize;
+
+    2 * (0 + { a });
+    1 * ({ a } + 4);
+    1 * 1;
+}
+
+pub fn decide(a: bool, b: bool) -> u32 {
+    0 + if a { 1 } else { 2 } + if b { 3 } else { 5 }
 }
diff --git a/src/tools/clippy/tests/ui/identity_op.stderr b/src/tools/clippy/tests/ui/identity_op.stderr
index d8cb65839cb..1a104a20b84 100644
--- a/src/tools/clippy/tests/ui/identity_op.stderr
+++ b/src/tools/clippy/tests/ui/identity_op.stderr
@@ -1,202 +1,238 @@
-error: the operation is ineffective. Consider reducing it to `x`
-  --> $DIR/identity_op.rs:39:5
+error: this operation has no effect
+  --> $DIR/identity_op.rs:43:5
    |
 LL |     x + 0;
-   |     ^^^^^
+   |     ^^^^^ help: consider reducing it to: `x`
    |
    = note: `-D clippy::identity-op` implied by `-D warnings`
 
-error: the operation is ineffective. Consider reducing it to `x`
-  --> $DIR/identity_op.rs:40:5
+error: this operation has no effect
+  --> $DIR/identity_op.rs:44:5
    |
 LL |     x + (1 - 1);
-   |     ^^^^^^^^^^^
+   |     ^^^^^^^^^^^ help: consider reducing it to: `x`
 
-error: the operation is ineffective. Consider reducing it to `x`
-  --> $DIR/identity_op.rs:42:5
+error: this operation has no effect
+  --> $DIR/identity_op.rs:46:5
    |
 LL |     0 + x;
-   |     ^^^^^
+   |     ^^^^^ help: consider reducing it to: `x`
 
-error: the operation is ineffective. Consider reducing it to `x`
-  --> $DIR/identity_op.rs:45:5
+error: this operation has no effect
+  --> $DIR/identity_op.rs:49:5
    |
 LL |     x | (0);
-   |     ^^^^^^^
+   |     ^^^^^^^ help: consider reducing it to: `x`
 
-error: the operation is ineffective. Consider reducing it to `x`
-  --> $DIR/identity_op.rs:48:5
+error: this operation has no effect
+  --> $DIR/identity_op.rs:52:5
    |
 LL |     x * 1;
-   |     ^^^^^
+   |     ^^^^^ help: consider reducing it to: `x`
 
-error: the operation is ineffective. Consider reducing it to `x`
-  --> $DIR/identity_op.rs:49:5
+error: this operation has no effect
+  --> $DIR/identity_op.rs:53:5
    |
 LL |     1 * x;
-   |     ^^^^^
+   |     ^^^^^ help: consider reducing it to: `x`
 
-error: the operation is ineffective. Consider reducing it to `x`
-  --> $DIR/identity_op.rs:55:5
+error: this operation has no effect
+  --> $DIR/identity_op.rs:59:5
    |
 LL |     -1 & x;
-   |     ^^^^^^
+   |     ^^^^^^ help: consider reducing it to: `x`
 
-error: the operation is ineffective. Consider reducing it to `u`
-  --> $DIR/identity_op.rs:58:5
+error: this operation has no effect
+  --> $DIR/identity_op.rs:62:5
    |
 LL |     u & 255;
-   |     ^^^^^^^
+   |     ^^^^^^^ help: consider reducing it to: `u`
 
-error: the operation is ineffective. Consider reducing it to `42`
-  --> $DIR/identity_op.rs:61:5
+error: this operation has no effect
+  --> $DIR/identity_op.rs:65:5
    |
 LL |     42 << 0;
-   |     ^^^^^^^
+   |     ^^^^^^^ help: consider reducing it to: `42`
 
-error: the operation is ineffective. Consider reducing it to `1`
-  --> $DIR/identity_op.rs:62:5
+error: this operation has no effect
+  --> $DIR/identity_op.rs:66:5
    |
 LL |     1 >> 0;
-   |     ^^^^^^
+   |     ^^^^^^ help: consider reducing it to: `1`
 
-error: the operation is ineffective. Consider reducing it to `42`
-  --> $DIR/identity_op.rs:63:5
+error: this operation has no effect
+  --> $DIR/identity_op.rs:67:5
    |
 LL |     42 >> 0;
-   |     ^^^^^^^
+   |     ^^^^^^^ help: consider reducing it to: `42`
 
-error: the operation is ineffective. Consider reducing it to `&x`
-  --> $DIR/identity_op.rs:64:5
+error: this operation has no effect
+  --> $DIR/identity_op.rs:68:5
    |
 LL |     &x >> 0;
-   |     ^^^^^^^
+   |     ^^^^^^^ help: consider reducing it to: `&x`
 
-error: the operation is ineffective. Consider reducing it to `x`
-  --> $DIR/identity_op.rs:65:5
+error: this operation has no effect
+  --> $DIR/identity_op.rs:69:5
    |
 LL |     x >> &0;
-   |     ^^^^^^^
+   |     ^^^^^^^ help: consider reducing it to: `x`
 
-error: the operation is ineffective. Consider reducing it to `2`
-  --> $DIR/identity_op.rs:72:5
+error: this operation has no effect
+  --> $DIR/identity_op.rs:76:5
    |
 LL |     2 % 3;
-   |     ^^^^^
+   |     ^^^^^ help: consider reducing it to: `2`
 
-error: the operation is ineffective. Consider reducing it to `-2`
-  --> $DIR/identity_op.rs:73:5
+error: this operation has no effect
+  --> $DIR/identity_op.rs:77:5
    |
 LL |     -2 % 3;
-   |     ^^^^^^
+   |     ^^^^^^ help: consider reducing it to: `-2`
 
-error: the operation is ineffective. Consider reducing it to `2`
-  --> $DIR/identity_op.rs:74:5
+error: this operation has no effect
+  --> $DIR/identity_op.rs:78:5
    |
 LL |     2 % -3 + x;
-   |     ^^^^^^
+   |     ^^^^^^ help: consider reducing it to: `2`
 
-error: the operation is ineffective. Consider reducing it to `-2`
-  --> $DIR/identity_op.rs:75:5
+error: this operation has no effect
+  --> $DIR/identity_op.rs:79:5
    |
 LL |     -2 % -3 + x;
-   |     ^^^^^^^
+   |     ^^^^^^^ help: consider reducing it to: `-2`
 
-error: the operation is ineffective. Consider reducing it to `1`
-  --> $DIR/identity_op.rs:76:9
+error: this operation has no effect
+  --> $DIR/identity_op.rs:80:9
    |
 LL |     x + 1 % 3;
-   |         ^^^^^
+   |         ^^^^^ help: consider reducing it to: `1`
 
-error: the operation is ineffective. Consider reducing it to `if b { 1 } else { 2 }`
-  --> $DIR/identity_op.rs:84:5
+error: this operation has no effect
+  --> $DIR/identity_op.rs:88:5
    |
 LL |     0 + if b { 1 } else { 2 };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(if b { 1 } else { 2 })`
 
-error: the operation is ineffective. Consider reducing it to `match a { 0 => 10, _ => 20 }`
-  --> $DIR/identity_op.rs:86:5
+error: this operation has no effect
+  --> $DIR/identity_op.rs:89:5
+   |
+LL |     0 + if b { 1 } else { 2 } + if b { 3 } else { 4 };
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(if b { 1 } else { 2 })`
+
+error: this operation has no effect
+  --> $DIR/identity_op.rs:90:5
    |
 LL |     0 + match a { 0 => 10, _ => 20 };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(match a { 0 => 10, _ => 20 })`
 
-error: the operation is ineffective. Consider reducing it to `if b { 0 + 1 } else { 2 }`
+error: this operation has no effect
   --> $DIR/identity_op.rs:91:5
    |
-LL |     0 + if b { 0 + 1 } else { 2 };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |     0 + match a { 0 => 10, _ => 20 } + match a { 0 => 30, _ => 40 };
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(match a { 0 => 10, _ => 20 })`
 
-error: the operation is ineffective. Consider reducing it to `1`
-  --> $DIR/identity_op.rs:91:16
+error: this operation has no effect
+  --> $DIR/identity_op.rs:92:5
    |
-LL |     0 + if b { 0 + 1 } else { 2 };
-   |                ^^^^^
+LL |     0 + if b { 1 } else { 2 } + match a { 0 => 30, _ => 40 };
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(if b { 1 } else { 2 })`
 
-error: the operation is ineffective. Consider reducing it to `match a { 0 =>  0 + 10, _ => 20 }`
-  --> $DIR/identity_op.rs:92:5
+error: this operation has no effect
+  --> $DIR/identity_op.rs:93:5
+   |
+LL |     0 + match a { 0 => 10, _ => 20 } + if b { 3 } else { 4 };
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(match a { 0 => 10, _ => 20 })`
+
+error: this operation has no effect
+  --> $DIR/identity_op.rs:94:5
+   |
+LL |     (if b { 1 } else { 2 }) + 0;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(if b { 1 } else { 2 })`
+
+error: this operation has no effect
+  --> $DIR/identity_op.rs:96:5
    |
-LL |     0 + match a { 0 =>  0 + 10, _ => 20 };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |     0 + { a } + 3;
+   |     ^^^^^^^^^ help: consider reducing it to: `({ a })`
 
-error: the operation is ineffective. Consider reducing it to `10`
-  --> $DIR/identity_op.rs:92:25
+error: this operation has no effect
+  --> $DIR/identity_op.rs:97:5
    |
-LL |     0 + match a { 0 =>  0 + 10, _ => 20 };
-   |                         ^^^^^^
+LL |     0 + { a } * 2;
+   |     ^^^^^^^^^^^^^ help: consider reducing it to: `({ a } * 2)`
 
-error: the operation is ineffective. Consider reducing it to `1`
-  --> $DIR/identity_op.rs:93:16
+error: this operation has no effect
+  --> $DIR/identity_op.rs:98:5
    |
-LL |     0 + if b { 0 + 1 } else { 2 } + match a { 0 => 0 + 30, _ => 40 };
-   |                ^^^^^
+LL |     0 + loop { let mut c = 0; if c == 10 { break c; } c += 1; } + { a * 2 };
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(loop { let mut c = 0; if c == 10 { break c; } c += 1; })`
 
-error: the operation is ineffective. Consider reducing it to `30`
-  --> $DIR/identity_op.rs:93:52
+error: this operation has no effect
+  --> $DIR/identity_op.rs:103:7
    |
-LL |     0 + if b { 0 + 1 } else { 2 } + match a { 0 => 0 + 30, _ => 40 };
-   |                                                    ^^^^^^
+LL |     f(1 * a + { 8 * 5 });
+   |       ^^^^^ help: consider reducing it to: `a`
 
-error: the operation is ineffective. Consider reducing it to `1`
-  --> $DIR/identity_op.rs:95:20
+error: this operation has no effect
+  --> $DIR/identity_op.rs:104:7
    |
-LL |     let _ = 0 + if 0 + 1 > 0 { 1 } else { 2 } + if 0 + 1 > 0 { 3 } else { 4 };
-   |                    ^^^^^
+LL |     f(0 + if b { 1 } else { 2 } + 3);
+   |       ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `if b { 1 } else { 2 }`
 
-error: the operation is ineffective. Consider reducing it to `1`
-  --> $DIR/identity_op.rs:95:52
+error: this operation has no effect
+  --> $DIR/identity_op.rs:105:20
    |
-LL |     let _ = 0 + if 0 + 1 > 0 { 1 } else { 2 } + if 0 + 1 > 0 { 3 } else { 4 };
-   |                                                    ^^^^^
+LL |     const _: i32 = { 2 * 4 } + 0 + 3;
+   |                    ^^^^^^^^^^^^^ help: consider reducing it to: `{ 2 * 4 }`
 
-error: the operation is ineffective. Consider reducing it to `1`
-  --> $DIR/identity_op.rs:96:23
+error: this operation has no effect
+  --> $DIR/identity_op.rs:106:20
    |
-LL |     let _ = 0 + match 0 + 1 { 0 => 10, _ => 20 } + match 0 + 1  { 0 => 30, _ => 40 };
-   |                       ^^^^^
+LL |     const _: i32 = 0 + { 1 + 2 * 3 } + 3;
+   |                    ^^^^^^^^^^^^^^^^^ help: consider reducing it to: `{ 1 + 2 * 3 }`
 
-error: the operation is ineffective. Consider reducing it to `1`
-  --> $DIR/identity_op.rs:96:58
+error: this operation has no effect
+  --> $DIR/identity_op.rs:108:5
    |
-LL |     let _ = 0 + match 0 + 1 { 0 => 10, _ => 20 } + match 0 + 1  { 0 => 30, _ => 40 };
-   |                                                          ^^^^^
+LL |     0 + a as usize;
+   |     ^^^^^^^^^^^^^^ help: consider reducing it to: `a as usize`
 
-error: the operation is ineffective. Consider reducing it to `0 + if b { 1 } else { 2 } + if b { 3 } else { 4 }`
-  --> $DIR/identity_op.rs:98:5
+error: this operation has no effect
+  --> $DIR/identity_op.rs:109:13
    |
-LL |     0 + if b { 1 } else { 2 } + if b { 3 } else { 4 } + 0;
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |     let _ = 0 + a as usize;
+   |             ^^^^^^^^^^^^^^ help: consider reducing it to: `a as usize`
 
-error: the operation is ineffective. Consider reducing it to `a`
-  --> $DIR/identity_op.rs:106:7
+error: this operation has no effect
+  --> $DIR/identity_op.rs:110:5
    |
-LL |     f(1 * a + { 8 * 5 });
-   |       ^^^^^
+LL |     0 + { a } as usize;
+   |     ^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `({ a } as usize)`
 
-error: the operation is ineffective. Consider reducing it to `{ 2 * 4 }`
-  --> $DIR/identity_op.rs:108:20
+error: this operation has no effect
+  --> $DIR/identity_op.rs:112:9
    |
-LL |     const _: i32 = { 2 * 4 } + 0 + 3;
-   |                    ^^^^^^^^^^^^^
+LL |     2 * (0 + { a });
+   |         ^^^^^^^^^^^ help: consider reducing it to: `{ a }`
+
+error: this operation has no effect
+  --> $DIR/identity_op.rs:113:5
+   |
+LL |     1 * ({ a } + 4);
+   |     ^^^^^^^^^^^^^^^ help: consider reducing it to: `(({ a } + 4))`
+
+error: this operation has no effect
+  --> $DIR/identity_op.rs:114:5
+   |
+LL |     1 * 1;
+   |     ^^^^^ help: consider reducing it to: `1`
+
+error: this operation has no effect
+  --> $DIR/identity_op.rs:118:5
+   |
+LL |     0 + if a { 1 } else { 2 } + if b { 3 } else { 5 }
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(if a { 1 } else { 2 })`
 
-error: aborting due to 33 previous errors
+error: aborting due to 39 previous errors
 
diff --git a/src/tools/clippy/tests/ui/implicit_clone.fixed b/src/tools/clippy/tests/ui/implicit_clone.fixed
new file mode 100644
index 00000000000..33770fc2a2c
--- /dev/null
+++ b/src/tools/clippy/tests/ui/implicit_clone.fixed
@@ -0,0 +1,118 @@
+// run-rustfix
+#![warn(clippy::implicit_clone)]
+#![allow(clippy::clone_on_copy, clippy::redundant_clone)]
+use std::borrow::Borrow;
+use std::ffi::{OsStr, OsString};
+use std::path::PathBuf;
+
+fn return_owned_from_slice(slice: &[u32]) -> Vec<u32> {
+    slice.to_owned()
+}
+
+pub fn own_same<T>(v: T) -> T
+where
+    T: ToOwned<Owned = T>,
+{
+    v.to_owned()
+}
+
+pub fn own_same_from_ref<T>(v: &T) -> T
+where
+    T: ToOwned<Owned = T>,
+{
+    v.to_owned()
+}
+
+pub fn own_different<T, U>(v: T) -> U
+where
+    T: ToOwned<Owned = U>,
+{
+    v.to_owned()
+}
+
+#[derive(Copy, Clone)]
+struct Kitten;
+impl Kitten {
+    // badly named method
+    fn to_vec(self) -> Kitten {
+        Kitten {}
+    }
+}
+impl Borrow<BorrowedKitten> for Kitten {
+    fn borrow(&self) -> &BorrowedKitten {
+        static VALUE: BorrowedKitten = BorrowedKitten {};
+        &VALUE
+    }
+}
+
+struct BorrowedKitten;
+impl ToOwned for BorrowedKitten {
+    type Owned = Kitten;
+    fn to_owned(&self) -> Kitten {
+        Kitten {}
+    }
+}
+
+mod weird {
+    #[allow(clippy::ptr_arg)]
+    pub fn to_vec(v: &Vec<u32>) -> Vec<u32> {
+        v.clone()
+    }
+}
+
+fn main() {
+    let vec = vec![5];
+    let _ = return_owned_from_slice(&vec);
+    let _ = vec.clone();
+    let _ = vec.clone();
+
+    let vec_ref = &vec;
+    let _ = return_owned_from_slice(vec_ref);
+    let _ = vec_ref.clone();
+    let _ = vec_ref.clone();
+
+    // we expect no lint for this
+    let _ = weird::to_vec(&vec);
+
+    // we expect no lints for this
+    let slice: &[u32] = &[1, 2, 3, 4, 5];
+    let _ = return_owned_from_slice(slice);
+    let _ = slice.to_owned();
+    let _ = slice.to_vec();
+
+    let str = "hello world".to_string();
+    let _ = str.clone();
+
+    // testing w/ an arbitrary type
+    let kitten = Kitten {};
+    let _ = kitten.clone();
+    let _ = own_same_from_ref(&kitten);
+    // this shouln't lint
+    let _ = kitten.to_vec();
+
+    // we expect no lints for this
+    let borrowed = BorrowedKitten {};
+    let _ = borrowed.to_owned();
+
+    let pathbuf = PathBuf::new();
+    let _ = pathbuf.clone();
+    let _ = pathbuf.clone();
+
+    let os_string = OsString::from("foo");
+    let _ = os_string.clone();
+    let _ = os_string.clone();
+
+    // we expect no lints for this
+    let os_str = OsStr::new("foo");
+    let _ = os_str.to_owned();
+    let _ = os_str.to_os_string();
+
+    // issue #8227
+    let pathbuf_ref = &pathbuf;
+    let pathbuf_ref = &pathbuf_ref;
+    let _ = pathbuf_ref.to_owned(); // Don't lint. Returns `&PathBuf`
+    let _ = (*pathbuf_ref).clone();
+    let pathbuf_ref = &pathbuf_ref;
+    let _ = pathbuf_ref.to_owned(); // Don't lint. Returns `&&PathBuf`
+    let _ = (**pathbuf_ref).clone();
+}
diff --git a/src/tools/clippy/tests/ui/implicit_clone.rs b/src/tools/clippy/tests/ui/implicit_clone.rs
index 2549c9f32f9..fc896525bd2 100644
--- a/src/tools/clippy/tests/ui/implicit_clone.rs
+++ b/src/tools/clippy/tests/ui/implicit_clone.rs
@@ -1,5 +1,6 @@
+// run-rustfix
 #![warn(clippy::implicit_clone)]
-#![allow(clippy::redundant_clone)]
+#![allow(clippy::clone_on_copy, clippy::redundant_clone)]
 use std::borrow::Borrow;
 use std::ffi::{OsStr, OsString};
 use std::path::PathBuf;
diff --git a/src/tools/clippy/tests/ui/implicit_clone.stderr b/src/tools/clippy/tests/ui/implicit_clone.stderr
index 0f412424190..92c1aa58aff 100644
--- a/src/tools/clippy/tests/ui/implicit_clone.stderr
+++ b/src/tools/clippy/tests/ui/implicit_clone.stderr
@@ -1,5 +1,5 @@
 error: implicitly cloning a `Vec` by calling `to_owned` on its dereferenced type
-  --> $DIR/implicit_clone.rs:65:13
+  --> $DIR/implicit_clone.rs:66:13
    |
 LL |     let _ = vec.to_owned();
    |             ^^^^^^^^^^^^^^ help: consider using: `vec.clone()`
@@ -7,67 +7,67 @@ LL |     let _ = vec.to_owned();
    = note: `-D clippy::implicit-clone` implied by `-D warnings`
 
 error: implicitly cloning a `Vec` by calling `to_vec` on its dereferenced type
-  --> $DIR/implicit_clone.rs:66:13
+  --> $DIR/implicit_clone.rs:67:13
    |
 LL |     let _ = vec.to_vec();
    |             ^^^^^^^^^^^^ help: consider using: `vec.clone()`
 
 error: implicitly cloning a `Vec` by calling `to_owned` on its dereferenced type
-  --> $DIR/implicit_clone.rs:70:13
+  --> $DIR/implicit_clone.rs:71:13
    |
 LL |     let _ = vec_ref.to_owned();
    |             ^^^^^^^^^^^^^^^^^^ help: consider using: `vec_ref.clone()`
 
 error: implicitly cloning a `Vec` by calling `to_vec` on its dereferenced type
-  --> $DIR/implicit_clone.rs:71:13
+  --> $DIR/implicit_clone.rs:72:13
    |
 LL |     let _ = vec_ref.to_vec();
    |             ^^^^^^^^^^^^^^^^ help: consider using: `vec_ref.clone()`
 
 error: implicitly cloning a `String` by calling `to_owned` on its dereferenced type
-  --> $DIR/implicit_clone.rs:83:13
+  --> $DIR/implicit_clone.rs:84:13
    |
 LL |     let _ = str.to_owned();
    |             ^^^^^^^^^^^^^^ help: consider using: `str.clone()`
 
 error: implicitly cloning a `Kitten` by calling `to_owned` on its dereferenced type
-  --> $DIR/implicit_clone.rs:87:13
+  --> $DIR/implicit_clone.rs:88:13
    |
 LL |     let _ = kitten.to_owned();
    |             ^^^^^^^^^^^^^^^^^ help: consider using: `kitten.clone()`
 
 error: implicitly cloning a `PathBuf` by calling `to_owned` on its dereferenced type
-  --> $DIR/implicit_clone.rs:97:13
+  --> $DIR/implicit_clone.rs:98:13
    |
 LL |     let _ = pathbuf.to_owned();
    |             ^^^^^^^^^^^^^^^^^^ help: consider using: `pathbuf.clone()`
 
 error: implicitly cloning a `PathBuf` by calling `to_path_buf` on its dereferenced type
-  --> $DIR/implicit_clone.rs:98:13
+  --> $DIR/implicit_clone.rs:99:13
    |
 LL |     let _ = pathbuf.to_path_buf();
    |             ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `pathbuf.clone()`
 
 error: implicitly cloning a `OsString` by calling `to_owned` on its dereferenced type
-  --> $DIR/implicit_clone.rs:101:13
+  --> $DIR/implicit_clone.rs:102:13
    |
 LL |     let _ = os_string.to_owned();
    |             ^^^^^^^^^^^^^^^^^^^^ help: consider using: `os_string.clone()`
 
 error: implicitly cloning a `OsString` by calling `to_os_string` on its dereferenced type
-  --> $DIR/implicit_clone.rs:102:13
+  --> $DIR/implicit_clone.rs:103:13
    |
 LL |     let _ = os_string.to_os_string();
    |             ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `os_string.clone()`
 
 error: implicitly cloning a `PathBuf` by calling `to_path_buf` on its dereferenced type
-  --> $DIR/implicit_clone.rs:113:13
+  --> $DIR/implicit_clone.rs:114:13
    |
 LL |     let _ = pathbuf_ref.to_path_buf();
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(*pathbuf_ref).clone()`
 
 error: implicitly cloning a `PathBuf` by calling `to_path_buf` on its dereferenced type
-  --> $DIR/implicit_clone.rs:116:13
+  --> $DIR/implicit_clone.rs:117:13
    |
 LL |     let _ = pathbuf_ref.to_path_buf();
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(**pathbuf_ref).clone()`
diff --git a/src/tools/clippy/tests/ui/issue_2356.fixed b/src/tools/clippy/tests/ui/issue_2356.fixed
new file mode 100644
index 00000000000..942e99fa878
--- /dev/null
+++ b/src/tools/clippy/tests/ui/issue_2356.fixed
@@ -0,0 +1,26 @@
+// run-rustfix
+#![deny(clippy::while_let_on_iterator)]
+#![allow(unused_mut)]
+
+use std::iter::Iterator;
+
+struct Foo;
+
+impl Foo {
+    fn foo1<I: Iterator<Item = usize>>(mut it: I) {
+        while let Some(_) = it.next() {
+            println!("{:?}", it.size_hint());
+        }
+    }
+
+    fn foo2<I: Iterator<Item = usize>>(mut it: I) {
+        for e in it {
+            println!("{:?}", e);
+        }
+    }
+}
+
+fn main() {
+    Foo::foo1(vec![].into_iter());
+    Foo::foo2(vec![].into_iter());
+}
diff --git a/src/tools/clippy/tests/ui/issue_2356.rs b/src/tools/clippy/tests/ui/issue_2356.rs
index da580a1839a..b000234ea59 100644
--- a/src/tools/clippy/tests/ui/issue_2356.rs
+++ b/src/tools/clippy/tests/ui/issue_2356.rs
@@ -1,4 +1,6 @@
+// run-rustfix
 #![deny(clippy::while_let_on_iterator)]
+#![allow(unused_mut)]
 
 use std::iter::Iterator;
 
diff --git a/src/tools/clippy/tests/ui/issue_2356.stderr b/src/tools/clippy/tests/ui/issue_2356.stderr
index 51b872e21c0..4e3ff7522e0 100644
--- a/src/tools/clippy/tests/ui/issue_2356.stderr
+++ b/src/tools/clippy/tests/ui/issue_2356.stderr
@@ -1,11 +1,11 @@
 error: this loop could be written as a `for` loop
-  --> $DIR/issue_2356.rs:15:9
+  --> $DIR/issue_2356.rs:17:9
    |
 LL |         while let Some(e) = it.next() {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for e in it`
    |
 note: the lint level is defined here
-  --> $DIR/issue_2356.rs:1:9
+  --> $DIR/issue_2356.rs:2:9
    |
 LL | #![deny(clippy::while_let_on_iterator)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/clippy/tests/ui/iter_next_slice.fixed b/src/tools/clippy/tests/ui/iter_next_slice.fixed
index 11ffc8edb14..f612d26aaab 100644
--- a/src/tools/clippy/tests/ui/iter_next_slice.fixed
+++ b/src/tools/clippy/tests/ui/iter_next_slice.fixed
@@ -6,8 +6,8 @@ fn main() {
     let s = [1, 2, 3];
     let v = vec![1, 2, 3];
 
-    let _ = s.get(0);
-    // Should be replaced by s.get(0)
+    let _ = s.first();
+    // Should be replaced by s.first()
 
     let _ = s.get(2);
     // Should be replaced by s.get(2)
@@ -15,8 +15,8 @@ fn main() {
     let _ = v.get(5);
     // Should be replaced by v.get(5)
 
-    let _ = v.get(0);
-    // Should be replaced by v.get(0)
+    let _ = v.first();
+    // Should be replaced by v.first()
 
     let o = Some(5);
     o.iter().next();
diff --git a/src/tools/clippy/tests/ui/iter_next_slice.rs b/src/tools/clippy/tests/ui/iter_next_slice.rs
index e0d3aabd54a..5195f1c8667 100644
--- a/src/tools/clippy/tests/ui/iter_next_slice.rs
+++ b/src/tools/clippy/tests/ui/iter_next_slice.rs
@@ -7,7 +7,7 @@ fn main() {
     let v = vec![1, 2, 3];
 
     let _ = s.iter().next();
-    // Should be replaced by s.get(0)
+    // Should be replaced by s.first()
 
     let _ = s[2..].iter().next();
     // Should be replaced by s.get(2)
@@ -16,7 +16,7 @@ fn main() {
     // Should be replaced by v.get(5)
 
     let _ = v.iter().next();
-    // Should be replaced by v.get(0)
+    // Should be replaced by v.first()
 
     let o = Some(5);
     o.iter().next();
diff --git a/src/tools/clippy/tests/ui/iter_next_slice.stderr b/src/tools/clippy/tests/ui/iter_next_slice.stderr
index a78d2c2d5e8..d8b89061ff8 100644
--- a/src/tools/clippy/tests/ui/iter_next_slice.stderr
+++ b/src/tools/clippy/tests/ui/iter_next_slice.stderr
@@ -2,7 +2,7 @@ error: using `.iter().next()` on an array
   --> $DIR/iter_next_slice.rs:9:13
    |
 LL |     let _ = s.iter().next();
-   |             ^^^^^^^^^^^^^^^ help: try calling: `s.get(0)`
+   |             ^^^^^^^^^^^^^^^ help: try calling: `s.first()`
    |
    = note: `-D clippy::iter-next-slice` implied by `-D warnings`
 
@@ -22,7 +22,7 @@ error: using `.iter().next()` on an array
   --> $DIR/iter_next_slice.rs:18:13
    |
 LL |     let _ = v.iter().next();
-   |             ^^^^^^^^^^^^^^^ help: try calling: `v.get(0)`
+   |             ^^^^^^^^^^^^^^^ help: try calling: `v.first()`
 
 error: aborting due to 4 previous errors
 
diff --git a/src/tools/clippy/tests/ui/large_enum_variant.rs b/src/tools/clippy/tests/ui/large_enum_variant.rs
index cee9e2372c2..23152a13322 100644
--- a/src/tools/clippy/tests/ui/large_enum_variant.rs
+++ b/src/tools/clippy/tests/ui/large_enum_variant.rs
@@ -98,6 +98,38 @@ struct Struct2 {
     a: [i32; 8000],
 }
 
+#[derive(Copy, Clone)]
+enum CopyableLargeEnum {
+    A(bool),
+    B([u128; 4000]),
+}
+
+enum ManuallyCopyLargeEnum {
+    A(bool),
+    B([u128; 4000]),
+}
+
+impl Clone for ManuallyCopyLargeEnum {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+impl Copy for ManuallyCopyLargeEnum {}
+
+enum SomeGenericPossiblyCopyEnum<T> {
+    A(bool, std::marker::PhantomData<T>),
+    B([u64; 4000]),
+}
+
+impl<T: Copy> Clone for SomeGenericPossiblyCopyEnum<T> {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+impl<T: Copy> Copy for SomeGenericPossiblyCopyEnum<T> {}
+
 fn main() {
     large_enum_variant!();
 }
diff --git a/src/tools/clippy/tests/ui/large_enum_variant.stderr b/src/tools/clippy/tests/ui/large_enum_variant.stderr
index cbf2ac972e2..0248327262d 100644
--- a/src/tools/clippy/tests/ui/large_enum_variant.stderr
+++ b/src/tools/clippy/tests/ui/large_enum_variant.stderr
@@ -127,5 +127,71 @@ help: consider boxing the large fields to reduce the total size of the enum
 LL |     B(Box<Struct2>),
    |       ~~~~~~~~~~~~
 
-error: aborting due to 8 previous errors
+error: large size difference between variants
+  --> $DIR/large_enum_variant.rs:104:5
+   |
+LL |     B([u128; 4000]),
+   |     ^^^^^^^^^^^^^^^ this variant is 64000 bytes
+   |
+note: and the second-largest variant is 1 bytes:
+  --> $DIR/large_enum_variant.rs:103:5
+   |
+LL |     A(bool),
+   |     ^^^^^^^
+note: boxing a variant would require the type no longer be `Copy`
+  --> $DIR/large_enum_variant.rs:102:6
+   |
+LL | enum CopyableLargeEnum {
+   |      ^^^^^^^^^^^^^^^^^
+help: consider boxing the large fields to reduce the total size of the enum
+  --> $DIR/large_enum_variant.rs:104:5
+   |
+LL |     B([u128; 4000]),
+   |     ^^^^^^^^^^^^^^^
+
+error: large size difference between variants
+  --> $DIR/large_enum_variant.rs:109:5
+   |
+LL |     B([u128; 4000]),
+   |     ^^^^^^^^^^^^^^^ this variant is 64000 bytes
+   |
+note: and the second-largest variant is 1 bytes:
+  --> $DIR/large_enum_variant.rs:108:5
+   |
+LL |     A(bool),
+   |     ^^^^^^^
+note: boxing a variant would require the type no longer be `Copy`
+  --> $DIR/large_enum_variant.rs:107:6
+   |
+LL | enum ManuallyCopyLargeEnum {
+   |      ^^^^^^^^^^^^^^^^^^^^^
+help: consider boxing the large fields to reduce the total size of the enum
+  --> $DIR/large_enum_variant.rs:109:5
+   |
+LL |     B([u128; 4000]),
+   |     ^^^^^^^^^^^^^^^
+
+error: large size difference between variants
+  --> $DIR/large_enum_variant.rs:122:5
+   |
+LL |     B([u64; 4000]),
+   |     ^^^^^^^^^^^^^^ this variant is 32000 bytes
+   |
+note: and the second-largest variant is 1 bytes:
+  --> $DIR/large_enum_variant.rs:121:5
+   |
+LL |     A(bool, std::marker::PhantomData<T>),
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: boxing a variant would require the type no longer be `Copy`
+  --> $DIR/large_enum_variant.rs:120:6
+   |
+LL | enum SomeGenericPossiblyCopyEnum<T> {
+   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: consider boxing the large fields to reduce the total size of the enum
+  --> $DIR/large_enum_variant.rs:122:5
+   |
+LL |     B([u64; 4000]),
+   |     ^^^^^^^^^^^^^^
+
+error: aborting due to 11 previous errors
 
diff --git a/src/tools/clippy/tests/ui/map_flatten_fixable.fixed b/src/tools/clippy/tests/ui/map_flatten_fixable.fixed
index fec3a95edd6..928e5bd509c 100644
--- a/src/tools/clippy/tests/ui/map_flatten_fixable.fixed
+++ b/src/tools/clippy/tests/ui/map_flatten_fixable.fixed
@@ -28,4 +28,41 @@ fn main() {
 
     // mapping to Result on Result
     let _: Result<_, &str> = (Ok(Ok(1))).and_then(|x| x);
+
+    issue8734();
+    issue8878();
+}
+
+fn issue8734() {
+    //     let _ = [0u8, 1, 2, 3]
+    //         .into_iter()
+    //         .map(|n| match n {
+    //             1 => [n
+    //                 .saturating_add(1)
+    //                 .saturating_add(1)
+    //                 .saturating_add(1)
+    //                 .saturating_add(1)
+    //                 .saturating_add(1)
+    //                 .saturating_add(1)
+    //                 .saturating_add(1)
+    //                 .saturating_add(1)],
+    //             n => [n],
+    //         })
+    //         .flatten();
+}
+
+#[allow(clippy::bind_instead_of_map)] // map + flatten will be suggested to `and_then`, but afterwards `map` is suggested again
+#[rustfmt::skip] // whitespace is important for this one
+fn issue8878() {
+    std::collections::HashMap::<u32, u32>::new()
+        .get(&0)
+        .and_then(|_| {
+// we need some newlines
+// so that the span is big enough
+// we need some newlines
+// so that the span is big enough
+// for a splitted output of the diagnostic
+            Some("")
+ // whitespace beforehand is important as well
+        });
 }
diff --git a/src/tools/clippy/tests/ui/map_flatten_fixable.rs b/src/tools/clippy/tests/ui/map_flatten_fixable.rs
index aa1f76e335a..4345c6eee74 100644
--- a/src/tools/clippy/tests/ui/map_flatten_fixable.rs
+++ b/src/tools/clippy/tests/ui/map_flatten_fixable.rs
@@ -28,4 +28,40 @@ fn main() {
 
     // mapping to Result on Result
     let _: Result<_, &str> = (Ok(Ok(1))).map(|x| x).flatten();
+
+    issue8734();
+    issue8878();
+}
+
+fn issue8734() {
+    //     let _ = [0u8, 1, 2, 3]
+    //         .into_iter()
+    //         .map(|n| match n {
+    //             1 => [n
+    //                 .saturating_add(1)
+    //                 .saturating_add(1)
+    //                 .saturating_add(1)
+    //                 .saturating_add(1)
+    //                 .saturating_add(1)
+    //                 .saturating_add(1)
+    //                 .saturating_add(1)
+    //                 .saturating_add(1)],
+    //             n => [n],
+    //         })
+    //         .flatten();
+}
+
+#[allow(clippy::bind_instead_of_map)] // map + flatten will be suggested to `and_then`, but afterwards `map` is suggested again
+#[rustfmt::skip] // whitespace is important for this one
+fn issue8878() {
+    std::collections::HashMap::<u32, u32>::new()
+        .get(&0)
+        .map(|_| {
+// we need some newlines
+// so that the span is big enough
+// for a splitted output of the diagnostic
+            Some("")
+ // whitespace beforehand is important as well
+        })
+        .flatten();
 }
diff --git a/src/tools/clippy/tests/ui/map_flatten_fixable.stderr b/src/tools/clippy/tests/ui/map_flatten_fixable.stderr
index c91c73846b6..828e24acaad 100644
--- a/src/tools/clippy/tests/ui/map_flatten_fixable.stderr
+++ b/src/tools/clippy/tests/ui/map_flatten_fixable.stderr
@@ -76,5 +76,31 @@ help: try replacing `map` with `and_then`, and remove the `.flatten()`
 LL |     let _: Result<_, &str> = (Ok(Ok(1))).and_then(|x| x);
    |                                          ~~~~~~~~~~~~~~~
 
-error: aborting due to 7 previous errors
+error: called `map(..).flatten()` on `Option`
+  --> $DIR/map_flatten_fixable.rs:59:10
+   |
+LL |           .map(|_| {
+   |  __________^
+LL | | // we need some newlines
+LL | | // so that the span is big enough
+LL | | // for a splitted output of the diagnostic
+...  |
+LL | |         })
+LL | |         .flatten();
+   | |__________________^
+   |
+help: try replacing `map` with `and_then`
+   |
+LL ~         .and_then(|_| {
+LL + // we need some newlines
+LL + // so that the span is big enough
+   |
+help: and remove the `.flatten()`
+   |
+LL +             Some("")
+LL +  // whitespace beforehand is important as well
+LL ~         });
+   |
+
+error: aborting due to 8 previous errors
 
diff --git a/src/tools/clippy/tests/ui/match_ref_pats.fixed b/src/tools/clippy/tests/ui/match_ref_pats.fixed
new file mode 100644
index 00000000000..1b6c2d92412
--- /dev/null
+++ b/src/tools/clippy/tests/ui/match_ref_pats.fixed
@@ -0,0 +1,118 @@
+// run-rustfix
+#![warn(clippy::match_ref_pats)]
+#![allow(dead_code, unused_variables, clippy::equatable_if_let, clippy::enum_variant_names)]
+
+fn ref_pats() {
+    {
+        let v = &Some(0);
+        match *v {
+            Some(v) => println!("{:?}", v),
+            None => println!("none"),
+        }
+        match v {
+            // This doesn't trigger; we have a different pattern.
+            &Some(v) => println!("some"),
+            other => println!("other"),
+        }
+    }
+    let tup = &(1, 2);
+    match tup {
+        &(v, 1) => println!("{}", v),
+        _ => println!("none"),
+    }
+    // Special case: using `&` both in expr and pats.
+    let w = Some(0);
+    match w {
+        Some(v) => println!("{:?}", v),
+        None => println!("none"),
+    }
+    // False positive: only wildcard pattern.
+    let w = Some(0);
+    #[allow(clippy::match_single_binding)]
+    match w {
+        _ => println!("none"),
+    }
+
+    let a = &Some(0);
+    if a.is_none() {
+        println!("none");
+    }
+
+    let b = Some(0);
+    if b.is_none() {
+        println!("none");
+    }
+}
+
+mod ice_3719 {
+    macro_rules! foo_variant(
+        ($idx:expr) => (Foo::get($idx).unwrap())
+    );
+
+    enum Foo {
+        A,
+        B,
+    }
+
+    impl Foo {
+        fn get(idx: u8) -> Option<&'static Self> {
+            match idx {
+                0 => Some(&Foo::A),
+                1 => Some(&Foo::B),
+                _ => None,
+            }
+        }
+    }
+
+    fn ice_3719() {
+        // ICE #3719
+        match foo_variant!(0) {
+            &Foo::A => println!("A"),
+            _ => println!("Wild"),
+        }
+    }
+}
+
+mod issue_7740 {
+    macro_rules! foobar_variant(
+        ($idx:expr) => (FooBar::get($idx).unwrap())
+    );
+
+    enum FooBar {
+        Foo,
+        Bar,
+        FooBar,
+        BarFoo,
+    }
+
+    impl FooBar {
+        fn get(idx: u8) -> Option<&'static Self> {
+            match idx {
+                0 => Some(&FooBar::Foo),
+                1 => Some(&FooBar::Bar),
+                2 => Some(&FooBar::FooBar),
+                3 => Some(&FooBar::BarFoo),
+                _ => None,
+            }
+        }
+    }
+
+    fn issue_7740() {
+        // Issue #7740
+        match *foobar_variant!(0) {
+            FooBar::Foo => println!("Foo"),
+            FooBar::Bar => println!("Bar"),
+            FooBar::FooBar => println!("FooBar"),
+            _ => println!("Wild"),
+        }
+
+        // This shouldn't trigger
+        if let &FooBar::BarFoo = foobar_variant!(3) {
+            println!("BarFoo");
+        } else {
+            println!("Wild");
+        }
+    }
+}
+
+fn main() {}
diff --git a/src/tools/clippy/tests/ui/match_ref_pats.rs b/src/tools/clippy/tests/ui/match_ref_pats.rs
index 7e3674ab8c9..68dfac4e2e9 100644
--- a/src/tools/clippy/tests/ui/match_ref_pats.rs
+++ b/src/tools/clippy/tests/ui/match_ref_pats.rs
@@ -1,5 +1,6 @@
+// run-rustfix
 #![warn(clippy::match_ref_pats)]
-#![allow(clippy::equatable_if_let, clippy::enum_variant_names)]
+#![allow(dead_code, unused_variables, clippy::equatable_if_let, clippy::enum_variant_names)]
 
 fn ref_pats() {
     {
diff --git a/src/tools/clippy/tests/ui/match_ref_pats.stderr b/src/tools/clippy/tests/ui/match_ref_pats.stderr
index 901820077e2..353f7399d9c 100644
--- a/src/tools/clippy/tests/ui/match_ref_pats.stderr
+++ b/src/tools/clippy/tests/ui/match_ref_pats.stderr
@@ -1,5 +1,5 @@
 error: you don't need to add `&` to all patterns
-  --> $DIR/match_ref_pats.rs:7:9
+  --> $DIR/match_ref_pats.rs:8:9
    |
 LL | /         match v {
 LL | |             &Some(v) => println!("{:?}", v),
@@ -16,7 +16,7 @@ LL ~             None => println!("none"),
    |
 
 error: you don't need to add `&` to both the expression and the patterns
-  --> $DIR/match_ref_pats.rs:24:5
+  --> $DIR/match_ref_pats.rs:25:5
    |
 LL | /     match &w {
 LL | |         &Some(v) => println!("{:?}", v),
@@ -32,7 +32,7 @@ LL ~         None => println!("none"),
    |
 
 error: redundant pattern matching, consider using `is_none()`
-  --> $DIR/match_ref_pats.rs:36:12
+  --> $DIR/match_ref_pats.rs:37:12
    |
 LL |     if let &None = a {
    |     -------^^^^^---- help: try this: `if a.is_none()`
@@ -40,13 +40,13 @@ LL |     if let &None = a {
    = note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
 
 error: redundant pattern matching, consider using `is_none()`
-  --> $DIR/match_ref_pats.rs:41:12
+  --> $DIR/match_ref_pats.rs:42:12
    |
 LL |     if let &None = &b {
    |     -------^^^^^----- help: try this: `if b.is_none()`
 
 error: you don't need to add `&` to all patterns
-  --> $DIR/match_ref_pats.rs:101:9
+  --> $DIR/match_ref_pats.rs:102:9
    |
 LL | /         match foobar_variant!(0) {
 LL | |             &FooBar::Foo => println!("Foo"),
diff --git a/src/tools/clippy/tests/ui/match_str_case_mismatch.fixed b/src/tools/clippy/tests/ui/match_str_case_mismatch.fixed
new file mode 100644
index 00000000000..e436bcf495f
--- /dev/null
+++ b/src/tools/clippy/tests/ui/match_str_case_mismatch.fixed
@@ -0,0 +1,186 @@
+// run-rustfix
+#![warn(clippy::match_str_case_mismatch)]
+#![allow(dead_code)]
+
+// Valid
+
+fn as_str_match() {
+    let var = "BAR";
+
+    match var.to_ascii_lowercase().as_str() {
+        "foo" => {},
+        "bar" => {},
+        _ => {},
+    }
+}
+
+fn non_alphabetic() {
+    let var = "~!@#$%^&*()-_=+FOO";
+
+    match var.to_ascii_lowercase().as_str() {
+        "1234567890" => {},
+        "~!@#$%^&*()-_=+foo" => {},
+        "\n\r\t\x7F" => {},
+        _ => {},
+    }
+}
+
+fn unicode_cased() {
+    let var = "ВОДЫ";
+
+    match var.to_lowercase().as_str() {
+        "水" => {},
+        "νερό" => {},
+        "воды" => {},
+        "물" => {},
+        _ => {},
+    }
+}
+
+fn titlecase() {
+    let var = "BarDz";
+
+    match var.to_lowercase().as_str() {
+        "foolj" => {},
+        "bardz" => {},
+        _ => {},
+    }
+}
+
+fn no_case_equivalent() {
+    let var = "barʁ";
+
+    match var.to_uppercase().as_str() {
+        "FOOɕ" => {},
+        "BARʁ" => {},
+        _ => {},
+    }
+}
+
+fn addrof_unary_match() {
+    let var = "BAR";
+
+    match &*var.to_ascii_lowercase() {
+        "foo" => {},
+        "bar" => {},
+        _ => {},
+    }
+}
+
+fn alternating_chain() {
+    let var = "BAR";
+
+    match &*var
+        .to_ascii_lowercase()
+        .to_uppercase()
+        .to_lowercase()
+        .to_ascii_uppercase()
+    {
+        "FOO" => {},
+        "BAR" => {},
+        _ => {},
+    }
+}
+
+fn unrelated_method() {
+    struct Item {
+        a: String,
+    }
+
+    impl Item {
+        #[allow(clippy::wrong_self_convention)]
+        fn to_lowercase(self) -> String {
+            self.a
+        }
+    }
+
+    let item = Item { a: String::from("BAR") };
+
+    match &*item.to_lowercase() {
+        "FOO" => {},
+        "BAR" => {},
+        _ => {},
+    }
+}
+
+// Invalid
+
+fn as_str_match_mismatch() {
+    let var = "BAR";
+
+    match var.to_ascii_lowercase().as_str() {
+        "foo" => {},
+        "bar" => {},
+        _ => {},
+    }
+}
+
+fn non_alphabetic_mismatch() {
+    let var = "~!@#$%^&*()-_=+FOO";
+
+    match var.to_ascii_lowercase().as_str() {
+        "1234567890" => {},
+        "~!@#$%^&*()-_=+foo" => {},
+        "\n\r\t\x7F" => {},
+        _ => {},
+    }
+}
+
+fn unicode_cased_mismatch() {
+    let var = "ВОДЫ";
+
+    match var.to_lowercase().as_str() {
+        "水" => {},
+        "νερό" => {},
+        "воды" => {},
+        "물" => {},
+        _ => {},
+    }
+}
+
+fn titlecase_mismatch() {
+    let var = "BarDz";
+
+    match var.to_lowercase().as_str() {
+        "foolj" => {},
+        "bardz" => {},
+        _ => {},
+    }
+}
+
+fn no_case_equivalent_mismatch() {
+    let var = "barʁ";
+
+    match var.to_uppercase().as_str() {
+        "FOOɕ" => {},
+        "BARʁ" => {},
+        _ => {},
+    }
+}
+
+fn addrof_unary_match_mismatch() {
+    let var = "BAR";
+
+    match &*var.to_ascii_lowercase() {
+        "foo" => {},
+        "bar" => {},
+        _ => {},
+    }
+}
+
+fn alternating_chain_mismatch() {
+    let var = "BAR";
+
+    match &*var
+        .to_ascii_lowercase()
+        .to_uppercase()
+        .to_lowercase()
+        .to_ascii_uppercase()
+    {
+        "FOO" => {},
+        "BAR" => {},
+        _ => {},
+    }
+}
+
+fn main() {}
diff --git a/src/tools/clippy/tests/ui/match_str_case_mismatch.rs b/src/tools/clippy/tests/ui/match_str_case_mismatch.rs
index ac555c87d83..92e2a000ade 100644
--- a/src/tools/clippy/tests/ui/match_str_case_mismatch.rs
+++ b/src/tools/clippy/tests/ui/match_str_case_mismatch.rs
@@ -1,4 +1,6 @@
+// run-rustfix
 #![warn(clippy::match_str_case_mismatch)]
+#![allow(dead_code)]
 
 // Valid
 
diff --git a/src/tools/clippy/tests/ui/match_str_case_mismatch.stderr b/src/tools/clippy/tests/ui/match_str_case_mismatch.stderr
index 92baa40ef28..197520a3d60 100644
--- a/src/tools/clippy/tests/ui/match_str_case_mismatch.stderr
+++ b/src/tools/clippy/tests/ui/match_str_case_mismatch.stderr
@@ -1,5 +1,5 @@
 error: this `match` arm has a differing case than its expression
-  --> $DIR/match_str_case_mismatch.rs:111:9
+  --> $DIR/match_str_case_mismatch.rs:113:9
    |
 LL |         "Bar" => {},
    |         ^^^^^
@@ -11,7 +11,7 @@ LL |         "bar" => {},
    |         ~~~~~
 
 error: this `match` arm has a differing case than its expression
-  --> $DIR/match_str_case_mismatch.rs:121:9
+  --> $DIR/match_str_case_mismatch.rs:123:9
    |
 LL |         "~!@#$%^&*()-_=+Foo" => {},
    |         ^^^^^^^^^^^^^^^^^^^^
@@ -22,7 +22,7 @@ LL |         "~!@#$%^&*()-_=+foo" => {},
    |         ~~~~~~~~~~~~~~~~~~~~
 
 error: this `match` arm has a differing case than its expression
-  --> $DIR/match_str_case_mismatch.rs:133:9
+  --> $DIR/match_str_case_mismatch.rs:135:9
    |
 LL |         "Воды" => {},
    |         ^^^^^^
@@ -33,7 +33,7 @@ LL |         "воды" => {},
    |         ~~~~~~
 
 error: this `match` arm has a differing case than its expression
-  --> $DIR/match_str_case_mismatch.rs:144:9
+  --> $DIR/match_str_case_mismatch.rs:146:9
    |
 LL |         "barDz" => {},
    |         ^^^^^^
@@ -44,7 +44,7 @@ LL |         "bardz" => {},
    |         ~~~~~~
 
 error: this `match` arm has a differing case than its expression
-  --> $DIR/match_str_case_mismatch.rs:154:9
+  --> $DIR/match_str_case_mismatch.rs:156:9
    |
 LL |         "bARʁ" => {},
    |         ^^^^^^
@@ -55,7 +55,7 @@ LL |         "BARʁ" => {},
    |         ~~~~~~
 
 error: this `match` arm has a differing case than its expression
-  --> $DIR/match_str_case_mismatch.rs:164:9
+  --> $DIR/match_str_case_mismatch.rs:166:9
    |
 LL |         "Bar" => {},
    |         ^^^^^
@@ -66,7 +66,7 @@ LL |         "bar" => {},
    |         ~~~~~
 
 error: this `match` arm has a differing case than its expression
-  --> $DIR/match_str_case_mismatch.rs:179:9
+  --> $DIR/match_str_case_mismatch.rs:181:9
    |
 LL |         "bAR" => {},
    |         ^^^^^
diff --git a/src/tools/clippy/tests/ui/mismatching_type_param_order.rs b/src/tools/clippy/tests/ui/mismatching_type_param_order.rs
new file mode 100644
index 00000000000..8f286c9304c
--- /dev/null
+++ b/src/tools/clippy/tests/ui/mismatching_type_param_order.rs
@@ -0,0 +1,60 @@
+#![warn(clippy::mismatching_type_param_order)]
+#![allow(clippy::blacklisted_name)]
+
+fn main() {
+    struct Foo<A, B> {
+        x: A,
+        y: B,
+    }
+
+    // lint on both params
+    impl<B, A> Foo<B, A> {}
+
+    // lint on the 2nd param
+    impl<C, A> Foo<C, A> {}
+
+    // should not lint
+    impl<A, B> Foo<A, B> {}
+
+    struct FooLifetime<'l, 'm, A, B> {
+        x: &'l A,
+        y: &'m B,
+    }
+
+    // should not lint on lifetimes
+    impl<'m, 'l, B, A> FooLifetime<'m, 'l, B, A> {}
+
+    struct Bar {
+        x: i32,
+    }
+
+    // should not lint
+    impl Bar {}
+
+    // also works for enums
+    enum FooEnum<A, B, C> {
+        X(A),
+        Y(B),
+        Z(C),
+    }
+
+    impl<C, A, B> FooEnum<C, A, B> {}
+
+    // also works for unions
+    union FooUnion<A: Copy, B>
+    where
+        B: Copy,
+    {
+        x: A,
+        y: B,
+    }
+
+    impl<B: Copy, A> FooUnion<B, A> where A: Copy {}
+
+    impl<A, B> FooUnion<A, B>
+    where
+        A: Copy,
+        B: Copy,
+    {
+    }
+}
diff --git a/src/tools/clippy/tests/ui/mismatching_type_param_order.stderr b/src/tools/clippy/tests/ui/mismatching_type_param_order.stderr
new file mode 100644
index 00000000000..cb720256c50
--- /dev/null
+++ b/src/tools/clippy/tests/ui/mismatching_type_param_order.stderr
@@ -0,0 +1,83 @@
+error: `Foo` has a similarly named generic type parameter `B` in its declaration, but in a different order
+  --> $DIR/mismatching_type_param_order.rs:11:20
+   |
+LL |     impl<B, A> Foo<B, A> {}
+   |                    ^
+   |
+   = note: `-D clippy::mismatching-type-param-order` implied by `-D warnings`
+   = help: try `A`, or a name that does not conflict with `Foo`'s generic params
+
+error: `Foo` has a similarly named generic type parameter `A` in its declaration, but in a different order
+  --> $DIR/mismatching_type_param_order.rs:11:23
+   |
+LL |     impl<B, A> Foo<B, A> {}
+   |                       ^
+   |
+   = help: try `B`, or a name that does not conflict with `Foo`'s generic params
+
+error: `Foo` has a similarly named generic type parameter `A` in its declaration, but in a different order
+  --> $DIR/mismatching_type_param_order.rs:14:23
+   |
+LL |     impl<C, A> Foo<C, A> {}
+   |                       ^
+   |
+   = help: try `B`, or a name that does not conflict with `Foo`'s generic params
+
+error: `FooLifetime` has a similarly named generic type parameter `B` in its declaration, but in a different order
+  --> $DIR/mismatching_type_param_order.rs:25:44
+   |
+LL |     impl<'m, 'l, B, A> FooLifetime<'m, 'l, B, A> {}
+   |                                            ^
+   |
+   = help: try `A`, or a name that does not conflict with `FooLifetime`'s generic params
+
+error: `FooLifetime` has a similarly named generic type parameter `A` in its declaration, but in a different order
+  --> $DIR/mismatching_type_param_order.rs:25:47
+   |
+LL |     impl<'m, 'l, B, A> FooLifetime<'m, 'l, B, A> {}
+   |                                               ^
+   |
+   = help: try `B`, or a name that does not conflict with `FooLifetime`'s generic params
+
+error: `FooEnum` has a similarly named generic type parameter `C` in its declaration, but in a different order
+  --> $DIR/mismatching_type_param_order.rs:41:27
+   |
+LL |     impl<C, A, B> FooEnum<C, A, B> {}
+   |                           ^
+   |
+   = help: try `A`, or a name that does not conflict with `FooEnum`'s generic params
+
+error: `FooEnum` has a similarly named generic type parameter `A` in its declaration, but in a different order
+  --> $DIR/mismatching_type_param_order.rs:41:30
+   |
+LL |     impl<C, A, B> FooEnum<C, A, B> {}
+   |                              ^
+   |
+   = help: try `B`, or a name that does not conflict with `FooEnum`'s generic params
+
+error: `FooEnum` has a similarly named generic type parameter `B` in its declaration, but in a different order
+  --> $DIR/mismatching_type_param_order.rs:41:33
+   |
+LL |     impl<C, A, B> FooEnum<C, A, B> {}
+   |                                 ^
+   |
+   = help: try `C`, or a name that does not conflict with `FooEnum`'s generic params
+
+error: `FooUnion` has a similarly named generic type parameter `B` in its declaration, but in a different order
+  --> $DIR/mismatching_type_param_order.rs:52:31
+   |
+LL |     impl<B: Copy, A> FooUnion<B, A> where A: Copy {}
+   |                               ^
+   |
+   = help: try `A`, or a name that does not conflict with `FooUnion`'s generic params
+
+error: `FooUnion` has a similarly named generic type parameter `A` in its declaration, but in a different order
+  --> $DIR/mismatching_type_param_order.rs:52:34
+   |
+LL |     impl<B: Copy, A> FooUnion<B, A> where A: Copy {}
+   |                                  ^
+   |
+   = help: try `B`, or a name that does not conflict with `FooUnion`'s generic params
+
+error: aborting due to 10 previous errors
+
diff --git a/src/tools/clippy/tests/ui/modulo_one.rs b/src/tools/clippy/tests/ui/modulo_one.rs
index 678a312f66e..adff08e5d1e 100644
--- a/src/tools/clippy/tests/ui/modulo_one.rs
+++ b/src/tools/clippy/tests/ui/modulo_one.rs
@@ -1,5 +1,5 @@
 #![warn(clippy::modulo_one)]
-#![allow(clippy::no_effect, clippy::unnecessary_operation)]
+#![allow(clippy::no_effect, clippy::unnecessary_operation, clippy::identity_op)]
 
 static STATIC_ONE: usize = 2 - 1;
 static STATIC_NEG_ONE: i64 = 1 - 2;
diff --git a/src/tools/clippy/tests/ui/modulo_one.stderr b/src/tools/clippy/tests/ui/modulo_one.stderr
index 03f460897fc..04ecdef5e99 100644
--- a/src/tools/clippy/tests/ui/modulo_one.stderr
+++ b/src/tools/clippy/tests/ui/modulo_one.stderr
@@ -38,14 +38,6 @@ error: any number modulo -1 will panic/overflow or result in 0
 LL |     i32::MIN % (-1); // also caught by rustc
    |     ^^^^^^^^^^^^^^^
 
-error: the operation is ineffective. Consider reducing it to `1`
-  --> $DIR/modulo_one.rs:13:22
-   |
-LL |     const ONE: u32 = 1 * 1;
-   |                      ^^^^^
-   |
-   = note: `-D clippy::identity-op` implied by `-D warnings`
-
 error: any number modulo 1 will be 0
   --> $DIR/modulo_one.rs:17:5
    |
@@ -64,5 +56,5 @@ error: any number modulo -1 will panic/overflow or result in 0
 LL |     INT_MIN % NEG_ONE; // also caught by rustc
    |     ^^^^^^^^^^^^^^^^^
 
-error: aborting due to 10 previous errors
+error: aborting due to 9 previous errors
 
diff --git a/src/tools/clippy/tests/ui/needless_late_init.fixed b/src/tools/clippy/tests/ui/needless_late_init.fixed
new file mode 100644
index 00000000000..fee8e3030b8
--- /dev/null
+++ b/src/tools/clippy/tests/ui/needless_late_init.fixed
@@ -0,0 +1,273 @@
+// run-rustfix
+#![feature(let_chains)]
+#![allow(
+    unused,
+    clippy::assign_op_pattern,
+    clippy::blocks_in_if_conditions,
+    clippy::let_and_return,
+    clippy::let_unit_value,
+    clippy::nonminimal_bool
+)]
+
+use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
+use std::rc::Rc;
+
+struct SignificantDrop;
+impl std::ops::Drop for SignificantDrop {
+    fn drop(&mut self) {
+        println!("dropped");
+    }
+}
+
+fn simple() {
+    
+    let a = "zero";
+
+    
+    
+    let b = 1;
+    let c = 2;
+
+    
+    let d: usize = 1;
+
+    
+    let e = format!("{}", d);
+}
+
+fn main() {
+    
+    let n = 1;
+    let a = match n {
+        1 => "one",
+        _ => {
+            "two"
+        },
+    };
+
+    
+    let b = if n == 3 {
+        "four"
+    } else {
+        "five"
+    };
+
+    
+    let d = if true {
+        let temp = 5;
+        temp
+    } else {
+        15
+    };
+
+    
+    let e = if true {
+        format!("{} {}", a, b)
+    } else {
+        format!("{}", n)
+    };
+
+    
+    let f = match 1 {
+        1 => "three",
+        _ => return,
+    }; // has semi
+
+    
+    let g: usize = if true {
+        5
+    } else {
+        panic!();
+    };
+
+    // Drop order only matters if both are significant
+    
+    let y = SignificantDrop;
+    let x = 1;
+
+    
+    let y = 1;
+    let x = SignificantDrop;
+
+    
+    // types that should be considered insignificant
+    let y = 1;
+    let y = "2";
+    let y = String::new();
+    let y = vec![3.0];
+    let y = HashMap::<usize, usize>::new();
+    let y = BTreeMap::<usize, usize>::new();
+    let y = HashSet::<usize>::new();
+    let y = BTreeSet::<usize>::new();
+    let y = Box::new(4);
+    let x = SignificantDrop;
+}
+
+async fn in_async() -> &'static str {
+    async fn f() -> &'static str {
+        "one"
+    }
+
+    
+    let n = 1;
+    let a = match n {
+        1 => f().await,
+        _ => {
+            "two"
+        },
+    };
+
+    a
+}
+
+const fn in_const() -> &'static str {
+    const fn f() -> &'static str {
+        "one"
+    }
+
+    
+    let n = 1;
+    let a = match n {
+        1 => f(),
+        _ => {
+            "two"
+        },
+    };
+
+    a
+}
+
+fn does_not_lint() {
+    let z;
+    if false {
+        z = 1;
+    }
+
+    let x;
+    let y;
+    if true {
+        x = 1;
+    } else {
+        y = 1;
+    }
+
+    let mut x;
+    if true {
+        x = 5;
+        x = 10 / x;
+    } else {
+        x = 2;
+    }
+
+    let x;
+    let _ = match 1 {
+        1 => x = 10,
+        _ => x = 20,
+    };
+
+    // using tuples would be possible, but not always preferable
+    let x;
+    let y;
+    if true {
+        x = 1;
+        y = 2;
+    } else {
+        x = 3;
+        y = 4;
+    }
+
+    // could match with a smarter heuristic to avoid multiple assignments
+    let x;
+    if true {
+        let mut y = 5;
+        y = 6;
+        x = y;
+    } else {
+        x = 2;
+    }
+
+    let (x, y);
+    if true {
+        x = 1;
+    } else {
+        x = 2;
+    }
+    y = 3;
+
+    macro_rules! assign {
+        ($i:ident) => {
+            $i = 1;
+        };
+    }
+    let x;
+    assign!(x);
+
+    let x;
+    if true {
+        assign!(x);
+    } else {
+        x = 2;
+    }
+
+    macro_rules! in_macro {
+        () => {
+            let x;
+            x = 1;
+
+            let x;
+            if true {
+                x = 1;
+            } else {
+                x = 2;
+            }
+        };
+    }
+    in_macro!();
+
+    // ignore if-lets - https://github.com/rust-lang/rust-clippy/issues/8613
+    let x;
+    if let Some(n) = Some("v") {
+        x = 1;
+    } else {
+        x = 2;
+    }
+
+    let x;
+    if true && let Some(n) = Some("let chains too") {
+        x = 1;
+    } else {
+        x = 2;
+    }
+
+    // ignore mut bindings
+    // https://github.com/shepmaster/twox-hash/blob/b169c16d86eb8ea4a296b0acb9d00ca7e3c3005f/src/sixty_four.rs#L88-L93
+    // https://github.com/dtolnay/thiserror/blob/21c26903e29cb92ba1a7ff11e82ae2001646b60d/tests/test_generics.rs#L91-L100
+    let mut x: usize;
+    x = 1;
+    x = 2;
+    x = 3;
+
+    // should not move the declaration if `x` has a significant drop, and there
+    // is another binding with a significant drop between it and the first usage
+    let x;
+    let y = SignificantDrop;
+    x = SignificantDrop;
+}
+
+#[rustfmt::skip]
+fn issue8911() -> u32 {
+    let x;
+    match 1 {
+        _ if { x = 1; false } => return 1,
+        _ => return 2,
+    }
+
+    let x;
+    if { x = 1; true } {
+        return 1;
+    } else {
+        return 2;
+    }
+
+    3
+}
diff --git a/src/tools/clippy/tests/ui/needless_late_init.rs b/src/tools/clippy/tests/ui/needless_late_init.rs
index 54e66b391b8..402d9f9ef7f 100644
--- a/src/tools/clippy/tests/ui/needless_late_init.rs
+++ b/src/tools/clippy/tests/ui/needless_late_init.rs
@@ -1,5 +1,13 @@
+// run-rustfix
 #![feature(let_chains)]
-#![allow(unused, clippy::nonminimal_bool, clippy::let_unit_value)]
+#![allow(
+    unused,
+    clippy::assign_op_pattern,
+    clippy::blocks_in_if_conditions,
+    clippy::let_and_return,
+    clippy::let_unit_value,
+    clippy::nonminimal_bool
+)]
 
 use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
 use std::rc::Rc;
@@ -11,6 +19,22 @@ impl std::ops::Drop for SignificantDrop {
     }
 }
 
+fn simple() {
+    let a;
+    a = "zero";
+
+    let b;
+    let c;
+    b = 1;
+    c = 2;
+
+    let d: usize;
+    d = 1;
+
+    let e;
+    e = format!("{}", d);
+}
+
 fn main() {
     let a;
     let n = 1;
@@ -229,3 +253,21 @@ fn does_not_lint() {
     let y = SignificantDrop;
     x = SignificantDrop;
 }
+
+#[rustfmt::skip]
+fn issue8911() -> u32 {
+    let x;
+    match 1 {
+        _ if { x = 1; false } => return 1,
+        _ => return 2,
+    }
+
+    let x;
+    if { x = 1; true } {
+        return 1;
+    } else {
+        return 2;
+    }
+
+    3
+}
diff --git a/src/tools/clippy/tests/ui/needless_late_init.stderr b/src/tools/clippy/tests/ui/needless_late_init.stderr
index d33a117b288..f320b5b9cbb 100644
--- a/src/tools/clippy/tests/ui/needless_late_init.stderr
+++ b/src/tools/clippy/tests/ui/needless_late_init.stderr
@@ -1,12 +1,79 @@
 error: unneeded late initialization
-  --> $DIR/needless_late_init.rs:15:5
+  --> $DIR/needless_late_init.rs:23:5
    |
 LL |     let a;
-   |     ^^^^^^
+   |     ^^^^^^ created here
+LL |     a = "zero";
+   |     ^^^^^^^^^^ initialised here
    |
    = note: `-D clippy::needless-late-init` implied by `-D warnings`
 help: declare `a` here
    |
+LL |     let a = "zero";
+   |     ~~~~~
+
+error: unneeded late initialization
+  --> $DIR/needless_late_init.rs:26:5
+   |
+LL |     let b;
+   |     ^^^^^^ created here
+LL |     let c;
+LL |     b = 1;
+   |     ^^^^^ initialised here
+   |
+help: declare `b` here
+   |
+LL |     let b = 1;
+   |     ~~~~~
+
+error: unneeded late initialization
+  --> $DIR/needless_late_init.rs:27:5
+   |
+LL |     let c;
+   |     ^^^^^^ created here
+LL |     b = 1;
+LL |     c = 2;
+   |     ^^^^^ initialised here
+   |
+help: declare `c` here
+   |
+LL |     let c = 2;
+   |     ~~~~~
+
+error: unneeded late initialization
+  --> $DIR/needless_late_init.rs:31:5
+   |
+LL |     let d: usize;
+   |     ^^^^^^^^^^^^^ created here
+LL |     d = 1;
+   |     ^^^^^ initialised here
+   |
+help: declare `d` here
+   |
+LL |     let d: usize = 1;
+   |     ~~~~~~~~~~~~
+
+error: unneeded late initialization
+  --> $DIR/needless_late_init.rs:34:5
+   |
+LL |     let e;
+   |     ^^^^^^ created here
+LL |     e = format!("{}", d);
+   |     ^^^^^^^^^^^^^^^^^^^^ initialised here
+   |
+help: declare `e` here
+   |
+LL |     let e = format!("{}", d);
+   |     ~~~~~
+
+error: unneeded late initialization
+  --> $DIR/needless_late_init.rs:39:5
+   |
+LL |     let a;
+   |     ^^^^^^
+   |
+help: declare `a` here
+   |
 LL |     let a = match n {
    |     +++++++
 help: remove the assignments from the `match` arms
@@ -21,7 +88,7 @@ LL |     };
    |      +
 
 error: unneeded late initialization
-  --> $DIR/needless_late_init.rs:24:5
+  --> $DIR/needless_late_init.rs:48:5
    |
 LL |     let b;
    |     ^^^^^^
@@ -42,7 +109,7 @@ LL |     };
    |      +
 
 error: unneeded late initialization
-  --> $DIR/needless_late_init.rs:31:5
+  --> $DIR/needless_late_init.rs:55:5
    |
 LL |     let d;
    |     ^^^^^^
@@ -63,7 +130,7 @@ LL |     };
    |      +
 
 error: unneeded late initialization
-  --> $DIR/needless_late_init.rs:39:5
+  --> $DIR/needless_late_init.rs:63:5
    |
 LL |     let e;
    |     ^^^^^^
@@ -84,7 +151,7 @@ LL |     };
    |      +
 
 error: unneeded late initialization
-  --> $DIR/needless_late_init.rs:46:5
+  --> $DIR/needless_late_init.rs:70:5
    |
 LL |     let f;
    |     ^^^^^^
@@ -100,7 +167,7 @@ LL +         1 => "three",
    | 
 
 error: unneeded late initialization
-  --> $DIR/needless_late_init.rs:52:5
+  --> $DIR/needless_late_init.rs:76:5
    |
 LL |     let g: usize;
    |     ^^^^^^^^^^^^^
@@ -120,7 +187,7 @@ LL |     };
    |      +
 
 error: unneeded late initialization
-  --> $DIR/needless_late_init.rs:60:5
+  --> $DIR/needless_late_init.rs:84:5
    |
 LL |     let x;
    |     ^^^^^^ created here
@@ -134,7 +201,7 @@ LL |     let x = 1;
    |     ~~~~~
 
 error: unneeded late initialization
-  --> $DIR/needless_late_init.rs:64:5
+  --> $DIR/needless_late_init.rs:88:5
    |
 LL |     let x;
    |     ^^^^^^ created here
@@ -148,7 +215,7 @@ LL |     let x = SignificantDrop;
    |     ~~~~~
 
 error: unneeded late initialization
-  --> $DIR/needless_late_init.rs:68:5
+  --> $DIR/needless_late_init.rs:92:5
    |
 LL |     let x;
    |     ^^^^^^ created here
@@ -162,7 +229,7 @@ LL |     let x = SignificantDrop;
    |     ~~~~~
 
 error: unneeded late initialization
-  --> $DIR/needless_late_init.rs:87:5
+  --> $DIR/needless_late_init.rs:111:5
    |
 LL |     let a;
    |     ^^^^^^
@@ -183,7 +250,7 @@ LL |     };
    |      +
 
 error: unneeded late initialization
-  --> $DIR/needless_late_init.rs:104:5
+  --> $DIR/needless_late_init.rs:128:5
    |
 LL |     let a;
    |     ^^^^^^
@@ -203,5 +270,5 @@ help: add a semicolon after the `match` expression
 LL |     };
    |      +
 
-error: aborting due to 11 previous errors
+error: aborting due to 16 previous errors
 
diff --git a/src/tools/clippy/tests/ui/needless_late_init_fixable.fixed b/src/tools/clippy/tests/ui/needless_late_init_fixable.fixed
deleted file mode 100644
index 724477e8691..00000000000
--- a/src/tools/clippy/tests/ui/needless_late_init_fixable.fixed
+++ /dev/null
@@ -1,19 +0,0 @@
-// run-rustfix
-
-#![allow(unused, clippy::assign_op_pattern)]
-
-fn main() {
-    
-    let a = "zero";
-
-    
-    
-    let b = 1;
-    let c = 2;
-
-    
-    let d: usize = 1;
-
-    
-    let e = format!("{}", d);
-}
diff --git a/src/tools/clippy/tests/ui/needless_late_init_fixable.rs b/src/tools/clippy/tests/ui/needless_late_init_fixable.rs
deleted file mode 100644
index 3e6bd363672..00000000000
--- a/src/tools/clippy/tests/ui/needless_late_init_fixable.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-// run-rustfix
-
-#![allow(unused, clippy::assign_op_pattern)]
-
-fn main() {
-    let a;
-    a = "zero";
-
-    let b;
-    let c;
-    b = 1;
-    c = 2;
-
-    let d: usize;
-    d = 1;
-
-    let e;
-    e = format!("{}", d);
-}
diff --git a/src/tools/clippy/tests/ui/needless_late_init_fixable.stderr b/src/tools/clippy/tests/ui/needless_late_init_fixable.stderr
deleted file mode 100644
index 8c664309e3e..00000000000
--- a/src/tools/clippy/tests/ui/needless_late_init_fixable.stderr
+++ /dev/null
@@ -1,70 +0,0 @@
-error: unneeded late initialization
-  --> $DIR/needless_late_init_fixable.rs:6:5
-   |
-LL |     let a;
-   |     ^^^^^^ created here
-LL |     a = "zero";
-   |     ^^^^^^^^^^ initialised here
-   |
-   = note: `-D clippy::needless-late-init` implied by `-D warnings`
-help: declare `a` here
-   |
-LL |     let a = "zero";
-   |     ~~~~~
-
-error: unneeded late initialization
-  --> $DIR/needless_late_init_fixable.rs:9:5
-   |
-LL |     let b;
-   |     ^^^^^^ created here
-LL |     let c;
-LL |     b = 1;
-   |     ^^^^^ initialised here
-   |
-help: declare `b` here
-   |
-LL |     let b = 1;
-   |     ~~~~~
-
-error: unneeded late initialization
-  --> $DIR/needless_late_init_fixable.rs:10:5
-   |
-LL |     let c;
-   |     ^^^^^^ created here
-LL |     b = 1;
-LL |     c = 2;
-   |     ^^^^^ initialised here
-   |
-help: declare `c` here
-   |
-LL |     let c = 2;
-   |     ~~~~~
-
-error: unneeded late initialization
-  --> $DIR/needless_late_init_fixable.rs:14:5
-   |
-LL |     let d: usize;
-   |     ^^^^^^^^^^^^^ created here
-LL |     d = 1;
-   |     ^^^^^ initialised here
-   |
-help: declare `d` here
-   |
-LL |     let d: usize = 1;
-   |     ~~~~~~~~~~~~
-
-error: unneeded late initialization
-  --> $DIR/needless_late_init_fixable.rs:17:5
-   |
-LL |     let e;
-   |     ^^^^^^ created here
-LL |     e = format!("{}", d);
-   |     ^^^^^^^^^^^^^^^^^^^^ initialised here
-   |
-help: declare `e` here
-   |
-LL |     let e = format!("{}", d);
-   |     ~~~~~
-
-error: aborting due to 5 previous errors
-
diff --git a/src/tools/clippy/tests/ui/needless_lifetimes.rs b/src/tools/clippy/tests/ui/needless_lifetimes.rs
index 1456204ca86..fc686b1dac0 100644
--- a/src/tools/clippy/tests/ui/needless_lifetimes.rs
+++ b/src/tools/clippy/tests/ui/needless_lifetimes.rs
@@ -4,7 +4,8 @@
     clippy::boxed_local,
     clippy::needless_pass_by_value,
     clippy::unnecessary_wraps,
-    dyn_drop
+    dyn_drop,
+    clippy::get_first
 )]
 
 fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) {}
diff --git a/src/tools/clippy/tests/ui/needless_lifetimes.stderr b/src/tools/clippy/tests/ui/needless_lifetimes.stderr
index a488bc01fff..3c428fd4674 100644
--- a/src/tools/clippy/tests/ui/needless_lifetimes.stderr
+++ b/src/tools/clippy/tests/ui/needless_lifetimes.stderr
@@ -1,5 +1,5 @@
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:10:1
+  --> $DIR/needless_lifetimes.rs:11:1
    |
 LL | fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -7,181 +7,181 @@ LL | fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) {}
    = note: `-D clippy::needless-lifetimes` implied by `-D warnings`
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:12:1
+  --> $DIR/needless_lifetimes.rs:13:1
    |
 LL | fn distinct_and_static<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: &'static u8) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:22:1
+  --> $DIR/needless_lifetimes.rs:23:1
    |
 LL | fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:56:1
+  --> $DIR/needless_lifetimes.rs:57:1
    |
 LL | fn deep_reference_3<'a>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:61:1
+  --> $DIR/needless_lifetimes.rs:62:1
    |
 LL | fn where_clause_without_lt<'a, T>(x: &'a u8, _y: u8) -> Result<&'a u8, ()>
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:73:1
+  --> $DIR/needless_lifetimes.rs:74:1
    |
 LL | fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:97:1
+  --> $DIR/needless_lifetimes.rs:98:1
    |
 LL | fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:127:5
+  --> $DIR/needless_lifetimes.rs:128:5
    |
 LL |     fn self_and_out<'s>(&'s self) -> &'s u8 {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:136:5
+  --> $DIR/needless_lifetimes.rs:137:5
    |
 LL |     fn distinct_self_and_in<'s, 't>(&'s self, _x: &'t u8) {}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:155:1
+  --> $DIR/needless_lifetimes.rs:156:1
    |
 LL | fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:185:1
+  --> $DIR/needless_lifetimes.rs:186:1
    |
 LL | fn trait_obj_elided2<'a>(_arg: &'a dyn Drop) -> &'a str {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:191:1
+  --> $DIR/needless_lifetimes.rs:192:1
    |
 LL | fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:210:1
+  --> $DIR/needless_lifetimes.rs:211:1
    |
 LL | fn named_input_elided_output<'a>(_arg: &'a str) -> &str {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:218:1
+  --> $DIR/needless_lifetimes.rs:219:1
    |
 LL | fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:254:1
+  --> $DIR/needless_lifetimes.rs:255:1
    |
 LL | fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:261:9
+  --> $DIR/needless_lifetimes.rs:262:9
    |
 LL |         fn needless_lt<'a>(x: &'a u8) {}
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:265:9
+  --> $DIR/needless_lifetimes.rs:266:9
    |
 LL |         fn needless_lt<'a>(_x: &'a u8) {}
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:278:9
+  --> $DIR/needless_lifetimes.rs:279:9
    |
 LL |         fn baz<'a>(&'a self) -> impl Foo + 'a {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:310:5
+  --> $DIR/needless_lifetimes.rs:311:5
    |
 LL |     fn impl_trait_elidable_nested_anonymous_lifetimes<'a>(i: &'a i32, f: impl Fn(&i32) -> &i32) -> &'a i32 {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:319:5
+  --> $DIR/needless_lifetimes.rs:320:5
    |
 LL |     fn generics_elidable<'a, T: Fn(&i32) -> &i32>(i: &'a i32, f: T) -> &'a i32 {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:331:5
+  --> $DIR/needless_lifetimes.rs:332:5
    |
 LL |     fn where_clause_elidadable<'a, T>(i: &'a i32, f: T) -> &'a i32
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:346:5
+  --> $DIR/needless_lifetimes.rs:347:5
    |
 LL |     fn pointer_fn_elidable<'a>(i: &'a i32, f: fn(&i32) -> &i32) -> &'a i32 {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:359:5
+  --> $DIR/needless_lifetimes.rs:360:5
    |
 LL |     fn nested_fn_pointer_3<'a>(_: &'a i32) -> fn(fn(&i32) -> &i32) -> i32 {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:362:5
+  --> $DIR/needless_lifetimes.rs:363:5
    |
 LL |     fn nested_fn_pointer_4<'a>(_: &'a i32) -> impl Fn(fn(&i32)) {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:384:9
+  --> $DIR/needless_lifetimes.rs:385:9
    |
 LL |         fn implicit<'a>(&'a self) -> &'a () {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:387:9
+  --> $DIR/needless_lifetimes.rs:388:9
    |
 LL |         fn implicit_mut<'a>(&'a mut self) -> &'a () {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:398:9
+  --> $DIR/needless_lifetimes.rs:399:9
    |
 LL |         fn lifetime_elsewhere<'a>(self: Box<Self>, here: &'a ()) -> &'a () {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:404:9
+  --> $DIR/needless_lifetimes.rs:405:9
    |
 LL |         fn implicit<'a>(&'a self) -> &'a ();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:405:9
+  --> $DIR/needless_lifetimes.rs:406:9
    |
 LL |         fn implicit_provided<'a>(&'a self) -> &'a () {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:414:9
+  --> $DIR/needless_lifetimes.rs:415:9
    |
 LL |         fn lifetime_elsewhere<'a>(self: Box<Self>, here: &'a ()) -> &'a ();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
-  --> $DIR/needless_lifetimes.rs:415:9
+  --> $DIR/needless_lifetimes.rs:416:9
    |
 LL |         fn lifetime_elsewhere_provided<'a>(self: Box<Self>, here: &'a ()) -> &'a () {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/clippy/tests/ui/needless_return.fixed b/src/tools/clippy/tests/ui/needless_return.fixed
index 603d438d558..7c828430b78 100644
--- a/src/tools/clippy/tests/ui/needless_return.fixed
+++ b/src/tools/clippy/tests/ui/needless_return.fixed
@@ -53,7 +53,7 @@ fn test_closure() {
 }
 
 fn test_macro_call() -> i32 {
-    return the_answer!();
+    the_answer!()
 }
 
 fn test_void_fun() {
@@ -175,7 +175,7 @@ async fn async_test_closure() {
 }
 
 async fn async_test_macro_call() -> i32 {
-    return the_answer!();
+    the_answer!()
 }
 
 async fn async_test_void_fun() {
@@ -223,4 +223,10 @@ fn let_else() {
     let Some(1) = Some(1) else { return };
 }
 
+fn needless_return_macro() -> String {
+    let _ = "foo";
+    let _ = "bar";
+    format!("Hello {}", "world!")
+}
+
 fn main() {}
diff --git a/src/tools/clippy/tests/ui/needless_return.rs b/src/tools/clippy/tests/ui/needless_return.rs
index c6c8cb9ec15..fe82af00e67 100644
--- a/src/tools/clippy/tests/ui/needless_return.rs
+++ b/src/tools/clippy/tests/ui/needless_return.rs
@@ -223,4 +223,10 @@ fn let_else() {
     let Some(1) = Some(1) else { return };
 }
 
+fn needless_return_macro() -> String {
+    let _ = "foo";
+    let _ = "bar";
+    return format!("Hello {}", "world!");
+}
+
 fn main() {}
diff --git a/src/tools/clippy/tests/ui/needless_return.stderr b/src/tools/clippy/tests/ui/needless_return.stderr
index 5bc787c56a6..4c8be47b025 100644
--- a/src/tools/clippy/tests/ui/needless_return.stderr
+++ b/src/tools/clippy/tests/ui/needless_return.stderr
@@ -49,6 +49,12 @@ LL |     let _ = || return true;
    |                ^^^^^^^^^^^ help: remove `return`: `true`
 
 error: unneeded `return` statement
+  --> $DIR/needless_return.rs:56:5
+   |
+LL |     return the_answer!();
+   |     ^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `the_answer!()`
+
+error: unneeded `return` statement
   --> $DIR/needless_return.rs:60:5
    |
 LL |     return;
@@ -169,6 +175,12 @@ LL |     let _ = || return true;
    |                ^^^^^^^^^^^ help: remove `return`: `true`
 
 error: unneeded `return` statement
+  --> $DIR/needless_return.rs:178:5
+   |
+LL |     return the_answer!();
+   |     ^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `the_answer!()`
+
+error: unneeded `return` statement
   --> $DIR/needless_return.rs:182:5
    |
 LL |     return;
@@ -204,5 +216,11 @@ error: unneeded `return` statement
 LL |         return String::new();
    |         ^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `String::new()`
 
-error: aborting due to 34 previous errors
+error: unneeded `return` statement
+  --> $DIR/needless_return.rs:229:5
+   |
+LL |     return format!("Hello {}", "world!");
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `format!("Hello {}", "world!")`
+
+error: aborting due to 37 previous errors
 
diff --git a/src/tools/clippy/tests/ui/no_effect_replace.rs b/src/tools/clippy/tests/ui/no_effect_replace.rs
new file mode 100644
index 00000000000..ad17d53f789
--- /dev/null
+++ b/src/tools/clippy/tests/ui/no_effect_replace.rs
@@ -0,0 +1,51 @@
+#![warn(clippy::no_effect_replace)]
+
+fn main() {
+    let _ = "12345".replace('1', "1");
+    let _ = "12345".replace("12", "12");
+    let _ = String::new().replace("12", "12");
+
+    let _ = "12345".replacen('1', "1", 1);
+    let _ = "12345".replacen("12", "12", 1);
+    let _ = String::new().replacen("12", "12", 1);
+
+    let _ = "12345".replace("12", "22");
+    let _ = "12345".replacen("12", "22", 1);
+
+    let mut x = X::default();
+    let _ = "hello".replace(&x.f(), &x.f());
+    let _ = "hello".replace(&x.f(), &x.ff());
+
+    let _ = "hello".replace(&y(), &y());
+    let _ = "hello".replace(&y(), &z());
+
+    let _ = Replaceme.replace("a", "a");
+}
+
+#[derive(Default)]
+struct X {}
+
+impl X {
+    fn f(&mut self) -> String {
+        "he".to_string()
+    }
+
+    fn ff(&mut self) -> String {
+        "hh".to_string()
+    }
+}
+
+fn y() -> String {
+    "he".to_string()
+}
+
+fn z() -> String {
+    "hh".to_string()
+}
+
+struct Replaceme;
+impl Replaceme {
+    pub fn replace(&mut self, a: &str, b: &str) -> Self {
+        Self
+    }
+}
diff --git a/src/tools/clippy/tests/ui/no_effect_replace.stderr b/src/tools/clippy/tests/ui/no_effect_replace.stderr
new file mode 100644
index 00000000000..53a28aa73b7
--- /dev/null
+++ b/src/tools/clippy/tests/ui/no_effect_replace.stderr
@@ -0,0 +1,52 @@
+error: replacing text with itself
+  --> $DIR/no_effect_replace.rs:4:13
+   |
+LL |     let _ = "12345".replace('1', "1");
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: `-D clippy::no-effect-replace` implied by `-D warnings`
+
+error: replacing text with itself
+  --> $DIR/no_effect_replace.rs:5:13
+   |
+LL |     let _ = "12345".replace("12", "12");
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: replacing text with itself
+  --> $DIR/no_effect_replace.rs:6:13
+   |
+LL |     let _ = String::new().replace("12", "12");
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: replacing text with itself
+  --> $DIR/no_effect_replace.rs:8:13
+   |
+LL |     let _ = "12345".replacen('1', "1", 1);
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: replacing text with itself
+  --> $DIR/no_effect_replace.rs:9:13
+   |
+LL |     let _ = "12345".replacen("12", "12", 1);
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: replacing text with itself
+  --> $DIR/no_effect_replace.rs:10:13
+   |
+LL |     let _ = String::new().replacen("12", "12", 1);
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: replacing text with itself
+  --> $DIR/no_effect_replace.rs:16:13
+   |
+LL |     let _ = "hello".replace(&x.f(), &x.f());
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: replacing text with itself
+  --> $DIR/no_effect_replace.rs:19:13
+   |
+LL |     let _ = "hello".replace(&y(), &y());
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 8 previous errors
+
diff --git a/src/tools/clippy/tests/ui/nonminimal_bool_methods.fixed b/src/tools/clippy/tests/ui/nonminimal_bool_methods.fixed
new file mode 100644
index 00000000000..aad44089de4
--- /dev/null
+++ b/src/tools/clippy/tests/ui/nonminimal_bool_methods.fixed
@@ -0,0 +1,111 @@
+// run-rustfix
+#![allow(unused, clippy::diverging_sub_expression)]
+#![warn(clippy::nonminimal_bool)]
+
+fn methods_with_negation() {
+    let a: Option<i32> = unimplemented!();
+    let b: Result<i32, i32> = unimplemented!();
+    let _ = a.is_some();
+    let _ = a.is_none();
+    let _ = a.is_none();
+    let _ = a.is_some();
+    let _ = b.is_err();
+    let _ = b.is_ok();
+    let _ = b.is_ok();
+    let _ = b.is_err();
+    let c = false;
+    let _ = a.is_none() || c;
+    let _ = a.is_none() && c;
+    let _ = !(!c ^ c) || a.is_none();
+    let _ = (!c ^ c) || a.is_none();
+    let _ = !c ^ c || a.is_none();
+}
+
+// Simplified versions of https://github.com/rust-lang/rust-clippy/issues/2638
+// clippy::nonminimal_bool should only check the built-in Result and Some type, not
+// any other types like the following.
+enum CustomResultOk<E> {
+    Ok,
+    Err(E),
+}
+enum CustomResultErr<E> {
+    Ok,
+    Err(E),
+}
+enum CustomSomeSome<T> {
+    Some(T),
+    None,
+}
+enum CustomSomeNone<T> {
+    Some(T),
+    None,
+}
+
+impl<E> CustomResultOk<E> {
+    pub fn is_ok(&self) -> bool {
+        true
+    }
+}
+
+impl<E> CustomResultErr<E> {
+    pub fn is_err(&self) -> bool {
+        true
+    }
+}
+
+impl<T> CustomSomeSome<T> {
+    pub fn is_some(&self) -> bool {
+        true
+    }
+}
+
+impl<T> CustomSomeNone<T> {
+    pub fn is_none(&self) -> bool {
+        true
+    }
+}
+
+fn dont_warn_for_custom_methods_with_negation() {
+    let res = CustomResultOk::Err("Error");
+    // Should not warn and suggest 'is_err()' because the type does not
+    // implement is_err().
+    if !res.is_ok() {}
+
+    let res = CustomResultErr::Err("Error");
+    // Should not warn and suggest 'is_ok()' because the type does not
+    // implement is_ok().
+    if !res.is_err() {}
+
+    let res = CustomSomeSome::Some("thing");
+    // Should not warn and suggest 'is_none()' because the type does not
+    // implement is_none().
+    if !res.is_some() {}
+
+    let res = CustomSomeNone::Some("thing");
+    // Should not warn and suggest 'is_some()' because the type does not
+    // implement is_some().
+    if !res.is_none() {}
+}
+
+// Only Built-in Result and Some types should suggest the negated alternative
+fn warn_for_built_in_methods_with_negation() {
+    let res: Result<usize, usize> = Ok(1);
+    if res.is_err() {}
+    if res.is_ok() {}
+
+    let res = Some(1);
+    if res.is_none() {}
+    if res.is_some() {}
+}
+
+#[allow(clippy::neg_cmp_op_on_partial_ord)]
+fn dont_warn_for_negated_partial_ord_comparison() {
+    let a: f64 = unimplemented!();
+    let b: f64 = unimplemented!();
+    let _ = !(a < b);
+    let _ = !(a <= b);
+    let _ = !(a > b);
+    let _ = !(a >= b);
+}
+
+fn main() {}
diff --git a/src/tools/clippy/tests/ui/nonminimal_bool_methods.rs b/src/tools/clippy/tests/ui/nonminimal_bool_methods.rs
index d0a289b7ea4..b9074da8427 100644
--- a/src/tools/clippy/tests/ui/nonminimal_bool_methods.rs
+++ b/src/tools/clippy/tests/ui/nonminimal_bool_methods.rs
@@ -1,3 +1,4 @@
+// run-rustfix
 #![allow(unused, clippy::diverging_sub_expression)]
 #![warn(clippy::nonminimal_bool)]
 
diff --git a/src/tools/clippy/tests/ui/nonminimal_bool_methods.stderr b/src/tools/clippy/tests/ui/nonminimal_bool_methods.stderr
index a2df889d623..21b84db8589 100644
--- a/src/tools/clippy/tests/ui/nonminimal_bool_methods.stderr
+++ b/src/tools/clippy/tests/ui/nonminimal_bool_methods.stderr
@@ -1,5 +1,5 @@
 error: this boolean expression can be simplified
-  --> $DIR/nonminimal_bool_methods.rs:8:13
+  --> $DIR/nonminimal_bool_methods.rs:9:13
    |
 LL |     let _ = !a.is_some();
    |             ^^^^^^^^^^^^ help: try: `a.is_none()`
@@ -7,73 +7,73 @@ LL |     let _ = !a.is_some();
    = note: `-D clippy::nonminimal-bool` implied by `-D warnings`
 
 error: this boolean expression can be simplified
-  --> $DIR/nonminimal_bool_methods.rs:10:13
+  --> $DIR/nonminimal_bool_methods.rs:11:13
    |
 LL |     let _ = !a.is_none();
    |             ^^^^^^^^^^^^ help: try: `a.is_some()`
 
 error: this boolean expression can be simplified
-  --> $DIR/nonminimal_bool_methods.rs:12:13
+  --> $DIR/nonminimal_bool_methods.rs:13:13
    |
 LL |     let _ = !b.is_err();
    |             ^^^^^^^^^^^ help: try: `b.is_ok()`
 
 error: this boolean expression can be simplified
-  --> $DIR/nonminimal_bool_methods.rs:14:13
+  --> $DIR/nonminimal_bool_methods.rs:15:13
    |
 LL |     let _ = !b.is_ok();
    |             ^^^^^^^^^^ help: try: `b.is_err()`
 
 error: this boolean expression can be simplified
-  --> $DIR/nonminimal_bool_methods.rs:16:13
+  --> $DIR/nonminimal_bool_methods.rs:17:13
    |
 LL |     let _ = !(a.is_some() && !c);
    |             ^^^^^^^^^^^^^^^^^^^^ help: try: `a.is_none() || c`
 
 error: this boolean expression can be simplified
-  --> $DIR/nonminimal_bool_methods.rs:17:13
+  --> $DIR/nonminimal_bool_methods.rs:18:13
    |
 LL |     let _ = !(a.is_some() || !c);
    |             ^^^^^^^^^^^^^^^^^^^^ help: try: `a.is_none() && c`
 
 error: this boolean expression can be simplified
-  --> $DIR/nonminimal_bool_methods.rs:18:26
+  --> $DIR/nonminimal_bool_methods.rs:19:26
    |
 LL |     let _ = !(!c ^ c) || !a.is_some();
    |                          ^^^^^^^^^^^^ help: try: `a.is_none()`
 
 error: this boolean expression can be simplified
-  --> $DIR/nonminimal_bool_methods.rs:19:25
+  --> $DIR/nonminimal_bool_methods.rs:20:25
    |
 LL |     let _ = (!c ^ c) || !a.is_some();
    |                         ^^^^^^^^^^^^ help: try: `a.is_none()`
 
 error: this boolean expression can be simplified
-  --> $DIR/nonminimal_bool_methods.rs:20:23
+  --> $DIR/nonminimal_bool_methods.rs:21:23
    |
 LL |     let _ = !c ^ c || !a.is_some();
    |                       ^^^^^^^^^^^^ help: try: `a.is_none()`
 
 error: this boolean expression can be simplified
-  --> $DIR/nonminimal_bool_methods.rs:92:8
+  --> $DIR/nonminimal_bool_methods.rs:93:8
    |
 LL |     if !res.is_ok() {}
    |        ^^^^^^^^^^^^ help: try: `res.is_err()`
 
 error: this boolean expression can be simplified
-  --> $DIR/nonminimal_bool_methods.rs:93:8
+  --> $DIR/nonminimal_bool_methods.rs:94:8
    |
 LL |     if !res.is_err() {}
    |        ^^^^^^^^^^^^^ help: try: `res.is_ok()`
 
 error: this boolean expression can be simplified
-  --> $DIR/nonminimal_bool_methods.rs:96:8
+  --> $DIR/nonminimal_bool_methods.rs:97:8
    |
 LL |     if !res.is_some() {}
    |        ^^^^^^^^^^^^^^ help: try: `res.is_none()`
 
 error: this boolean expression can be simplified
-  --> $DIR/nonminimal_bool_methods.rs:97:8
+  --> $DIR/nonminimal_bool_methods.rs:98:8
    |
 LL |     if !res.is_none() {}
    |        ^^^^^^^^^^^^^^ help: try: `res.is_some()`
diff --git a/src/tools/clippy/tests/ui/range_contains.fixed b/src/tools/clippy/tests/ui/range_contains.fixed
index f4977199711..85d021b2f25 100644
--- a/src/tools/clippy/tests/ui/range_contains.fixed
+++ b/src/tools/clippy/tests/ui/range_contains.fixed
@@ -49,6 +49,13 @@ fn main() {
     x >= 10 && x <= -10;
     (-3. ..=3.).contains(&y);
     y >= 3. && y <= -3.;
+
+    // Fix #8745
+    let z = 42;
+    (0..=10).contains(&x) && (0..=10).contains(&z);
+    !(0..10).contains(&x) || !(0..10).contains(&z);
+    // Make sure operators in parens don't give a breaking suggestion
+    ((x % 2 == 0) || (x < 0)) || (x >= 10);
 }
 
 // Fix #6373
diff --git a/src/tools/clippy/tests/ui/range_contains.rs b/src/tools/clippy/tests/ui/range_contains.rs
index 9e2180b0c99..9a7a75dc132 100644
--- a/src/tools/clippy/tests/ui/range_contains.rs
+++ b/src/tools/clippy/tests/ui/range_contains.rs
@@ -49,6 +49,13 @@ fn main() {
     x >= 10 && x <= -10;
     y >= -3. && y <= 3.;
     y >= 3. && y <= -3.;
+
+    // Fix #8745
+    let z = 42;
+    (x >= 0) && (x <= 10) && (z >= 0) && (z <= 10);
+    (x < 0) || (x >= 10) || (z < 0) || (z >= 10);
+    // Make sure operators in parens don't give a breaking suggestion
+    ((x % 2 == 0) || (x < 0)) || (x >= 10);
 }
 
 // Fix #6373
diff --git a/src/tools/clippy/tests/ui/range_contains.stderr b/src/tools/clippy/tests/ui/range_contains.stderr
index 1817ee1715d..936859db5a1 100644
--- a/src/tools/clippy/tests/ui/range_contains.stderr
+++ b/src/tools/clippy/tests/ui/range_contains.stderr
@@ -96,5 +96,29 @@ error: manual `RangeInclusive::contains` implementation
 LL |     y >= -3. && y <= 3.;
    |     ^^^^^^^^^^^^^^^^^^^ help: use: `(-3. ..=3.).contains(&y)`
 
-error: aborting due to 16 previous errors
+error: manual `RangeInclusive::contains` implementation
+  --> $DIR/range_contains.rs:55:30
+   |
+LL |     (x >= 0) && (x <= 10) && (z >= 0) && (z <= 10);
+   |                              ^^^^^^^^^^^^^^^^^^^^^ help: use: `(0..=10).contains(&z)`
+
+error: manual `RangeInclusive::contains` implementation
+  --> $DIR/range_contains.rs:55:5
+   |
+LL |     (x >= 0) && (x <= 10) && (z >= 0) && (z <= 10);
+   |     ^^^^^^^^^^^^^^^^^^^^^ help: use: `(0..=10).contains(&x)`
+
+error: manual `!Range::contains` implementation
+  --> $DIR/range_contains.rs:56:29
+   |
+LL |     (x < 0) || (x >= 10) || (z < 0) || (z >= 10);
+   |                             ^^^^^^^^^^^^^^^^^^^^ help: use: `!(0..10).contains(&z)`
+
+error: manual `!Range::contains` implementation
+  --> $DIR/range_contains.rs:56:5
+   |
+LL |     (x < 0) || (x >= 10) || (z < 0) || (z >= 10);
+   |     ^^^^^^^^^^^^^^^^^^^^ help: use: `!(0..10).contains(&x)`
+
+error: aborting due to 20 previous errors
 
diff --git a/src/tools/clippy/tests/ui/rc_buffer.fixed b/src/tools/clippy/tests/ui/rc_buffer.fixed
new file mode 100644
index 00000000000..8910c01b1fc
--- /dev/null
+++ b/src/tools/clippy/tests/ui/rc_buffer.fixed
@@ -0,0 +1,28 @@
+// run-rustfix
+#![warn(clippy::rc_buffer)]
+#![allow(dead_code, unused_imports)]
+
+use std::cell::RefCell;
+use std::ffi::OsString;
+use std::path::PathBuf;
+use std::rc::Rc;
+
+struct S {
+    // triggers lint
+    bad1: Rc<str>,
+    bad2: Rc<std::path::Path>,
+    bad3: Rc<[u8]>,
+    bad4: Rc<std::ffi::OsStr>,
+    // does not trigger lint
+    good1: Rc<RefCell<String>>,
+}
+
+// triggers lint
+fn func_bad1(_: Rc<str>) {}
+fn func_bad2(_: Rc<std::path::Path>) {}
+fn func_bad3(_: Rc<[u8]>) {}
+fn func_bad4(_: Rc<std::ffi::OsStr>) {}
+// does not trigger lint
+fn func_good1(_: Rc<RefCell<String>>) {}
+
+fn main() {}
diff --git a/src/tools/clippy/tests/ui/rc_buffer.rs b/src/tools/clippy/tests/ui/rc_buffer.rs
index 1fa98643936..1e63a43262e 100644
--- a/src/tools/clippy/tests/ui/rc_buffer.rs
+++ b/src/tools/clippy/tests/ui/rc_buffer.rs
@@ -1,4 +1,6 @@
+// run-rustfix
 #![warn(clippy::rc_buffer)]
+#![allow(dead_code, unused_imports)]
 
 use std::cell::RefCell;
 use std::ffi::OsString;
diff --git a/src/tools/clippy/tests/ui/rc_buffer.stderr b/src/tools/clippy/tests/ui/rc_buffer.stderr
index e4cc169af07..9ed028e3df4 100644
--- a/src/tools/clippy/tests/ui/rc_buffer.stderr
+++ b/src/tools/clippy/tests/ui/rc_buffer.stderr
@@ -1,5 +1,5 @@
 error: usage of `Rc<T>` when T is a buffer type
-  --> $DIR/rc_buffer.rs:10:11
+  --> $DIR/rc_buffer.rs:12:11
    |
 LL |     bad1: Rc<String>,
    |           ^^^^^^^^^^ help: try: `Rc<str>`
@@ -7,43 +7,43 @@ LL |     bad1: Rc<String>,
    = note: `-D clippy::rc-buffer` implied by `-D warnings`
 
 error: usage of `Rc<T>` when T is a buffer type
-  --> $DIR/rc_buffer.rs:11:11
+  --> $DIR/rc_buffer.rs:13:11
    |
 LL |     bad2: Rc<PathBuf>,
    |           ^^^^^^^^^^^ help: try: `Rc<std::path::Path>`
 
 error: usage of `Rc<T>` when T is a buffer type
-  --> $DIR/rc_buffer.rs:12:11
+  --> $DIR/rc_buffer.rs:14:11
    |
 LL |     bad3: Rc<Vec<u8>>,
    |           ^^^^^^^^^^^ help: try: `Rc<[u8]>`
 
 error: usage of `Rc<T>` when T is a buffer type
-  --> $DIR/rc_buffer.rs:13:11
+  --> $DIR/rc_buffer.rs:15:11
    |
 LL |     bad4: Rc<OsString>,
    |           ^^^^^^^^^^^^ help: try: `Rc<std::ffi::OsStr>`
 
 error: usage of `Rc<T>` when T is a buffer type
-  --> $DIR/rc_buffer.rs:19:17
+  --> $DIR/rc_buffer.rs:21:17
    |
 LL | fn func_bad1(_: Rc<String>) {}
    |                 ^^^^^^^^^^ help: try: `Rc<str>`
 
 error: usage of `Rc<T>` when T is a buffer type
-  --> $DIR/rc_buffer.rs:20:17
+  --> $DIR/rc_buffer.rs:22:17
    |
 LL | fn func_bad2(_: Rc<PathBuf>) {}
    |                 ^^^^^^^^^^^ help: try: `Rc<std::path::Path>`
 
 error: usage of `Rc<T>` when T is a buffer type
-  --> $DIR/rc_buffer.rs:21:17
+  --> $DIR/rc_buffer.rs:23:17
    |
 LL | fn func_bad3(_: Rc<Vec<u8>>) {}
    |                 ^^^^^^^^^^^ help: try: `Rc<[u8]>`
 
 error: usage of `Rc<T>` when T is a buffer type
-  --> $DIR/rc_buffer.rs:22:17
+  --> $DIR/rc_buffer.rs:24:17
    |
 LL | fn func_bad4(_: Rc<OsString>) {}
    |                 ^^^^^^^^^^^^ help: try: `Rc<std::ffi::OsStr>`
diff --git a/src/tools/clippy/tests/ui/rc_buffer_arc.fixed b/src/tools/clippy/tests/ui/rc_buffer_arc.fixed
new file mode 100644
index 00000000000..13dd6f5fcd1
--- /dev/null
+++ b/src/tools/clippy/tests/ui/rc_buffer_arc.fixed
@@ -0,0 +1,27 @@
+// run-rustfix
+#![warn(clippy::rc_buffer)]
+#![allow(dead_code, unused_imports)]
+
+use std::ffi::OsString;
+use std::path::PathBuf;
+use std::sync::{Arc, Mutex};
+
+struct S {
+    // triggers lint
+    bad1: Arc<str>,
+    bad2: Arc<std::path::Path>,
+    bad3: Arc<[u8]>,
+    bad4: Arc<std::ffi::OsStr>,
+    // does not trigger lint
+    good1: Arc<Mutex<String>>,
+}
+
+// triggers lint
+fn func_bad1(_: Arc<str>) {}
+fn func_bad2(_: Arc<std::path::Path>) {}
+fn func_bad3(_: Arc<[u8]>) {}
+fn func_bad4(_: Arc<std::ffi::OsStr>) {}
+// does not trigger lint
+fn func_good1(_: Arc<Mutex<String>>) {}
+
+fn main() {}
diff --git a/src/tools/clippy/tests/ui/rc_buffer_arc.rs b/src/tools/clippy/tests/ui/rc_buffer_arc.rs
index 5d586584817..1a521bfeb7c 100644
--- a/src/tools/clippy/tests/ui/rc_buffer_arc.rs
+++ b/src/tools/clippy/tests/ui/rc_buffer_arc.rs
@@ -1,4 +1,6 @@
+// run-rustfix
 #![warn(clippy::rc_buffer)]
+#![allow(dead_code, unused_imports)]
 
 use std::ffi::OsString;
 use std::path::PathBuf;
diff --git a/src/tools/clippy/tests/ui/rc_buffer_arc.stderr b/src/tools/clippy/tests/ui/rc_buffer_arc.stderr
index 8252270d2ac..911feea7352 100644
--- a/src/tools/clippy/tests/ui/rc_buffer_arc.stderr
+++ b/src/tools/clippy/tests/ui/rc_buffer_arc.stderr
@@ -1,5 +1,5 @@
 error: usage of `Arc<T>` when T is a buffer type
-  --> $DIR/rc_buffer_arc.rs:9:11
+  --> $DIR/rc_buffer_arc.rs:11:11
    |
 LL |     bad1: Arc<String>,
    |           ^^^^^^^^^^^ help: try: `Arc<str>`
@@ -7,43 +7,43 @@ LL |     bad1: Arc<String>,
    = note: `-D clippy::rc-buffer` implied by `-D warnings`
 
 error: usage of `Arc<T>` when T is a buffer type
-  --> $DIR/rc_buffer_arc.rs:10:11
+  --> $DIR/rc_buffer_arc.rs:12:11
    |
 LL |     bad2: Arc<PathBuf>,
    |           ^^^^^^^^^^^^ help: try: `Arc<std::path::Path>`
 
 error: usage of `Arc<T>` when T is a buffer type
-  --> $DIR/rc_buffer_arc.rs:11:11
+  --> $DIR/rc_buffer_arc.rs:13:11
    |
 LL |     bad3: Arc<Vec<u8>>,
    |           ^^^^^^^^^^^^ help: try: `Arc<[u8]>`
 
 error: usage of `Arc<T>` when T is a buffer type
-  --> $DIR/rc_buffer_arc.rs:12:11
+  --> $DIR/rc_buffer_arc.rs:14:11
    |
 LL |     bad4: Arc<OsString>,
    |           ^^^^^^^^^^^^^ help: try: `Arc<std::ffi::OsStr>`
 
 error: usage of `Arc<T>` when T is a buffer type
-  --> $DIR/rc_buffer_arc.rs:18:17
+  --> $DIR/rc_buffer_arc.rs:20:17
    |
 LL | fn func_bad1(_: Arc<String>) {}
    |                 ^^^^^^^^^^^ help: try: `Arc<str>`
 
 error: usage of `Arc<T>` when T is a buffer type
-  --> $DIR/rc_buffer_arc.rs:19:17
+  --> $DIR/rc_buffer_arc.rs:21:17
    |
 LL | fn func_bad2(_: Arc<PathBuf>) {}
    |                 ^^^^^^^^^^^^ help: try: `Arc<std::path::Path>`
 
 error: usage of `Arc<T>` when T is a buffer type
-  --> $DIR/rc_buffer_arc.rs:20:17
+  --> $DIR/rc_buffer_arc.rs:22:17
    |
 LL | fn func_bad3(_: Arc<Vec<u8>>) {}
    |                 ^^^^^^^^^^^^ help: try: `Arc<[u8]>`
 
 error: usage of `Arc<T>` when T is a buffer type
-  --> $DIR/rc_buffer_arc.rs:21:17
+  --> $DIR/rc_buffer_arc.rs:23:17
    |
 LL | fn func_bad4(_: Arc<OsString>) {}
    |                 ^^^^^^^^^^^^^ help: try: `Arc<std::ffi::OsStr>`
diff --git a/src/tools/clippy/tests/ui/rc_clone_in_vec_init/arc.stderr b/src/tools/clippy/tests/ui/rc_clone_in_vec_init/arc.stderr
index ce84186c8e3..cd7d91e1206 100644
--- a/src/tools/clippy/tests/ui/rc_clone_in_vec_init/arc.stderr
+++ b/src/tools/clippy/tests/ui/rc_clone_in_vec_init/arc.stderr
@@ -1,4 +1,4 @@
-error: calling `Arc::new` in `vec![elem; len]`
+error: initializing a reference-counted pointer in `vec![elem; len]`
   --> $DIR/arc.rs:7:13
    |
 LL |     let v = vec![Arc::new("x".to_string()); 2];
@@ -10,19 +10,19 @@ help: consider initializing each `Arc` element individually
    |
 LL ~     let v = {
 LL +         let mut v = Vec::with_capacity(2);
-LL +         (0..2).for_each(|_| v.push(Arc::new("x".to_string())));
+LL +         (0..2).for_each(|_| v.push(Arc::new(..)));
 LL +         v
 LL ~     };
    |
 help: or if this is intentional, consider extracting the `Arc` initialization to a variable
    |
 LL ~     let v = {
-LL +         let data = Arc::new("x".to_string());
+LL +         let data = Arc::new(..);
 LL +         vec![data; 2]
 LL ~     };
    |
 
-error: calling `Arc::new` in `vec![elem; len]`
+error: initializing a reference-counted pointer in `vec![elem; len]`
   --> $DIR/arc.rs:15:21
    |
 LL |             let v = vec![Arc::new("x".to_string()); 2];
@@ -33,19 +33,19 @@ help: consider initializing each `Arc` element individually
    |
 LL ~             let v = {
 LL +                 let mut v = Vec::with_capacity(2);
-LL +                 (0..2).for_each(|_| v.push(Arc::new("x".to_string())));
+LL +                 (0..2).for_each(|_| v.push(Arc::new(..)));
 LL +                 v
 LL ~             };
    |
 help: or if this is intentional, consider extracting the `Arc` initialization to a variable
    |
 LL ~             let v = {
-LL +                 let data = Arc::new("x".to_string());
+LL +                 let data = Arc::new(..);
 LL +                 vec![data; 2]
 LL ~             };
    |
 
-error: calling `Arc::new` in `vec![elem; len]`
+error: initializing a reference-counted pointer in `vec![elem; len]`
   --> $DIR/arc.rs:21:13
    |
 LL |       let v = vec![
@@ -75,7 +75,7 @@ LL +         vec![data; 2]
 LL ~     };
    |
 
-error: calling `Arc::new` in `vec![elem; len]`
+error: initializing a reference-counted pointer in `vec![elem; len]`
   --> $DIR/arc.rs:30:14
    |
 LL |       let v1 = vec![
diff --git a/src/tools/clippy/tests/ui/rc_clone_in_vec_init/rc.stderr b/src/tools/clippy/tests/ui/rc_clone_in_vec_init/rc.stderr
index 0f5cc0cf98f..fe861afe054 100644
--- a/src/tools/clippy/tests/ui/rc_clone_in_vec_init/rc.stderr
+++ b/src/tools/clippy/tests/ui/rc_clone_in_vec_init/rc.stderr
@@ -1,4 +1,4 @@
-error: calling `Rc::new` in `vec![elem; len]`
+error: initializing a reference-counted pointer in `vec![elem; len]`
   --> $DIR/rc.rs:8:13
    |
 LL |     let v = vec![Rc::new("x".to_string()); 2];
@@ -10,19 +10,19 @@ help: consider initializing each `Rc` element individually
    |
 LL ~     let v = {
 LL +         let mut v = Vec::with_capacity(2);
-LL +         (0..2).for_each(|_| v.push(Rc::new("x".to_string())));
+LL +         (0..2).for_each(|_| v.push(Rc::new(..)));
 LL +         v
 LL ~     };
    |
 help: or if this is intentional, consider extracting the `Rc` initialization to a variable
    |
 LL ~     let v = {
-LL +         let data = Rc::new("x".to_string());
+LL +         let data = Rc::new(..);
 LL +         vec![data; 2]
 LL ~     };
    |
 
-error: calling `Rc::new` in `vec![elem; len]`
+error: initializing a reference-counted pointer in `vec![elem; len]`
   --> $DIR/rc.rs:16:21
    |
 LL |             let v = vec![Rc::new("x".to_string()); 2];
@@ -33,19 +33,19 @@ help: consider initializing each `Rc` element individually
    |
 LL ~             let v = {
 LL +                 let mut v = Vec::with_capacity(2);
-LL +                 (0..2).for_each(|_| v.push(Rc::new("x".to_string())));
+LL +                 (0..2).for_each(|_| v.push(Rc::new(..)));
 LL +                 v
 LL ~             };
    |
 help: or if this is intentional, consider extracting the `Rc` initialization to a variable
    |
 LL ~             let v = {
-LL +                 let data = Rc::new("x".to_string());
+LL +                 let data = Rc::new(..);
 LL +                 vec![data; 2]
 LL ~             };
    |
 
-error: calling `Rc::new` in `vec![elem; len]`
+error: initializing a reference-counted pointer in `vec![elem; len]`
   --> $DIR/rc.rs:22:13
    |
 LL |       let v = vec![
@@ -75,7 +75,7 @@ LL +         vec![data; 2]
 LL ~     };
    |
 
-error: calling `Rc::new` in `vec![elem; len]`
+error: initializing a reference-counted pointer in `vec![elem; len]`
   --> $DIR/rc.rs:31:14
    |
 LL |       let v1 = vec![
diff --git a/src/tools/clippy/tests/ui/rc_clone_in_vec_init/weak.rs b/src/tools/clippy/tests/ui/rc_clone_in_vec_init/weak.rs
new file mode 100644
index 00000000000..693c9b553c5
--- /dev/null
+++ b/src/tools/clippy/tests/ui/rc_clone_in_vec_init/weak.rs
@@ -0,0 +1,83 @@
+#![warn(clippy::rc_clone_in_vec_init)]
+use std::rc::{Rc, Weak as UnSyncWeak};
+use std::sync::{Arc, Mutex, Weak as SyncWeak};
+
+fn main() {}
+
+fn should_warn_simple_case() {
+    let v = vec![SyncWeak::<u32>::new(); 2];
+    let v2 = vec![UnSyncWeak::<u32>::new(); 2];
+
+    let v = vec![Rc::downgrade(&Rc::new("x".to_string())); 2];
+    let v = vec![Arc::downgrade(&Arc::new("x".to_string())); 2];
+}
+
+fn should_warn_simple_case_with_big_indentation() {
+    if true {
+        let k = 1;
+        dbg!(k);
+        if true {
+            let v = vec![Arc::downgrade(&Arc::new("x".to_string())); 2];
+            let v2 = vec![Rc::downgrade(&Rc::new("x".to_string())); 2];
+        }
+    }
+}
+
+fn should_warn_complex_case() {
+    let v = vec![
+        Arc::downgrade(&Arc::new(Mutex::new({
+            let x = 1;
+            dbg!(x);
+            x
+        })));
+        2
+    ];
+
+    let v1 = vec![
+        Rc::downgrade(&Rc::new(Mutex::new({
+            let x = 1;
+            dbg!(x);
+            x
+        })));
+        2
+    ];
+}
+
+fn should_not_warn_custom_weak() {
+    #[derive(Clone)]
+    struct Weak;
+
+    impl Weak {
+        fn new() -> Self {
+            Weak
+        }
+    }
+
+    let v = vec![Weak::new(); 2];
+}
+
+fn should_not_warn_vec_from_elem_but_not_weak() {
+    let v = vec![String::new(); 2];
+    let v1 = vec![1; 2];
+    let v2 = vec![
+        Box::new(Arc::downgrade(&Arc::new({
+            let y = 3;
+            dbg!(y);
+            y
+        })));
+        2
+    ];
+    let v3 = vec![
+        Box::new(Rc::downgrade(&Rc::new({
+            let y = 3;
+            dbg!(y);
+            y
+        })));
+        2
+    ];
+}
+
+fn should_not_warn_vec_macro_but_not_from_elem() {
+    let v = vec![Arc::downgrade(&Arc::new("x".to_string()))];
+    let v = vec![Rc::downgrade(&Rc::new("x".to_string()))];
+}
diff --git a/src/tools/clippy/tests/ui/rc_clone_in_vec_init/weak.stderr b/src/tools/clippy/tests/ui/rc_clone_in_vec_init/weak.stderr
new file mode 100644
index 00000000000..4a21946ccdf
--- /dev/null
+++ b/src/tools/clippy/tests/ui/rc_clone_in_vec_init/weak.stderr
@@ -0,0 +1,201 @@
+error: initializing a reference-counted pointer in `vec![elem; len]`
+  --> $DIR/weak.rs:8:13
+   |
+LL |     let v = vec![SyncWeak::<u32>::new(); 2];
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: `-D clippy::rc-clone-in-vec-init` implied by `-D warnings`
+   = note: each element will point to the same `Weak` instance
+help: consider initializing each `Weak` element individually
+   |
+LL ~     let v = {
+LL +         let mut v = Vec::with_capacity(2);
+LL +         (0..2).for_each(|_| v.push(SyncWeak::<u32>::new(..)));
+LL +         v
+LL ~     };
+   |
+help: or if this is intentional, consider extracting the `Weak` initialization to a variable
+   |
+LL ~     let v = {
+LL +         let data = SyncWeak::<u32>::new(..);
+LL +         vec![data; 2]
+LL ~     };
+   |
+
+error: initializing a reference-counted pointer in `vec![elem; len]`
+  --> $DIR/weak.rs:9:14
+   |
+LL |     let v2 = vec![UnSyncWeak::<u32>::new(); 2];
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: each element will point to the same `Weak` instance
+help: consider initializing each `Weak` element individually
+   |
+LL ~     let v2 = {
+LL +         let mut v = Vec::with_capacity(2);
+LL +         (0..2).for_each(|_| v.push(UnSyncWeak::<u32>::new(..)));
+LL +         v
+LL ~     };
+   |
+help: or if this is intentional, consider extracting the `Weak` initialization to a variable
+   |
+LL ~     let v2 = {
+LL +         let data = UnSyncWeak::<u32>::new(..);
+LL +         vec![data; 2]
+LL ~     };
+   |
+
+error: initializing a reference-counted pointer in `vec![elem; len]`
+  --> $DIR/weak.rs:11:13
+   |
+LL |     let v = vec![Rc::downgrade(&Rc::new("x".to_string())); 2];
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: each element will point to the same `Weak` instance
+help: consider initializing each `Weak` element individually
+   |
+LL ~     let v = {
+LL +         let mut v = Vec::with_capacity(2);
+LL +         (0..2).for_each(|_| v.push(Rc::downgrade(..)));
+LL +         v
+LL ~     };
+   |
+help: or if this is intentional, consider extracting the `Weak` initialization to a variable
+   |
+LL ~     let v = {
+LL +         let data = Rc::downgrade(..);
+LL +         vec![data; 2]
+LL ~     };
+   |
+
+error: initializing a reference-counted pointer in `vec![elem; len]`
+  --> $DIR/weak.rs:12:13
+   |
+LL |     let v = vec![Arc::downgrade(&Arc::new("x".to_string())); 2];
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: each element will point to the same `Weak` instance
+help: consider initializing each `Weak` element individually
+   |
+LL ~     let v = {
+LL +         let mut v = Vec::with_capacity(2);
+LL +         (0..2).for_each(|_| v.push(Arc::downgrade(..)));
+LL +         v
+LL ~     };
+   |
+help: or if this is intentional, consider extracting the `Weak` initialization to a variable
+   |
+LL ~     let v = {
+LL +         let data = Arc::downgrade(..);
+LL +         vec![data; 2]
+LL ~     };
+   |
+
+error: initializing a reference-counted pointer in `vec![elem; len]`
+  --> $DIR/weak.rs:20:21
+   |
+LL |             let v = vec![Arc::downgrade(&Arc::new("x".to_string())); 2];
+   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: each element will point to the same `Weak` instance
+help: consider initializing each `Weak` element individually
+   |
+LL ~             let v = {
+LL +                 let mut v = Vec::with_capacity(2);
+LL +                 (0..2).for_each(|_| v.push(Arc::downgrade(..)));
+LL +                 v
+LL ~             };
+   |
+help: or if this is intentional, consider extracting the `Weak` initialization to a variable
+   |
+LL ~             let v = {
+LL +                 let data = Arc::downgrade(..);
+LL +                 vec![data; 2]
+LL ~             };
+   |
+
+error: initializing a reference-counted pointer in `vec![elem; len]`
+  --> $DIR/weak.rs:21:22
+   |
+LL |             let v2 = vec![Rc::downgrade(&Rc::new("x".to_string())); 2];
+   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: each element will point to the same `Weak` instance
+help: consider initializing each `Weak` element individually
+   |
+LL ~             let v2 = {
+LL +                 let mut v = Vec::with_capacity(2);
+LL +                 (0..2).for_each(|_| v.push(Rc::downgrade(..)));
+LL +                 v
+LL ~             };
+   |
+help: or if this is intentional, consider extracting the `Weak` initialization to a variable
+   |
+LL ~             let v2 = {
+LL +                 let data = Rc::downgrade(..);
+LL +                 vec![data; 2]
+LL ~             };
+   |
+
+error: initializing a reference-counted pointer in `vec![elem; len]`
+  --> $DIR/weak.rs:27:13
+   |
+LL |       let v = vec![
+   |  _____________^
+LL | |         Arc::downgrade(&Arc::new(Mutex::new({
+LL | |             let x = 1;
+LL | |             dbg!(x);
+...  |
+LL | |         2
+LL | |     ];
+   | |_____^
+   |
+   = note: each element will point to the same `Weak` instance
+help: consider initializing each `Weak` element individually
+   |
+LL ~     let v = {
+LL +         let mut v = Vec::with_capacity(2);
+LL +         (0..2).for_each(|_| v.push(Arc::downgrade(..)));
+LL +         v
+LL ~     };
+   |
+help: or if this is intentional, consider extracting the `Weak` initialization to a variable
+   |
+LL ~     let v = {
+LL +         let data = Arc::downgrade(..);
+LL +         vec![data; 2]
+LL ~     };
+   |
+
+error: initializing a reference-counted pointer in `vec![elem; len]`
+  --> $DIR/weak.rs:36:14
+   |
+LL |       let v1 = vec![
+   |  ______________^
+LL | |         Rc::downgrade(&Rc::new(Mutex::new({
+LL | |             let x = 1;
+LL | |             dbg!(x);
+...  |
+LL | |         2
+LL | |     ];
+   | |_____^
+   |
+   = note: each element will point to the same `Weak` instance
+help: consider initializing each `Weak` element individually
+   |
+LL ~     let v1 = {
+LL +         let mut v = Vec::with_capacity(2);
+LL +         (0..2).for_each(|_| v.push(Rc::downgrade(..)));
+LL +         v
+LL ~     };
+   |
+help: or if this is intentional, consider extracting the `Weak` initialization to a variable
+   |
+LL ~     let v1 = {
+LL +         let data = Rc::downgrade(..);
+LL +         vec![data; 2]
+LL ~     };
+   |
+
+error: aborting due to 8 previous errors
+
diff --git a/src/tools/clippy/tests/ui/recursive_format_impl.rs b/src/tools/clippy/tests/ui/recursive_format_impl.rs
index f72fc77ab99..cb6ba36b14c 100644
--- a/src/tools/clippy/tests/ui/recursive_format_impl.rs
+++ b/src/tools/clippy/tests/ui/recursive_format_impl.rs
@@ -2,7 +2,8 @@
 #![allow(
     clippy::inherent_to_string_shadow_display,
     clippy::to_string_in_format_args,
-    clippy::deref_addrof
+    clippy::deref_addrof,
+    clippy::borrow_deref_ref
 )]
 
 use std::fmt;
diff --git a/src/tools/clippy/tests/ui/recursive_format_impl.stderr b/src/tools/clippy/tests/ui/recursive_format_impl.stderr
index 1a717ac92d8..84ce69df566 100644
--- a/src/tools/clippy/tests/ui/recursive_format_impl.stderr
+++ b/src/tools/clippy/tests/ui/recursive_format_impl.stderr
@@ -1,5 +1,5 @@
 error: using `self.to_string` in `fmt::Display` implementation will cause infinite recursion
-  --> $DIR/recursive_format_impl.rs:29:25
+  --> $DIR/recursive_format_impl.rs:30:25
    |
 LL |         write!(f, "{}", self.to_string())
    |                         ^^^^^^^^^^^^^^^^
@@ -7,7 +7,7 @@ LL |         write!(f, "{}", self.to_string())
    = note: `-D clippy::recursive-format-impl` implied by `-D warnings`
 
 error: using `self` as `Display` in `impl Display` will cause infinite recursion
-  --> $DIR/recursive_format_impl.rs:73:9
+  --> $DIR/recursive_format_impl.rs:74:9
    |
 LL |         write!(f, "{}", self)
    |         ^^^^^^^^^^^^^^^^^^^^^
@@ -15,7 +15,7 @@ LL |         write!(f, "{}", self)
    = note: this error originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: using `self` as `Display` in `impl Display` will cause infinite recursion
-  --> $DIR/recursive_format_impl.rs:82:9
+  --> $DIR/recursive_format_impl.rs:83:9
    |
 LL |         write!(f, "{}", &self)
    |         ^^^^^^^^^^^^^^^^^^^^^^
@@ -23,7 +23,7 @@ LL |         write!(f, "{}", &self)
    = note: this error originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: using `self` as `Debug` in `impl Debug` will cause infinite recursion
-  --> $DIR/recursive_format_impl.rs:88:9
+  --> $DIR/recursive_format_impl.rs:89:9
    |
 LL |         write!(f, "{:?}", &self)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -31,7 +31,7 @@ LL |         write!(f, "{:?}", &self)
    = note: this error originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: using `self` as `Display` in `impl Display` will cause infinite recursion
-  --> $DIR/recursive_format_impl.rs:97:9
+  --> $DIR/recursive_format_impl.rs:98:9
    |
 LL |         write!(f, "{}", &&&self)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -39,7 +39,7 @@ LL |         write!(f, "{}", &&&self)
    = note: this error originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: using `self` as `Display` in `impl Display` will cause infinite recursion
-  --> $DIR/recursive_format_impl.rs:171:9
+  --> $DIR/recursive_format_impl.rs:172:9
    |
 LL |         write!(f, "{}", &*self)
    |         ^^^^^^^^^^^^^^^^^^^^^^^
@@ -47,7 +47,7 @@ LL |         write!(f, "{}", &*self)
    = note: this error originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: using `self` as `Debug` in `impl Debug` will cause infinite recursion
-  --> $DIR/recursive_format_impl.rs:177:9
+  --> $DIR/recursive_format_impl.rs:178:9
    |
 LL |         write!(f, "{:?}", &*self)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -55,7 +55,7 @@ LL |         write!(f, "{:?}", &*self)
    = note: this error originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: using `self` as `Display` in `impl Display` will cause infinite recursion
-  --> $DIR/recursive_format_impl.rs:193:9
+  --> $DIR/recursive_format_impl.rs:194:9
    |
 LL |         write!(f, "{}", *self)
    |         ^^^^^^^^^^^^^^^^^^^^^^
@@ -63,7 +63,7 @@ LL |         write!(f, "{}", *self)
    = note: this error originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: using `self` as `Display` in `impl Display` will cause infinite recursion
-  --> $DIR/recursive_format_impl.rs:209:9
+  --> $DIR/recursive_format_impl.rs:210:9
    |
 LL |         write!(f, "{}", **&&*self)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -71,7 +71,7 @@ LL |         write!(f, "{}", **&&*self)
    = note: this error originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: using `self` as `Display` in `impl Display` will cause infinite recursion
-  --> $DIR/recursive_format_impl.rs:225:9
+  --> $DIR/recursive_format_impl.rs:226:9
    |
 LL |         write!(f, "{}", &&**&&*self)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/clippy/tests/ui/shadow.rs b/src/tools/clippy/tests/ui/shadow.rs
index a394ef8f25c..1fa9fc749a9 100644
--- a/src/tools/clippy/tests/ui/shadow.rs
+++ b/src/tools/clippy/tests/ui/shadow.rs
@@ -88,4 +88,11 @@ pub async fn foo2(_a: i32, _b: i64) {
     let _b = _a;
 }
 
+fn ice_8748() {
+    let _ = [0; {
+        let x = 1;
+        if let Some(x) = Some(1) { x } else { 1 }
+    }];
+}
+
 fn main() {}
diff --git a/src/tools/clippy/tests/ui/significant_drop_in_scrutinee.rs b/src/tools/clippy/tests/ui/significant_drop_in_scrutinee.rs
index f83a6dd0eb2..4347610f393 100644
--- a/src/tools/clippy/tests/ui/significant_drop_in_scrutinee.rs
+++ b/src/tools/clippy/tests/ui/significant_drop_in_scrutinee.rs
@@ -7,8 +7,10 @@
 #![allow(unused_assignments)]
 #![allow(dead_code)]
 
+use std::num::ParseIntError;
 use std::ops::Deref;
 use std::sync::atomic::{AtomicU64, Ordering};
+use std::sync::RwLock;
 use std::sync::{Mutex, MutexGuard};
 
 struct State {}
@@ -552,4 +554,41 @@ fn should_not_cause_stack_overflow() {
     }
 }
 
+fn should_not_produce_lint_for_try_desugar() -> Result<u64, ParseIntError> {
+    // TryDesugar (i.e. using `?` for a Result type) will turn into a match but is out of scope
+    // for this lint
+    let rwlock = RwLock::new("1".to_string());
+    let result = rwlock.read().unwrap().parse::<u64>()?;
+    println!("{}", result);
+    rwlock.write().unwrap().push('2');
+    Ok(result)
+}
+
+struct ResultReturner {
+    s: String,
+}
+
+impl ResultReturner {
+    fn to_number(&self) -> Result<i64, ParseIntError> {
+        self.s.parse::<i64>()
+    }
+}
+
+fn should_trigger_lint_for_non_ref_move_and_clone_suggestion() {
+    let rwlock = RwLock::<ResultReturner>::new(ResultReturner { s: "1".to_string() });
+    match rwlock.read().unwrap().to_number() {
+        Ok(n) => println!("Converted to number: {}", n),
+        Err(e) => println!("Could not convert {} to number", e),
+    };
+}
+
+fn should_trigger_lint_for_read_write_lock_for_loop() {
+    // For-in loops desugar to match expressions and are prone to the type of deadlock this lint is
+    // designed to look for.
+    let rwlock = RwLock::<Vec<String>>::new(vec!["1".to_string()]);
+    for s in rwlock.read().unwrap().iter() {
+        println!("{}", s);
+    }
+}
+
 fn main() {}
diff --git a/src/tools/clippy/tests/ui/significant_drop_in_scrutinee.stderr b/src/tools/clippy/tests/ui/significant_drop_in_scrutinee.stderr
index af160564985..303f3c1df03 100644
--- a/src/tools/clippy/tests/ui/significant_drop_in_scrutinee.stderr
+++ b/src/tools/clippy/tests/ui/significant_drop_in_scrutinee.stderr
@@ -1,5 +1,5 @@
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:57:11
+  --> $DIR/significant_drop_in_scrutinee.rs:59:11
    |
 LL |     match mutex.lock().unwrap().foo() {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -12,7 +12,7 @@ LL ~     match value {
    |
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:130:11
+  --> $DIR/significant_drop_in_scrutinee.rs:132:11
    |
 LL |     match s.lock_m().get_the_value() {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -24,7 +24,7 @@ LL ~     match value {
    |
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:151:11
+  --> $DIR/significant_drop_in_scrutinee.rs:153:11
    |
 LL |     match s.lock_m_m().get_the_value() {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -36,7 +36,7 @@ LL ~     match value {
    |
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:199:11
+  --> $DIR/significant_drop_in_scrutinee.rs:201:11
    |
 LL |     match counter.temp_increment().len() {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -48,7 +48,7 @@ LL ~     match value {
    |
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:222:16
+  --> $DIR/significant_drop_in_scrutinee.rs:224:16
    |
 LL |         match (mutex1.lock().unwrap().s.len(), true) {
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -60,7 +60,7 @@ LL ~         match (value, true) {
    |
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:231:22
+  --> $DIR/significant_drop_in_scrutinee.rs:233:22
    |
 LL |         match (true, mutex1.lock().unwrap().s.len(), true) {
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -72,7 +72,7 @@ LL ~         match (true, value, true) {
    |
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:241:16
+  --> $DIR/significant_drop_in_scrutinee.rs:243:16
    |
 LL |         match (mutex1.lock().unwrap().s.len(), true, mutex2.lock().unwrap().s.len()) {
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -84,7 +84,7 @@ LL ~         match (value, true, mutex2.lock().unwrap().s.len()) {
    |
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:241:54
+  --> $DIR/significant_drop_in_scrutinee.rs:243:54
    |
 LL |         match (mutex1.lock().unwrap().s.len(), true, mutex2.lock().unwrap().s.len()) {
    |                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -96,19 +96,19 @@ LL ~         match (mutex1.lock().unwrap().s.len(), true, value) {
    |
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:252:15
+  --> $DIR/significant_drop_in_scrutinee.rs:254:15
    |
 LL |         match mutex3.lock().unwrap().s.as_str() {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:262:22
+  --> $DIR/significant_drop_in_scrutinee.rs:264:22
    |
 LL |         match (true, mutex3.lock().unwrap().s.as_str()) {
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:281:11
+  --> $DIR/significant_drop_in_scrutinee.rs:283:11
    |
 LL |     match mutex.lock().unwrap().s.len() > 1 {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -120,7 +120,7 @@ LL ~     match value {
    |
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:288:11
+  --> $DIR/significant_drop_in_scrutinee.rs:290:11
    |
 LL |     match 1 < mutex.lock().unwrap().s.len() {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -132,7 +132,7 @@ LL ~     match value {
    |
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:306:11
+  --> $DIR/significant_drop_in_scrutinee.rs:308:11
    |
 LL |     match mutex1.lock().unwrap().s.len() < mutex2.lock().unwrap().s.len() {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -144,7 +144,7 @@ LL ~     match value {
    |
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:317:11
+  --> $DIR/significant_drop_in_scrutinee.rs:319:11
    |
 LL |     match mutex1.lock().unwrap().s.len() >= mutex2.lock().unwrap().s.len() {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -156,7 +156,7 @@ LL ~     match value {
    |
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:352:11
+  --> $DIR/significant_drop_in_scrutinee.rs:354:11
    |
 LL |     match get_mutex_guard().s.len() > 1 {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -168,7 +168,7 @@ LL ~     match value {
    |
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:369:11
+  --> $DIR/significant_drop_in_scrutinee.rs:371:11
    |
 LL |       match match i {
    |  ___________^
@@ -191,7 +191,7 @@ LL +     .len()
  ...
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:395:11
+  --> $DIR/significant_drop_in_scrutinee.rs:397:11
    |
 LL |       match if i > 1 {
    |  ___________^
@@ -214,7 +214,7 @@ LL +     .s
  ...
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:449:11
+  --> $DIR/significant_drop_in_scrutinee.rs:451:11
    |
 LL |     match s.lock().deref().deref() {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -226,13 +226,13 @@ LL ~     match value {
    |
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:477:11
+  --> $DIR/significant_drop_in_scrutinee.rs:479:11
    |
 LL |     match s.lock().deref().deref() {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:496:11
+  --> $DIR/significant_drop_in_scrutinee.rs:498:11
    |
 LL |     match mutex.lock().unwrap().i = i {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -244,7 +244,7 @@ LL ~     match () {
    |
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:502:11
+  --> $DIR/significant_drop_in_scrutinee.rs:504:11
    |
 LL |     match i = mutex.lock().unwrap().i {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -256,7 +256,7 @@ LL ~     match () {
    |
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:508:11
+  --> $DIR/significant_drop_in_scrutinee.rs:510:11
    |
 LL |     match mutex.lock().unwrap().i += 1 {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -268,7 +268,7 @@ LL ~     match () {
    |
 
 error: temporary with significant drop in match scrutinee
-  --> $DIR/significant_drop_in_scrutinee.rs:514:11
+  --> $DIR/significant_drop_in_scrutinee.rs:516:11
    |
 LL |     match i += mutex.lock().unwrap().i {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -279,5 +279,17 @@ LL ~     i += mutex.lock().unwrap().i;
 LL ~     match () {
    |
 
-error: aborting due to 23 previous errors
+error: temporary with significant drop in match scrutinee
+  --> $DIR/significant_drop_in_scrutinee.rs:579:11
+   |
+LL |     match rwlock.read().unwrap().to_number() {
+   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: temporary with significant drop in for loop
+  --> $DIR/significant_drop_in_scrutinee.rs:589:14
+   |
+LL |     for s in rwlock.read().unwrap().iter() {
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 25 previous errors
 
diff --git a/src/tools/clippy/tests/ui/suspicious_operation_groupings.fixed b/src/tools/clippy/tests/ui/suspicious_operation_groupings.fixed
new file mode 100644
index 00000000000..ede8a39fed7
--- /dev/null
+++ b/src/tools/clippy/tests/ui/suspicious_operation_groupings.fixed
@@ -0,0 +1,209 @@
+// run-rustfix
+#![warn(clippy::suspicious_operation_groupings)]
+#![allow(dead_code, unused_parens, clippy::eq_op)]
+
+struct Vec3 {
+    x: f64,
+    y: f64,
+    z: f64,
+}
+
+impl Eq for Vec3 {}
+
+impl PartialEq for Vec3 {
+    fn eq(&self, other: &Self) -> bool {
+        // This should trigger the lint because `self.x` is compared to `other.y`
+        self.x == other.x && self.y == other.y && self.z == other.z
+    }
+}
+
+struct S {
+    a: i32,
+    b: i32,
+    c: i32,
+    d: i32,
+}
+
+fn buggy_ab_cmp(s1: &S, s2: &S) -> bool {
+    // There's no `s1.b`
+    s1.a < s2.a && s1.b < s2.b
+}
+
+struct SaOnly {
+    a: i32,
+}
+
+impl S {
+    fn a(&self) -> i32 {
+        0
+    }
+}
+
+fn do_not_give_bad_suggestions_for_this_unusual_expr(s1: &S, s2: &SaOnly) -> bool {
+    // This is superficially similar to `buggy_ab_cmp`, but we should not suggest
+    // `s2.b` since that is invalid.
+    s1.a < s2.a && s1.a() < s1.b
+}
+
+fn do_not_give_bad_suggestions_for_this_macro_expr(s1: &S, s2: &SaOnly) -> bool {
+    macro_rules! s1 {
+        () => {
+            S {
+                a: 1,
+                b: 1,
+                c: 1,
+                d: 1,
+            }
+        };
+    }
+
+    // This is superficially similar to `buggy_ab_cmp`, but we should not suggest
+    // `s2.b` since that is invalid.
+    s1.a < s2.a && s1!().a < s1.b
+}
+
+fn do_not_give_bad_suggestions_for_this_incorrect_expr(s1: &S, s2: &SaOnly) -> bool {
+    // There's two `s1.b`, but we should not suggest `s2.b` since that is invalid
+    s1.a < s2.a && s1.b < s1.b
+}
+
+fn permissable(s1: &S, s2: &S) -> bool {
+    // Something like this seems like it might actually be what is desired.
+    s1.a == s2.b
+}
+
+fn non_boolean_operators(s1: &S, s2: &S) -> i32 {
+    // There's no `s2.c`
+    s1.a * s2.a + s1.b * s2.b + s1.c * s2.c + s1.d * s2.d
+}
+
+fn odd_number_of_pairs(s1: &S, s2: &S) -> i32 {
+    // There's no `s2.b`
+    s1.a * s2.a + s1.b * s2.b + s1.c * s2.c
+}
+
+fn not_caught_by_eq_op_middle_change_left(s1: &S, s2: &S) -> i32 {
+    // There's no `s1.b`
+    s1.a * s2.a + s1.b * s2.b + s1.c * s2.c
+}
+
+fn not_caught_by_eq_op_middle_change_right(s1: &S, s2: &S) -> i32 {
+    // There's no `s2.b`
+    s1.a * s2.a + s1.b * s2.b + s1.c * s2.c
+}
+
+fn not_caught_by_eq_op_start(s1: &S, s2: &S) -> i32 {
+    // There's no `s2.a`
+    s1.a * s2.a + s1.b * s2.b + s1.c * s2.c
+}
+
+fn not_caught_by_eq_op_end(s1: &S, s2: &S) -> i32 {
+    // There's no `s2.c`
+    s1.a * s2.a + s1.b * s2.b + s1.c * s2.c
+}
+
+fn the_cross_product_should_not_lint(s1: &S, s2: &S) -> (i32, i32, i32) {
+    (
+        s1.b * s2.c - s1.c * s2.b,
+        s1.c * s2.a - s1.a * s2.c,
+        s1.a * s2.b - s1.b * s2.a,
+    )
+}
+
+fn outer_parens_simple(s1: &S, s2: &S) -> i32 {
+    // There's no `s2.b`
+    (s1.a * s2.a + s1.b * s2.b)
+}
+
+fn outer_parens(s1: &S, s2: &S) -> i32 {
+    // There's no `s2.c`
+    (s1.a * s2.a + s1.b * s2.b + s1.c * s2.c + s1.d * s2.d)
+}
+
+fn inner_parens(s1: &S, s2: &S) -> i32 {
+    // There's no `s2.c`
+    (s1.a * s2.a) + (s1.b * s2.b) + (s1.c * s2.c) + (s1.d * s2.d)
+}
+
+fn outer_and_some_inner_parens(s1: &S, s2: &S) -> i32 {
+    // There's no `s2.c`
+    ((s1.a * s2.a) + (s1.b * s2.b) + (s1.c * s2.c) + (s1.d * s2.d))
+}
+
+fn all_parens_balanced_tree(s1: &S, s2: &S) -> i32 {
+    // There's no `s2.c`
+    (((s1.a * s2.a) + (s1.b * s2.b)) + ((s1.c * s2.c) + (s1.d * s2.d)))
+}
+
+fn all_parens_left_tree(s1: &S, s2: &S) -> i32 {
+    // There's no `s2.c`
+    (((s1.a * s2.a) + (s1.b * s2.b) + (s1.c * s2.c)) + (s1.d * s2.d))
+}
+
+fn all_parens_right_tree(s1: &S, s2: &S) -> i32 {
+    // There's no `s2.c`
+    ((s1.a * s2.a) + ((s1.b * s2.b) + (s1.c * s2.c) + (s1.d * s2.d)))
+}
+
+fn inside_other_binop_expression(s1: &S, s2: &S) -> i32 {
+    // There's no `s1.b`
+    (s1.a * s2.a + s1.b * s2.b) / 2
+}
+
+fn inside_function_call(s1: &S, s2: &S) -> i32 {
+    // There's no `s1.b`
+    i32::swap_bytes(s1.a * s2.a + s1.b * s2.b)
+}
+
+fn inside_larger_boolean_expression(s1: &S, s2: &S) -> bool {
+    // There's no `s1.c`
+    s1.a > 0 && s1.b > 0 && s1.c == s2.c && s1.d == s2.d
+}
+
+fn inside_larger_boolean_expression_with_unsorted_ops(s1: &S, s2: &S) -> bool {
+    // There's no `s1.c`
+    s1.a > 0 && s1.c == s2.c && s1.b > 0 && s1.d == s2.d
+}
+
+struct Nested {
+    inner: ((i32,), (i32,), (i32,)),
+}
+
+fn changed_middle_ident(n1: &Nested, n2: &Nested) -> bool {
+    // There's no `n2.inner.2.0`
+    (n1.inner.0).0 == (n2.inner.0).0 && (n1.inner.1).0 == (n2.inner.1).0 && (n1.inner.2).0 == (n2.inner.2).0
+}
+
+// `eq_op` should catch this one.
+fn changed_initial_ident(n1: &Nested, n2: &Nested) -> bool {
+    // There's no `n2.inner.0.0`
+    (n1.inner.0).0 == (n1.inner.0).0 && (n1.inner.1).0 == (n2.inner.1).0 && (n1.inner.2).0 == (n2.inner.2).0
+}
+
+fn inside_fn_with_similar_expression(s1: &S, s2: &S, strict: bool) -> bool {
+    if strict {
+        s1.a < s2.a && s1.b < s2.b
+    } else {
+        // There's no `s1.b` in this subexpression
+        s1.a <= s2.a && s1.b <= s2.b
+    }
+}
+
+fn inside_an_if_statement(s1: &mut S, s2: &S) {
+    // There's no `s1.b`
+    if s1.a < s2.a && s1.b < s2.b {
+        s1.c = s2.c;
+    }
+}
+
+fn maximum_unary_minus_right_tree(s1: &S, s2: &S) -> i32 {
+    // There's no `s2.c`
+    -(-(-s1.a * -s2.a) + (-(-s1.b * -s2.b) + -(-s1.c * -s2.c) + -(-s1.d * -s2.d)))
+}
+
+fn unary_minus_and_an_if_expression(s1: &S, s2: &S) -> i32 {
+    // There's no `s1.b`
+    -(if -s1.a < -s2.a && -s1.b < -s2.b { s1.c } else { s2.a })
+}
+
+fn main() {}
diff --git a/src/tools/clippy/tests/ui/suspicious_operation_groupings.rs b/src/tools/clippy/tests/ui/suspicious_operation_groupings.rs
index 3201d5de0f3..26ce97bb37f 100644
--- a/src/tools/clippy/tests/ui/suspicious_operation_groupings.rs
+++ b/src/tools/clippy/tests/ui/suspicious_operation_groupings.rs
@@ -1,5 +1,6 @@
+// run-rustfix
 #![warn(clippy::suspicious_operation_groupings)]
-#![allow(clippy::eq_op)]
+#![allow(dead_code, unused_parens, clippy::eq_op)]
 
 struct Vec3 {
     x: f64,
diff --git a/src/tools/clippy/tests/ui/suspicious_operation_groupings.stderr b/src/tools/clippy/tests/ui/suspicious_operation_groupings.stderr
index baf9bc74b00..29f229245fe 100644
--- a/src/tools/clippy/tests/ui/suspicious_operation_groupings.stderr
+++ b/src/tools/clippy/tests/ui/suspicious_operation_groupings.stderr
@@ -1,5 +1,5 @@
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:15:9
+  --> $DIR/suspicious_operation_groupings.rs:16:9
    |
 LL |         self.x == other.y && self.y == other.y && self.z == other.z
    |         ^^^^^^^^^^^^^^^^^ help: did you mean: `self.x == other.x`
@@ -7,151 +7,151 @@ LL |         self.x == other.y && self.y == other.y && self.z == other.z
    = note: `-D clippy::suspicious-operation-groupings` implied by `-D warnings`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:28:20
+  --> $DIR/suspicious_operation_groupings.rs:29:20
    |
 LL |     s1.a < s2.a && s1.a < s2.b
    |                    ^^^^^^^^^^^ help: did you mean: `s1.b < s2.b`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:76:33
+  --> $DIR/suspicious_operation_groupings.rs:77:33
    |
 LL |     s1.a * s2.a + s1.b * s2.b + s1.c * s2.b + s1.d * s2.d
    |                                 ^^^^^^^^^^^ help: did you mean: `s1.c * s2.c`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:81:19
+  --> $DIR/suspicious_operation_groupings.rs:82:19
    |
 LL |     s1.a * s2.a + s1.b * s2.c + s1.c * s2.c
    |                   ^^^^^^^^^^^ help: did you mean: `s1.b * s2.b`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:81:19
+  --> $DIR/suspicious_operation_groupings.rs:82:19
    |
 LL |     s1.a * s2.a + s1.b * s2.c + s1.c * s2.c
    |                   ^^^^^^^^^^^ help: did you mean: `s1.b * s2.b`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:86:19
+  --> $DIR/suspicious_operation_groupings.rs:87:19
    |
 LL |     s1.a * s2.a + s2.b * s2.b + s1.c * s2.c
    |                   ^^^^^^^^^^^ help: did you mean: `s1.b * s2.b`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:91:19
+  --> $DIR/suspicious_operation_groupings.rs:92:19
    |
 LL |     s1.a * s2.a + s1.b * s1.b + s1.c * s2.c
    |                   ^^^^^^^^^^^ help: did you mean: `s1.b * s2.b`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:96:5
+  --> $DIR/suspicious_operation_groupings.rs:97:5
    |
 LL |     s1.a * s1.a + s1.b * s2.b + s1.c * s2.c
    |     ^^^^^^^^^^^ help: did you mean: `s1.a * s2.a`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:101:33
+  --> $DIR/suspicious_operation_groupings.rs:102:33
    |
 LL |     s1.a * s2.a + s1.b * s2.b + s1.c * s1.c
    |                                 ^^^^^^^^^^^ help: did you mean: `s1.c * s2.c`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:114:20
+  --> $DIR/suspicious_operation_groupings.rs:115:20
    |
 LL |     (s1.a * s2.a + s1.b * s1.b)
    |                    ^^^^^^^^^^^ help: did you mean: `s1.b * s2.b`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:119:34
+  --> $DIR/suspicious_operation_groupings.rs:120:34
    |
 LL |     (s1.a * s2.a + s1.b * s2.b + s1.c * s2.b + s1.d * s2.d)
    |                                  ^^^^^^^^^^^ help: did you mean: `s1.c * s2.c`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:124:38
+  --> $DIR/suspicious_operation_groupings.rs:125:38
    |
 LL |     (s1.a * s2.a) + (s1.b * s2.b) + (s1.c * s2.b) + (s1.d * s2.d)
    |                                      ^^^^^^^^^^^ help: did you mean: `s1.c * s2.c`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:129:39
+  --> $DIR/suspicious_operation_groupings.rs:130:39
    |
 LL |     ((s1.a * s2.a) + (s1.b * s2.b) + (s1.c * s2.b) + (s1.d * s2.d))
    |                                       ^^^^^^^^^^^ help: did you mean: `s1.c * s2.c`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:134:42
+  --> $DIR/suspicious_operation_groupings.rs:135:42
    |
 LL |     (((s1.a * s2.a) + (s1.b * s2.b)) + ((s1.c * s2.b) + (s1.d * s2.d)))
    |                                          ^^^^^^^^^^^ help: did you mean: `s1.c * s2.c`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:134:42
+  --> $DIR/suspicious_operation_groupings.rs:135:42
    |
 LL |     (((s1.a * s2.a) + (s1.b * s2.b)) + ((s1.c * s2.b) + (s1.d * s2.d)))
    |                                          ^^^^^^^^^^^ help: did you mean: `s1.c * s2.c`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:139:40
+  --> $DIR/suspicious_operation_groupings.rs:140:40
    |
 LL |     (((s1.a * s2.a) + (s1.b * s2.b) + (s1.c * s2.b)) + (s1.d * s2.d))
    |                                        ^^^^^^^^^^^ help: did you mean: `s1.c * s2.c`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:144:40
+  --> $DIR/suspicious_operation_groupings.rs:145:40
    |
 LL |     ((s1.a * s2.a) + ((s1.b * s2.b) + (s1.c * s2.b) + (s1.d * s2.d)))
    |                                        ^^^^^^^^^^^ help: did you mean: `s1.c * s2.c`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:149:20
+  --> $DIR/suspicious_operation_groupings.rs:150:20
    |
 LL |     (s1.a * s2.a + s2.b * s2.b) / 2
    |                    ^^^^^^^^^^^ help: did you mean: `s1.b * s2.b`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:154:35
+  --> $DIR/suspicious_operation_groupings.rs:155:35
    |
 LL |     i32::swap_bytes(s1.a * s2.a + s2.b * s2.b)
    |                                   ^^^^^^^^^^^ help: did you mean: `s1.b * s2.b`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:159:29
+  --> $DIR/suspicious_operation_groupings.rs:160:29
    |
 LL |     s1.a > 0 && s1.b > 0 && s1.d == s2.c && s1.d == s2.d
    |                             ^^^^^^^^^^^^ help: did you mean: `s1.c == s2.c`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:164:17
+  --> $DIR/suspicious_operation_groupings.rs:165:17
    |
 LL |     s1.a > 0 && s1.d == s2.c && s1.b > 0 && s1.d == s2.d
    |                 ^^^^^^^^^^^^ help: did you mean: `s1.c == s2.c`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:173:77
+  --> $DIR/suspicious_operation_groupings.rs:174:77
    |
 LL |     (n1.inner.0).0 == (n2.inner.0).0 && (n1.inner.1).0 == (n2.inner.1).0 && (n1.inner.2).0 == (n2.inner.1).0
    |                                                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `(n1.inner.2).0 == (n2.inner.2).0`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:187:25
+  --> $DIR/suspicious_operation_groupings.rs:188:25
    |
 LL |         s1.a <= s2.a && s1.a <= s2.b
    |                         ^^^^^^^^^^^^ help: did you mean: `s1.b <= s2.b`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:193:23
+  --> $DIR/suspicious_operation_groupings.rs:194:23
    |
 LL |     if s1.a < s2.a && s1.a < s2.b {
    |                       ^^^^^^^^^^^ help: did you mean: `s1.b < s2.b`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:200:48
+  --> $DIR/suspicious_operation_groupings.rs:201:48
    |
 LL |     -(-(-s1.a * -s2.a) + (-(-s1.b * -s2.b) + -(-s1.c * -s2.b) + -(-s1.d * -s2.d)))
    |                                                ^^^^^^^^^^^^^ help: did you mean: `-s1.c * -s2.c`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:205:27
+  --> $DIR/suspicious_operation_groupings.rs:206:27
    |
 LL |     -(if -s1.a < -s2.a && -s1.a < -s2.b { s1.c } else { s2.a })
    |                           ^^^^^^^^^^^^^ help: did you mean: `-s1.b < -s2.b`
diff --git a/src/tools/clippy/tests/ui/swap_ptr_to_ref.fixed b/src/tools/clippy/tests/ui/swap_ptr_to_ref.fixed
new file mode 100644
index 00000000000..596b6ee919b
--- /dev/null
+++ b/src/tools/clippy/tests/ui/swap_ptr_to_ref.fixed
@@ -0,0 +1,24 @@
+// run-rustfix
+
+#![warn(clippy::swap_ptr_to_ref)]
+
+use core::ptr::addr_of_mut;
+
+fn main() {
+    let mut x = 0u32;
+    let y: *mut _ = &mut x;
+    let z: *mut _ = &mut x;
+
+    unsafe {
+        core::ptr::swap(y, z);
+        core::ptr::swap(y, &mut x);
+        core::ptr::swap(&mut x, y);
+        core::ptr::swap(addr_of_mut!(x), addr_of_mut!(x));
+    }
+
+    let y = &mut x;
+    let mut z = 0u32;
+    let z = &mut z;
+
+    core::mem::swap(y, z);
+}
diff --git a/src/tools/clippy/tests/ui/swap_ptr_to_ref.rs b/src/tools/clippy/tests/ui/swap_ptr_to_ref.rs
new file mode 100644
index 00000000000..282f571211d
--- /dev/null
+++ b/src/tools/clippy/tests/ui/swap_ptr_to_ref.rs
@@ -0,0 +1,24 @@
+// run-rustfix
+
+#![warn(clippy::swap_ptr_to_ref)]
+
+use core::ptr::addr_of_mut;
+
+fn main() {
+    let mut x = 0u32;
+    let y: *mut _ = &mut x;
+    let z: *mut _ = &mut x;
+
+    unsafe {
+        core::mem::swap(&mut *y, &mut *z);
+        core::mem::swap(&mut *y, &mut x);
+        core::mem::swap(&mut x, &mut *y);
+        core::mem::swap(&mut *addr_of_mut!(x), &mut *addr_of_mut!(x));
+    }
+
+    let y = &mut x;
+    let mut z = 0u32;
+    let z = &mut z;
+
+    core::mem::swap(y, z);
+}
diff --git a/src/tools/clippy/tests/ui/swap_ptr_to_ref.stderr b/src/tools/clippy/tests/ui/swap_ptr_to_ref.stderr
new file mode 100644
index 00000000000..401ce070869
--- /dev/null
+++ b/src/tools/clippy/tests/ui/swap_ptr_to_ref.stderr
@@ -0,0 +1,28 @@
+error: call to `core::mem::swap` with a parameter derived from a raw pointer
+  --> $DIR/swap_ptr_to_ref.rs:13:9
+   |
+LL |         core::mem::swap(&mut *y, &mut *z);
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use ptr::swap: `core::ptr::swap(y, z)`
+   |
+   = note: `-D clippy::swap-ptr-to-ref` implied by `-D warnings`
+
+error: call to `core::mem::swap` with a parameter derived from a raw pointer
+  --> $DIR/swap_ptr_to_ref.rs:14:9
+   |
+LL |         core::mem::swap(&mut *y, &mut x);
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use ptr::swap: `core::ptr::swap(y, &mut x)`
+
+error: call to `core::mem::swap` with a parameter derived from a raw pointer
+  --> $DIR/swap_ptr_to_ref.rs:15:9
+   |
+LL |         core::mem::swap(&mut x, &mut *y);
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use ptr::swap: `core::ptr::swap(&mut x, y)`
+
+error: call to `core::mem::swap` with a parameter derived from a raw pointer
+  --> $DIR/swap_ptr_to_ref.rs:16:9
+   |
+LL |         core::mem::swap(&mut *addr_of_mut!(x), &mut *addr_of_mut!(x));
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use ptr::swap: `core::ptr::swap(addr_of_mut!(x), addr_of_mut!(x))`
+
+error: aborting due to 4 previous errors
+
diff --git a/src/tools/clippy/tests/ui/swap_ptr_to_ref_unfixable.rs b/src/tools/clippy/tests/ui/swap_ptr_to_ref_unfixable.rs
new file mode 100644
index 00000000000..66ea7c6529b
--- /dev/null
+++ b/src/tools/clippy/tests/ui/swap_ptr_to_ref_unfixable.rs
@@ -0,0 +1,18 @@
+#![warn(clippy::swap_ptr_to_ref)]
+
+macro_rules! addr_of_mut_to_ref {
+    ($e:expr) => {
+        &mut *core::ptr::addr_of_mut!($e)
+    };
+}
+
+fn main() {
+    let mut x = 0u32;
+    let y: *mut _ = &mut x;
+
+    unsafe {
+        core::mem::swap(addr_of_mut_to_ref!(x), &mut *y);
+        core::mem::swap(&mut *y, addr_of_mut_to_ref!(x));
+        core::mem::swap(addr_of_mut_to_ref!(x), addr_of_mut_to_ref!(x));
+    }
+}
diff --git a/src/tools/clippy/tests/ui/swap_ptr_to_ref_unfixable.stderr b/src/tools/clippy/tests/ui/swap_ptr_to_ref_unfixable.stderr
new file mode 100644
index 00000000000..c261205d556
--- /dev/null
+++ b/src/tools/clippy/tests/ui/swap_ptr_to_ref_unfixable.stderr
@@ -0,0 +1,22 @@
+error: call to `core::mem::swap` with a parameter derived from a raw pointer
+  --> $DIR/swap_ptr_to_ref_unfixable.rs:14:9
+   |
+LL |         core::mem::swap(addr_of_mut_to_ref!(x), &mut *y);
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: `-D clippy::swap-ptr-to-ref` implied by `-D warnings`
+
+error: call to `core::mem::swap` with a parameter derived from a raw pointer
+  --> $DIR/swap_ptr_to_ref_unfixable.rs:15:9
+   |
+LL |         core::mem::swap(&mut *y, addr_of_mut_to_ref!(x));
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: call to `core::mem::swap` with a parameter derived from a raw pointer
+  --> $DIR/swap_ptr_to_ref_unfixable.rs:16:9
+   |
+LL |         core::mem::swap(addr_of_mut_to_ref!(x), addr_of_mut_to_ref!(x));
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 3 previous errors
+
diff --git a/src/tools/clippy/tests/ui/transmute.rs b/src/tools/clippy/tests/ui/transmute.rs
index 5b688ce4d64..001c910239a 100644
--- a/src/tools/clippy/tests/ui/transmute.rs
+++ b/src/tools/clippy/tests/ui/transmute.rs
@@ -16,7 +16,8 @@ fn my_vec() -> MyVec<i32> {
 #[allow(clippy::needless_lifetimes, clippy::transmute_ptr_to_ptr)]
 #[warn(clippy::useless_transmute)]
 unsafe fn _generic<'a, T, U: 'a>(t: &'a T) {
-    let _: &'a T = core::intrinsics::transmute(t);
+    // FIXME: should lint
+    // let _: &'a T = core::intrinsics::transmute(t);
 
     let _: &'a U = core::intrinsics::transmute(t);
 
@@ -48,6 +49,22 @@ fn useless() {
 
         let _ = (1 + 1_usize) as *const usize;
     }
+
+    unsafe fn _f<'a, 'b>(x: &'a u32) -> &'b u32 {
+        std::mem::transmute(x)
+    }
+
+    unsafe fn _f2<'a, 'b>(x: *const (dyn Iterator<Item = u32> + 'a)) -> *const (dyn Iterator<Item = u32> + 'b) {
+        std::mem::transmute(x)
+    }
+
+    unsafe fn _f3<'a, 'b>(x: fn(&'a u32)) -> fn(&'b u32) {
+        std::mem::transmute(x)
+    }
+
+    unsafe fn _f4<'a, 'b>(x: std::borrow::Cow<'a, str>) -> std::borrow::Cow<'b, str> {
+        std::mem::transmute(x)
+    }
 }
 
 struct Usize(usize);
diff --git a/src/tools/clippy/tests/ui/transmute.stderr b/src/tools/clippy/tests/ui/transmute.stderr
index 72a386e8fa6..008b4a981d7 100644
--- a/src/tools/clippy/tests/ui/transmute.stderr
+++ b/src/tools/clippy/tests/ui/transmute.stderr
@@ -1,73 +1,67 @@
-error: transmute from a type (`&T`) to itself
-  --> $DIR/transmute.rs:19:20
-   |
-LL |     let _: &'a T = core::intrinsics::transmute(t);
-   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: `-D clippy::useless-transmute` implied by `-D warnings`
-
 error: transmute from a reference to a pointer
-  --> $DIR/transmute.rs:23:23
+  --> $DIR/transmute.rs:24:23
    |
 LL |     let _: *const T = core::intrinsics::transmute(t);
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `t as *const T`
+   |
+   = note: `-D clippy::useless-transmute` implied by `-D warnings`
 
 error: transmute from a reference to a pointer
-  --> $DIR/transmute.rs:25:21
+  --> $DIR/transmute.rs:26:21
    |
 LL |     let _: *mut T = core::intrinsics::transmute(t);
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `t as *const T as *mut T`
 
 error: transmute from a reference to a pointer
-  --> $DIR/transmute.rs:27:23
+  --> $DIR/transmute.rs:28:23
    |
 LL |     let _: *const U = core::intrinsics::transmute(t);
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `t as *const T as *const U`
 
 error: transmute from a type (`std::vec::Vec<i32>`) to itself
-  --> $DIR/transmute.rs:33:27
+  --> $DIR/transmute.rs:34:27
    |
 LL |         let _: Vec<i32> = core::intrinsics::transmute(my_vec());
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: transmute from a type (`std::vec::Vec<i32>`) to itself
-  --> $DIR/transmute.rs:35:27
+  --> $DIR/transmute.rs:36:27
    |
 LL |         let _: Vec<i32> = core::mem::transmute(my_vec());
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: transmute from a type (`std::vec::Vec<i32>`) to itself
-  --> $DIR/transmute.rs:37:27
+  --> $DIR/transmute.rs:38:27
    |
 LL |         let _: Vec<i32> = std::intrinsics::transmute(my_vec());
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: transmute from a type (`std::vec::Vec<i32>`) to itself
-  --> $DIR/transmute.rs:39:27
+  --> $DIR/transmute.rs:40:27
    |
 LL |         let _: Vec<i32> = std::mem::transmute(my_vec());
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: transmute from a type (`std::vec::Vec<i32>`) to itself
-  --> $DIR/transmute.rs:41:27
+  --> $DIR/transmute.rs:42:27
    |
 LL |         let _: Vec<i32> = my_transmute(my_vec());
    |                           ^^^^^^^^^^^^^^^^^^^^^^
 
 error: transmute from an integer to a pointer
-  --> $DIR/transmute.rs:43:31
+  --> $DIR/transmute.rs:44:31
    |
 LL |         let _: *const usize = std::mem::transmute(5_isize);
    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `5_isize as *const usize`
 
 error: transmute from an integer to a pointer
-  --> $DIR/transmute.rs:47:31
+  --> $DIR/transmute.rs:48:31
    |
 LL |         let _: *const usize = std::mem::transmute(1 + 1usize);
    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(1 + 1usize) as *const usize`
 
 error: transmute from a type (`*const Usize`) to the type that it points to (`Usize`)
-  --> $DIR/transmute.rs:62:24
+  --> $DIR/transmute.rs:79:24
    |
 LL |         let _: Usize = core::intrinsics::transmute(int_const_ptr);
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -75,25 +69,25 @@ LL |         let _: Usize = core::intrinsics::transmute(int_const_ptr);
    = note: `-D clippy::crosspointer-transmute` implied by `-D warnings`
 
 error: transmute from a type (`*mut Usize`) to the type that it points to (`Usize`)
-  --> $DIR/transmute.rs:64:24
+  --> $DIR/transmute.rs:81:24
    |
 LL |         let _: Usize = core::intrinsics::transmute(int_mut_ptr);
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: transmute from a type (`Usize`) to a pointer to that type (`*const Usize`)
-  --> $DIR/transmute.rs:66:31
+  --> $DIR/transmute.rs:83:31
    |
 LL |         let _: *const Usize = core::intrinsics::transmute(my_int());
    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: transmute from a type (`Usize`) to a pointer to that type (`*mut Usize`)
-  --> $DIR/transmute.rs:68:29
+  --> $DIR/transmute.rs:85:29
    |
 LL |         let _: *mut Usize = core::intrinsics::transmute(my_int());
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: transmute from a `u32` to a `char`
-  --> $DIR/transmute.rs:74:28
+  --> $DIR/transmute.rs:91:28
    |
 LL |     let _: char = unsafe { std::mem::transmute(0_u32) };
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::char::from_u32(0_u32).unwrap()`
@@ -101,13 +95,13 @@ LL |     let _: char = unsafe { std::mem::transmute(0_u32) };
    = note: `-D clippy::transmute-int-to-char` implied by `-D warnings`
 
 error: transmute from a `i32` to a `char`
-  --> $DIR/transmute.rs:75:28
+  --> $DIR/transmute.rs:92:28
    |
 LL |     let _: char = unsafe { std::mem::transmute(0_i32) };
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::char::from_u32(0_i32 as u32).unwrap()`
 
 error: transmute from a `u8` to a `bool`
-  --> $DIR/transmute.rs:84:28
+  --> $DIR/transmute.rs:101:28
    |
 LL |     let _: bool = unsafe { std::mem::transmute(0_u8) };
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `0_u8 != 0`
@@ -115,7 +109,7 @@ LL |     let _: bool = unsafe { std::mem::transmute(0_u8) };
    = note: `-D clippy::transmute-int-to-bool` implied by `-D warnings`
 
 error: transmute from a `u32` to a `f32`
-  --> $DIR/transmute.rs:90:31
+  --> $DIR/transmute.rs:107:31
    |
 LL |         let _: f32 = unsafe { std::mem::transmute(0_u32) };
    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f32::from_bits(0_u32)`
@@ -123,25 +117,25 @@ LL |         let _: f32 = unsafe { std::mem::transmute(0_u32) };
    = note: `-D clippy::transmute-int-to-float` implied by `-D warnings`
 
 error: transmute from a `i32` to a `f32`
-  --> $DIR/transmute.rs:91:31
+  --> $DIR/transmute.rs:108:31
    |
 LL |         let _: f32 = unsafe { std::mem::transmute(0_i32) };
    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f32::from_bits(0_i32 as u32)`
 
 error: transmute from a `u64` to a `f64`
-  --> $DIR/transmute.rs:92:31
+  --> $DIR/transmute.rs:109:31
    |
 LL |         let _: f64 = unsafe { std::mem::transmute(0_u64) };
    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f64::from_bits(0_u64)`
 
 error: transmute from a `i64` to a `f64`
-  --> $DIR/transmute.rs:93:31
+  --> $DIR/transmute.rs:110:31
    |
 LL |         let _: f64 = unsafe { std::mem::transmute(0_i64) };
    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f64::from_bits(0_i64 as u64)`
 
 error: transmute from a `u8` to a `[u8; 1]`
-  --> $DIR/transmute.rs:113:30
+  --> $DIR/transmute.rs:130:30
    |
 LL |             let _: [u8; 1] = std::mem::transmute(0u8);
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u8.to_ne_bytes()`
@@ -149,85 +143,85 @@ LL |             let _: [u8; 1] = std::mem::transmute(0u8);
    = note: `-D clippy::transmute-num-to-bytes` implied by `-D warnings`
 
 error: transmute from a `u32` to a `[u8; 4]`
-  --> $DIR/transmute.rs:114:30
+  --> $DIR/transmute.rs:131:30
    |
 LL |             let _: [u8; 4] = std::mem::transmute(0u32);
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u32.to_ne_bytes()`
 
 error: transmute from a `u128` to a `[u8; 16]`
-  --> $DIR/transmute.rs:115:31
+  --> $DIR/transmute.rs:132:31
    |
 LL |             let _: [u8; 16] = std::mem::transmute(0u128);
    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u128.to_ne_bytes()`
 
 error: transmute from a `i8` to a `[u8; 1]`
-  --> $DIR/transmute.rs:116:30
+  --> $DIR/transmute.rs:133:30
    |
 LL |             let _: [u8; 1] = std::mem::transmute(0i8);
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i8.to_ne_bytes()`
 
 error: transmute from a `i32` to a `[u8; 4]`
-  --> $DIR/transmute.rs:117:30
+  --> $DIR/transmute.rs:134:30
    |
 LL |             let _: [u8; 4] = std::mem::transmute(0i32);
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i32.to_ne_bytes()`
 
 error: transmute from a `i128` to a `[u8; 16]`
-  --> $DIR/transmute.rs:118:31
+  --> $DIR/transmute.rs:135:31
    |
 LL |             let _: [u8; 16] = std::mem::transmute(0i128);
    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i128.to_ne_bytes()`
 
 error: transmute from a `f32` to a `[u8; 4]`
-  --> $DIR/transmute.rs:119:30
+  --> $DIR/transmute.rs:136:30
    |
 LL |             let _: [u8; 4] = std::mem::transmute(0.0f32);
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0.0f32.to_ne_bytes()`
 
 error: transmute from a `f64` to a `[u8; 8]`
-  --> $DIR/transmute.rs:120:30
+  --> $DIR/transmute.rs:137:30
    |
 LL |             let _: [u8; 8] = std::mem::transmute(0.0f64);
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0.0f64.to_ne_bytes()`
 
 error: transmute from a `u8` to a `[u8; 1]`
-  --> $DIR/transmute.rs:125:30
+  --> $DIR/transmute.rs:142:30
    |
 LL |             let _: [u8; 1] = std::mem::transmute(0u8);
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u8.to_ne_bytes()`
 
 error: transmute from a `u32` to a `[u8; 4]`
-  --> $DIR/transmute.rs:126:30
+  --> $DIR/transmute.rs:143:30
    |
 LL |             let _: [u8; 4] = std::mem::transmute(0u32);
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u32.to_ne_bytes()`
 
 error: transmute from a `u128` to a `[u8; 16]`
-  --> $DIR/transmute.rs:127:31
+  --> $DIR/transmute.rs:144:31
    |
 LL |             let _: [u8; 16] = std::mem::transmute(0u128);
    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u128.to_ne_bytes()`
 
 error: transmute from a `i8` to a `[u8; 1]`
-  --> $DIR/transmute.rs:128:30
+  --> $DIR/transmute.rs:145:30
    |
 LL |             let _: [u8; 1] = std::mem::transmute(0i8);
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i8.to_ne_bytes()`
 
 error: transmute from a `i32` to a `[u8; 4]`
-  --> $DIR/transmute.rs:129:30
+  --> $DIR/transmute.rs:146:30
    |
 LL |             let _: [u8; 4] = std::mem::transmute(0i32);
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i32.to_ne_bytes()`
 
 error: transmute from a `i128` to a `[u8; 16]`
-  --> $DIR/transmute.rs:130:31
+  --> $DIR/transmute.rs:147:31
    |
 LL |             let _: [u8; 16] = std::mem::transmute(0i128);
    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i128.to_ne_bytes()`
 
 error: transmute from a `&[u8]` to a `&str`
-  --> $DIR/transmute.rs:140:28
+  --> $DIR/transmute.rs:157:28
    |
 LL |     let _: &str = unsafe { std::mem::transmute(B) };
    |                            ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8(B).unwrap()`
@@ -235,16 +229,16 @@ LL |     let _: &str = unsafe { std::mem::transmute(B) };
    = note: `-D clippy::transmute-bytes-to-str` implied by `-D warnings`
 
 error: transmute from a `&mut [u8]` to a `&mut str`
-  --> $DIR/transmute.rs:141:32
+  --> $DIR/transmute.rs:158:32
    |
 LL |     let _: &mut str = unsafe { std::mem::transmute(mb) };
    |                                ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8_mut(mb).unwrap()`
 
 error: transmute from a `&[u8]` to a `&str`
-  --> $DIR/transmute.rs:142:30
+  --> $DIR/transmute.rs:159:30
    |
 LL |     const _: &str = unsafe { std::mem::transmute(B) };
    |                              ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8_unchecked(B)`
 
-error: aborting due to 39 previous errors
+error: aborting due to 38 previous errors
 
diff --git a/src/tools/clippy/tests/ui/transmute_undefined_repr.rs b/src/tools/clippy/tests/ui/transmute_undefined_repr.rs
index b06ed4a9173..ebcaa7a84cf 100644
--- a/src/tools/clippy/tests/ui/transmute_undefined_repr.rs
+++ b/src/tools/clippy/tests/ui/transmute_undefined_repr.rs
@@ -1,5 +1,5 @@
 #![warn(clippy::transmute_undefined_repr)]
-#![allow(clippy::unit_arg, clippy::transmute_ptr_to_ref)]
+#![allow(clippy::unit_arg, clippy::transmute_ptr_to_ref, clippy::useless_transmute)]
 
 use core::any::TypeId;
 use core::ffi::c_void;
diff --git a/src/tools/clippy/tests/ui/unicode.fixed b/src/tools/clippy/tests/ui/unicode.fixed
new file mode 100644
index 00000000000..328cda369e1
--- /dev/null
+++ b/src/tools/clippy/tests/ui/unicode.fixed
@@ -0,0 +1,36 @@
+// run-rustfix
+#[warn(clippy::invisible_characters)]
+fn zero() {
+    print!("Here >\u{200B}< is a ZWS, and \u{200B}another");
+    print!("This\u{200B}is\u{200B}fine");
+    print!("Here >\u{AD}< is a SHY, and \u{AD}another");
+    print!("This\u{ad}is\u{ad}fine");
+    print!("Here >\u{2060}< is a WJ, and \u{2060}another");
+    print!("This\u{2060}is\u{2060}fine");
+}
+
+#[warn(clippy::unicode_not_nfc)]
+fn canon() {
+    print!("̀àh?");
+    print!("a\u{0300}h?"); // also ok
+}
+
+#[warn(clippy::non_ascii_literal)]
+fn uni() {
+    print!("\u{dc}ben!");
+    print!("\u{DC}ben!"); // this is ok
+}
+
+// issue 8013
+#[warn(clippy::non_ascii_literal)]
+fn single_quote() {
+    const _EMPTY_BLOCK: char = '\u{25b1}';
+    const _FULL_BLOCK: char = '\u{25b0}';
+}
+
+fn main() {
+    zero();
+    uni();
+    canon();
+    single_quote();
+}
diff --git a/src/tools/clippy/tests/ui/unicode.rs b/src/tools/clippy/tests/ui/unicode.rs
index e0a4eadce33..7828d6bcbea 100644
--- a/src/tools/clippy/tests/ui/unicode.rs
+++ b/src/tools/clippy/tests/ui/unicode.rs
@@ -1,3 +1,4 @@
+// run-rustfix
 #[warn(clippy::invisible_characters)]
 fn zero() {
     print!("Here >​< is a ZWS, and ​another");
diff --git a/src/tools/clippy/tests/ui/unicode.stderr b/src/tools/clippy/tests/ui/unicode.stderr
index 3f54e3880e7..01d3f3c0296 100644
--- a/src/tools/clippy/tests/ui/unicode.stderr
+++ b/src/tools/clippy/tests/ui/unicode.stderr
@@ -1,5 +1,5 @@
 error: invisible character detected
-  --> $DIR/unicode.rs:3:12
+  --> $DIR/unicode.rs:4:12
    |
 LL |     print!("Here >​< is a ZWS, and ​another");
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Here >/u{200B}< is a ZWS, and /u{200B}another"`
@@ -7,19 +7,19 @@ LL |     print!("Here >​< is a ZWS, and ​another");
    = note: `-D clippy::invisible-characters` implied by `-D warnings`
 
 error: invisible character detected
-  --> $DIR/unicode.rs:5:12
+  --> $DIR/unicode.rs:6:12
    |
 LL |     print!("Here >­< is a SHY, and ­another");
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Here >/u{AD}< is a SHY, and /u{AD}another"`
 
 error: invisible character detected
-  --> $DIR/unicode.rs:7:12
+  --> $DIR/unicode.rs:8:12
    |
 LL |     print!("Here >⁠< is a WJ, and ⁠another");
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Here >/u{2060}< is a WJ, and /u{2060}another"`
 
 error: non-NFC Unicode sequence detected
-  --> $DIR/unicode.rs:13:12
+  --> $DIR/unicode.rs:14:12
    |
 LL |     print!("̀àh?");
    |            ^^^^^ help: consider replacing the string with: `"̀àh?"`
@@ -27,7 +27,7 @@ LL |     print!("̀àh?");
    = note: `-D clippy::unicode-not-nfc` implied by `-D warnings`
 
 error: literal non-ASCII character detected
-  --> $DIR/unicode.rs:19:12
+  --> $DIR/unicode.rs:20:12
    |
 LL |     print!("Üben!");
    |            ^^^^^^^ help: consider replacing the string with: `"/u{dc}ben!"`
@@ -35,13 +35,13 @@ LL |     print!("Üben!");
    = note: `-D clippy::non-ascii-literal` implied by `-D warnings`
 
 error: literal non-ASCII character detected
-  --> $DIR/unicode.rs:26:32
+  --> $DIR/unicode.rs:27:32
    |
 LL |     const _EMPTY_BLOCK: char = '▱';
    |                                ^^^ help: consider replacing the string with: `'/u{25b1}'`
 
 error: literal non-ASCII character detected
-  --> $DIR/unicode.rs:27:31
+  --> $DIR/unicode.rs:28:31
    |
 LL |     const _FULL_BLOCK: char = '▰';
    |                               ^^^ help: consider replacing the string with: `'/u{25b0}'`
diff --git a/src/tools/clippy/tests/ui/unit_arg_empty_blocks.fixed b/src/tools/clippy/tests/ui/unit_arg_empty_blocks.fixed
new file mode 100644
index 00000000000..9400e93cac8
--- /dev/null
+++ b/src/tools/clippy/tests/ui/unit_arg_empty_blocks.fixed
@@ -0,0 +1,30 @@
+// run-rustfix
+#![warn(clippy::unit_arg)]
+#![allow(clippy::no_effect, unused_must_use, unused_variables)]
+
+use std::fmt::Debug;
+
+fn foo<T: Debug>(t: T) {
+    println!("{:?}", t);
+}
+
+fn foo3<T1: Debug, T2: Debug, T3: Debug>(t1: T1, t2: T2, t3: T3) {
+    println!("{:?}, {:?}, {:?}", t1, t2, t3);
+}
+
+fn bad() {
+    foo(());
+    foo3((), 2, 2);
+    foo(0);
+    taking_two_units((), ());
+    foo(0);
+    foo(1);
+    taking_three_units((), (), ());
+}
+
+fn taking_two_units(a: (), b: ()) {}
+fn taking_three_units(a: (), b: (), c: ()) {}
+
+fn main() {
+    bad();
+}
diff --git a/src/tools/clippy/tests/ui/unit_arg_empty_blocks.rs b/src/tools/clippy/tests/ui/unit_arg_empty_blocks.rs
index 18a31eb3dee..5f52b6c5315 100644
--- a/src/tools/clippy/tests/ui/unit_arg_empty_blocks.rs
+++ b/src/tools/clippy/tests/ui/unit_arg_empty_blocks.rs
@@ -1,3 +1,4 @@
+// run-rustfix
 #![warn(clippy::unit_arg)]
 #![allow(clippy::no_effect, unused_must_use, unused_variables)]
 
diff --git a/src/tools/clippy/tests/ui/unit_arg_empty_blocks.stderr b/src/tools/clippy/tests/ui/unit_arg_empty_blocks.stderr
index 39072c9a8cc..d35e931697d 100644
--- a/src/tools/clippy/tests/ui/unit_arg_empty_blocks.stderr
+++ b/src/tools/clippy/tests/ui/unit_arg_empty_blocks.stderr
@@ -1,5 +1,5 @@
 error: passing a unit value to a function
-  --> $DIR/unit_arg_empty_blocks.rs:15:5
+  --> $DIR/unit_arg_empty_blocks.rs:16:5
    |
 LL |     foo({});
    |     ^^^^--^
@@ -9,7 +9,7 @@ LL |     foo({});
    = note: `-D clippy::unit-arg` implied by `-D warnings`
 
 error: passing a unit value to a function
-  --> $DIR/unit_arg_empty_blocks.rs:16:5
+  --> $DIR/unit_arg_empty_blocks.rs:17:5
    |
 LL |     foo3({}, 2, 2);
    |     ^^^^^--^^^^^^^
@@ -17,7 +17,7 @@ LL |     foo3({}, 2, 2);
    |          help: use a unit literal instead: `()`
 
 error: passing unit values to a function
-  --> $DIR/unit_arg_empty_blocks.rs:17:5
+  --> $DIR/unit_arg_empty_blocks.rs:18:5
    |
 LL |     taking_two_units({}, foo(0));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -29,7 +29,7 @@ LL ~     taking_two_units((), ());
    |
 
 error: passing unit values to a function
-  --> $DIR/unit_arg_empty_blocks.rs:18:5
+  --> $DIR/unit_arg_empty_blocks.rs:19:5
    |
 LL |     taking_three_units({}, foo(0), foo(1));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/clippy/tests/ui/unnecessary_cast.fixed b/src/tools/clippy/tests/ui/unnecessary_cast.fixed
new file mode 100644
index 00000000000..b352b285c86
--- /dev/null
+++ b/src/tools/clippy/tests/ui/unnecessary_cast.fixed
@@ -0,0 +1,91 @@
+// run-rustfix
+#![warn(clippy::unnecessary_cast)]
+#![allow(
+    unused_must_use,
+    clippy::borrow_as_ptr,
+    clippy::no_effect,
+    clippy::nonstandard_macro_braces,
+    clippy::unnecessary_operation
+)]
+
+#[rustfmt::skip]
+fn main() {
+    // Test cast_unnecessary
+    1_i32;
+    1_f32;
+    false;
+    &1i32 as &i32;
+
+    -1_i32;
+    - 1_i32;
+    -1_f32;
+    1_i32;
+    1_f32;
+
+    // macro version
+    macro_rules! foo {
+        ($a:ident, $b:ident) => {
+            #[allow(unused)]
+            pub fn $a() -> $b {
+                1 as $b
+            }
+        };
+    }
+    foo!(a, i32);
+    foo!(b, f32);
+    foo!(c, f64);
+
+    // do not lint cast to cfg-dependant type
+    1 as std::os::raw::c_char;
+
+    // do not lint cast to alias type
+    1 as I32Alias;
+    &1 as &I32Alias;
+}
+
+type I32Alias = i32;
+
+mod fixable {
+    #![allow(dead_code)]
+
+    fn main() {
+        // casting integer literal to float is unnecessary
+        100_f32;
+        100_f64;
+        100_f64;
+        let _ = -100_f32;
+        let _ = -100_f64;
+        let _ = -100_f64;
+        100_f32;
+        100_f64;
+        // Should not trigger
+        #[rustfmt::skip]
+        let v = vec!(1);
+        &v as &[i32];
+        0x10 as f32;
+        0o10 as f32;
+        0b10 as f32;
+        0x11 as f64;
+        0o11 as f64;
+        0b11 as f64;
+
+        1_u32;
+        0x10_i32;
+        0b10_usize;
+        0o73_u16;
+        1_000_000_000_u32;
+
+        1.0_f64;
+        0.5_f32;
+
+        1.0 as u16;
+
+        let _ = -1_i32;
+        let _ = -1.0_f32;
+
+        let _ = 1 as I32Alias;
+        let _ = &1 as &I32Alias;
+    }
+
+    type I32Alias = i32;
+}
diff --git a/src/tools/clippy/tests/ui/unnecessary_cast.rs b/src/tools/clippy/tests/ui/unnecessary_cast.rs
index 62c3e963686..6c8cc3effe8 100644
--- a/src/tools/clippy/tests/ui/unnecessary_cast.rs
+++ b/src/tools/clippy/tests/ui/unnecessary_cast.rs
@@ -1,5 +1,12 @@
+// run-rustfix
 #![warn(clippy::unnecessary_cast)]
-#![allow(clippy::no_effect)]
+#![allow(
+    unused_must_use,
+    clippy::borrow_as_ptr,
+    clippy::no_effect,
+    clippy::nonstandard_macro_braces,
+    clippy::unnecessary_operation
+)]
 
 #[rustfmt::skip]
 fn main() {
@@ -37,3 +44,48 @@ fn main() {
 }
 
 type I32Alias = i32;
+
+mod fixable {
+    #![allow(dead_code)]
+
+    fn main() {
+        // casting integer literal to float is unnecessary
+        100 as f32;
+        100 as f64;
+        100_i32 as f64;
+        let _ = -100 as f32;
+        let _ = -100 as f64;
+        let _ = -100_i32 as f64;
+        100. as f32;
+        100. as f64;
+        // Should not trigger
+        #[rustfmt::skip]
+        let v = vec!(1);
+        &v as &[i32];
+        0x10 as f32;
+        0o10 as f32;
+        0b10 as f32;
+        0x11 as f64;
+        0o11 as f64;
+        0b11 as f64;
+
+        1 as u32;
+        0x10 as i32;
+        0b10 as usize;
+        0o73 as u16;
+        1_000_000_000 as u32;
+
+        1.0 as f64;
+        0.5 as f32;
+
+        1.0 as u16;
+
+        let _ = -1 as i32;
+        let _ = -1.0 as f32;
+
+        let _ = 1 as I32Alias;
+        let _ = &1 as &I32Alias;
+    }
+
+    type I32Alias = i32;
+}
diff --git a/src/tools/clippy/tests/ui/unnecessary_cast.stderr b/src/tools/clippy/tests/ui/unnecessary_cast.stderr
index a5a93c6110c..bad45f0025b 100644
--- a/src/tools/clippy/tests/ui/unnecessary_cast.stderr
+++ b/src/tools/clippy/tests/ui/unnecessary_cast.stderr
@@ -1,5 +1,5 @@
 error: casting integer literal to `i32` is unnecessary
-  --> $DIR/unnecessary_cast.rs:7:5
+  --> $DIR/unnecessary_cast.rs:14:5
    |
 LL |     1i32 as i32;
    |     ^^^^^^^^^^^ help: try: `1_i32`
@@ -7,46 +7,148 @@ LL |     1i32 as i32;
    = note: `-D clippy::unnecessary-cast` implied by `-D warnings`
 
 error: casting float literal to `f32` is unnecessary
-  --> $DIR/unnecessary_cast.rs:8:5
+  --> $DIR/unnecessary_cast.rs:15:5
    |
 LL |     1f32 as f32;
    |     ^^^^^^^^^^^ help: try: `1_f32`
 
 error: casting to the same type is unnecessary (`bool` -> `bool`)
-  --> $DIR/unnecessary_cast.rs:9:5
+  --> $DIR/unnecessary_cast.rs:16:5
    |
 LL |     false as bool;
    |     ^^^^^^^^^^^^^ help: try: `false`
 
 error: casting integer literal to `i32` is unnecessary
-  --> $DIR/unnecessary_cast.rs:12:5
+  --> $DIR/unnecessary_cast.rs:19:5
    |
 LL |     -1_i32 as i32;
    |     ^^^^^^^^^^^^^ help: try: `-1_i32`
 
 error: casting integer literal to `i32` is unnecessary
-  --> $DIR/unnecessary_cast.rs:13:5
+  --> $DIR/unnecessary_cast.rs:20:5
    |
 LL |     - 1_i32 as i32;
    |     ^^^^^^^^^^^^^^ help: try: `- 1_i32`
 
 error: casting float literal to `f32` is unnecessary
-  --> $DIR/unnecessary_cast.rs:14:5
+  --> $DIR/unnecessary_cast.rs:21:5
    |
 LL |     -1f32 as f32;
    |     ^^^^^^^^^^^^ help: try: `-1_f32`
 
 error: casting integer literal to `i32` is unnecessary
-  --> $DIR/unnecessary_cast.rs:15:5
+  --> $DIR/unnecessary_cast.rs:22:5
    |
 LL |     1_i32 as i32;
    |     ^^^^^^^^^^^^ help: try: `1_i32`
 
 error: casting float literal to `f32` is unnecessary
-  --> $DIR/unnecessary_cast.rs:16:5
+  --> $DIR/unnecessary_cast.rs:23:5
    |
 LL |     1_f32 as f32;
    |     ^^^^^^^^^^^^ help: try: `1_f32`
 
-error: aborting due to 8 previous errors
+error: casting integer literal to `f32` is unnecessary
+  --> $DIR/unnecessary_cast.rs:53:9
+   |
+LL |         100 as f32;
+   |         ^^^^^^^^^^ help: try: `100_f32`
+
+error: casting integer literal to `f64` is unnecessary
+  --> $DIR/unnecessary_cast.rs:54:9
+   |
+LL |         100 as f64;
+   |         ^^^^^^^^^^ help: try: `100_f64`
+
+error: casting integer literal to `f64` is unnecessary
+  --> $DIR/unnecessary_cast.rs:55:9
+   |
+LL |         100_i32 as f64;
+   |         ^^^^^^^^^^^^^^ help: try: `100_f64`
+
+error: casting integer literal to `f32` is unnecessary
+  --> $DIR/unnecessary_cast.rs:56:17
+   |
+LL |         let _ = -100 as f32;
+   |                 ^^^^^^^^^^^ help: try: `-100_f32`
+
+error: casting integer literal to `f64` is unnecessary
+  --> $DIR/unnecessary_cast.rs:57:17
+   |
+LL |         let _ = -100 as f64;
+   |                 ^^^^^^^^^^^ help: try: `-100_f64`
+
+error: casting integer literal to `f64` is unnecessary
+  --> $DIR/unnecessary_cast.rs:58:17
+   |
+LL |         let _ = -100_i32 as f64;
+   |                 ^^^^^^^^^^^^^^^ help: try: `-100_f64`
+
+error: casting float literal to `f32` is unnecessary
+  --> $DIR/unnecessary_cast.rs:59:9
+   |
+LL |         100. as f32;
+   |         ^^^^^^^^^^^ help: try: `100_f32`
+
+error: casting float literal to `f64` is unnecessary
+  --> $DIR/unnecessary_cast.rs:60:9
+   |
+LL |         100. as f64;
+   |         ^^^^^^^^^^^ help: try: `100_f64`
+
+error: casting integer literal to `u32` is unnecessary
+  --> $DIR/unnecessary_cast.rs:72:9
+   |
+LL |         1 as u32;
+   |         ^^^^^^^^ help: try: `1_u32`
+
+error: casting integer literal to `i32` is unnecessary
+  --> $DIR/unnecessary_cast.rs:73:9
+   |
+LL |         0x10 as i32;
+   |         ^^^^^^^^^^^ help: try: `0x10_i32`
+
+error: casting integer literal to `usize` is unnecessary
+  --> $DIR/unnecessary_cast.rs:74:9
+   |
+LL |         0b10 as usize;
+   |         ^^^^^^^^^^^^^ help: try: `0b10_usize`
+
+error: casting integer literal to `u16` is unnecessary
+  --> $DIR/unnecessary_cast.rs:75:9
+   |
+LL |         0o73 as u16;
+   |         ^^^^^^^^^^^ help: try: `0o73_u16`
+
+error: casting integer literal to `u32` is unnecessary
+  --> $DIR/unnecessary_cast.rs:76:9
+   |
+LL |         1_000_000_000 as u32;
+   |         ^^^^^^^^^^^^^^^^^^^^ help: try: `1_000_000_000_u32`
+
+error: casting float literal to `f64` is unnecessary
+  --> $DIR/unnecessary_cast.rs:78:9
+   |
+LL |         1.0 as f64;
+   |         ^^^^^^^^^^ help: try: `1.0_f64`
+
+error: casting float literal to `f32` is unnecessary
+  --> $DIR/unnecessary_cast.rs:79:9
+   |
+LL |         0.5 as f32;
+   |         ^^^^^^^^^^ help: try: `0.5_f32`
+
+error: casting integer literal to `i32` is unnecessary
+  --> $DIR/unnecessary_cast.rs:83:17
+   |
+LL |         let _ = -1 as i32;
+   |                 ^^^^^^^^^ help: try: `-1_i32`
+
+error: casting float literal to `f32` is unnecessary
+  --> $DIR/unnecessary_cast.rs:84:17
+   |
+LL |         let _ = -1.0 as f32;
+   |                 ^^^^^^^^^^^ help: try: `-1.0_f32`
+
+error: aborting due to 25 previous errors
 
diff --git a/src/tools/clippy/tests/ui/unnecessary_cast_fixable.fixed b/src/tools/clippy/tests/ui/unnecessary_cast_fixable.fixed
deleted file mode 100644
index 36800c5340d..00000000000
--- a/src/tools/clippy/tests/ui/unnecessary_cast_fixable.fixed
+++ /dev/null
@@ -1,50 +0,0 @@
-// run-rustfix
-
-#![warn(clippy::unnecessary_cast)]
-#![allow(
-    clippy::no_effect,
-    clippy::unnecessary_operation,
-    clippy::nonstandard_macro_braces,
-    clippy::borrow_as_ptr
-)]
-
-fn main() {
-    // casting integer literal to float is unnecessary
-    100_f32;
-    100_f64;
-    100_f64;
-    let _ = -100_f32;
-    let _ = -100_f64;
-    let _ = -100_f64;
-    100_f32;
-    100_f64;
-    // Should not trigger
-    #[rustfmt::skip]
-    let v = vec!(1);
-    &v as &[i32];
-    0x10 as f32;
-    0o10 as f32;
-    0b10 as f32;
-    0x11 as f64;
-    0o11 as f64;
-    0b11 as f64;
-
-    1_u32;
-    0x10_i32;
-    0b10_usize;
-    0o73_u16;
-    1_000_000_000_u32;
-
-    1.0_f64;
-    0.5_f32;
-
-    1.0 as u16;
-
-    let _ = -1_i32;
-    let _ = -1.0_f32;
-
-    let _ = 1 as I32Alias;
-    let _ = &1 as &I32Alias;
-}
-
-type I32Alias = i32;
diff --git a/src/tools/clippy/tests/ui/unnecessary_cast_fixable.rs b/src/tools/clippy/tests/ui/unnecessary_cast_fixable.rs
deleted file mode 100644
index d4b6bb952ab..00000000000
--- a/src/tools/clippy/tests/ui/unnecessary_cast_fixable.rs
+++ /dev/null
@@ -1,50 +0,0 @@
-// run-rustfix
-
-#![warn(clippy::unnecessary_cast)]
-#![allow(
-    clippy::no_effect,
-    clippy::unnecessary_operation,
-    clippy::nonstandard_macro_braces,
-    clippy::borrow_as_ptr
-)]
-
-fn main() {
-    // casting integer literal to float is unnecessary
-    100 as f32;
-    100 as f64;
-    100_i32 as f64;
-    let _ = -100 as f32;
-    let _ = -100 as f64;
-    let _ = -100_i32 as f64;
-    100. as f32;
-    100. as f64;
-    // Should not trigger
-    #[rustfmt::skip]
-    let v = vec!(1);
-    &v as &[i32];
-    0x10 as f32;
-    0o10 as f32;
-    0b10 as f32;
-    0x11 as f64;
-    0o11 as f64;
-    0b11 as f64;
-
-    1 as u32;
-    0x10 as i32;
-    0b10 as usize;
-    0o73 as u16;
-    1_000_000_000 as u32;
-
-    1.0 as f64;
-    0.5 as f32;
-
-    1.0 as u16;
-
-    let _ = -1 as i32;
-    let _ = -1.0 as f32;
-
-    let _ = 1 as I32Alias;
-    let _ = &1 as &I32Alias;
-}
-
-type I32Alias = i32;
diff --git a/src/tools/clippy/tests/ui/unnecessary_cast_fixable.stderr b/src/tools/clippy/tests/ui/unnecessary_cast_fixable.stderr
deleted file mode 100644
index a281143281b..00000000000
--- a/src/tools/clippy/tests/ui/unnecessary_cast_fixable.stderr
+++ /dev/null
@@ -1,106 +0,0 @@
-error: casting integer literal to `f32` is unnecessary
-  --> $DIR/unnecessary_cast_fixable.rs:13:5
-   |
-LL |     100 as f32;
-   |     ^^^^^^^^^^ help: try: `100_f32`
-   |
-   = note: `-D clippy::unnecessary-cast` implied by `-D warnings`
-
-error: casting integer literal to `f64` is unnecessary
-  --> $DIR/unnecessary_cast_fixable.rs:14:5
-   |
-LL |     100 as f64;
-   |     ^^^^^^^^^^ help: try: `100_f64`
-
-error: casting integer literal to `f64` is unnecessary
-  --> $DIR/unnecessary_cast_fixable.rs:15:5
-   |
-LL |     100_i32 as f64;
-   |     ^^^^^^^^^^^^^^ help: try: `100_f64`
-
-error: casting integer literal to `f32` is unnecessary
-  --> $DIR/unnecessary_cast_fixable.rs:16:13
-   |
-LL |     let _ = -100 as f32;
-   |             ^^^^^^^^^^^ help: try: `-100_f32`
-
-error: casting integer literal to `f64` is unnecessary
-  --> $DIR/unnecessary_cast_fixable.rs:17:13
-   |
-LL |     let _ = -100 as f64;
-   |             ^^^^^^^^^^^ help: try: `-100_f64`
-
-error: casting integer literal to `f64` is unnecessary
-  --> $DIR/unnecessary_cast_fixable.rs:18:13
-   |
-LL |     let _ = -100_i32 as f64;
-   |             ^^^^^^^^^^^^^^^ help: try: `-100_f64`
-
-error: casting float literal to `f32` is unnecessary
-  --> $DIR/unnecessary_cast_fixable.rs:19:5
-   |
-LL |     100. as f32;
-   |     ^^^^^^^^^^^ help: try: `100_f32`
-
-error: casting float literal to `f64` is unnecessary
-  --> $DIR/unnecessary_cast_fixable.rs:20:5
-   |
-LL |     100. as f64;
-   |     ^^^^^^^^^^^ help: try: `100_f64`
-
-error: casting integer literal to `u32` is unnecessary
-  --> $DIR/unnecessary_cast_fixable.rs:32:5
-   |
-LL |     1 as u32;
-   |     ^^^^^^^^ help: try: `1_u32`
-
-error: casting integer literal to `i32` is unnecessary
-  --> $DIR/unnecessary_cast_fixable.rs:33:5
-   |
-LL |     0x10 as i32;
-   |     ^^^^^^^^^^^ help: try: `0x10_i32`
-
-error: casting integer literal to `usize` is unnecessary
-  --> $DIR/unnecessary_cast_fixable.rs:34:5
-   |
-LL |     0b10 as usize;
-   |     ^^^^^^^^^^^^^ help: try: `0b10_usize`
-
-error: casting integer literal to `u16` is unnecessary
-  --> $DIR/unnecessary_cast_fixable.rs:35:5
-   |
-LL |     0o73 as u16;
-   |     ^^^^^^^^^^^ help: try: `0o73_u16`
-
-error: casting integer literal to `u32` is unnecessary
-  --> $DIR/unnecessary_cast_fixable.rs:36:5
-   |
-LL |     1_000_000_000 as u32;
-   |     ^^^^^^^^^^^^^^^^^^^^ help: try: `1_000_000_000_u32`
-
-error: casting float literal to `f64` is unnecessary
-  --> $DIR/unnecessary_cast_fixable.rs:38:5
-   |
-LL |     1.0 as f64;
-   |     ^^^^^^^^^^ help: try: `1.0_f64`
-
-error: casting float literal to `f32` is unnecessary
-  --> $DIR/unnecessary_cast_fixable.rs:39:5
-   |
-LL |     0.5 as f32;
-   |     ^^^^^^^^^^ help: try: `0.5_f32`
-
-error: casting integer literal to `i32` is unnecessary
-  --> $DIR/unnecessary_cast_fixable.rs:43:13
-   |
-LL |     let _ = -1 as i32;
-   |             ^^^^^^^^^ help: try: `-1_i32`
-
-error: casting float literal to `f32` is unnecessary
-  --> $DIR/unnecessary_cast_fixable.rs:44:13
-   |
-LL |     let _ = -1.0 as f32;
-   |             ^^^^^^^^^^^ help: try: `-1.0_f32`
-
-error: aborting due to 17 previous errors
-
diff --git a/src/tools/clippy/tests/ui/unused_rounding.fixed b/src/tools/clippy/tests/ui/unused_rounding.fixed
new file mode 100644
index 00000000000..54f85806ac3
--- /dev/null
+++ b/src/tools/clippy/tests/ui/unused_rounding.fixed
@@ -0,0 +1,9 @@
+// run-rustfix
+#![warn(clippy::unused_rounding)]
+
+fn main() {
+    let _ = 1f32;
+    let _ = 1.0f64;
+    let _ = 1.00f32;
+    let _ = 2e-54f64.floor();
+}
diff --git a/src/tools/clippy/tests/ui/unused_rounding.rs b/src/tools/clippy/tests/ui/unused_rounding.rs
new file mode 100644
index 00000000000..8d007bc4a1d
--- /dev/null
+++ b/src/tools/clippy/tests/ui/unused_rounding.rs
@@ -0,0 +1,9 @@
+// run-rustfix
+#![warn(clippy::unused_rounding)]
+
+fn main() {
+    let _ = 1f32.ceil();
+    let _ = 1.0f64.floor();
+    let _ = 1.00f32.round();
+    let _ = 2e-54f64.floor();
+}
diff --git a/src/tools/clippy/tests/ui/unused_rounding.stderr b/src/tools/clippy/tests/ui/unused_rounding.stderr
new file mode 100644
index 00000000000..6cfb02e0402
--- /dev/null
+++ b/src/tools/clippy/tests/ui/unused_rounding.stderr
@@ -0,0 +1,22 @@
+error: used the `ceil` method with a whole number float
+  --> $DIR/unused_rounding.rs:5:13
+   |
+LL |     let _ = 1f32.ceil();
+   |             ^^^^^^^^^^^ help: remove the `ceil` method call: `1f32`
+   |
+   = note: `-D clippy::unused-rounding` implied by `-D warnings`
+
+error: used the `floor` method with a whole number float
+  --> $DIR/unused_rounding.rs:6:13
+   |
+LL |     let _ = 1.0f64.floor();
+   |             ^^^^^^^^^^^^^^ help: remove the `floor` method call: `1.0f64`
+
+error: used the `round` method with a whole number float
+  --> $DIR/unused_rounding.rs:7:13
+   |
+LL |     let _ = 1.00f32.round();
+   |             ^^^^^^^^^^^^^^^ help: remove the `round` method call: `1.00f32`
+
+error: aborting due to 3 previous errors
+
diff --git a/src/tools/clippy/tests/ui/use_self.fixed b/src/tools/clippy/tests/ui/use_self.fixed
index 3e62ffe74fe..4f80aaecc90 100644
--- a/src/tools/clippy/tests/ui/use_self.fixed
+++ b/src/tools/clippy/tests/ui/use_self.fixed
@@ -542,3 +542,69 @@ mod use_self_in_pat {
         }
     }
 }
+
+mod issue8845 {
+    pub enum Something {
+        Num(u8),
+        TupleNums(u8, u8),
+        StructNums { one: u8, two: u8 },
+    }
+
+    struct Foo(u8);
+
+    struct Bar {
+        x: u8,
+        y: usize,
+    }
+
+    impl Something {
+        fn get_value(&self) -> u8 {
+            match self {
+                Self::Num(n) => *n,
+                Self::TupleNums(n, _m) => *n,
+                Self::StructNums { one, two: _ } => *one,
+            }
+        }
+
+        fn use_crate(&self) -> u8 {
+            match self {
+                Self::Num(n) => *n,
+                Self::TupleNums(n, _m) => *n,
+                Self::StructNums { one, two: _ } => *one,
+            }
+        }
+
+        fn imported_values(&self) -> u8 {
+            use Something::*;
+            match self {
+                Num(n) => *n,
+                TupleNums(n, _m) => *n,
+                StructNums { one, two: _ } => *one,
+            }
+        }
+    }
+
+    impl Foo {
+        fn get_value(&self) -> u8 {
+            let Self(x) = self;
+            *x
+        }
+
+        fn use_crate(&self) -> u8 {
+            let Self(x) = self;
+            *x
+        }
+    }
+
+    impl Bar {
+        fn get_value(&self) -> u8 {
+            let Self { x, .. } = self;
+            *x
+        }
+
+        fn use_crate(&self) -> u8 {
+            let Self { x, .. } = self;
+            *x
+        }
+    }
+}
diff --git a/src/tools/clippy/tests/ui/use_self.rs b/src/tools/clippy/tests/ui/use_self.rs
index da2faddee12..52da72db53c 100644
--- a/src/tools/clippy/tests/ui/use_self.rs
+++ b/src/tools/clippy/tests/ui/use_self.rs
@@ -542,3 +542,69 @@ mod use_self_in_pat {
         }
     }
 }
+
+mod issue8845 {
+    pub enum Something {
+        Num(u8),
+        TupleNums(u8, u8),
+        StructNums { one: u8, two: u8 },
+    }
+
+    struct Foo(u8);
+
+    struct Bar {
+        x: u8,
+        y: usize,
+    }
+
+    impl Something {
+        fn get_value(&self) -> u8 {
+            match self {
+                Something::Num(n) => *n,
+                Something::TupleNums(n, _m) => *n,
+                Something::StructNums { one, two: _ } => *one,
+            }
+        }
+
+        fn use_crate(&self) -> u8 {
+            match self {
+                crate::issue8845::Something::Num(n) => *n,
+                crate::issue8845::Something::TupleNums(n, _m) => *n,
+                crate::issue8845::Something::StructNums { one, two: _ } => *one,
+            }
+        }
+
+        fn imported_values(&self) -> u8 {
+            use Something::*;
+            match self {
+                Num(n) => *n,
+                TupleNums(n, _m) => *n,
+                StructNums { one, two: _ } => *one,
+            }
+        }
+    }
+
+    impl Foo {
+        fn get_value(&self) -> u8 {
+            let Foo(x) = self;
+            *x
+        }
+
+        fn use_crate(&self) -> u8 {
+            let crate::issue8845::Foo(x) = self;
+            *x
+        }
+    }
+
+    impl Bar {
+        fn get_value(&self) -> u8 {
+            let Bar { x, .. } = self;
+            *x
+        }
+
+        fn use_crate(&self) -> u8 {
+            let crate::issue8845::Bar { x, .. } = self;
+            *x
+        }
+    }
+}
diff --git a/src/tools/clippy/tests/ui/use_self.stderr b/src/tools/clippy/tests/ui/use_self.stderr
index 34d98618253..f06bb959b3b 100644
--- a/src/tools/clippy/tests/ui/use_self.stderr
+++ b/src/tools/clippy/tests/ui/use_self.stderr
@@ -186,5 +186,65 @@ error: unnecessary structure name repetition
 LL |             if let Foo::Bar = self {
    |                    ^^^ help: use the applicable keyword: `Self`
 
-error: aborting due to 31 previous errors
+error: unnecessary structure name repetition
+  --> $DIR/use_self.rs:563:17
+   |
+LL |                 Something::Num(n) => *n,
+   |                 ^^^^^^^^^ help: use the applicable keyword: `Self`
+
+error: unnecessary structure name repetition
+  --> $DIR/use_self.rs:564:17
+   |
+LL |                 Something::TupleNums(n, _m) => *n,
+   |                 ^^^^^^^^^ help: use the applicable keyword: `Self`
+
+error: unnecessary structure name repetition
+  --> $DIR/use_self.rs:565:17
+   |
+LL |                 Something::StructNums { one, two: _ } => *one,
+   |                 ^^^^^^^^^ help: use the applicable keyword: `Self`
+
+error: unnecessary structure name repetition
+  --> $DIR/use_self.rs:571:17
+   |
+LL |                 crate::issue8845::Something::Num(n) => *n,
+   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
+
+error: unnecessary structure name repetition
+  --> $DIR/use_self.rs:572:17
+   |
+LL |                 crate::issue8845::Something::TupleNums(n, _m) => *n,
+   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
+
+error: unnecessary structure name repetition
+  --> $DIR/use_self.rs:573:17
+   |
+LL |                 crate::issue8845::Something::StructNums { one, two: _ } => *one,
+   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
+
+error: unnecessary structure name repetition
+  --> $DIR/use_self.rs:589:17
+   |
+LL |             let Foo(x) = self;
+   |                 ^^^ help: use the applicable keyword: `Self`
+
+error: unnecessary structure name repetition
+  --> $DIR/use_self.rs:594:17
+   |
+LL |             let crate::issue8845::Foo(x) = self;
+   |                 ^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
+
+error: unnecessary structure name repetition
+  --> $DIR/use_self.rs:601:17
+   |
+LL |             let Bar { x, .. } = self;
+   |                 ^^^ help: use the applicable keyword: `Self`
+
+error: unnecessary structure name repetition
+  --> $DIR/use_self.rs:606:17
+   |
+LL |             let crate::issue8845::Bar { x, .. } = self;
+   |                 ^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
+
+error: aborting due to 41 previous errors
 
diff --git a/src/tools/clippy/util/gh-pages/script.js b/src/tools/clippy/util/gh-pages/script.js
index bf4ce79b2cb..6909fbcae09 100644
--- a/src/tools/clippy/util/gh-pages/script.js
+++ b/src/tools/clippy/util/gh-pages/script.js
@@ -232,6 +232,9 @@
                     return true;
                 }
                 searchStr = searchStr.toLowerCase();
+                if (searchStr.startsWith("clippy::")) {
+                    searchStr = searchStr.slice(8);
+                }
 
                 // Search by id
                 if (lint.id.indexOf(searchStr.replace("-", "_")) !== -1) {
@@ -343,17 +346,23 @@ function setTheme(theme, store) {
     let enableNight = false;
     let enableAyu = false;
 
-    if (theme == "ayu") {
-        enableAyu = true;
-    } else if (theme == "coal" || theme == "navy") {
-        enableNight = true;
-    } else if (theme == "rust") {
-        enableHighlight = true;
-    } else {
-        enableHighlight = true;
-        // this makes sure that an unknown theme request gets set to a known one
-        theme = "light";
+    switch(theme) {
+        case "ayu":
+            enableAyu = true;
+            break;
+        case "coal":
+        case "navy":
+            enableNight = true;
+            break;
+        case "rust":
+            enableHighlight = true;
+            break;
+        default:
+            enableHighlight = true;
+            theme = "light";
+            break;
     }
+
     document.getElementsByTagName("body")[0].className = theme;
 
     document.getElementById("styleHighlight").disabled = !enableHighlight;
@@ -368,4 +377,10 @@ function setTheme(theme, store) {
 }
 
 // loading the theme after the initial load
-setTheme(localStorage.getItem('clippy-lint-list-theme'), false);
+const prefersDark = window.matchMedia("(prefers-color-scheme: dark)");
+const theme = localStorage.getItem('clippy-lint-list-theme');
+if (prefersDark.matches && !theme) {
+    setTheme("coal", false);
+} else {
+    setTheme(theme, false);
+}
diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs
index ea13ae13208..bdf26d040ad 100644
--- a/src/tools/compiletest/src/common.rs
+++ b/src/tools/compiletest/src/common.rs
@@ -118,7 +118,6 @@ pub enum FailMode {
 
 #[derive(Clone, Debug, PartialEq)]
 pub enum CompareMode {
-    Nll,
     Polonius,
     Chalk,
     SplitDwarf,
@@ -128,7 +127,6 @@ pub enum CompareMode {
 impl CompareMode {
     pub(crate) fn to_str(&self) -> &'static str {
         match *self {
-            CompareMode::Nll => "nll",
             CompareMode::Polonius => "polonius",
             CompareMode::Chalk => "chalk",
             CompareMode::SplitDwarf => "split-dwarf",
@@ -138,7 +136,6 @@ impl CompareMode {
 
     pub fn parse(s: String) -> CompareMode {
         match s.as_str() {
-            "nll" => CompareMode::Nll,
             "polonius" => CompareMode::Polonius,
             "chalk" => CompareMode::Chalk,
             "split-dwarf" => CompareMode::SplitDwarf,
diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs
index e6f058569db..5352f7c6fe0 100644
--- a/src/tools/compiletest/src/header.rs
+++ b/src/tools/compiletest/src/header.rs
@@ -627,7 +627,6 @@ impl Config {
             (name == "endian-big" && util::is_big_endian(&self.target)) ||
             (self.remote_test_client.is_some() && name == "remote") ||
             match self.compare_mode {
-                Some(CompareMode::Nll) => name == "compare-mode-nll",
                 Some(CompareMode::Polonius) => name == "compare-mode-polonius",
                 Some(CompareMode::Chalk) => name == "compare-mode-chalk",
                 Some(CompareMode::SplitDwarf) => name == "compare-mode-split-dwarf",
diff --git a/src/tools/compiletest/src/read2.rs b/src/tools/compiletest/src/read2.rs
index 897b9dd4007..7640e651744 100644
--- a/src/tools/compiletest/src/read2.rs
+++ b/src/tools/compiletest/src/read2.rs
@@ -1,71 +1,24 @@
 // FIXME: This is a complete copy of `cargo/src/cargo/util/read2.rs`
 // Consider unify the read2() in libstd, cargo and this to prevent further code duplication.
 
+#[cfg(test)]
+mod tests;
+
 pub use self::imp::read2;
-use std::io;
+use std::io::{self, Write};
+use std::mem::replace;
 use std::process::{Child, Output};
 
-pub fn read2_abbreviated(mut child: Child) -> io::Result<Output> {
-    use io::Write;
-    use std::mem::replace;
-
-    const HEAD_LEN: usize = 160 * 1024;
-    const TAIL_LEN: usize = 256 * 1024;
-
-    enum ProcOutput {
-        Full(Vec<u8>),
-        Abbreviated { head: Vec<u8>, skipped: usize, tail: Box<[u8]> },
-    }
-
-    impl ProcOutput {
-        fn extend(&mut self, data: &[u8]) {
-            let new_self = match *self {
-                ProcOutput::Full(ref mut bytes) => {
-                    bytes.extend_from_slice(data);
-                    let new_len = bytes.len();
-                    if new_len <= HEAD_LEN + TAIL_LEN {
-                        return;
-                    }
-                    let tail = bytes.split_off(new_len - TAIL_LEN).into_boxed_slice();
-                    let head = replace(bytes, Vec::new());
-                    let skipped = new_len - HEAD_LEN - TAIL_LEN;
-                    ProcOutput::Abbreviated { head, skipped, tail }
-                }
-                ProcOutput::Abbreviated { ref mut skipped, ref mut tail, .. } => {
-                    *skipped += data.len();
-                    if data.len() <= TAIL_LEN {
-                        tail[..data.len()].copy_from_slice(data);
-                        tail.rotate_left(data.len());
-                    } else {
-                        tail.copy_from_slice(&data[(data.len() - TAIL_LEN)..]);
-                    }
-                    return;
-                }
-            };
-            *self = new_self;
-        }
-
-        fn into_bytes(self) -> Vec<u8> {
-            match self {
-                ProcOutput::Full(bytes) => bytes,
-                ProcOutput::Abbreviated { mut head, skipped, tail } => {
-                    write!(&mut head, "\n\n<<<<<< SKIPPED {} BYTES >>>>>>\n\n", skipped).unwrap();
-                    head.extend_from_slice(&tail);
-                    head
-                }
-            }
-        }
-    }
-
-    let mut stdout = ProcOutput::Full(Vec::new());
-    let mut stderr = ProcOutput::Full(Vec::new());
+pub fn read2_abbreviated(mut child: Child, filter_paths_from_len: &[String]) -> io::Result<Output> {
+    let mut stdout = ProcOutput::new();
+    let mut stderr = ProcOutput::new();
 
     drop(child.stdin.take());
     read2(
         child.stdout.take().unwrap(),
         child.stderr.take().unwrap(),
         &mut |is_stdout, data, _| {
-            if is_stdout { &mut stdout } else { &mut stderr }.extend(data);
+            if is_stdout { &mut stdout } else { &mut stderr }.extend(data, filter_paths_from_len);
             data.clear();
         },
     )?;
@@ -74,6 +27,98 @@ pub fn read2_abbreviated(mut child: Child) -> io::Result<Output> {
     Ok(Output { status, stdout: stdout.into_bytes(), stderr: stderr.into_bytes() })
 }
 
+const HEAD_LEN: usize = 160 * 1024;
+const TAIL_LEN: usize = 256 * 1024;
+
+// Whenever a path is filtered when counting the length of the output, we need to add some
+// placeholder length to ensure a compiler emitting only filtered paths doesn't cause a OOM.
+//
+// 32 was chosen semi-arbitrarily: it was the highest power of two that still allowed the test
+// suite to pass at the moment of implementing path filtering.
+const FILTERED_PATHS_PLACEHOLDER_LEN: usize = 32;
+
+enum ProcOutput {
+    Full { bytes: Vec<u8>, filtered_len: usize },
+    Abbreviated { head: Vec<u8>, skipped: usize, tail: Box<[u8]> },
+}
+
+impl ProcOutput {
+    fn new() -> Self {
+        ProcOutput::Full { bytes: Vec::new(), filtered_len: 0 }
+    }
+
+    fn extend(&mut self, data: &[u8], filter_paths_from_len: &[String]) {
+        let new_self = match *self {
+            ProcOutput::Full { ref mut bytes, ref mut filtered_len } => {
+                let old_len = bytes.len();
+                bytes.extend_from_slice(data);
+                *filtered_len += data.len();
+
+                // We had problems in the past with tests failing only in some environments,
+                // due to the length of the base path pushing the output size over the limit.
+                //
+                // To make those failures deterministic across all environments we ignore known
+                // paths when calculating the string length, while still including the full
+                // path in the output. This could result in some output being larger than the
+                // threshold, but it's better than having nondeterministic failures.
+                //
+                // The compiler emitting only excluded strings is addressed by adding a
+                // placeholder size for each excluded segment, which will eventually reach
+                // the configured threshold.
+                for path in filter_paths_from_len {
+                    let path_bytes = path.as_bytes();
+                    // We start matching `path_bytes - 1` into the previously loaded data,
+                    // to account for the fact a path_bytes might be included across multiple
+                    // `extend` calls. Starting from `- 1` avoids double-counting paths.
+                    let matches = (&bytes[(old_len.saturating_sub(path_bytes.len() - 1))..])
+                        .windows(path_bytes.len())
+                        .filter(|window| window == &path_bytes)
+                        .count();
+                    *filtered_len -= matches * path_bytes.len();
+
+                    // We can't just remove the length of the filtered path from the output lenght,
+                    // otherwise a compiler emitting only filtered paths would OOM compiletest. Add
+                    // a fixed placeholder length for each path to prevent that.
+                    *filtered_len += matches * FILTERED_PATHS_PLACEHOLDER_LEN;
+                }
+
+                let new_len = bytes.len();
+                if *filtered_len <= HEAD_LEN + TAIL_LEN {
+                    return;
+                }
+
+                let mut head = replace(bytes, Vec::new());
+                let mut middle = head.split_off(HEAD_LEN);
+                let tail = middle.split_off(middle.len() - TAIL_LEN).into_boxed_slice();
+                let skipped = new_len - HEAD_LEN - TAIL_LEN;
+                ProcOutput::Abbreviated { head, skipped, tail }
+            }
+            ProcOutput::Abbreviated { ref mut skipped, ref mut tail, .. } => {
+                *skipped += data.len();
+                if data.len() <= TAIL_LEN {
+                    tail[..data.len()].copy_from_slice(data);
+                    tail.rotate_left(data.len());
+                } else {
+                    tail.copy_from_slice(&data[(data.len() - TAIL_LEN)..]);
+                }
+                return;
+            }
+        };
+        *self = new_self;
+    }
+
+    fn into_bytes(self) -> Vec<u8> {
+        match self {
+            ProcOutput::Full { bytes, .. } => bytes,
+            ProcOutput::Abbreviated { mut head, skipped, tail } => {
+                write!(&mut head, "\n\n<<<<<< SKIPPED {} BYTES >>>>>>\n\n", skipped).unwrap();
+                head.extend_from_slice(&tail);
+                head
+            }
+        }
+    }
+}
+
 #[cfg(not(any(unix, windows)))]
 mod imp {
     use std::io::{self, Read};
diff --git a/src/tools/compiletest/src/read2/tests.rs b/src/tools/compiletest/src/read2/tests.rs
new file mode 100644
index 00000000000..1ca682a46aa
--- /dev/null
+++ b/src/tools/compiletest/src/read2/tests.rs
@@ -0,0 +1,123 @@
+use crate::read2::{ProcOutput, FILTERED_PATHS_PLACEHOLDER_LEN, HEAD_LEN, TAIL_LEN};
+
+#[test]
+fn test_abbreviate_short_string() {
+    let mut out = ProcOutput::new();
+    out.extend(b"Hello world!", &[]);
+    assert_eq!(b"Hello world!", &*out.into_bytes());
+}
+
+#[test]
+fn test_abbreviate_short_string_multiple_steps() {
+    let mut out = ProcOutput::new();
+
+    out.extend(b"Hello ", &[]);
+    out.extend(b"world!", &[]);
+
+    assert_eq!(b"Hello world!", &*out.into_bytes());
+}
+
+#[test]
+fn test_abbreviate_long_string() {
+    let mut out = ProcOutput::new();
+
+    let data = vec![b'.'; HEAD_LEN + TAIL_LEN + 16];
+    out.extend(&data, &[]);
+
+    let mut expected = vec![b'.'; HEAD_LEN];
+    expected.extend_from_slice(b"\n\n<<<<<< SKIPPED 16 BYTES >>>>>>\n\n");
+    expected.extend_from_slice(&vec![b'.'; TAIL_LEN]);
+
+    // We first check the length to avoid endless terminal output if the length differs, since
+    // `out` is hundreds of KBs in size.
+    let out = out.into_bytes();
+    assert_eq!(expected.len(), out.len());
+    assert_eq!(expected, out);
+}
+
+#[test]
+fn test_abbreviate_long_string_multiple_steps() {
+    let mut out = ProcOutput::new();
+
+    out.extend(&vec![b'.'; HEAD_LEN], &[]);
+    out.extend(&vec![b'.'; TAIL_LEN], &[]);
+    // Also test whether the rotation works
+    out.extend(&vec![b'!'; 16], &[]);
+    out.extend(&vec![b'?'; 16], &[]);
+
+    let mut expected = vec![b'.'; HEAD_LEN];
+    expected.extend_from_slice(b"\n\n<<<<<< SKIPPED 32 BYTES >>>>>>\n\n");
+    expected.extend_from_slice(&vec![b'.'; TAIL_LEN - 32]);
+    expected.extend_from_slice(&vec![b'!'; 16]);
+    expected.extend_from_slice(&vec![b'?'; 16]);
+
+    // We first check the length to avoid endless terminal output if the length differs, since
+    // `out` is hundreds of KBs in size.
+    let out = out.into_bytes();
+    assert_eq!(expected.len(), out.len());
+    assert_eq!(expected, out);
+}
+
+#[test]
+fn test_abbreviate_filterss_are_detected() {
+    let mut out = ProcOutput::new();
+    let filters = &["foo".to_string(), "quux".to_string()];
+
+    out.extend(b"Hello foo", filters);
+    // Check items from a previous extension are not double-counted.
+    out.extend(b"! This is a qu", filters);
+    // Check items are detected across extensions.
+    out.extend(b"ux.", filters);
+
+    match &out {
+        ProcOutput::Full { bytes, filtered_len } => assert_eq!(
+            *filtered_len,
+            bytes.len() + FILTERED_PATHS_PLACEHOLDER_LEN * filters.len()
+                - filters.iter().map(|i| i.len()).sum::<usize>()
+        ),
+        ProcOutput::Abbreviated { .. } => panic!("out should not be abbreviated"),
+    }
+
+    assert_eq!(b"Hello foo! This is a quux.", &*out.into_bytes());
+}
+
+#[test]
+fn test_abbreviate_filters_avoid_abbreviations() {
+    let mut out = ProcOutput::new();
+    let filters = &[std::iter::repeat('a').take(64).collect::<String>()];
+
+    let mut expected = vec![b'.'; HEAD_LEN - FILTERED_PATHS_PLACEHOLDER_LEN as usize];
+    expected.extend_from_slice(filters[0].as_bytes());
+    expected.extend_from_slice(&vec![b'.'; TAIL_LEN]);
+
+    out.extend(&expected, filters);
+
+    // We first check the length to avoid endless terminal output if the length differs, since
+    // `out` is hundreds of KBs in size.
+    let out = out.into_bytes();
+    assert_eq!(expected.len(), out.len());
+    assert_eq!(expected, out);
+}
+
+#[test]
+fn test_abbreviate_filters_can_still_cause_abbreviations() {
+    let mut out = ProcOutput::new();
+    let filters = &[std::iter::repeat('a').take(64).collect::<String>()];
+
+    let mut input = vec![b'.'; HEAD_LEN];
+    input.extend_from_slice(&vec![b'.'; TAIL_LEN]);
+    input.extend_from_slice(filters[0].as_bytes());
+
+    let mut expected = vec![b'.'; HEAD_LEN];
+    expected.extend_from_slice(b"\n\n<<<<<< SKIPPED 64 BYTES >>>>>>\n\n");
+    expected.extend_from_slice(&vec![b'.'; TAIL_LEN - 64]);
+    expected.extend_from_slice(&vec![b'a'; 64]);
+
+    out.extend(&input, filters);
+
+    // We first check the length to avoid endless terminal output if the length differs, since
+    // `out` is hundreds of KBs in size.
+    let out = out.into_bytes();
+    assert_eq!(expected.len(), out.len());
+    assert_eq!(expected, out);
+}
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 494c8d771b0..49c8248b80d 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -28,7 +28,7 @@ use std::hash::{Hash, Hasher};
 use std::io::prelude::*;
 use std::io::{self, BufReader};
 use std::path::{Path, PathBuf};
-use std::process::{Command, ExitStatus, Output, Stdio};
+use std::process::{Child, Command, ExitStatus, Output, Stdio};
 use std::str;
 
 use glob::glob;
@@ -1745,6 +1745,28 @@ impl<'test> TestCx<'test> {
         dylib
     }
 
+    fn read2_abbreviated(&self, child: Child) -> Output {
+        let mut filter_paths_from_len = Vec::new();
+        let mut add_path = |path: &Path| {
+            let path = path.display().to_string();
+            let windows = path.replace("\\", "\\\\");
+            if windows != path {
+                filter_paths_from_len.push(windows);
+            }
+            filter_paths_from_len.push(path);
+        };
+
+        // List of paths that will not be measured when determining whether the output is larger
+        // than the output truncation threshold.
+        //
+        // Note: avoid adding a subdirectory of an already filtered directory here, otherwise the
+        // same slice of text will be double counted and the truncation might not happen.
+        add_path(&self.config.src_base);
+        add_path(&self.config.build_base);
+
+        read2_abbreviated(child, &filter_paths_from_len).expect("failed to read output")
+    }
+
     fn compose_and_run(
         &self,
         mut command: Command,
@@ -1779,8 +1801,7 @@ impl<'test> TestCx<'test> {
             child.stdin.as_mut().unwrap().write_all(input.as_bytes()).unwrap();
         }
 
-        let Output { status, stdout, stderr } =
-            read2_abbreviated(child).expect("failed to read output");
+        let Output { status, stdout, stderr } = self.read2_abbreviated(child);
 
         let result = ProcRes {
             status,
@@ -1917,9 +1938,6 @@ impl<'test> TestCx<'test> {
         }
 
         match self.config.compare_mode {
-            Some(CompareMode::Nll) => {
-                rustc.args(&["-Zborrowck=mir"]);
-            }
             Some(CompareMode::Polonius) => {
                 rustc.args(&["-Zpolonius", "-Zborrowck=mir"]);
             }
@@ -2969,7 +2987,7 @@ impl<'test> TestCx<'test> {
             }
         }
 
-        let output = cmd.spawn().and_then(read2_abbreviated).expect("failed to spawn `make`");
+        let output = self.read2_abbreviated(cmd.spawn().expect("failed to spawn `make`"));
         if !output.status.success() {
             let res = ProcRes {
                 status: output.status,
@@ -3121,8 +3139,7 @@ impl<'test> TestCx<'test> {
 
         let expected_fixed = self.load_expected_output(UI_FIXED);
 
-        let modes_to_prune = vec![CompareMode::Nll];
-        self.check_and_prune_duplicate_outputs(&proc_res, &[], &modes_to_prune);
+        self.check_and_prune_duplicate_outputs(&proc_res, &[], &[]);
 
         let mut errors = self.load_compare_outputs(&proc_res, TestOutput::Compile, explicit);
         let rustfix_input = json::rustfix_diagnostics_only(&proc_res.stderr);
@@ -3638,12 +3655,7 @@ impl<'test> TestCx<'test> {
 
         if !path.exists() {
             if let Some(CompareMode::Polonius) = self.config.compare_mode {
-                path = expected_output_path(
-                    &self.testpaths,
-                    self.revision,
-                    &Some(CompareMode::Nll),
-                    kind,
-                );
+                path = expected_output_path(&self.testpaths, self.revision, &None, kind);
             }
         }
 
diff --git a/src/tools/miri b/src/tools/miri
-Subproject 749efd29565a9b8f47afb441aaacfcc10bc145d
+Subproject 3361eabf3882578207a483f2cee631646e80eab
diff --git a/src/tools/rustc-workspace-hack/Cargo.toml b/src/tools/rustc-workspace-hack/Cargo.toml
index 4bda3fb22c2..a79290e7a6b 100644
--- a/src/tools/rustc-workspace-hack/Cargo.toml
+++ b/src/tools/rustc-workspace-hack/Cargo.toml
@@ -61,6 +61,7 @@ features = [
   "wincrypt",
   "windef",
   "winioctl",
+  "winnt",
   "winreg",
   "winsock2",
   "winuser",
diff --git a/src/tools/tidy/src/error_codes_check.rs b/src/tools/tidy/src/error_codes_check.rs
index 281773b0569..e56ce3329cc 100644
--- a/src/tools/tidy/src/error_codes_check.rs
+++ b/src/tools/tidy/src/error_codes_check.rs
@@ -10,8 +10,8 @@ use regex::Regex;
 
 // A few of those error codes can't be tested but all the others can and *should* be tested!
 const EXEMPTED_FROM_TEST: &[&str] = &[
-    "E0279", "E0313", "E0377", "E0461", "E0462", "E0465", "E0476", "E0514", "E0519", "E0523",
-    "E0554", "E0640", "E0717", "E0729",
+    "E0279", "E0313", "E0377", "E0461", "E0462", "E0465", "E0476", "E0490", "E0514", "E0519",
+    "E0523", "E0554", "E0640", "E0717", "E0729",
 ];
 
 // Some error codes don't have any tests apparently...
diff --git a/triagebot.toml b/triagebot.toml
index e161adcd6e0..25e2c384624 100644
--- a/triagebot.toml
+++ b/triagebot.toml
@@ -183,6 +183,16 @@ message_on_add = """\
 """
 message_on_remove = "Issue #{number}'s nomination request has been removed."
 
+[notify-zulip."I-types-nominated"]
+zulip_stream = 326866 # #T-types/nominated
+topic = "#{number}: {title}"
+message_on_add = """\
+@*T-types* issue #{number} "{title}" has been nominated for team discussion.
+"""
+message_on_remove = "Issue #{number}'s nomination has been removed. Thanks all for participating!"
+message_on_close = "Issue #{number} has been closed. Thanks for participating!"
+message_on_reopen = "Issue #{number} has been reopened. Pinging @*T-types*."
+
 [notify-zulip."A-edition-2021"]
 required_labels = ["C-bug"]
 zulip_stream = 268952 # #edition 2021