about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/Cargo.toml1
-rw-r--r--src/bootstrap/builder.rs28
-rw-r--r--src/bootstrap/builder/tests.rs5
-rw-r--r--src/bootstrap/test.rs26
-rw-r--r--src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile2
-rwxr-xr-xsrc/ci/init_repo.sh2
-rwxr-xr-xsrc/ci/run.sh6
-rw-r--r--src/ci/shared.sh8
-rw-r--r--src/doc/rust.css43
-rw-r--r--src/librustdoc/Cargo.toml1
-rw-r--r--src/librustdoc/externalfiles.rs4
-rw-r--r--src/librustdoc/html/format.rs26
-rw-r--r--src/librustdoc/html/layout.rs214
-rw-r--r--src/librustdoc/html/render/context.rs14
-rw-r--r--src/librustdoc/html/render/mod.rs62
-rw-r--r--src/librustdoc/html/render/print_item.rs54
-rw-r--r--src/librustdoc/html/render/write_shared.rs15
-rw-r--r--src/librustdoc/html/sources.rs1
-rw-r--r--src/librustdoc/html/static/COPYRIGHT.txt14
-rw-r--r--src/librustdoc/html/static/FiraSans-LICENSE.txt4
-rw-r--r--src/librustdoc/html/static/SourceCodePro-It.ttf.woff2bin0 -> 44896 bytes
-rw-r--r--src/librustdoc/html/static/SourceCodePro-Regular.ttf.woff2bin0 -> 52228 bytes
-rw-r--r--src/librustdoc/html/static/SourceCodePro-Semibold.ttf.woff2bin0 -> 52348 bytes
-rw-r--r--src/librustdoc/html/static/SourceSerif4-Bold.ttf.woff2bin0 -> 81320 bytes
-rw-r--r--src/librustdoc/html/static/SourceSerif4-It.ttf.woff2bin0 -> 59860 bytes
-rw-r--r--src/librustdoc/html/static/SourceSerif4-Regular.ttf.woff2bin0 -> 76180 bytes
-rw-r--r--src/librustdoc/html/static/rustdoc.css27
-rw-r--r--src/librustdoc/html/static_files.rs26
-rw-r--r--src/librustdoc/html/templates/STYLE.md37
-rw-r--r--src/librustdoc/html/templates/page.html119
-rw-r--r--src/librustdoc/passes/collect_intra_doc_links.rs51
-rw-r--r--src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff63
-rw-r--r--src/test/mir-opt/lower_slice_len.rs14
-rw-r--r--src/test/rustdoc-gui/README.md12
-rw-r--r--src/test/rustdoc-gui/basic-code.goml2
-rw-r--r--src/test/rustdoc-gui/check_info_sign_position.goml8
-rw-r--r--src/test/rustdoc-gui/code-sidebar-toggle.goml2
-rw-r--r--src/test/rustdoc-gui/escape-key.goml26
-rw-r--r--src/test/rustdoc-gui/font-weight.goml10
-rw-r--r--src/test/rustdoc-gui/hash-item-expansion.goml10
-rw-r--r--src/test/rustdoc-gui/impl-default-expansion.goml2
-rw-r--r--src/test/rustdoc-gui/search-result-colors.goml4
-rw-r--r--src/test/rustdoc-gui/search-result-description.goml2
-rw-r--r--src/test/rustdoc-gui/search-result-display.goml4
-rw-r--r--src/test/rustdoc-gui/search-result-keyword.goml4
-rw-r--r--src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml6
-rw-r--r--src/test/rustdoc-gui/shortcuts.goml14
-rw-r--r--src/test/rustdoc-gui/sidebar.goml54
-rw-r--r--src/test/rustdoc-gui/source-code-page.goml12
-rw-r--r--src/test/rustdoc-gui/theme-change.goml4
-rw-r--r--src/test/rustdoc-gui/toggle-docs-mobile.goml16
-rw-r--r--src/test/rustdoc-gui/toggle-docs.goml6
-rw-r--r--src/test/rustdoc-gui/toggled-open-implementations.goml2
-rw-r--r--src/test/rustdoc-gui/trait-sidebar-item-order.goml12
-rw-r--r--src/test/rustdoc/const-display.rs26
-rw-r--r--src/test/rustdoc/intra-doc/type-alias.rs19
-rw-r--r--src/test/ui/array-slice-vec/slice-panic-1.rs2
-rw-r--r--src/test/ui/array-slice-vec/slice-panic-2.rs2
-rw-r--r--src/test/ui/array-slice-vec/slice.rs16
-rw-r--r--src/test/ui/const-generics/issues/issue-61432.rs4
-rw-r--r--src/test/ui/consts/const-eval/dangling.rs3
-rw-r--r--src/test/ui/consts/const-eval/dangling.stderr17
-rw-r--r--src/test/ui/consts/const-eval/heap/alloc_intrinsic_errors.rs3
-rw-r--r--src/test/ui/consts/const-eval/heap/alloc_intrinsic_errors.stderr10
-rw-r--r--src/test/ui/consts/const-eval/issue-49296.rs3
-rw-r--r--src/test/ui/consts/const-eval/issue-49296.stderr11
-rw-r--r--src/test/ui/consts/const-eval/ub-incorrect-vtable.32bit.stderr31
-rw-r--r--src/test/ui/consts/const-eval/ub-incorrect-vtable.64bit.stderr31
-rw-r--r--src/test/ui/consts/const-eval/ub-incorrect-vtable.rs6
-rw-r--r--src/test/ui/consts/const-eval/ub-nonnull.32bit.stderr31
-rw-r--r--src/test/ui/consts/const-eval/ub-nonnull.64bit.stderr31
-rw-r--r--src/test/ui/consts/const-eval/ub-nonnull.rs3
-rw-r--r--src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr19
-rw-r--r--src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr19
-rw-r--r--src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs3
-rw-r--r--src/test/ui/consts/const-int-unchecked.rs147
-rw-r--r--src/test/ui/consts/const-int-unchecked.stderr539
-rw-r--r--src/test/ui/consts/const_unsafe_unreachable_ub.rs7
-rw-r--r--src/test/ui/consts/const_unsafe_unreachable_ub.stderr38
-rw-r--r--src/test/ui/consts/issue-39161-bogus-error.rs13
-rw-r--r--src/test/ui/consts/offset_from_ub.rs20
-rw-r--r--src/test/ui/consts/offset_from_ub.stderr100
-rw-r--r--src/test/ui/consts/offset_ub.stderr93
-rw-r--r--src/test/ui/consts/ptr_comparisons.rs4
-rw-r--r--src/test/ui/consts/ptr_comparisons.stderr25
-rw-r--r--src/test/ui/dynamically-sized-types/dst-index.rs2
-rw-r--r--src/test/ui/error-codes/E0121.rs3
-rw-r--r--src/test/ui/function-pointer/function-pointer-comparison-issue-54685.rs31
-rw-r--r--src/test/ui/generator/too-live-local-in-immovable-gen.rs2
-rw-r--r--src/test/ui/generator/too-live-local-in-immovable-gen.stderr2
-rw-r--r--src/test/ui/generator/yield-in-initializer.rs2
-rw-r--r--src/test/ui/issues/issue-20644.rs4
-rw-r--r--src/test/ui/issues/issue-27895.rs10
-rw-r--r--src/test/ui/issues/issue-27895.stderr9
-rw-r--r--src/test/ui/issues/issue-43205.rs2
-rw-r--r--src/test/ui/issues/issue-5280.rs2
-rw-r--r--src/test/ui/issues/issue-54696.rs4
-rw-r--r--src/test/ui/limits/issue-69485-var-size-diffs-too-large.stderr4
-rw-r--r--src/test/ui/lint/unused-borrows.rs33
-rw-r--r--src/test/ui/lint/unused-borrows.stderr44
-rw-r--r--src/test/ui/macros/issue-84632-eager-expansion-recursion-limit.rs16
-rw-r--r--src/test/ui/macros/issue-84632-eager-expansion-recursion-limit.stderr14
-rw-r--r--src/test/ui/macros/macro-or-patterns-back-compat.fixed17
-rw-r--r--src/test/ui/macros/macro-or-patterns-back-compat.rs17
-rw-r--r--src/test/ui/macros/macro-or-patterns-back-compat.stderr19
-rw-r--r--src/test/ui/non-constant-in-const-path.rs7
-rw-r--r--src/test/ui/non-constant-in-const-path.stderr9
-rw-r--r--src/test/ui/parser/expr-as-stmt.fixed1
-rw-r--r--src/test/ui/parser/expr-as-stmt.rs1
-rw-r--r--src/test/ui/parser/expr-as-stmt.stderr18
-rw-r--r--src/test/ui/pattern/issue-68394-let-pat-runtime-value.rs5
-rw-r--r--src/test/ui/pattern/issue-68394-let-pat-runtime-value.stderr9
-rw-r--r--src/test/ui/pattern/non-constant-in-const-path.rs18
-rw-r--r--src/test/ui/pattern/non-constant-in-const-path.stderr28
-rw-r--r--src/test/ui/repr/issue-83505-repr-simd.rs10
-rw-r--r--src/test/ui/repr/issue-83505-repr-simd.stderr30
-rw-r--r--src/test/ui/rt-explody-panic-payloads.rs30
-rw-r--r--src/test/ui/rust-2021/future-prelude-collision-imported.fixed59
-rw-r--r--src/test/ui/rust-2021/future-prelude-collision-imported.rs59
-rw-r--r--src/test/ui/rust-2021/future-prelude-collision-imported.stderr34
-rw-r--r--src/test/ui/rust-2021/future-prelude-collision-shadow.rs32
-rw-r--r--src/test/ui/rust-2021/future-prelude-collision-shadow.stderr40
-rw-r--r--src/test/ui/rust-2021/future-prelude-collision.fixed96
-rw-r--r--src/test/ui/rust-2021/future-prelude-collision.rs96
-rw-r--r--src/test/ui/rust-2021/future-prelude-collision.stderr79
-rw-r--r--src/test/ui/rust-2021/generic-type-collision.fixed18
-rw-r--r--src/test/ui/rust-2021/generic-type-collision.rs18
-rw-r--r--src/test/ui/rust-2021/generic-type-collision.stderr16
-rw-r--r--src/test/ui/rust-2021/inherent-dyn-collision.fixed53
-rw-r--r--src/test/ui/rust-2021/inherent-dyn-collision.rs53
-rw-r--r--src/test/ui/rust-2021/inherent-dyn-collision.stderr16
-rw-r--r--src/test/ui/rust-2021/inherent-method-collision.rs15
-rw-r--r--src/test/ui/span/missing-unit-argument.rs2
-rw-r--r--src/test/ui/span/missing-unit-argument.stderr2
-rw-r--r--src/test/ui/thread-local/thread-local-issue-37508.rs36
-rw-r--r--src/test/ui/traits/issue-78632.rs59
-rw-r--r--src/test/ui/traits/operator-overloading-issue-52025.rs57
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-85113.rs22
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-85113.stderr48
-rw-r--r--src/test/ui/typeck/issue-75889.rs6
-rw-r--r--src/test/ui/typeck/issue-75889.stderr15
-rw-r--r--src/test/ui/typeck/struct-enum-wrong-args.rs14
-rw-r--r--src/test/ui/typeck/struct-enum-wrong-args.stderr67
-rw-r--r--src/test/ui/variance/variance-btree-invariant-types.nll.stderr58
-rw-r--r--src/test/ui/variance/variance-btree-invariant-types.rs15
-rw-r--r--src/test/ui/variance/variance-btree-invariant-types.stderr110
-rw-r--r--src/tools/clippy/CONTRIBUTING.md2
-rw-r--r--src/tools/clippy/README.md2
-rw-r--r--src/tools/clippy/clippy_utils/src/ast_utils.rs2
-rw-r--r--src/tools/clippy/doc/basics.md4
-rw-r--r--src/tools/clippy/lintcheck/README.md2
-rw-r--r--src/tools/clippy/tests/ui/bytes_nth.fixed2
-rw-r--r--src/tools/clippy/tests/ui/bytes_nth.rs2
-rw-r--r--src/tools/clippy/tests/ui/bytes_nth.stderr6
-rw-r--r--src/tools/clippy/tests/ui/iter_count.fixed6
-rw-r--r--src/tools/clippy/tests/ui/iter_count.rs6
-rw-r--r--src/tools/clippy/tests/ui/iter_count.stderr18
-rw-r--r--src/tools/clippy/util/gh-pages/index.html8
-rw-r--r--src/tools/compiletest/Cargo.toml2
-rw-r--r--src/tools/compiletest/src/runtest.rs7
-rw-r--r--src/tools/linkchecker/main.rs2
-rw-r--r--src/tools/linkchecker/tests/broken_redir/redir-bad.html1
-rw-r--r--src/tools/linkchecker/tests/checks.rs50
-rw-r--r--src/tools/linkchecker/tests/redirect_loop/redir-bad.html1
-rw-r--r--src/tools/linkchecker/tests/valid/inner/redir-bad.html1
-rw-r--r--src/tools/linkchecker/tests/valid/inner/redir.html1
m---------src/tools/miri18
m---------src/tools/rust-analyzer35
-rw-r--r--src/tools/rustdoc-gui/tester.js32
-rw-r--r--src/tools/rustfmt/CHANGELOG.md10
-rw-r--r--src/tools/rustfmt/Configurations.md32
-rw-r--r--src/tools/rustfmt/Contributing.md2
-rw-r--r--src/tools/rustfmt/Design.md4
-rw-r--r--src/tools/rustfmt/README.md4
-rwxr-xr-xsrc/tools/rustfmt/ci/integration.sh2
-rw-r--r--src/tools/rustfmt/docs/index.html8
-rw-r--r--src/tools/rustfmt/src/modules.rs2
-rw-r--r--src/tools/rustfmt/src/test/mod.rs1
-rw-r--r--src/tools/rustfmt/src/test/mod_resolver.rs25
-rw-r--r--src/tools/rustfmt/tests/mod-resolver/issue-4874/bar/baz.rs5
-rw-r--r--src/tools/rustfmt/tests/mod-resolver/issue-4874/foo.rs1
-rw-r--r--src/tools/rustfmt/tests/mod-resolver/issue-4874/foo/qux.rs5
-rw-r--r--src/tools/rustfmt/tests/mod-resolver/issue-4874/main.rs8
-rw-r--r--src/tools/tidy/src/deps.rs20
-rw-r--r--src/tools/tidy/src/pal.rs1
185 files changed, 2821 insertions, 1472 deletions
diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml
index 8445d811e0f..d1e666936f8 100644
--- a/src/bootstrap/Cargo.toml
+++ b/src/bootstrap/Cargo.toml
@@ -50,6 +50,7 @@ time = "0.1"
 ignore = "0.4.10"
 opener = "0.4"
 merge = "0.1.0"
+once_cell = "1.7.2"
 
 [target.'cfg(windows)'.dependencies.winapi]
 version = "0.3"
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index bc499fdba59..e2f605257bd 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -29,6 +29,8 @@ use crate::util::{self, add_dylib_path, add_link_lib_path, exe, libdir};
 use crate::{Build, DocTests, GitRepo, Mode};
 
 pub use crate::Compiler;
+// FIXME: replace with std::lazy after it gets stabilized and reaches beta
+use once_cell::sync::Lazy;
 
 pub struct Builder<'a> {
     pub build: &'a Build,
@@ -195,7 +197,7 @@ impl StepDescription {
 
         if paths.is_empty() || builder.config.include_default_paths {
             for (desc, should_run) in v.iter().zip(&should_runs) {
-                if desc.default && should_run.is_really_default {
+                if desc.default && should_run.is_really_default() {
                     for pathset in &should_run.paths {
                         desc.maybe_run(builder, pathset);
                     }
@@ -228,7 +230,11 @@ impl StepDescription {
     }
 }
 
-#[derive(Clone)]
+enum ReallyDefault<'a> {
+    Bool(bool),
+    Lazy(Lazy<bool, Box<dyn Fn() -> bool + 'a>>),
+}
+
 pub struct ShouldRun<'a> {
     pub builder: &'a Builder<'a>,
     // use a BTreeSet to maintain sort order
@@ -236,7 +242,7 @@ pub struct ShouldRun<'a> {
 
     // If this is a default rule, this is an additional constraint placed on
     // its run. Generally something like compiler docs being enabled.
-    is_really_default: bool,
+    is_really_default: ReallyDefault<'a>,
 }
 
 impl<'a> ShouldRun<'a> {
@@ -244,15 +250,27 @@ impl<'a> ShouldRun<'a> {
         ShouldRun {
             builder,
             paths: BTreeSet::new(),
-            is_really_default: true, // by default no additional conditions
+            is_really_default: ReallyDefault::Bool(true), // by default no additional conditions
         }
     }
 
     pub fn default_condition(mut self, cond: bool) -> Self {
-        self.is_really_default = cond;
+        self.is_really_default = ReallyDefault::Bool(cond);
+        self
+    }
+
+    pub fn lazy_default_condition(mut self, lazy_cond: Box<dyn Fn() -> bool + 'a>) -> Self {
+        self.is_really_default = ReallyDefault::Lazy(Lazy::new(lazy_cond));
         self
     }
 
+    pub fn is_really_default(&self) -> bool {
+        match &self.is_really_default {
+            ReallyDefault::Bool(val) => *val,
+            ReallyDefault::Lazy(lazy) => *lazy.deref(),
+        }
+    }
+
     /// Indicates it should run if the command-line selects the given crate or
     /// any of its (local) dependencies.
     ///
diff --git a/src/bootstrap/builder/tests.rs b/src/bootstrap/builder/tests.rs
index 4d7c207e3ab..e7fb8c0d4d5 100644
--- a/src/bootstrap/builder/tests.rs
+++ b/src/bootstrap/builder/tests.rs
@@ -613,9 +613,14 @@ mod dist {
         // Note that the stages here are +1 than what they actually are because
         // Rustdoc::run swaps out the compiler with stage minus 1 if --stage is
         // not 0.
+        //
+        // The stage 0 copy is the one downloaded for bootstrapping. It is
+        // (currently) needed to run "cargo test" on the linkchecker, and
+        // should be relatively "free".
         assert_eq!(
             first(builder.cache.all::<tool::Rustdoc>()),
             &[
+                tool::Rustdoc { compiler: Compiler { host: a, stage: 0 } },
                 tool::Rustdoc { compiler: Compiler { host: a, stage: 1 } },
                 tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } },
             ]
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 0b7a0e25df1..92ac3b364f6 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -124,8 +124,25 @@ You can skip linkcheck with --exclude src/tools/linkchecker"
 
         builder.info(&format!("Linkcheck ({})", host));
 
+        // Test the linkchecker itself.
+        let bootstrap_host = builder.config.build;
+        let compiler = builder.compiler(0, bootstrap_host);
+        let cargo = tool::prepare_tool_cargo(
+            builder,
+            compiler,
+            Mode::ToolBootstrap,
+            bootstrap_host,
+            "test",
+            "src/tools/linkchecker",
+            SourceType::InTree,
+            &[],
+        );
+        try_run(builder, &mut cargo.into());
+
+        // Build all the default documentation.
         builder.default_doc(&[]);
 
+        // Run the linkchecker.
         let _time = util::timeit(&builder);
         try_run(
             builder,
@@ -806,15 +823,15 @@ impl Step for RustdocGUI {
     fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
         let builder = run.builder;
         let run = run.suite_path("src/test/rustdoc-gui");
-        run.default_condition(
+        run.lazy_default_condition(Box::new(move || {
             builder.config.nodejs.is_some()
                 && builder
                     .config
                     .npm
                     .as_ref()
                     .map(|p| check_if_browser_ui_test_is_installed(p))
-                    .unwrap_or(false),
-        )
+                    .unwrap_or(false)
+        }))
     }
 
     fn make_run(run: RunConfig<'_>) {
@@ -877,6 +894,9 @@ impl Step for RustdocGUI {
                 }
             }
         }
+        for test_arg in builder.config.cmd.test_args() {
+            command.arg(test_arg);
+        }
         builder.run(&mut command);
     }
 }
diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile
index e2c064ee75d..c33d5b4e4dc 100644
--- a/src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile
+++ b/src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile
@@ -71,7 +71,7 @@ ENV PATH="/node-v14.4.0-linux-x64/bin:${PATH}"
 # https://github.com/puppeteer/puppeteer/issues/375
 #
 # We also specify the version in case we need to update it to go around cache limitations.
-RUN npm install -g browser-ui-test@0.2.14 --unsafe-perm=true
+RUN npm install -g browser-ui-test@0.3.0 --unsafe-perm=true
 
 ENV RUST_CONFIGURE_ARGS \
   --build=x86_64-unknown-linux-gnu \
diff --git a/src/ci/init_repo.sh b/src/ci/init_repo.sh
index 060b3079dad..3c61dcc9d9c 100755
--- a/src/ci/init_repo.sh
+++ b/src/ci/init_repo.sh
@@ -31,7 +31,7 @@ mkdir "$CACHE_DIR"
 
 # On the beta channel we'll be automatically calculating the prerelease version
 # via the git history, so unshallow our shallow clone from CI.
-if grep -q RUST_RELEASE_CHANNEL=beta src/ci/run.sh; then
+if [ "$(releaseChannel)" = "beta" ]; then
   git fetch origin --unshallow beta master
 fi
 
diff --git a/src/ci/run.sh b/src/ci/run.sh
index c5e225c7cd1..b5019d83af4 100755
--- a/src/ci/run.sh
+++ b/src/ci/run.sh
@@ -65,11 +65,7 @@ fi
 # Always set the release channel for bootstrap; this is normally not important (i.e., only dist
 # builds would seem to matter) but in practice bootstrap wants to know whether we're targeting
 # master, beta, or stable with a build to determine whether to run some checks (notably toolstate).
-if [[ -z "${RUST_CI_OVERRIDE_RELEASE_CHANNEL+x}" ]]; then
-    export RUST_RELEASE_CHANNEL="$(cat "${ci_dir}/channel")"
-else
-    export RUST_RELEASE_CHANNEL="${RUST_CI_OVERRIDE_RELEASE_CHANNEL}"
-fi
+export RUST_RELEASE_CHANNEL=$(releaseChannel)
 RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --release-channel=$RUST_RELEASE_CHANNEL"
 
 if [ "$DEPLOY$DEPLOY_ALT" = "1" ]; then
diff --git a/src/ci/shared.sh b/src/ci/shared.sh
index 332a949a4dc..b095afb542d 100644
--- a/src/ci/shared.sh
+++ b/src/ci/shared.sh
@@ -141,3 +141,11 @@ function ciCommandSetEnv {
         exit 1
     fi
 }
+
+function releaseChannel {
+    if [[ -z "${RUST_CI_OVERRIDE_RELEASE_CHANNEL+x}" ]]; then
+        cat "${ci_dir}/channel"
+    else
+        echo $RUST_CI_OVERRIDE_RELEASE_CHANNEL
+    fi
+}
diff --git a/src/doc/rust.css b/src/doc/rust.css
index 06f4df9a9b6..dba97a067a3 100644
--- a/src/doc/rust.css
+++ b/src/doc/rust.css
@@ -1,45 +1,68 @@
+/* See FiraSans-LICENSE.txt for the Fira Sans license. */
 @font-face {
 	font-family: 'Fira Sans';
 	font-style: normal;
 	font-weight: 400;
-	src: local('Fira Sans'), url("FiraSans-Regular.woff") format('woff');
+	src: local('Fira Sans'),
+		url("FiraSans-Regular.woff2") format("woff2"),
+		url("FiraSans-Regular.woff") format('woff');
 	font-display: swap;
 }
 @font-face {
 	font-family: 'Fira Sans';
 	font-style: normal;
 	font-weight: 500;
-	src: local('Fira Sans Medium'), url("FiraSans-Medium.woff") format('woff');
+	src: local('Fira Sans Medium'),
+		url("FiraSans-Medium.woff2") format("woff2"),
+		url("FiraSans-Medium.woff") format('woff');
 	font-display: swap;
 }
+
+/* See SourceSerif4-LICENSE.md for the Source Serif 4 license. */
 @font-face {
-	font-family: 'Source Serif Pro';
+	font-family: 'Source Serif 4';
 	font-style: normal;
 	font-weight: 400;
-	src: local('Source Serif Pro'), url("SourceSerifPro-Regular.ttf.woff") format('woff');
+	src: local('Source Serif 4'), url("SourceSerif4-Regular.ttf.woff") format('woff');
 	font-display: swap;
 }
 @font-face {
-	font-family: 'Source Serif Pro';
+	font-family: 'Source Serif 4';
 	font-style: italic;
 	font-weight: 400;
-	src: url("SourceSerifPro-It.ttf.woff") format('woff');
+	src: local('Source Serif 4 Italic'), url("SourceSerif4-It.ttf.woff") format('woff');
 	font-display: swap;
 }
 @font-face {
-	font-family: 'Source Serif Pro';
+	font-family: 'Source Serif 4';
 	font-style: normal;
 	font-weight: 700;
-	src: local('Source Serif Pro Bold'), url("SourceSerifPro-Bold.ttf.woff") format('woff');
+	src: local('Source Serif 4 Bold'), url("SourceSerif4-Bold.ttf.woff") format('woff');
 	font-display: swap;
 }
+
+/* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */
 @font-face {
 	font-family: 'Source Code Pro';
 	font-style: normal;
 	font-weight: 400;
 	/* Avoid using locally installed font because bad versions are in circulation:
 	 * see https://github.com/rust-lang/rust/issues/24355 */
-	src: url("SourceCodePro-Regular.woff") format('woff');
+	src: url("SourceCodePro-Regular.ttf.woff") format('woff');
+	font-display: swap;
+}
+@font-face {
+	font-family: 'Source Code Pro';
+	font-style: italic;
+	font-weight: 400;
+	src: url("SourceCodePro-It.ttf.woff") format('woff');
+	font-display: swap;
+}
+@font-face {
+	font-family: 'Source Code Pro';
+	font-style: normal;
+	font-weight: 600;
+	src: url("SourceCodePro-Semibold.ttf.woff") format('woff');
 	font-display: swap;
 }
 
@@ -55,7 +78,7 @@ body {
 	background-color: white;
 	margin: 0 auto;
 	padding: 0 15px;
-	font-family: "Source Serif Pro", Georgia, Times, "Times New Roman", serif;
+	font-family: "Source Serif 4", Georgia, Times, "Times New Roman", serif;
 	font-size: 18px;
 	color: #333;
 	line-height: 1.428571429;
diff --git a/src/librustdoc/Cargo.toml b/src/librustdoc/Cargo.toml
index 5ce75949457..d5957b632dc 100644
--- a/src/librustdoc/Cargo.toml
+++ b/src/librustdoc/Cargo.toml
@@ -21,6 +21,7 @@ regex = "1"
 rustdoc-json-types = { path = "../rustdoc-json-types" }
 tracing = "0.1"
 tracing-tree = "0.1.9"
+tera = { version = "1.10.0", default-features = false }
 
 [dependencies.tracing-subscriber]
 version = "0.2.13"
diff --git a/src/librustdoc/externalfiles.rs b/src/librustdoc/externalfiles.rs
index 6c86baa36ac..56d2ca57218 100644
--- a/src/librustdoc/externalfiles.rs
+++ b/src/librustdoc/externalfiles.rs
@@ -4,7 +4,9 @@ use std::fs;
 use std::path::Path;
 use std::str;
 
-#[derive(Clone, Debug)]
+use serde::Serialize;
+
+#[derive(Clone, Debug, Serialize)]
 crate struct ExternalHtml {
     /// Content that will be included inline in the <head> section of a
     /// rendered Markdown file or generated documentation
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs
index 918a5cb5094..58c609cf252 100644
--- a/src/librustdoc/html/format.rs
+++ b/src/librustdoc/html/format.rs
@@ -9,6 +9,7 @@ use std::cell::Cell;
 use std::fmt;
 use std::iter;
 
+use rustc_attr::{ConstStability, StabilityLevel};
 use rustc_data_structures::captures::Captures;
 use rustc_data_structures::fx::FxHashSet;
 use rustc_hir as hir;
@@ -1253,15 +1254,6 @@ impl PrintWithSpace for hir::Unsafety {
     }
 }
 
-impl PrintWithSpace for hir::Constness {
-    fn print_with_space(&self) -> &str {
-        match self {
-            hir::Constness::Const => "const ",
-            hir::Constness::NotConst => "",
-        }
-    }
-}
-
 impl PrintWithSpace for hir::IsAsync {
     fn print_with_space(&self) -> &str {
         match self {
@@ -1280,6 +1272,22 @@ impl PrintWithSpace for hir::Mutability {
     }
 }
 
+crate fn print_constness_with_space(
+    c: &hir::Constness,
+    s: Option<&ConstStability>,
+) -> &'static str {
+    match (c, s) {
+        // const stable or when feature(staged_api) is not set
+        (
+            hir::Constness::Const,
+            Some(ConstStability { level: StabilityLevel::Stable { .. }, .. }),
+        )
+        | (hir::Constness::Const, None) => "const ",
+        // const unstable or not const
+        _ => "",
+    }
+}
+
 impl clean::Import {
     crate fn print<'a, 'tcx: 'a>(
         &'a self,
diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs
index d2d1757b900..6ed603c96bb 100644
--- a/src/librustdoc/html/layout.rs
+++ b/src/librustdoc/html/layout.rs
@@ -7,7 +7,9 @@ use crate::html::escape::Escape;
 use crate::html::format::{Buffer, Print};
 use crate::html::render::{ensure_trailing_slash, StylePath};
 
-#[derive(Clone)]
+use serde::Serialize;
+
+#[derive(Clone, Serialize)]
 crate struct Layout {
     crate logo: String,
     crate favicon: String,
@@ -22,6 +24,7 @@ crate struct Layout {
     crate generate_search_filter: bool,
 }
 
+#[derive(Serialize)]
 crate struct Page<'a> {
     crate title: &'a str,
     crate css_class: &'a str,
@@ -40,7 +43,19 @@ impl<'a> Page<'a> {
     }
 }
 
+#[derive(Serialize)]
+struct PageLayout<'a> {
+    static_root_path: &'a str,
+    page: &'a Page<'a>,
+    layout: &'a Layout,
+    style_files: String,
+    sidebar: String,
+    content: String,
+    krate_with_trailing_slash: String,
+}
+
 crate fn render<T: Print, S: Print>(
+    templates: &tera::Tera,
     layout: &Layout,
     page: &Page<'_>,
     sidebar: S,
@@ -48,184 +63,35 @@ crate fn render<T: Print, S: Print>(
     style_files: &[StylePath],
 ) -> String {
     let static_root_path = page.get_static_root_path();
-    format!(
-        "<!DOCTYPE html>\
-<html lang=\"en\">\
-<head>\
-    <meta charset=\"utf-8\">\
-    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\
-    <meta name=\"generator\" content=\"rustdoc\">\
-    <meta name=\"description\" content=\"{description}\">\
-    <meta name=\"keywords\" content=\"{keywords}\">\
-    <title>{title}</title>\
-    <link rel=\"stylesheet\" type=\"text/css\" href=\"{static_root_path}normalize{suffix}.css\">\
-    <link rel=\"stylesheet\" type=\"text/css\" href=\"{static_root_path}rustdoc{suffix}.css\" \
-          id=\"mainThemeStyle\">\
-    {style_files}\
-    <script id=\"default-settings\"{default_settings}></script>\
-    <script src=\"{static_root_path}storage{suffix}.js\"></script>\
-    <script src=\"{root_path}crates{suffix}.js\"></script>\
-    <noscript><link rel=\"stylesheet\" href=\"{static_root_path}noscript{suffix}.css\"></noscript>\
-    {css_extension}\
-    {favicon}\
-    {in_header}\
-    <style type=\"text/css\">\
-    #crate-search{{background-image:url(\"{static_root_path}down-arrow{suffix}.svg\");}}\
-    </style>\
-</head>\
-<body class=\"rustdoc {css_class}\">\
-    <!--[if lte IE 11]>\
-    <div class=\"warning\">\
-        This old browser is unsupported and will most likely display funky \
-        things.\
-    </div>\
-    <![endif]-->\
-    {before_content}\
-    <nav class=\"sidebar\">\
-        <div class=\"sidebar-menu\" role=\"button\">&#9776;</div>\
-        {logo}\
-        {sidebar}\
-    </nav>\
-    <div class=\"theme-picker\">\
-        <button id=\"theme-picker\" aria-label=\"Pick another theme!\" aria-haspopup=\"menu\" title=\"themes\">\
-            <img src=\"{static_root_path}brush{suffix}.svg\" \
-                 width=\"18\" height=\"18\" \
-                 alt=\"Pick another theme!\">\
-        </button>\
-        <div id=\"theme-choices\" role=\"menu\"></div>\
-    </div>\
-    <nav class=\"sub\">\
-        <form class=\"search-form\">\
-            <div class=\"search-container\">\
-                <div>{filter_crates}\
-                    <input class=\"search-input\" name=\"search\" \
-                           disabled \
-                           autocomplete=\"off\" \
-                           spellcheck=\"false\" \
-                           placeholder=\"Click or press ‘S’ to search, ‘?’ for more options…\" \
-                           type=\"search\">\
-                </div>\
-                <button type=\"button\" id=\"help-button\" title=\"help\">?</button>\
-                <a id=\"settings-menu\" href=\"{root_path}settings.html\" title=\"settings\">\
-                    <img src=\"{static_root_path}wheel{suffix}.svg\" \
-                         width=\"18\" height=\"18\" \
-                         alt=\"Change settings\">\
-                </a>\
-            </div>\
-        </form>\
-    </nav>\
-    <section id=\"main\" class=\"content\">{content}</section>\
-    <section id=\"search\" class=\"content hidden\"></section>\
-    {after_content}\
-    <div id=\"rustdoc-vars\" data-root-path=\"{root_path}\" data-current-crate=\"{krate}\" \
-       data-search-index-js=\"{root_path}search-index{suffix}.js\" \
-       data-search-js=\"{static_root_path}search{suffix}.js\"></div>\
-    <script src=\"{static_root_path}main{suffix}.js\"></script>\
-    {extra_scripts}\
-</body>\
-</html>",
-        css_extension = if layout.css_file_extension.is_some() {
+    let krate_with_trailing_slash = ensure_trailing_slash(&layout.krate).to_string();
+    let style_files = style_files
+        .iter()
+        .filter_map(|t| {
+            if let Some(stem) = t.path.file_stem() { Some((stem, t.disabled)) } else { None }
+        })
+        .filter_map(|t| if let Some(path) = t.0.to_str() { Some((path, t.1)) } else { None })
+        .map(|t| {
             format!(
-                "<link rel=\"stylesheet\" \
-                       type=\"text/css\" \
-                       href=\"{static_root_path}theme{suffix}.css\">",
-                static_root_path = static_root_path,
-                suffix = page.resource_suffix
-            )
-        } else {
-            String::new()
-        },
-        content = Buffer::html().to_display(t),
-        static_root_path = static_root_path,
-        root_path = page.root_path,
-        css_class = page.css_class,
-        logo = {
-            if layout.logo.is_empty() {
-                format!(
-                    "<a href='{root}{path}index.html'>\
-                     <div class='logo-container rust-logo'>\
-                     <img src='{static_root_path}rust-logo{suffix}.png' alt='logo'></div></a>",
-                    root = page.root_path,
-                    path = ensure_trailing_slash(&layout.krate),
-                    static_root_path = static_root_path,
-                    suffix = page.resource_suffix
-                )
-            } else {
-                format!(
-                    "<a href='{root}{path}index.html'>\
-                     <div class='logo-container'><img src='{logo}' alt='logo'></div></a>",
-                    root = page.root_path,
-                    path = ensure_trailing_slash(&layout.krate),
-                    logo = layout.logo
-                )
-            }
-        },
-        title = page.title,
-        description = Escape(page.description),
-        keywords = page.keywords,
-        favicon = if layout.favicon.is_empty() {
-            format!(
-                r##"<link rel="icon" type="image/svg+xml" href="{static_root_path}favicon{suffix}.svg">
-<link rel="alternate icon" type="image/png" href="{static_root_path}favicon-16x16{suffix}.png">
-<link rel="alternate icon" type="image/png" href="{static_root_path}favicon-32x32{suffix}.png">"##,
-                static_root_path = static_root_path,
-                suffix = page.resource_suffix
-            )
-        } else {
-            format!(r#"<link rel="shortcut icon" href="{}">"#, layout.favicon)
-        },
-        in_header = layout.external_html.in_header,
-        before_content = layout.external_html.before_content,
-        after_content = layout.external_html.after_content,
-        sidebar = Buffer::html().to_display(sidebar),
-        krate = layout.krate,
-        default_settings = layout
-            .default_settings
-            .iter()
-            .map(|(k, v)| format!(r#" data-{}="{}""#, k.replace('-', "_"), Escape(v)))
-            .collect::<String>(),
-        style_files = style_files
-            .iter()
-            .filter_map(|t| {
-                if let Some(stem) = t.path.file_stem() { Some((stem, t.disabled)) } else { None }
-            })
-            .filter_map(|t| {
-                if let Some(path) = t.0.to_str() { Some((path, t.1)) } else { None }
-            })
-            .map(|t| format!(
                 r#"<link rel="stylesheet" type="text/css" href="{}.css" {} {}>"#,
                 Escape(&format!("{}{}{}", static_root_path, t.0, page.resource_suffix)),
                 if t.1 { "disabled" } else { "" },
                 if t.0 == "light" { "id=\"themeStyle\"" } else { "" }
-            ))
-            .collect::<String>(),
-        suffix = page.resource_suffix,
-        extra_scripts = page
-            .static_extra_scripts
-            .iter()
-            .map(|e| {
-                format!(
-                    "<script src=\"{static_root_path}{extra_script}.js\"></script>",
-                    static_root_path = static_root_path,
-                    extra_script = e
-                )
-            })
-            .chain(page.extra_scripts.iter().map(|e| {
-                format!(
-                    "<script src=\"{root_path}{extra_script}.js\"></script>",
-                    root_path = page.root_path,
-                    extra_script = e
-                )
-            }))
-            .collect::<String>(),
-        filter_crates = if layout.generate_search_filter {
-            "<select id=\"crate-search\">\
-                 <option value=\"All crates\">All crates</option>\
-             </select>"
-        } else {
-            ""
-        },
-    )
+            )
+        })
+        .collect::<String>();
+    let content = Buffer::html().to_display(t); // Note: This must happen before making the sidebar.
+    let sidebar = Buffer::html().to_display(sidebar);
+    let teractx = tera::Context::from_serialize(PageLayout {
+        static_root_path,
+        page,
+        layout,
+        style_files,
+        sidebar,
+        content,
+        krate_with_trailing_slash,
+    })
+    .unwrap();
+    templates.render("page.html", &teractx).unwrap()
 }
 
 crate fn redirect(url: &str) -> String {
diff --git a/src/librustdoc/html/render/context.rs b/src/librustdoc/html/render/context.rs
index 1898f5feed2..2085739fc46 100644
--- a/src/librustdoc/html/render/context.rs
+++ b/src/librustdoc/html/render/context.rs
@@ -1,5 +1,6 @@
 use std::cell::RefCell;
 use std::collections::BTreeMap;
+use std::error::Error as StdError;
 use std::io;
 use std::path::{Path, PathBuf};
 use std::rc::Rc;
@@ -29,6 +30,7 @@ use crate::formats::FormatRenderer;
 use crate::html::escape::Escape;
 use crate::html::format::Buffer;
 use crate::html::markdown::{self, plain_text_summary, ErrorCodes, IdMap};
+use crate::html::static_files::PAGE;
 use crate::html::{layout, sources};
 
 /// Major driving force in all rustdoc rendering. This contains information
@@ -121,6 +123,8 @@ crate struct SharedContext<'tcx> {
     /// to `Some(...)`, it'll store redirections and then generate a JSON file at the top level of
     /// the crate.
     redirections: Option<RefCell<FxHashMap<String, String>>>,
+
+    pub(crate) templates: tera::Tera,
 }
 
 impl SharedContext<'_> {
@@ -218,6 +222,7 @@ impl<'tcx> Context<'tcx> {
 
         if !self.render_redirect_pages {
             layout::render(
+                &self.shared.templates,
                 &self.shared.layout,
                 &page,
                 |buf: &mut _| print_sidebar(self, it, buf),
@@ -408,6 +413,12 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
         let mut issue_tracker_base_url = None;
         let mut include_sources = true;
 
+        let mut templates = tera::Tera::default();
+        templates.add_raw_template("page.html", PAGE).map_err(|e| Error {
+            file: "page.html".into(),
+            error: format!("{}: {}", e, e.source().map(|e| e.to_string()).unwrap_or_default()),
+        })?;
+
         // Crawl the crate attributes looking for attributes which control how we're
         // going to emit HTML
         for attr in krate.module.attrs.lists(sym::doc) {
@@ -454,6 +465,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
             errors: receiver,
             redirections: if generate_redirect_map { Some(Default::default()) } else { None },
             show_type_layout,
+            templates,
         };
 
         // Add the default themes to the `Vec` of stylepaths
@@ -540,6 +552,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
         };
         let all = self.shared.all.replace(AllTypes::new());
         let v = layout::render(
+            &self.shared.templates,
             &self.shared.layout,
             &page,
             sidebar,
@@ -557,6 +570,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
         let sidebar = "<p class=\"location\">Settings</p><div class=\"sidebar-elems\"></div>";
         style_files.push(StylePath { path: PathBuf::from("settings.css"), disabled: false });
         let v = layout::render(
+            &self.shared.templates,
             &self.shared.layout,
             &page,
             sidebar,
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index 62d3c142eeb..03b607c2d2c 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -42,7 +42,7 @@ use std::str;
 use std::string::ToString;
 
 use rustc_ast_pretty::pprust;
-use rustc_attr::{Deprecation, StabilityLevel};
+use rustc_attr::{ConstStability, Deprecation, StabilityLevel};
 use rustc_data_structures::fx::FxHashSet;
 use rustc_hir as hir;
 use rustc_hir::def::CtorKind;
@@ -61,8 +61,8 @@ use crate::formats::item_type::ItemType;
 use crate::formats::{AssocItemRender, Impl, RenderMode};
 use crate::html::escape::Escape;
 use crate::html::format::{
-    href, print_abi_with_space, print_default_space, print_generic_bounds, print_where_clause,
-    Buffer, PrintWithSpace,
+    href, print_abi_with_space, print_constness_with_space, print_default_space,
+    print_generic_bounds, print_where_clause, Buffer, PrintWithSpace,
 };
 use crate::html::markdown::{Markdown, MarkdownHtml, MarkdownSummaryLine};
 
@@ -826,21 +826,45 @@ fn assoc_type(
 fn render_stability_since_raw(
     w: &mut Buffer,
     ver: Option<&str>,
-    const_ver: Option<&str>,
+    const_stability: Option<&ConstStability>,
     containing_ver: Option<&str>,
     containing_const_ver: Option<&str>,
 ) {
     let ver = ver.filter(|inner| !inner.is_empty());
-    let const_ver = const_ver.filter(|inner| !inner.is_empty());
 
-    match (ver, const_ver) {
-        (Some(v), Some(cv)) if const_ver != containing_const_ver => {
+    match (ver, const_stability) {
+        // stable and const stable
+        (Some(v), Some(ConstStability { level: StabilityLevel::Stable { since }, .. }))
+            if Some(since.as_str()).as_deref() != containing_const_ver =>
+        {
             write!(
                 w,
                 "<span class=\"since\" title=\"Stable since Rust version {0}, const since {1}\">{0} (const: {1})</span>",
-                v, cv
+                v, since
             );
         }
+        // stable and const unstable
+        (
+            Some(v),
+            Some(ConstStability { level: StabilityLevel::Unstable { issue, .. }, feature, .. }),
+        ) => {
+            write!(
+                w,
+                "<span class=\"since\" title=\"Stable since Rust version {0}, const unstable\">{0} (const: ",
+                v
+            );
+            if let Some(n) = issue {
+                write!(
+                    w,
+                    "<a href=\"https://github.com/rust-lang/rust/issues/{}\" title=\"Tracking issue for {}\">unstable</a>",
+                    n, feature
+                );
+            } else {
+                write!(w, "unstable");
+            }
+            write!(w, ")</span>");
+        }
+        // stable
         (Some(v), _) if ver != containing_ver => {
             write!(
                 w,
@@ -888,11 +912,13 @@ fn render_assoc_item(
             }
         };
         let vis = meth.visibility.print_with_space(meth.def_id, cx).to_string();
-        let constness = header.constness.print_with_space();
+        let constness =
+            print_constness_with_space(&header.constness, meth.const_stability(cx.tcx()));
         let asyncness = header.asyncness.print_with_space();
         let unsafety = header.unsafety.print_with_space();
         let defaultness = print_default_space(meth.is_default());
         let abi = print_abi_with_space(header.abi).to_string();
+
         // NOTE: `{:#}` does not print HTML formatting, `{}` does. So `g.print` can't be reused between the length calculation and `write!`.
         let generics_len = format!("{:#}", g.print(cx)).len();
         let mut header_len = "fn ".len()
@@ -917,15 +943,15 @@ fn render_assoc_item(
         w.reserve(header_len + "<a href=\"\" class=\"fnname\">{".len() + "</a>".len());
         write!(
             w,
-            "{}{}{}{}{}{}{}fn <a href=\"{href}\" class=\"fnname\">{name}</a>\
+            "{indent}{vis}{constness}{asyncness}{unsafety}{defaultness}{abi}fn <a href=\"{href}\" class=\"fnname\">{name}</a>\
              {generics}{decl}{notable_traits}{where_clause}",
-            indent_str,
-            vis,
-            constness,
-            asyncness,
-            unsafety,
-            defaultness,
-            abi,
+            indent = indent_str,
+            vis = vis,
+            constness = constness,
+            asyncness = asyncness,
+            unsafety = unsafety,
+            defaultness = defaultness,
+            abi = abi,
             href = href,
             name = name,
             generics = g.print(cx),
@@ -1583,7 +1609,7 @@ fn render_rightside(
     render_stability_since_raw(
         w,
         item.stable_since(tcx).as_deref(),
-        item.const_stable_since(tcx).as_deref(),
+        item.const_stability(tcx),
         containing_item.stable_since(tcx).as_deref(),
         containing_item.const_stable_since(tcx).as_deref(),
     );
diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs
index 8fd53538912..0174bfec32d 100644
--- a/src/librustdoc/html/render/print_item.rs
+++ b/src/librustdoc/html/render/print_item.rs
@@ -22,7 +22,9 @@ use crate::clean::{self, GetDefId};
 use crate::formats::item_type::ItemType;
 use crate::formats::{AssocItemRender, Impl, RenderMode};
 use crate::html::escape::Escape;
-use crate::html::format::{print_abi_with_space, print_where_clause, Buffer, PrintWithSpace};
+use crate::html::format::{
+    print_abi_with_space, print_constness_with_space, print_where_clause, Buffer, PrintWithSpace,
+};
 use crate::html::highlight;
 use crate::html::layout::Page;
 use crate::html::markdown::MarkdownSummaryLine;
@@ -94,7 +96,7 @@ pub(super) fn print_item(cx: &Context<'_>, item: &clean::Item, buf: &mut Buffer,
     render_stability_since_raw(
         buf,
         item.stable_since(cx.tcx()).as_deref(),
-        item.const_stable_since(cx.tcx()).as_deref(),
+        item.const_stability(cx.tcx()),
         None,
         None,
     );
@@ -430,29 +432,36 @@ fn extra_info_tags(item: &clean::Item, parent: &clean::Item, tcx: TyCtxt<'_>) ->
 }
 
 fn item_function(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, f: &clean::Function) {
-    let header_len = format!(
-        "{}{}{}{}{:#}fn {}{:#}",
-        it.visibility.print_with_space(it.def_id, cx),
-        f.header.constness.print_with_space(),
-        f.header.asyncness.print_with_space(),
-        f.header.unsafety.print_with_space(),
-        print_abi_with_space(f.header.abi),
-        it.name.as_ref().unwrap(),
-        f.generics.print(cx),
-    )
-    .len();
+    let vis = it.visibility.print_with_space(it.def_id, cx).to_string();
+    let constness = print_constness_with_space(&f.header.constness, it.const_stability(cx.tcx()));
+    let asyncness = f.header.asyncness.print_with_space();
+    let unsafety = f.header.unsafety.print_with_space();
+    let abi = print_abi_with_space(f.header.abi).to_string();
+    let name = it.name.as_ref().unwrap();
+
+    let generics_len = format!("{:#}", f.generics.print(cx)).len();
+    let header_len = "fn ".len()
+        + vis.len()
+        + constness.len()
+        + asyncness.len()
+        + unsafety.len()
+        + abi.len()
+        + name.as_str().len()
+        + generics_len;
+
     w.write_str("<pre class=\"rust fn\">");
     render_attributes_in_pre(w, it, "");
+    w.reserve(header_len);
     write!(
         w,
         "{vis}{constness}{asyncness}{unsafety}{abi}fn \
          {name}{generics}{decl}{notable_traits}{where_clause}</pre>",
-        vis = it.visibility.print_with_space(it.def_id, cx),
-        constness = f.header.constness.print_with_space(),
-        asyncness = f.header.asyncness.print_with_space(),
-        unsafety = f.header.unsafety.print_with_space(),
-        abi = print_abi_with_space(f.header.abi),
-        name = it.name.as_ref().unwrap(),
+        vis = vis,
+        constness = constness,
+        asyncness = asyncness,
+        unsafety = unsafety,
+        abi = abi,
+        name = name,
         generics = f.generics.print(cx),
         where_clause = print_where_clause(&f.generics, cx, 0, true),
         decl = f.decl.full_print(header_len, 0, f.header.asyncness, cx),
@@ -981,7 +990,9 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
                 }
                 w.write_str(")");
             }
-            w.write_str("</code></div>");
+            w.write_str("</code>");
+            render_stability_since(w, variant, it, cx.tcx());
+            w.write_str("</div>");
             document(w, cx, variant, Some(it));
             document_non_exhaustive(w, variant);
 
@@ -1023,7 +1034,6 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
                 w.write_str("</div></div>");
                 toggle_close(w);
             }
-            render_stability_since(w, variant, it, cx.tcx());
         }
     }
     let def_id = it.def_id.expect_real();
@@ -1290,7 +1300,7 @@ fn render_stability_since(
     render_stability_since_raw(
         w,
         item.stable_since(tcx).as_deref(),
-        item.const_stable_since(tcx).as_deref(),
+        item.const_stability(tcx),
         containing_item.stable_since(tcx).as_deref(),
         containing_item.const_stable_since(tcx).as_deref(),
     )
diff --git a/src/librustdoc/html/render/write_shared.rs b/src/librustdoc/html/render/write_shared.rs
index a4188e6b203..94a902a2d05 100644
--- a/src/librustdoc/html/render/write_shared.rs
+++ b/src/librustdoc/html/render/write_shared.rs
@@ -25,10 +25,16 @@ static FILES_UNVERSIONED: Lazy<FxHashMap<&str, &[u8]>> = Lazy::new(|| {
         "FiraSans-Regular.woff" => static_files::fira_sans::REGULAR,
         "FiraSans-Medium.woff" => static_files::fira_sans::MEDIUM,
         "FiraSans-LICENSE.txt" => static_files::fira_sans::LICENSE,
+        "SourceSerif4-Regular.ttf.woff2" => static_files::source_serif_4::REGULAR2,
+        "SourceSerif4-Bold.ttf.woff2" => static_files::source_serif_4::BOLD2,
+        "SourceSerif4-It.ttf.woff2" => static_files::source_serif_4::ITALIC2,
         "SourceSerif4-Regular.ttf.woff" => static_files::source_serif_4::REGULAR,
         "SourceSerif4-Bold.ttf.woff" => static_files::source_serif_4::BOLD,
         "SourceSerif4-It.ttf.woff" => static_files::source_serif_4::ITALIC,
         "SourceSerif4-LICENSE.md" => static_files::source_serif_4::LICENSE,
+        "SourceCodePro-Regular.ttf.woff2" => static_files::source_code_pro::REGULAR2,
+        "SourceCodePro-Semibold.ttf.woff2" => static_files::source_code_pro::SEMIBOLD2,
+        "SourceCodePro-It.ttf.woff2" => static_files::source_code_pro::ITALIC2,
         "SourceCodePro-Regular.ttf.woff" => static_files::source_code_pro::REGULAR,
         "SourceCodePro-Semibold.ttf.woff" => static_files::source_code_pro::SEMIBOLD,
         "SourceCodePro-It.ttf.woff" => static_files::source_code_pro::ITALIC,
@@ -460,7 +466,14 @@ pub(super) fn write_shared(
                     })
                     .collect::<String>()
             );
-            let v = layout::render(&cx.shared.layout, &page, "", content, &cx.shared.style_files);
+            let v = layout::render(
+                &cx.shared.templates,
+                &cx.shared.layout,
+                &page,
+                "",
+                content,
+                &cx.shared.style_files,
+            );
             cx.shared.fs.write(&dst, v.as_bytes())?;
         }
     }
diff --git a/src/librustdoc/html/sources.rs b/src/librustdoc/html/sources.rs
index 5e2a94fe684..80dd7a7a952 100644
--- a/src/librustdoc/html/sources.rs
+++ b/src/librustdoc/html/sources.rs
@@ -136,6 +136,7 @@ impl SourceCollector<'_, 'tcx> {
             static_extra_scripts: &[&format!("source-script{}", self.scx.resource_suffix)],
         };
         let v = layout::render(
+            &self.scx.templates,
             &self.scx.layout,
             &page,
             "",
diff --git a/src/librustdoc/html/static/COPYRIGHT.txt b/src/librustdoc/html/static/COPYRIGHT.txt
index 16d79032fcc..c2629a83f70 100644
--- a/src/librustdoc/html/static/COPYRIGHT.txt
+++ b/src/librustdoc/html/static/COPYRIGHT.txt
@@ -2,7 +2,8 @@ These documentation pages include resources by third parties. This copyright
 file applies only to those resources. The following third party resources are
 included, and carry their own copyright notices and license terms:
 
-* Fira Sans (FiraSans-Regular.woff, FiraSans-Medium.woff):
+* Fira Sans (FiraSans-Regular.woff2, FiraSans-Medium.woff2,
+    FiraSans-Regular.woff, FiraSans-Medium.woff):
 
     Copyright (c) 2014, Mozilla Foundation https://mozilla.org/
     with Reserved Font Name Fira Sans.
@@ -23,8 +24,10 @@ included, and carry their own copyright notices and license terms:
     Copyright (c) Nicolas Gallagher and Jonathan Neal.
     Licensed under the MIT license (see LICENSE-MIT.txt).
 
-* Source Code Pro (SourceCodePro-Regular.ttf.woff,
-    SourceCodePro-Semibold.ttf.woff, SourceCodePro-It.ttf.woff):
+* Source Code Pro (SourceCodePro-Regular.ttf.woff2,
+    SourceCodePro-Semibold.ttf.woff2, SourceCodePro-It.ttf.woff2,
+    SourceCodePro-Regular.ttf.woff, SourceCodePro-Semibold.ttf.woff,
+    SourceCodePro-It.ttf.woff):
 
     Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/),
     with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark
@@ -33,8 +36,9 @@ included, and carry their own copyright notices and license terms:
     Licensed under the SIL Open Font License, Version 1.1.
     See SourceCodePro-LICENSE.txt.
 
-* Source Serif 4 (SourceSerif4-Regular.ttf.woff, SourceSerif4-Bold.ttf.woff,
-    SourceSerif4-It.ttf.woff):
+* Source Serif 4 (SourceSerif4-Regular.ttf.woff2, SourceSerif4-Bold.ttf.woff2,
+    SourceSerif4-It.ttf.woff2, SourceSerif4-Regular.ttf.woff,
+    SourceSerif4-Bold.ttf.woff, SourceSerif4-It.ttf.woff):
 
     Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name
     'Source'. All Rights Reserved. Source is a trademark of Adobe in the United
diff --git a/src/librustdoc/html/static/FiraSans-LICENSE.txt b/src/librustdoc/html/static/FiraSans-LICENSE.txt
index d444ea92b6f..ff9afab064a 100644
--- a/src/librustdoc/html/static/FiraSans-LICENSE.txt
+++ b/src/librustdoc/html/static/FiraSans-LICENSE.txt
@@ -1,5 +1,5 @@
 Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A.
-with Reserved Font Name < Fira >, 
+with Reserved Font Name < Fira >,
 
 This Font Software is licensed under the SIL Open Font License, Version 1.1.
 This license is copied below, and is also available with a FAQ at:
@@ -19,7 +19,7 @@ with others.
 
 The OFL allows the licensed fonts to be used, studied, modified and
 redistributed freely as long as they are not sold by themselves. The
-fonts, including any derivative works, can be bundled, embedded, 
+fonts, including any derivative works, can be bundled, embedded,
 redistributed and/or sold with any software provided that any reserved
 names are not used by derivative works. The fonts and derivatives,
 however, cannot be released under any other type of license. The
diff --git a/src/librustdoc/html/static/SourceCodePro-It.ttf.woff2 b/src/librustdoc/html/static/SourceCodePro-It.ttf.woff2
new file mode 100644
index 00000000000..462c34efcd9
--- /dev/null
+++ b/src/librustdoc/html/static/SourceCodePro-It.ttf.woff2
Binary files differdiff --git a/src/librustdoc/html/static/SourceCodePro-Regular.ttf.woff2 b/src/librustdoc/html/static/SourceCodePro-Regular.ttf.woff2
new file mode 100644
index 00000000000..10b558e0b69
--- /dev/null
+++ b/src/librustdoc/html/static/SourceCodePro-Regular.ttf.woff2
Binary files differdiff --git a/src/librustdoc/html/static/SourceCodePro-Semibold.ttf.woff2 b/src/librustdoc/html/static/SourceCodePro-Semibold.ttf.woff2
new file mode 100644
index 00000000000..5ec64eef0ec
--- /dev/null
+++ b/src/librustdoc/html/static/SourceCodePro-Semibold.ttf.woff2
Binary files differdiff --git a/src/librustdoc/html/static/SourceSerif4-Bold.ttf.woff2 b/src/librustdoc/html/static/SourceSerif4-Bold.ttf.woff2
new file mode 100644
index 00000000000..db57d21455c
--- /dev/null
+++ b/src/librustdoc/html/static/SourceSerif4-Bold.ttf.woff2
Binary files differdiff --git a/src/librustdoc/html/static/SourceSerif4-It.ttf.woff2 b/src/librustdoc/html/static/SourceSerif4-It.ttf.woff2
new file mode 100644
index 00000000000..1cbc021a3aa
--- /dev/null
+++ b/src/librustdoc/html/static/SourceSerif4-It.ttf.woff2
Binary files differdiff --git a/src/librustdoc/html/static/SourceSerif4-Regular.ttf.woff2 b/src/librustdoc/html/static/SourceSerif4-Regular.ttf.woff2
new file mode 100644
index 00000000000..2db73fe2b49
--- /dev/null
+++ b/src/librustdoc/html/static/SourceSerif4-Regular.ttf.woff2
Binary files differdiff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css
index 9a59ee528a0..9e1fcb929c5 100644
--- a/src/librustdoc/html/static/rustdoc.css
+++ b/src/librustdoc/html/static/rustdoc.css
@@ -23,21 +23,27 @@
 	font-family: 'Source Serif 4';
 	font-style: normal;
 	font-weight: 400;
-	src: local('Source Serif 4'), url("SourceSerif4-Regular.ttf.woff") format('woff');
+	src: local('Source Serif 4'),
+		url("SourceSerif4-Regular.ttf.woff2") format("woff2"),
+		url("SourceSerif4-Regular.ttf.woff") format("woff");
 	font-display: swap;
 }
 @font-face {
 	font-family: 'Source Serif 4';
 	font-style: italic;
 	font-weight: 400;
-	src: local('Source Serif 4 Italic'), url("SourceSerif4-It.ttf.woff") format('woff');
+	src: local('Source Serif 4 Italic'),
+		url("SourceSerif4-It.ttf.woff2") format("woff2"),
+		url("SourceSerif4-It.ttf.woff") format("woff");
 	font-display: swap;
 }
 @font-face {
 	font-family: 'Source Serif 4';
 	font-style: normal;
 	font-weight: 700;
-	src: local('Source Serif 4 Bold'), url("SourceSerif4-Bold.ttf.woff") format('woff');
+	src: local('Source Serif 4 Bold'),
+		url("SourceSerif4-Bold.ttf.woff2") format("woff2"),
+		url("SourceSerif4-Bold.ttf.woff") format("woff");
 	font-display: swap;
 }
 
@@ -48,21 +54,24 @@
 	font-weight: 400;
 	/* Avoid using locally installed font because bad versions are in circulation:
 	 * see https://github.com/rust-lang/rust/issues/24355 */
-	src: url("SourceCodePro-Regular.ttf.woff") format('woff');
+	src: url("SourceCodePro-Regular.ttf.woff2") format("woff2"),
+		url("SourceCodePro-Regular.ttf.woff") format("woff");
 	font-display: swap;
 }
 @font-face {
 	font-family: 'Source Code Pro';
 	font-style: italic;
 	font-weight: 400;
-	src: url("SourceCodePro-It.ttf.woff") format('woff');
+	src: url("SourceCodePro-It.ttf.woff2") format("woff2"),
+		url("SourceCodePro-It.ttf.woff") format("woff");
 	font-display: swap;
 }
 @font-face {
 	font-family: 'Source Code Pro';
 	font-style: normal;
 	font-weight: 600;
-	src: url("SourceCodePro-Semibold.ttf.woff") format('woff');
+	src: url("SourceCodePro-Semibold.ttf.woff2") format("woff2"),
+		url("SourceCodePro-Semibold.ttf.woff") format("woff");
 	font-display: swap;
 }
 
@@ -653,6 +662,12 @@ a {
 	background: transparent;
 }
 
+.small-section-header {
+	display: flex;
+	justify-content: space-between;
+	position: relative;
+}
+
 .small-section-header:hover > .anchor {
 	display: initial;
 }
diff --git a/src/librustdoc/html/static_files.rs b/src/librustdoc/html/static_files.rs
index ca7e5ef8150..4443c74834d 100644
--- a/src/librustdoc/html/static_files.rs
+++ b/src/librustdoc/html/static_files.rs
@@ -64,6 +64,8 @@ crate static RUST_FAVICON_SVG: &[u8] = include_bytes!("static/favicon.svg");
 crate static RUST_FAVICON_PNG_16: &[u8] = include_bytes!("static/favicon-16x16.png");
 crate static RUST_FAVICON_PNG_32: &[u8] = include_bytes!("static/favicon-32x32.png");
 
+crate static PAGE: &str = include_str!("templates/page.html");
+
 /// The built-in themes given to every documentation site.
 crate mod themes {
     /// The "light" theme, selected by default when no setting is available. Used as the basis for
@@ -100,12 +102,24 @@ crate mod source_serif_4 {
     /// The file `SourceSerif4-Regular.ttf.woff`, the Regular variant of the Source Serif 4 font.
     crate static REGULAR: &[u8] = include_bytes!("static/SourceSerif4-Regular.ttf.woff");
 
+    /// The file `SourceSerif4-Regular.ttf.woff2`, the Regular variant of the Source Serif 4 font in
+    /// woff2.
+    crate static REGULAR2: &[u8] = include_bytes!("static/SourceSerif4-Regular.ttf.woff2");
+
     /// The file `SourceSerif4-Bold.ttf.woff`, the Bold variant of the Source Serif 4 font.
     crate static BOLD: &[u8] = include_bytes!("static/SourceSerif4-Bold.ttf.woff");
 
+    /// The file `SourceSerif4-Bold.ttf.woff2`, the Bold variant of the Source Serif 4 font in
+    /// woff2.
+    crate static BOLD2: &[u8] = include_bytes!("static/SourceSerif4-Bold.ttf.woff2");
+
     /// The file `SourceSerif4-It.ttf.woff`, the Italic variant of the Source Serif 4 font.
     crate static ITALIC: &[u8] = include_bytes!("static/SourceSerif4-It.ttf.woff");
 
+    /// The file `SourceSerif4-It.ttf.woff2`, the Italic variant of the Source Serif 4 font in
+    /// woff2.
+    crate static ITALIC2: &[u8] = include_bytes!("static/SourceSerif4-It.ttf.woff2");
+
     /// The file `SourceSerif4-LICENSE.txt`, the license text for the Source Serif 4 font.
     crate static LICENSE: &[u8] = include_bytes!("static/SourceSerif4-LICENSE.md");
 }
@@ -115,13 +129,25 @@ crate mod source_code_pro {
     /// The file `SourceCodePro-Regular.ttf.woff`, the Regular variant of the Source Code Pro font.
     crate static REGULAR: &[u8] = include_bytes!("static/SourceCodePro-Regular.ttf.woff");
 
+    /// The file `SourceCodePro-Regular.ttf.woff2`, the Regular variant of the Source Code Pro font
+    /// in woff2.
+    crate static REGULAR2: &[u8] = include_bytes!("static/SourceCodePro-Regular.ttf.woff2");
+
     /// The file `SourceCodePro-Semibold.ttf.woff`, the Semibold variant of the Source Code Pro
     /// font.
     crate static SEMIBOLD: &[u8] = include_bytes!("static/SourceCodePro-Semibold.ttf.woff");
 
+    /// The file `SourceCodePro-Semibold.ttf.woff2`, the Semibold variant of the Source Code Pro
+    /// font in woff2.
+    crate static SEMIBOLD2: &[u8] = include_bytes!("static/SourceCodePro-Semibold.ttf.woff2");
+
     /// The file `SourceCodePro-It.ttf.woff`, the Italic variant of the Source Code Pro font.
     crate static ITALIC: &[u8] = include_bytes!("static/SourceCodePro-It.ttf.woff");
 
+    /// The file `SourceCodePro-It.ttf.woff2`, the Italic variant of the Source Code Pro font in
+    /// woff2.
+    crate static ITALIC2: &[u8] = include_bytes!("static/SourceCodePro-It.ttf.woff2");
+
     /// The file `SourceCodePro-LICENSE.txt`, the license text of the Source Code Pro font.
     crate static LICENSE: &[u8] = include_bytes!("static/SourceCodePro-LICENSE.txt");
 }
diff --git a/src/librustdoc/html/templates/STYLE.md b/src/librustdoc/html/templates/STYLE.md
new file mode 100644
index 00000000000..fff65e3b5ff
--- /dev/null
+++ b/src/librustdoc/html/templates/STYLE.md
@@ -0,0 +1,37 @@
+# Style for Templates
+
+This directory has templates in the [Tera templating language](teradoc), which is very
+similar to [Jinja2](jinjadoc) and [Django](djangodoc) templates, and also to [Askama](askamadoc).
+
+[teradoc]: https://tera.netlify.app/docs/#templates
+[jinjadoc]: https://jinja.palletsprojects.com/en/3.0.x/templates/
+[djangodoc]: https://docs.djangoproject.com/en/3.2/topics/templates/
+[askamadoc]: https://docs.rs/askama/0.10.5/askama/
+
+We want our rendered output to have as little unnecessary whitespace as
+possible, so that pages load quickly. To achieve that we use Tera's
+[whitespace control] features. At the end of most lines, we put an empty comment
+tag with the whitespace control characters: `{#- -#}`. This causes all
+whitespace between the end of the line and the beginning of the next, including
+indentation, to be omitted on render. Sometimes we want to preserve a single
+space. In those cases we put the space at the end of the line, followed by
+`{# -#}`, which is a directive to remove following whitespace but not preceding.
+We also use the whitespace control characters in most instances of tags with
+control flow, for example `{%- if foo -%}`.
+
+[whitespace control]: https://tera.netlify.app/docs/#whitespace-control
+
+We want our templates to be readable, so we use indentation and newlines
+liberally. We indent by four spaces after opening an HTML tag _or_ a Tera
+tag. In most cases an HTML tag should be followed by a newline, but if the
+tag has simple contents and fits with its close tag on a single line, the
+contents don't necessarily need a new line.
+
+Tera templates support quite sophisticated control flow. To keep our templates
+simple and understandable, we use only a subset: `if` and `for`. In particular
+we avoid [assignments in the template logic](assignments) and [Tera
+macros](macros). This also may make things easier if we switch to a different
+Jinja-style template system, like Askama, in the future.
+
+[assignments]: https://tera.netlify.app/docs/#assignments
+[macros]: https://tera.netlify.app/docs/#macros
diff --git a/src/librustdoc/html/templates/page.html b/src/librustdoc/html/templates/page.html
new file mode 100644
index 00000000000..9b1bef5e447
--- /dev/null
+++ b/src/librustdoc/html/templates/page.html
@@ -0,0 +1,119 @@
+<!DOCTYPE html> {#- -#}
+<html lang="en"> {#- -#}
+<head> {#- -#}
+    <meta charset="utf-8"> {#- -#}
+    <meta name="viewport" content="width=device-width, initial-scale=1.0"> {#- -#}
+    <meta name="generator" content="rustdoc"> {#- -#}
+    <meta name="description" content="{{page.description}}"> {#- -#}
+    <meta name="keywords" content="{{page.keywords}}"> {#- -#}
+    <title>{{page.title}}</title> {#- -#}
+    <link rel="stylesheet" type="text/css" {# -#}
+          href="{{static_root_path | safe}}normalize{{page.resource_suffix}}.css"> {#- -#}
+    <link rel="stylesheet" type="text/css" {# -#}
+          href="{{static_root_path | safe}}rustdoc{{page.resource_suffix}}.css" {# -#}
+          id="mainThemeStyle"> {#- -#}
+    {{- style_files | safe -}}
+    <script id="default-settings" {# -#}
+      {% for k, v in layout.default_settings %}
+        data-{{k}}="{{v}}"
+      {%- endfor -%}
+    ></script> {#- -#}
+    <script src="{{static_root_path | safe}}storage{{page.resource_suffix}}.js"></script> {#- -#}
+    <script src="{{page.root_path | safe}}crates{{page.resource_suffix}}.js"></script> {#- -#}
+    <noscript> {#- -#}
+        <link rel="stylesheet" {# -#}
+           href="{{static_root_path | safe}}noscript{{page.resource_suffix}}.css"> {#- -#}
+    </noscript> {#- -#}
+    {%- if layout.css_file_extension -%}
+        <link rel="stylesheet" type="text/css" {# -#}
+            href="{{static_root_path | safe}}theme{{page.resource_suffix}}.css"> {#- -#}
+    {%- endif -%}
+    {%- if layout.favicon -%}
+        <link rel="shortcut icon" href="{{layout.favicon}}"> {#- -#}
+    {%- else -%}
+        <link rel="icon" type="image/svg+xml" {# -#}
+            href="{{static_root_path | safe}}favicon{{page.resource_suffix}}.svg"> {#- -#}
+        <link rel="alternate icon" type="image/png" {# -#}
+            href="{{static_root_path | safe}}favicon-16x16{{page.resource_suffix}}.png"> {#- -#}
+        <link rel="alternate icon" type="image/png" {# -#}
+            href="{{static_root_path | safe}}favicon-32x32{{page.resource_suffix}}.png"> {#- -#}
+    {%- endif -%}
+    {{- layout.external_html.in_header | safe -}}
+    <style type="text/css"> {#- -#}
+    #crate-search{ {#- -#}
+        background-image:url("{{static_root_path | safe}}down-arrow{{page.resource_suffix}}.svg"); {#- -#}
+    } {#- -#}
+    </style> {#- -#}
+</head> {#- -#}
+<body class="rustdoc {{page.css_class}}"> {#- -#}
+    <!--[if lte IE 11]> {#- -#}
+    <div class="warning"> {#- -#}
+        This old browser is unsupported and will most likely display funky things. {#- -#}
+    </div> {#- -#}
+    <![endif]--> {#- -#}
+    {{- layout.external_html.before_content | safe -}}
+    <nav class="sidebar"> {#- -#}
+        <div class="sidebar-menu" role="button">&#9776;</div> {#- -#}
+        <a href='{{page.root_path | safe}}{{krate_with_trailing_slash | safe}}index.html'> {#- -#}
+            <div class='logo-container rust-logo'> {#- -#}
+            <img src='
+                {%- if layout.logo -%}
+                {{layout.logo}}
+                {%- else -%}
+                {{static_root_path | safe}}rust-logo{{page.resource_suffix}}.png
+                {%- endif -%}
+                ' alt='logo'> {#- -#}
+            </div> {#- -#}
+        </a> {#- -#}
+        {{- sidebar | safe -}}
+    </nav> {#- -#}
+    <div class="theme-picker"> {#- -#}
+        <button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"> {#- -#}
+            <img width="18" height="18" alt="Pick another theme!" {# -#}
+             src="{{static_root_path | safe}}brush{{page.resource_suffix}}.svg"> {#- -#}
+        </button> {#- -#}
+        <div id="theme-choices" role="menu"></div> {#- -#}
+    </div> {#- -#}
+    <nav class="sub"> {#- -#}
+        <form class="search-form"> {#- -#}
+            <div class="search-container"> {#- -#}
+                <div>{%- if layout.generate_search_filter -%}
+                    <select id="crate-search"> {#- -#}
+                        <option value="All crates">All crates</option> {#- -#}
+                    </select> {#- -#}
+                    {%- endif -%}
+                    <input {# -#}
+                        class="search-input"{# -#}
+                        name="search" {# -#}
+                        disabled {# -#}
+                        autocomplete="off" {# -#}
+                        spellcheck="false" {# -#}
+                        placeholder="Click or press ‘S’ to search, ‘?’ for more options…" {# -#}
+                        type="search"> {#- -#}
+                </div> {#- -#}
+                <button type="button" id="help-button" title="help">?</button> {#- -#}
+                <a id="settings-menu" href="{{page.root_path | safe}}settings.html" title="settings"> {#- -#}
+                    <img width="18" height="18" alt="Change settings" {# -#}
+                         src="{{static_root_path | safe}}wheel{{page.resource_suffix}}.svg"> {#- -#}
+                </a> {#- -#}
+            </div> {#- -#}
+        </form> {#- -#}
+    </nav> {#- -#}
+    <section id="main" class="content">{{- content | safe -}}</section> {#- -#}
+    <section id="search" class="content hidden"></section> {#- -#}
+    {{- layout.external_html.after_content | safe -}}
+    <div id="rustdoc-vars" {# -#}
+         data-root-path="{{page.root_path | safe}}" {# -#}
+         data-current-crate="{{layout.krate}}" {# -#}
+         data-search-index-js="{{page.root_path | safe}}search-index{{page.resource_suffix}}.js" {# -#}
+         data-search-js="{{static_root_path | safe}}search{{page.resource_suffix}}.js"> {#- -#}
+    </div>
+    <script src="{{static_root_path | safe}}main{{page.resource_suffix}}.js"></script> {#- -#}
+    {%- for script in page.static_extra_scripts -%}
+    <script src="{{static_root_path | safe}}{{script}}.js"></script> {#- -#}
+    {% endfor %}
+    {%- for script in page.extra_scripts -%}
+    <script src="{{page.root_path | safe}}{{script}}.js"></script> {#- -#}
+    {% endfor %}
+</body> {#- -#}
+</html> {#- -#}
diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs
index 9db83c903ab..fb82a075de0 100644
--- a/src/librustdoc/passes/collect_intra_doc_links.rs
+++ b/src/librustdoc/passes/collect_intra_doc_links.rs
@@ -544,6 +544,44 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
             })
     }
 
+    /// Convert a DefId to a Res, where possible.
+    ///
+    /// This is used for resolving type aliases.
+    fn def_id_to_res(&self, ty_id: DefId) -> Option<Res> {
+        use PrimitiveType::*;
+        Some(match *self.cx.tcx.type_of(ty_id).kind() {
+            ty::Bool => Res::Primitive(Bool),
+            ty::Char => Res::Primitive(Char),
+            ty::Int(ity) => Res::Primitive(ity.into()),
+            ty::Uint(uty) => Res::Primitive(uty.into()),
+            ty::Float(fty) => Res::Primitive(fty.into()),
+            ty::Str => Res::Primitive(Str),
+            ty::Tuple(ref tys) if tys.is_empty() => Res::Primitive(Unit),
+            ty::Tuple(_) => Res::Primitive(Tuple),
+            ty::Array(..) => Res::Primitive(Array),
+            ty::Slice(_) => Res::Primitive(Slice),
+            ty::RawPtr(_) => Res::Primitive(RawPointer),
+            ty::Ref(..) => Res::Primitive(Reference),
+            ty::FnDef(..) => panic!("type alias to a function definition"),
+            ty::FnPtr(_) => Res::Primitive(Fn),
+            ty::Never => Res::Primitive(Never),
+            ty::Adt(&ty::AdtDef { did, .. }, _) | ty::Foreign(did) => {
+                Res::Def(self.cx.tcx.def_kind(did), did)
+            }
+            ty::Projection(_)
+            | ty::Closure(..)
+            | ty::Generator(..)
+            | ty::GeneratorWitness(_)
+            | ty::Opaque(..)
+            | ty::Dynamic(..)
+            | ty::Param(_)
+            | ty::Bound(..)
+            | ty::Placeholder(_)
+            | ty::Infer(_)
+            | ty::Error(_) => return None,
+        })
+    }
+
     /// Returns:
     /// - None if no associated item was found
     /// - Some((_, _, Some(_))) if an item was found and should go through a side channel
@@ -559,12 +597,15 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
 
         match root_res {
             Res::Primitive(prim) => self.resolve_primitive_associated_item(prim, ns, item_name),
+            Res::Def(DefKind::TyAlias, did) => {
+                // Resolve the link on the type the alias points to.
+                // FIXME: if the associated item is defined directly on the type alias,
+                // it will show up on its documentation page, we should link there instead.
+                let res = self.def_id_to_res(did)?;
+                self.resolve_associated_item(res, item_name, ns, module_id)
+            }
             Res::Def(
-                DefKind::Struct
-                | DefKind::Union
-                | DefKind::Enum
-                | DefKind::TyAlias
-                | DefKind::ForeignTy,
+                DefKind::Struct | DefKind::Union | DefKind::Enum | DefKind::ForeignTy,
                 did,
             ) => {
                 debug!("looking for associated item named {} for item {:?}", item_name, did);
diff --git a/src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff b/src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff
new file mode 100644
index 00000000000..d2056ac13a7
--- /dev/null
+++ b/src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff
@@ -0,0 +1,63 @@
+- // MIR for `bound` before LowerSliceLenCalls
++ // MIR for `bound` after LowerSliceLenCalls
+  
+  fn bound(_1: usize, _2: &[u8]) -> u8 {
+      debug index => _1;                   // in scope 0 at $DIR/lower_slice_len.rs:4:14: 4:19
+      debug slice => _2;                   // in scope 0 at $DIR/lower_slice_len.rs:4:28: 4:33
+      let mut _0: u8;                      // return place in scope 0 at $DIR/lower_slice_len.rs:4:45: 4:47
+      let mut _3: bool;                    // in scope 0 at $DIR/lower_slice_len.rs:5:8: 5:27
+      let mut _4: usize;                   // in scope 0 at $DIR/lower_slice_len.rs:5:8: 5:13
+      let mut _5: usize;                   // in scope 0 at $DIR/lower_slice_len.rs:5:16: 5:27
+      let mut _6: &[u8];                   // in scope 0 at $DIR/lower_slice_len.rs:5:16: 5:21
+      let _7: usize;                       // in scope 0 at $DIR/lower_slice_len.rs:6:15: 6:20
+      let mut _8: usize;                   // in scope 0 at $DIR/lower_slice_len.rs:6:9: 6:21
+      let mut _9: bool;                    // in scope 0 at $DIR/lower_slice_len.rs:6:9: 6:21
+  
+      bb0: {
+          StorageLive(_3);                 // scope 0 at $DIR/lower_slice_len.rs:5:8: 5:27
+          StorageLive(_4);                 // scope 0 at $DIR/lower_slice_len.rs:5:8: 5:13
+          _4 = _1;                         // scope 0 at $DIR/lower_slice_len.rs:5:8: 5:13
+          StorageLive(_5);                 // scope 0 at $DIR/lower_slice_len.rs:5:16: 5:27
+          StorageLive(_6);                 // scope 0 at $DIR/lower_slice_len.rs:5:16: 5:21
+          _6 = &(*_2);                     // scope 0 at $DIR/lower_slice_len.rs:5:16: 5:21
+-         _5 = core::slice::<impl [u8]>::len(move _6) -> bb1; // scope 0 at $DIR/lower_slice_len.rs:5:16: 5:27
+-                                          // mir::Constant
+-                                          // + span: $DIR/lower_slice_len.rs:5:22: 5:25
+-                                          // + literal: Const { ty: for<'r> fn(&'r [u8]) -> usize {core::slice::<impl [u8]>::len}, val: Value(Scalar(<ZST>)) }
++         _5 = Len((*_6));                 // scope 0 at $DIR/lower_slice_len.rs:5:16: 5:27
++         goto -> bb1;                     // scope 0 at $DIR/lower_slice_len.rs:5:16: 5:27
+      }
+  
+      bb1: {
+          StorageDead(_6);                 // scope 0 at $DIR/lower_slice_len.rs:5:26: 5:27
+          _3 = Lt(move _4, move _5);       // scope 0 at $DIR/lower_slice_len.rs:5:8: 5:27
+          StorageDead(_5);                 // scope 0 at $DIR/lower_slice_len.rs:5:26: 5:27
+          StorageDead(_4);                 // scope 0 at $DIR/lower_slice_len.rs:5:26: 5:27
+          switchInt(move _3) -> [false: bb3, otherwise: bb2]; // scope 0 at $DIR/lower_slice_len.rs:5:5: 9:6
+      }
+  
+      bb2: {
+          StorageLive(_7);                 // scope 0 at $DIR/lower_slice_len.rs:6:15: 6:20
+          _7 = _1;                         // scope 0 at $DIR/lower_slice_len.rs:6:15: 6:20
+          _8 = Len((*_2));                 // scope 0 at $DIR/lower_slice_len.rs:6:9: 6:21
+          _9 = Lt(_7, _8);                 // scope 0 at $DIR/lower_slice_len.rs:6:9: 6:21
+          assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> bb4; // scope 0 at $DIR/lower_slice_len.rs:6:9: 6:21
+      }
+  
+      bb3: {
+          _0 = const 42_u8;                // scope 0 at $DIR/lower_slice_len.rs:8:9: 8:11
+          goto -> bb5;                     // scope 0 at $DIR/lower_slice_len.rs:5:5: 9:6
+      }
+  
+      bb4: {
+          _0 = (*_2)[_7];                  // scope 0 at $DIR/lower_slice_len.rs:6:9: 6:21
+          StorageDead(_7);                 // scope 0 at $DIR/lower_slice_len.rs:7:5: 7:6
+          goto -> bb5;                     // scope 0 at $DIR/lower_slice_len.rs:5:5: 9:6
+      }
+  
+      bb5: {
+          StorageDead(_3);                 // scope 0 at $DIR/lower_slice_len.rs:9:5: 9:6
+          return;                          // scope 0 at $DIR/lower_slice_len.rs:10:2: 10:2
+      }
+  }
+  
diff --git a/src/test/mir-opt/lower_slice_len.rs b/src/test/mir-opt/lower_slice_len.rs
new file mode 100644
index 00000000000..f2438e69749
--- /dev/null
+++ b/src/test/mir-opt/lower_slice_len.rs
@@ -0,0 +1,14 @@
+// compile-flags: -Z mir-opt-level=3
+
+// EMIT_MIR lower_slice_len.bound.LowerSliceLenCalls.diff
+pub fn bound(index: usize, slice: &[u8]) -> u8 {
+    if index < slice.len() {
+        slice[index]
+    } else {
+        42
+    }
+}
+
+fn main() {
+    let _ = bound(1, &[1, 2, 3]);
+}
diff --git a/src/test/rustdoc-gui/README.md b/src/test/rustdoc-gui/README.md
index 499a98a3d22..8efe7a578b8 100644
--- a/src/test/rustdoc-gui/README.md
+++ b/src/test/rustdoc-gui/README.md
@@ -8,5 +8,17 @@ test what's being currently displayed in the web page.
 
 You can find more information and its documentation in its [repository][browser-ui-test].
 
+If you need to have more information on the tests run, you can use `--test-args`:
+
+```bash
+$ ./x.py test src/test/rustdoc-gui --stage 1 --jobs 8 --test-args --debug
+```
+
+There are three options supported:
+
+ * `--debug`: allows to see puppeteer commands.
+ * `--no-headless`: disable headless mode so you can see what's going on.
+ * `--show-text`: by default, text isn't rendered because of issues with fonts, it enables it back.
+
 [browser-ui-test]: https://github.com/GuillaumeGomez/browser-UI-test/
 [puppeteer]: https://pptr.dev/
diff --git a/src/test/rustdoc-gui/basic-code.goml b/src/test/rustdoc-gui/basic-code.goml
index d014ed60eb0..27deb2c989c 100644
--- a/src/test/rustdoc-gui/basic-code.goml
+++ b/src/test/rustdoc-gui/basic-code.goml
@@ -1,3 +1,3 @@
 goto: file://|DOC_PATH|/test_docs/index.html
 click: ".srclink"
-assert: (".line-numbers", 1)
+assert-count: (".line-numbers", 1)
diff --git a/src/test/rustdoc-gui/check_info_sign_position.goml b/src/test/rustdoc-gui/check_info_sign_position.goml
index d64ee026137..94e3fe79c94 100644
--- a/src/test/rustdoc-gui/check_info_sign_position.goml
+++ b/src/test/rustdoc-gui/check_info_sign_position.goml
@@ -2,8 +2,8 @@ goto: file://|DOC_PATH|/test_docs/index.html
 goto: ./fn.check_list_code_block.html
 // If the codeblock is the first element of the docblock, the information tooltip must have
 // have some top margin to avoid going over the toggle (the "[+]").
-assert: (".docblock > .information > .compile_fail", { "margin-top": "16px" })
+assert-css: (".docblock > .information > .compile_fail", { "margin-top": "16px" })
 // Checks that the other codeblocks don't have this top margin.
-assert: ("ol > li > .information > .compile_fail", { "margin-top": "0px" })
-assert: ("ol > li > .information > .ignore", { "margin-top": "0px" })
-assert: (".docblock > .information > .ignore", { "margin-top": "0px" })
+assert-css: ("ol > li > .information > .compile_fail", { "margin-top": "0px" })
+assert-css: ("ol > li > .information > .ignore", { "margin-top": "0px" })
+assert-css: (".docblock > .information > .ignore", { "margin-top": "0px" })
diff --git a/src/test/rustdoc-gui/code-sidebar-toggle.goml b/src/test/rustdoc-gui/code-sidebar-toggle.goml
index 7e7003d4340..00326e9bbc4 100644
--- a/src/test/rustdoc-gui/code-sidebar-toggle.goml
+++ b/src/test/rustdoc-gui/code-sidebar-toggle.goml
@@ -3,4 +3,4 @@ click: ".srclink"
 click: "#sidebar-toggle"
 wait-for: 500
 fail: true
-assert: ("#source-sidebar", { "left": "-300px" })
+assert-css: ("#source-sidebar", { "left": "-300px" })
diff --git a/src/test/rustdoc-gui/escape-key.goml b/src/test/rustdoc-gui/escape-key.goml
index ec034f52c97..a81bd9a4c03 100644
--- a/src/test/rustdoc-gui/escape-key.goml
+++ b/src/test/rustdoc-gui/escape-key.goml
@@ -2,25 +2,25 @@ goto: file://|DOC_PATH|/test_docs/index.html
 // First, we check that the search results are hidden when the Escape key is pressed.
 write: (".search-input", "test")
 wait-for: "#search > h1" // The search element is empty before the first search 
-assert: ("#search", "class", "content")
-assert: ("#main", "class", "content hidden")
+assert-attr: ("#search", {"class": "content"})
+assert-attr: ("#main", {"class": "content hidden"})
 press-key: "Escape"
-assert: ("#search", "class", "content hidden")
-assert: ("#main", "class", "content")
+assert-attr: ("#search", {"class": "content hidden"})
+assert-attr: ("#main", {"class": "content"})
 
 // Check that focusing the search input brings back the search results
 focus: ".search-input"
-assert: ("#search", "class", "content")
-assert: ("#main", "class", "content hidden")
+assert-attr: ("#search", {"class": "content"})
+assert-attr: ("#main", {"class": "content hidden"})
 
 // Now let's check that when the help popup is displayed and we press Escape, it doesn't
 // hide the search results too.
 click: "#help-button"
-assert: ("#help", "class", "")
+assert-attr: ("#help", {"class": ""})
 press-key: "Escape"
-assert: ("#help", "class", "hidden")
-assert: ("#search", "class", "content")
-assert: ("#main", "class", "content hidden")
+assert-attr: ("#help", {"class": "hidden"})
+assert-attr: ("#search", {"class": "content"})
+assert-attr: ("#main", {"class": "content hidden"})
 
 // Check that Escape hides the search results when a search result is focused.
 focus: ".search-input"
@@ -29,6 +29,6 @@ press-key: "ArrowDown"
 assert-false: ".search-input:focus"
 assert: "#results a:focus"
 press-key: "Escape"
-assert: ("#help", "class", "hidden")
-assert: ("#search", "class", "content hidden")
-assert: ("#main", "class", "content")
+assert-attr: ("#help", {"class": "hidden"})
+assert-attr: ("#search", {"class": "content hidden"})
+assert-attr: ("#main", {"class": "content"})
diff --git a/src/test/rustdoc-gui/font-weight.goml b/src/test/rustdoc-gui/font-weight.goml
index d8ad6c2e3f5..80618112103 100644
--- a/src/test/rustdoc-gui/font-weight.goml
+++ b/src/test/rustdoc-gui/font-weight.goml
@@ -1,7 +1,7 @@
 goto: file://|DOC_PATH|/lib2/struct.Foo.html
 // This test checks that the font weight is correctly applied.
-assert: ("//*[@class='docblock type-decl']//a[text()='Alias']", {"font-weight": "400"})
-assert: ("//*[@class='structfield small-section-header']//a[text()='Alias']", {"font-weight": "400"})
-assert: ("#method\.a_method > code", {"font-weight": "600"})
-assert: ("#associatedtype\.X > code", {"font-weight": "600"})
-assert: ("#associatedconstant\.Y > code", {"font-weight": "600"})
+assert-css: ("//*[@class='docblock type-decl']//a[text()='Alias']", {"font-weight": "400"})
+assert-css: ("//*[@class='structfield small-section-header']//a[text()='Alias']", {"font-weight": "400"})
+assert-css: ("#method\.a_method > code", {"font-weight": "600"})
+assert-css: ("#associatedtype\.X > code", {"font-weight": "600"})
+assert-css: ("#associatedconstant\.Y > code", {"font-weight": "600"})
diff --git a/src/test/rustdoc-gui/hash-item-expansion.goml b/src/test/rustdoc-gui/hash-item-expansion.goml
index d5f9d4fc58b..62c1f200123 100644
--- a/src/test/rustdoc-gui/hash-item-expansion.goml
+++ b/src/test/rustdoc-gui/hash-item-expansion.goml
@@ -1,15 +1,15 @@
 // This test ensures that the element corresponding to the hash is displayed.
 goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.borrow
 // In the blanket implementations list, "Borrow" is the second one, hence the ":nth(2)".
-assert: ("#blanket-implementations-list > details:nth-child(2)", "open", "")
+assert-attr: ("#blanket-implementations-list > details:nth-child(2)", {"open": ""})
 // We first check that the impl block is open by default.
-assert: ("#implementations + details", "open", "")
+assert-attr: ("#implementations + details", {"open": ""})
 // We collapse it.
 click: "#implementations + details > summary"
 // We check that it was collapsed as expected.
-assert-false: ("#implementations + details", "open", "")
+assert-attr-false: ("#implementations + details", {"open": ""})
 // To ensure that we will click on the currently hidden method.
-assert: (".sidebar-links > a", "must_use")
+assert-text: (".sidebar-links > a", "must_use")
 click: ".sidebar-links > a"
 // We check that the impl block was opened as expected so that we can see the method.
-assert: ("#implementations + details", "open", "")
+assert-attr: ("#implementations + details", {"open": ""})
diff --git a/src/test/rustdoc-gui/impl-default-expansion.goml b/src/test/rustdoc-gui/impl-default-expansion.goml
index 3f1e7ec4a78..266b66d586f 100644
--- a/src/test/rustdoc-gui/impl-default-expansion.goml
+++ b/src/test/rustdoc-gui/impl-default-expansion.goml
@@ -1,3 +1,3 @@
 // This test ensures that the impl blocks are open by default.
 goto: file://|DOC_PATH|/test_docs/struct.Foo.html
-assert: ("#main > details.implementors-toggle", "open", "")
+assert-attr: ("#main > details.implementors-toggle", {"open": ""})
diff --git a/src/test/rustdoc-gui/search-result-colors.goml b/src/test/rustdoc-gui/search-result-colors.goml
index 25a01512159..6ed62006151 100644
--- a/src/test/rustdoc-gui/search-result-colors.goml
+++ b/src/test/rustdoc-gui/search-result-colors.goml
@@ -10,5 +10,5 @@ write: (".search-input", "thisisanalias")
 // Waiting for the search results to appear...
 wait-for: "#titles"
 // Checking that the colors for the alias element are the ones expected.
-assert: (".result-name > .alias", {"color": "rgb(255, 255, 255)"})
-assert: (".result-name > .alias > .grey", {"color": "rgb(204, 204, 204)"})
+assert-css: (".result-name > .alias", {"color": "rgb(255, 255, 255)"})
+assert-css: (".result-name > .alias > .grey", {"color": "rgb(204, 204, 204)"})
diff --git a/src/test/rustdoc-gui/search-result-description.goml b/src/test/rustdoc-gui/search-result-description.goml
index a50d03cf489..d8cb6ee5731 100644
--- a/src/test/rustdoc-gui/search-result-description.goml
+++ b/src/test/rustdoc-gui/search-result-description.goml
@@ -2,4 +2,4 @@
 goto: file://|DOC_PATH|/test_docs/index.html?search=some_more_function
 // Waiting for the search results to appear...
 wait-for: "#titles"
-assert: (".search-results .desc code", "format!")
+assert-text: (".search-results .desc code", "format!")
diff --git a/src/test/rustdoc-gui/search-result-display.goml b/src/test/rustdoc-gui/search-result-display.goml
index 96d15c624f1..ea94e5640fb 100644
--- a/src/test/rustdoc-gui/search-result-display.goml
+++ b/src/test/rustdoc-gui/search-result-display.goml
@@ -5,8 +5,8 @@ write: (".search-input", "test")
 wait-for: "#titles"
 // The width is returned by "getComputedStyle" which returns the exact number instead of the
 // CSS rule which is "50%"...
-assert: (".search-results div.desc", {"width": "320px"})
+assert-css: (".search-results div.desc", {"width": "320px"})
 size: (600, 100)
 // As counter-intuitive as it may seem, in this width, the width is "100%", which is why
 // when computed it's larger.
-assert: (".search-results div.desc", {"width": "570px"})
+assert-css: (".search-results div.desc", {"width": "570px"})
diff --git a/src/test/rustdoc-gui/search-result-keyword.goml b/src/test/rustdoc-gui/search-result-keyword.goml
index e7612d66371..5342d431d99 100644
--- a/src/test/rustdoc-gui/search-result-keyword.goml
+++ b/src/test/rustdoc-gui/search-result-keyword.goml
@@ -6,5 +6,5 @@ wait-for: "#titles"
 // less good.
 //
 // Checking that the CSS is displaying " (keyword)" in italic.
-assert: (".result-name span.keyword > i", "(keyword)")
-assert: (".result-name span.keyword", "CookieMonster (keyword)")
+assert-text: (".result-name span.keyword > i", "(keyword)")
+assert-text: (".result-name span.keyword", "CookieMonster (keyword)")
diff --git a/src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml b/src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml
index c828c72e910..88a0b340415 100644
--- a/src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml
+++ b/src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml
@@ -2,7 +2,7 @@ goto: file://|DOC_PATH|/test_docs/index.html
 write: (".search-input", "Foo")
 // Waiting for the search results to appear...
 wait-for: "#titles"
-assert: ("#titles > button:nth-of-type(1)", "class", "selected")
+assert-attr: ("#titles > button:nth-of-type(1)", {"class": "selected"})
 
 // To go back to the original "state"
 goto: file://|DOC_PATH|/test_docs/index.html
@@ -10,7 +10,7 @@ write: (".search-input", "-> String")
 // Waiting for the search results to appear...
 wait-for: "#titles"
 // With this search, only the last tab shouldn't be empty so it should be selected.
-assert: ("#titles > button:nth-of-type(3)", "class", "selected")
+assert-attr: ("#titles > button:nth-of-type(3)", {"class": "selected"})
 
 // To go back to the original "state"
 goto: file://|DOC_PATH|/test_docs/index.html
@@ -18,4 +18,4 @@ write: (".search-input", "-> Something")
 // Waiting for the search results to appear...
 wait-for: "#titles"
 // With this search, all the tabs are empty so the first one should remain selected.
-assert: ("#titles > button:nth-of-type(1)", "class", "selected")
+assert-attr: ("#titles > button:nth-of-type(1)", {"class": "selected"})
diff --git a/src/test/rustdoc-gui/shortcuts.goml b/src/test/rustdoc-gui/shortcuts.goml
index 884c38d85fb..42d945d0eb8 100644
--- a/src/test/rustdoc-gui/shortcuts.goml
+++ b/src/test/rustdoc-gui/shortcuts.goml
@@ -8,19 +8,19 @@ press-key: "Escape"
 assert-false: "input.search-input:focus"
 // We now check for the help popup.
 press-key: "?"
-assert: ("#help", {"display": "flex"})
+assert-css: ("#help", {"display": "flex"})
 assert-false: "#help.hidden"
 press-key: "Escape"
-assert: ("#help.hidden", {"display": "none"})
+assert-css: ("#help.hidden", {"display": "none"})
 // Check for the themes list.
-assert: ("#theme-choices", {"display": "none"})
+assert-css: ("#theme-choices", {"display": "none"})
 press-key: "t"
-assert: ("#theme-choices", {"display": "block"})
+assert-css: ("#theme-choices", {"display": "block"})
 press-key: "t"
 // We ensure that 't' hides back the menu.
-assert: ("#theme-choices", {"display": "none"})
+assert-css: ("#theme-choices", {"display": "none"})
 press-key: "t"
-assert: ("#theme-choices", {"display": "block"})
+assert-css: ("#theme-choices", {"display": "block"})
 press-key: "Escape"
 // We ensure that 'Escape' hides the menu too.
-assert: ("#theme-choices", {"display": "none"})
+assert-css: ("#theme-choices", {"display": "none"})
diff --git a/src/test/rustdoc-gui/sidebar.goml b/src/test/rustdoc-gui/sidebar.goml
index e0e6d19cace..4f6b3aded18 100644
--- a/src/test/rustdoc-gui/sidebar.goml
+++ b/src/test/rustdoc-gui/sidebar.goml
@@ -1,23 +1,23 @@
 goto: file://|DOC_PATH|/test_docs/index.html
-assert: (".sidebar > .location", "Crate test_docs")
+assert-text: (".sidebar > .location", "Crate test_docs")
 // In modules, we only have one "location" element.
-assert: (".sidebar .location", 1)
-assert: (".sidebar-elems > #all-types", "See all test_docs's items")
+assert-count: (".sidebar .location", 1)
+assert-text: (".sidebar-elems > #all-types", "See all test_docs's items")
 // We check that we have the crates list and that the "current" on is "test_docs".
-assert: (".sidebar-elems > .crate > ul > li > a.current", "test_docs")
+assert-text: (".sidebar-elems > .crate > ul > li > a.current", "test_docs")
 // And we're also supposed to have the list of items in the current module.
-assert: (".sidebar-elems > .items > ul > li:nth-child(1)", "Modules")
-assert: (".sidebar-elems > .items > ul > li:nth-child(2)", "Structs")
-assert: (".sidebar-elems > .items > ul > li:nth-child(3)", "Enums")
-assert: (".sidebar-elems > .items > ul > li:nth-child(4)", "Traits")
-assert: (".sidebar-elems > .items > ul > li:nth-child(5)", "Functions")
-assert: (".sidebar-elems > .items > ul > li:nth-child(6)", "Type Definitions")
-assert: (".sidebar-elems > .items > ul > li:nth-child(7)", "Keywords")
-assert: ("#structs + table td > a", "Foo")
+assert-text: (".sidebar-elems > .items > ul > li:nth-child(1)", "Modules")
+assert-text: (".sidebar-elems > .items > ul > li:nth-child(2)", "Structs")
+assert-text: (".sidebar-elems > .items > ul > li:nth-child(3)", "Enums")
+assert-text: (".sidebar-elems > .items > ul > li:nth-child(4)", "Traits")
+assert-text: (".sidebar-elems > .items > ul > li:nth-child(5)", "Functions")
+assert-text: (".sidebar-elems > .items > ul > li:nth-child(6)", "Type Definitions")
+assert-text: (".sidebar-elems > .items > ul > li:nth-child(7)", "Keywords")
+assert-text: ("#structs + table td > a", "Foo")
 click: "#structs + table td > a"
 
 // PAGE: struct.Foo.html
-assert: (".sidebar .location", 2)
+assert-count: (".sidebar .location", 2)
 // We check that there is no crate listed outside of the top level.
 assert-false: ".sidebar-elems > .crate"
 // We now go back to the crate page to click on the "lib2" crate link.
@@ -26,35 +26,35 @@ click: ".sidebar-elems > .crate > ul > li:first-child > a"
 
 // PAGE: lib2/index.html
 goto: file://|DOC_PATH|/lib2/index.html
-assert: (".sidebar > .location", "Crate lib2")
+assert-text: (".sidebar > .location", "Crate lib2")
 // We check that we have the crates list and that the "current" on is now "lib2".
-assert: (".sidebar-elems > .crate > ul > li > a.current", "lib2")
+assert-text: (".sidebar-elems > .crate > ul > li > a.current", "lib2")
 // We now go to the "foobar" function page.
-assert: (".sidebar-elems > .items > ul > li:nth-child(1)", "Modules")
-assert: (".sidebar-elems > .items > ul > li:nth-child(2)", "Structs")
-assert: (".sidebar-elems > .items > ul > li:nth-child(3)", "Traits")
-assert: (".sidebar-elems > .items > ul > li:nth-child(4)", "Functions")
-assert: (".sidebar-elems > .items > ul > li:nth-child(5)", "Type Definitions")
-assert:	("#functions + table td > a", "foobar")
+assert-text: (".sidebar-elems > .items > ul > li:nth-child(1)", "Modules")
+assert-text: (".sidebar-elems > .items > ul > li:nth-child(2)", "Structs")
+assert-text: (".sidebar-elems > .items > ul > li:nth-child(3)", "Traits")
+assert-text: (".sidebar-elems > .items > ul > li:nth-child(4)", "Functions")
+assert-text: (".sidebar-elems > .items > ul > li:nth-child(5)", "Type Definitions")
+assert-text: ("#functions + table td > a", "foobar")
 click: "#functions + table td > a"
 
 // PAGE: fn.foobar.html
 // In items containing no items (like functions or constants) and in modules, we have one
 // "location" elements.
-assert: (".sidebar .location", 1)
+assert-count: (".sidebar .location", 1)
 // There is a "<br>" tag between "in" and "lib2", but it doesn't count as a space.
-assert: (".sidebar .sidebar-elems .location", "Other items inlib2")
+assert-text: (".sidebar .sidebar-elems .location", "Other items inlib2")
 // We check that we don't have the crate list.
 assert-false: ".sidebar-elems > .crate"
 
 goto: ./module/index.html
-assert: (".sidebar > .location", "Module module")
+assert-text: (".sidebar > .location", "Module module")
 // We check that we don't have the crate list.
 assert-false: ".sidebar-elems > .crate"
 
 goto: ./sub_module/sub_sub_module/index.html
-assert: (".sidebar > .location", "Module sub_sub_module")
+assert-text: (".sidebar > .location", "Module sub_sub_module")
 // We check that we don't have the crate list.
 assert-false: ".sidebar-elems > .crate"
-assert: (".sidebar-elems > .items > ul > li:nth-child(1)", "Functions")
-assert: ("#functions + table td > a", "foo")
+assert-text: (".sidebar-elems > .items > ul > li:nth-child(1)", "Functions")
+assert-text: ("#functions + table td > a", "foo")
diff --git a/src/test/rustdoc-gui/source-code-page.goml b/src/test/rustdoc-gui/source-code-page.goml
index ff33a541a18..20396e26895 100644
--- a/src/test/rustdoc-gui/source-code-page.goml
+++ b/src/test/rustdoc-gui/source-code-page.goml
@@ -3,11 +3,11 @@ goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
 click: (40, 224) // This is the position of the span for line 4.
 // Unfortunately, "#4" isn't a valid query selector, so we have to go around that limitation
 // by instead getting the nth span.
-assert: (".line-numbers > span:nth-child(4)", "class", "line-highlighted")
+assert-attr: (".line-numbers > span:nth-child(4)", {"class": "line-highlighted"})
 // We now check that the good spans are highlighted
 goto: file://|DOC_PATH|/src/test_docs/lib.rs.html#4-6
-assert-false: (".line-numbers > span:nth-child(3)", "class", "line-highlighted")
-assert: (".line-numbers > span:nth-child(4)", "class", "line-highlighted")
-assert: (".line-numbers > span:nth-child(5)", "class", "line-highlighted")
-assert: (".line-numbers > span:nth-child(6)", "class", "line-highlighted")
-assert-false: (".line-numbers > span:nth-child(7)", "class", "line-highlighted")
+assert-attr-false: (".line-numbers > span:nth-child(3)", {"class": "line-highlighted"})
+assert-attr: (".line-numbers > span:nth-child(4)", {"class": "line-highlighted"})
+assert-attr: (".line-numbers > span:nth-child(5)", {"class": "line-highlighted"})
+assert-attr: (".line-numbers > span:nth-child(6)", {"class": "line-highlighted"})
+assert-attr-false: (".line-numbers > span:nth-child(7)", {"class": "line-highlighted"})
diff --git a/src/test/rustdoc-gui/theme-change.goml b/src/test/rustdoc-gui/theme-change.goml
index bc9063edd1e..5221cda2f1f 100644
--- a/src/test/rustdoc-gui/theme-change.goml
+++ b/src/test/rustdoc-gui/theme-change.goml
@@ -3,8 +3,8 @@ click: "#theme-picker"
 click: "#theme-choices > button:first-child"
 wait-for: 500
 // should be the ayu theme so let's check the color
-assert: ("body", { "background-color": "rgb(15, 20, 25)" })
+assert-css: ("body", { "background-color": "rgb(15, 20, 25)" })
 click: "#theme-choices > button:last-child"
 wait-for: 500
 // should be the light theme so let's check the color
-assert: ("body", { "background-color": "rgb(255, 255, 255)" })
+assert-css: ("body", { "background-color": "rgb(255, 255, 255)" })
diff --git a/src/test/rustdoc-gui/toggle-docs-mobile.goml b/src/test/rustdoc-gui/toggle-docs-mobile.goml
index fcdfc0344db..9ec91aba881 100644
--- a/src/test/rustdoc-gui/toggle-docs-mobile.goml
+++ b/src/test/rustdoc-gui/toggle-docs-mobile.goml
@@ -1,21 +1,21 @@
 goto: file://|DOC_PATH|/test_docs/struct.Foo.html
 size: (433, 600)
-assert: (".top-doc", "open", "")
+assert-attr: (".top-doc", {"open": ""})
 click: (4, 280) // This is the position of the top doc comment toggle
-assert-false: (".top-doc", "open", "")
+assert-attr-false: (".top-doc", {"open": ""})
 click: (4, 280)
-assert: (".top-doc", "open", "")
+assert-attr: (".top-doc", {"open": ""})
 // To ensure that the toggle isn't over the text, we check that the toggle isn't clicked.
 click: (3, 280)
-assert: (".top-doc", "open", "")
+assert-attr: (".top-doc", {"open": ""})
 
 // Now we do the same but with a little bigger width
 size: (600, 600)
-assert: (".top-doc", "open", "")
+assert-attr: (".top-doc", {"open": ""})
 click: (4, 240) // New Y position since all search elements are back on one line.
-assert-false: (".top-doc", "open", "")
+assert-attr-false: (".top-doc", {"open": ""})
 click: (4, 240)
-assert: (".top-doc", "open", "")
+assert-attr: (".top-doc", {"open": ""})
 // To ensure that the toggle isn't over the text, we check that the toggle isn't clicked.
 click: (3, 240)
-assert: (".top-doc", "open", "")
+assert-attr: (".top-doc", {"open": ""})
diff --git a/src/test/rustdoc-gui/toggle-docs.goml b/src/test/rustdoc-gui/toggle-docs.goml
index 062bc7d51e5..601998b7bd2 100644
--- a/src/test/rustdoc-gui/toggle-docs.goml
+++ b/src/test/rustdoc-gui/toggle-docs.goml
@@ -1,10 +1,10 @@
 goto: file://|DOC_PATH|/test_docs/index.html
-assert: ("#main > details.top-doc", "open", "")
+assert-attr: ("#main > details.top-doc", {"open": ""})
 click: "#toggle-all-docs"
 wait-for: 1000
 // This is now collapsed so there shouldn't be the "open" attribute on details.
-assert-false: ("#main > details.top-doc", "open", "")
+assert-attr-false: ("#main > details.top-doc", {"open": ""})
 click: "#toggle-all-docs"
 wait-for: 1000
 // Not collapsed anymore so the "open" attribute should be back.
-assert: ("#main > details.top-doc", "open", "")
+assert-attr: ("#main > details.top-doc", {"open": ""})
diff --git a/src/test/rustdoc-gui/toggled-open-implementations.goml b/src/test/rustdoc-gui/toggled-open-implementations.goml
index 96a5492edef..d8615c207b2 100644
--- a/src/test/rustdoc-gui/toggled-open-implementations.goml
+++ b/src/test/rustdoc-gui/toggled-open-implementations.goml
@@ -2,4 +2,4 @@
 // has all the implementations toggled open by default, so users can
 // find method names in those implementations with Ctrl-F.
 goto: file://|DOC_PATH|/test_docs/struct.Foo.html
-assert: (".rustdoc-toggle.implementors-toggle", "open", "")
+assert-attr: (".rustdoc-toggle.implementors-toggle", {"open": ""})
diff --git a/src/test/rustdoc-gui/trait-sidebar-item-order.goml b/src/test/rustdoc-gui/trait-sidebar-item-order.goml
index 2e9f85336ec..739745792c2 100644
--- a/src/test/rustdoc-gui/trait-sidebar-item-order.goml
+++ b/src/test/rustdoc-gui/trait-sidebar-item-order.goml
@@ -1,7 +1,7 @@
 goto: file://|DOC_PATH|/test_docs/trait.AnotherOne.html
-assert: (".sidebar-links a:nth-of-type(1)", "another")
-assert: (".sidebar-links a:nth-of-type(2)", "func1")
-assert: (".sidebar-links a:nth-of-type(3)", "func2")
-assert: (".sidebar-links a:nth-of-type(4)", "func3")
-assert: (".sidebar-links a:nth-of-type(5)", "hello")
-assert: (".sidebar-links a:nth-of-type(6)", "why_not")
+assert-text: (".sidebar-links a:nth-of-type(1)", "another")
+assert-text: (".sidebar-links a:nth-of-type(2)", "func1")
+assert-text: (".sidebar-links a:nth-of-type(3)", "func2")
+assert-text: (".sidebar-links a:nth-of-type(4)", "func3")
+assert-text: (".sidebar-links a:nth-of-type(5)", "hello")
+assert-text: (".sidebar-links a:nth-of-type(6)", "why_not")
diff --git a/src/test/rustdoc/const-display.rs b/src/test/rustdoc/const-display.rs
index 2761f92ef57..8c995b9426b 100644
--- a/src/test/rustdoc/const-display.rs
+++ b/src/test/rustdoc/const-display.rs
@@ -7,12 +7,20 @@
 #![feature(foo, foo2)]
 #![feature(staged_api)]
 
-// @has 'foo/fn.foo.html' '//pre' 'pub unsafe fn foo() -> u32'
+// @has 'foo/fn.foo.html' '//pre' 'pub fn foo() -> u32'
+// @has - '//span[@class="since"]' '1.0.0 (const: unstable)'
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_const_unstable(feature="foo", issue = "none")]
-pub const unsafe fn foo() -> u32 { 42 }
+pub const fn foo() -> u32 { 42 }
+
+// @has 'foo/fn.foo_unsafe.html' '//pre' 'pub unsafe fn foo_unsafe() -> u32'
+// @has - '//span[@class="since"]' '1.0.0 (const: unstable)'
+#[stable(feature = "rust1", since = "1.0.0")]
+#[rustc_const_unstable(feature="foo", issue = "none")]
+pub const unsafe fn foo_unsafe() -> u32 { 42 }
 
 // @has 'foo/fn.foo2.html' '//pre' 'pub const fn foo2() -> u32'
+// @!has - '//span[@class="since"]'
 #[unstable(feature = "humans", issue = "none")]
 pub const fn foo2() -> u32 { 42 }
 
@@ -22,7 +30,9 @@ pub const fn foo2() -> u32 { 42 }
 #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
 pub const fn bar2() -> u32 { 42 }
 
+
 // @has 'foo/fn.foo2_gated.html' '//pre' 'pub const unsafe fn foo2_gated() -> u32'
+// @!has - '//span[@class="since"]'
 #[unstable(feature = "foo2", issue = "none")]
 pub const unsafe fn foo2_gated() -> u32 { 42 }
 
@@ -33,15 +43,23 @@ pub const unsafe fn foo2_gated() -> u32 { 42 }
 pub const unsafe fn bar2_gated() -> u32 { 42 }
 
 // @has 'foo/fn.bar_not_gated.html' '//pre' 'pub const unsafe fn bar_not_gated() -> u32'
+// @!has - '//span[@class="since"]'
 pub const unsafe fn bar_not_gated() -> u32 { 42 }
 
 pub struct Foo;
 
 impl Foo {
-    // @has 'foo/struct.Foo.html' '//div[@id="method.gated"]/code' 'pub unsafe fn gated() -> u32'
+    // @has 'foo/struct.Foo.html' '//div[@id="method.gated"]/code' 'pub fn gated() -> u32'
+    // @has - '//span[@class="since"]' '1.0.0 (const: unstable)'
+    #[stable(feature = "rust1", since = "1.0.0")]
+    #[rustc_const_unstable(feature="foo", issue = "none")]
+    pub const fn gated() -> u32 { 42 }
+
+    // @has 'foo/struct.Foo.html' '//div[@id="method.gated_unsafe"]/code' 'pub unsafe fn gated_unsafe() -> u32'
+    // @has - '//span[@class="since"]' '1.0.0 (const: unstable)'
     #[stable(feature = "rust1", since = "1.0.0")]
     #[rustc_const_unstable(feature="foo", issue = "none")]
-    pub const unsafe fn gated() -> u32 { 42 }
+    pub const unsafe fn gated_unsafe() -> u32 { 42 }
 
     // @has 'foo/struct.Foo.html' '//div[@id="method.stable_impl"]/code' 'pub const fn stable_impl() -> u32'
     // @has - '//span[@class="since"]' '1.0.0 (const: 1.2.0)'
diff --git a/src/test/rustdoc/intra-doc/type-alias.rs b/src/test/rustdoc/intra-doc/type-alias.rs
new file mode 100644
index 00000000000..f3609ccd0a1
--- /dev/null
+++ b/src/test/rustdoc/intra-doc/type-alias.rs
@@ -0,0 +1,19 @@
+// Regression test for issue #86120.
+
+#![deny(broken_intra_doc_links)]
+#![crate_name = "foo"]
+
+pub struct Foo;
+
+/// You should really try [`Self::bar`]!
+pub type Bar = Foo;
+
+impl Bar {
+    pub fn bar() {}
+}
+
+/// The minimum is [`Self::MIN`].
+pub type Int = i32;
+
+// @has foo/type.Bar.html '//a[@href="struct.Foo.html#method.bar"]' 'Self::bar'
+// @has foo/type.Int.html '//a[@href="{{channel}}/std/primitive.i32.html#associatedconstant.MIN"]' 'Self::MIN'
diff --git a/src/test/ui/array-slice-vec/slice-panic-1.rs b/src/test/ui/array-slice-vec/slice-panic-1.rs
index 8b27d055e2b..4134c623778 100644
--- a/src/test/ui/array-slice-vec/slice-panic-1.rs
+++ b/src/test/ui/array-slice-vec/slice-panic-1.rs
@@ -17,7 +17,7 @@ impl Drop for Foo {
 
 fn foo() {
     let x: &[_] = &[Foo, Foo];
-    &x[3..4];
+    let _ = &x[3..4];
 }
 
 fn main() {
diff --git a/src/test/ui/array-slice-vec/slice-panic-2.rs b/src/test/ui/array-slice-vec/slice-panic-2.rs
index 2ee564cadb3..2f7178fb3e1 100644
--- a/src/test/ui/array-slice-vec/slice-panic-2.rs
+++ b/src/test/ui/array-slice-vec/slice-panic-2.rs
@@ -21,7 +21,7 @@ fn bar() -> usize {
 
 fn foo() {
     let x: &[_] = &[Foo, Foo];
-    &x[3..bar()];
+    let _ = &x[3..bar()];
 }
 
 fn main() {
diff --git a/src/test/ui/array-slice-vec/slice.rs b/src/test/ui/array-slice-vec/slice.rs
index 14e1ddf52eb..a514e202773 100644
--- a/src/test/ui/array-slice-vec/slice.rs
+++ b/src/test/ui/array-slice-vec/slice.rs
@@ -67,14 +67,14 @@ impl IndexMut<RangeFull> for Foo {
 
 fn main() {
     let mut x = Foo;
-    &x[..];
-    &x[Foo..];
-    &x[..Foo];
-    &x[Foo..Foo];
-    &mut x[..];
-    &mut x[Foo..];
-    &mut x[..Foo];
-    &mut x[Foo..Foo];
+    let _ = &x[..];
+    let _ = &x[Foo..];
+    let _ = &x[..Foo];
+    let _ = &x[Foo..Foo];
+    let _ = &mut x[..];
+    let _ = &mut x[Foo..];
+    let _ = &mut x[..Foo];
+    let _ = &mut x[Foo..Foo];
     unsafe {
         assert_eq!(COUNT, 8);
     }
diff --git a/src/test/ui/const-generics/issues/issue-61432.rs b/src/test/ui/const-generics/issues/issue-61432.rs
index 0e228126d77..97ab07dacce 100644
--- a/src/test/ui/const-generics/issues/issue-61432.rs
+++ b/src/test/ui/const-generics/issues/issue-61432.rs
@@ -6,9 +6,9 @@ fn promote<const N: i32>() {
     // works:
     //
     // let n = N;
-    // &n;
+    // let _ = &n;
 
-    &N;
+    let _ = &N;
 }
 
 fn main() {
diff --git a/src/test/ui/consts/const-eval/dangling.rs b/src/test/ui/consts/const-eval/dangling.rs
index 45c429c7eb0..610531c7b4c 100644
--- a/src/test/ui/consts/const-eval/dangling.rs
+++ b/src/test/ui/consts/const-eval/dangling.rs
@@ -5,9 +5,8 @@ use std::mem;
 // Make sure we error with the right kind of error on a too large slice.
 const TEST: () = { unsafe {
     let slice: *const [u8] = mem::transmute((1usize, usize::MAX));
-    let _val = &*slice; //~ ERROR: any use of this value will cause an error
+    let _val = &*slice; //~ ERROR: evaluation of constant value failed
     //~| slice is bigger than largest supported object
-    //~| WARN this was previously accepted by the compiler but is being phased out
 } };
 
 fn main() {}
diff --git a/src/test/ui/consts/const-eval/dangling.stderr b/src/test/ui/consts/const-eval/dangling.stderr
index 224fbb62a46..5665a9c3e05 100644
--- a/src/test/ui/consts/const-eval/dangling.stderr
+++ b/src/test/ui/consts/const-eval/dangling.stderr
@@ -1,18 +1,9 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
   --> $DIR/dangling.rs:8:16
    |
-LL | / const TEST: () = { unsafe {
-LL | |     let slice: *const [u8] = mem::transmute((1usize, usize::MAX));
-LL | |     let _val = &*slice;
-   | |                ^^^^^^^ invalid metadata in wide pointer: slice is bigger than largest supported object
-LL | |
-LL | |
-LL | | } };
-   | |____-
-   |
-   = 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>
+LL |     let _val = &*slice;
+   |                ^^^^^^^ invalid metadata in wide pointer: slice is bigger than largest supported object
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/heap/alloc_intrinsic_errors.rs b/src/test/ui/consts/const-eval/heap/alloc_intrinsic_errors.rs
index 43d79badd72..4df541eeeb4 100644
--- a/src/test/ui/consts/const-eval/heap/alloc_intrinsic_errors.rs
+++ b/src/test/ui/consts/const-eval/heap/alloc_intrinsic_errors.rs
@@ -8,8 +8,7 @@ const FOO: i32 = foo();
 const fn foo() -> i32 {
     unsafe {
         let _ = intrinsics::const_allocate(4, 3) as * mut i32;
-        //~^ error: any use of this value will cause an error [const_err]
-        //~| WARN this was previously accepted by the compiler but is being phased out
+        //~^ error: evaluation of constant value failed
     }
     1
 
diff --git a/src/test/ui/consts/const-eval/heap/alloc_intrinsic_errors.stderr b/src/test/ui/consts/const-eval/heap/alloc_intrinsic_errors.stderr
index 3d529ab4ca6..327e2911205 100644
--- a/src/test/ui/consts/const-eval/heap/alloc_intrinsic_errors.stderr
+++ b/src/test/ui/consts/const-eval/heap/alloc_intrinsic_errors.stderr
@@ -1,19 +1,15 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
   --> $DIR/alloc_intrinsic_errors.rs:10:17
    |
 LL | const FOO: i32 = foo();
-   | -----------------------
+   |                  ----- inside `FOO` at $DIR/alloc_intrinsic_errors.rs:7:18
 ...
 LL |         let _ = intrinsics::const_allocate(4, 3) as * mut i32;
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                 |
    |                 align has to be a power of 2, `3` is not a power of 2
    |                 inside `foo` at $DIR/alloc_intrinsic_errors.rs:10:17
-   |                 inside `FOO` at $DIR/alloc_intrinsic_errors.rs:7:18
-   |
-   = 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: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/issue-49296.rs b/src/test/ui/consts/const-eval/issue-49296.rs
index f2d9758b8dc..baa1848e9c3 100644
--- a/src/test/ui/consts/const-eval/issue-49296.rs
+++ b/src/test/ui/consts/const-eval/issue-49296.rs
@@ -17,8 +17,7 @@ const fn wat(x: u64) -> &'static u64 {
     unsafe { transmute(&x) }
 }
 const X: u64 = *wat(42);
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 
 fn main() {
     println!("{}", X);
diff --git a/src/test/ui/consts/const-eval/issue-49296.stderr b/src/test/ui/consts/const-eval/issue-49296.stderr
index 0389471edb5..49ec9eb047b 100644
--- a/src/test/ui/consts/const-eval/issue-49296.stderr
+++ b/src/test/ui/consts/const-eval/issue-49296.stderr
@@ -1,14 +1,9 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
   --> $DIR/issue-49296.rs:19:16
    |
 LL | const X: u64 = *wat(42);
-   | ---------------^^^^^^^^-
-   |                |
-   |                pointer to alloc1 was dereferenced after this allocation got freed
-   |
-   = 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>
+   |                ^^^^^^^^ pointer to alloc1 was dereferenced after this allocation got freed
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/ub-incorrect-vtable.32bit.stderr b/src/test/ui/consts/const-eval/ub-incorrect-vtable.32bit.stderr
index 941f08bfd8d..ffde14f894e 100644
--- a/src/test/ui/consts/const-eval/ub-incorrect-vtable.32bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-incorrect-vtable.32bit.stderr
@@ -1,30 +1,17 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
   --> $DIR/ub-incorrect-vtable.rs:19:14
    |
-LL | / const INVALID_VTABLE_ALIGNMENT: &dyn Trait =
-LL | |     unsafe { std::mem::transmute((&92u8, &[0usize, 1usize, 1000usize])) };
-   | |______________^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^__-
-   |                |
-   |                invalid vtable: alignment `1000` is not a power of 2
-   |
-   = 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>
+LL |     unsafe { std::mem::transmute((&92u8, &[0usize, 1usize, 1000usize])) };
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid vtable: alignment `1000` is not a power of 2
 
-error: any use of this value will cause an error
-  --> $DIR/ub-incorrect-vtable.rs:25:14
-   |
-LL | / const INVALID_VTABLE_SIZE: &dyn Trait =
-LL | |     unsafe { std::mem::transmute((&92u8, &[1usize, usize::MAX, 1usize])) };
-   | |______________^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^__-
-   |                |
-   |                invalid vtable: size is bigger than largest supported object
+error[E0080]: evaluation of constant value failed
+  --> $DIR/ub-incorrect-vtable.rs:24:14
    |
-   = 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>
+LL |     unsafe { std::mem::transmute((&92u8, &[1usize, usize::MAX, 1usize])) };
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid vtable: size is bigger than largest supported object
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-incorrect-vtable.rs:36:1
+  --> $DIR/ub-incorrect-vtable.rs:34:1
    |
 LL | / const INVALID_VTABLE_ALIGNMENT_UB: W<&dyn Trait> =
 LL | |     unsafe { std::mem::transmute((&92u8, &(drop_me as fn(*mut usize), 1usize, 1000usize))) };
@@ -36,7 +23,7 @@ LL | |     unsafe { std::mem::transmute((&92u8, &(drop_me as fn(*mut usize), 1us
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-incorrect-vtable.rs:41:1
+  --> $DIR/ub-incorrect-vtable.rs:39:1
    |
 LL | / const INVALID_VTABLE_SIZE_UB: W<&dyn Trait> =
 LL | |     unsafe { std::mem::transmute((&92u8, &(drop_me as fn(*mut usize), usize::MAX, 1usize))) };
diff --git a/src/test/ui/consts/const-eval/ub-incorrect-vtable.64bit.stderr b/src/test/ui/consts/const-eval/ub-incorrect-vtable.64bit.stderr
index ceed6f8268d..2ad164a8c35 100644
--- a/src/test/ui/consts/const-eval/ub-incorrect-vtable.64bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-incorrect-vtable.64bit.stderr
@@ -1,30 +1,17 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
   --> $DIR/ub-incorrect-vtable.rs:19:14
    |
-LL | / const INVALID_VTABLE_ALIGNMENT: &dyn Trait =
-LL | |     unsafe { std::mem::transmute((&92u8, &[0usize, 1usize, 1000usize])) };
-   | |______________^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^__-
-   |                |
-   |                invalid vtable: alignment `1000` is not a power of 2
-   |
-   = 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>
+LL |     unsafe { std::mem::transmute((&92u8, &[0usize, 1usize, 1000usize])) };
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid vtable: alignment `1000` is not a power of 2
 
-error: any use of this value will cause an error
-  --> $DIR/ub-incorrect-vtable.rs:25:14
-   |
-LL | / const INVALID_VTABLE_SIZE: &dyn Trait =
-LL | |     unsafe { std::mem::transmute((&92u8, &[1usize, usize::MAX, 1usize])) };
-   | |______________^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^__-
-   |                |
-   |                invalid vtable: size is bigger than largest supported object
+error[E0080]: evaluation of constant value failed
+  --> $DIR/ub-incorrect-vtable.rs:24:14
    |
-   = 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>
+LL |     unsafe { std::mem::transmute((&92u8, &[1usize, usize::MAX, 1usize])) };
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid vtable: size is bigger than largest supported object
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-incorrect-vtable.rs:36:1
+  --> $DIR/ub-incorrect-vtable.rs:34:1
    |
 LL | / const INVALID_VTABLE_ALIGNMENT_UB: W<&dyn Trait> =
 LL | |     unsafe { std::mem::transmute((&92u8, &(drop_me as fn(*mut usize), 1usize, 1000usize))) };
@@ -36,7 +23,7 @@ LL | |     unsafe { std::mem::transmute((&92u8, &(drop_me as fn(*mut usize), 1us
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-incorrect-vtable.rs:41:1
+  --> $DIR/ub-incorrect-vtable.rs:39:1
    |
 LL | / const INVALID_VTABLE_SIZE_UB: W<&dyn Trait> =
 LL | |     unsafe { std::mem::transmute((&92u8, &(drop_me as fn(*mut usize), usize::MAX, 1usize))) };
diff --git a/src/test/ui/consts/const-eval/ub-incorrect-vtable.rs b/src/test/ui/consts/const-eval/ub-incorrect-vtable.rs
index 7c514e804e0..4ec853576c9 100644
--- a/src/test/ui/consts/const-eval/ub-incorrect-vtable.rs
+++ b/src/test/ui/consts/const-eval/ub-incorrect-vtable.rs
@@ -17,14 +17,12 @@ trait Trait {}
 
 const INVALID_VTABLE_ALIGNMENT: &dyn Trait =
     unsafe { std::mem::transmute((&92u8, &[0usize, 1usize, 1000usize])) };
-//~^ ERROR any use of this value will cause an error
-//~| WARNING this was previously accepted by the compiler
+//~^ ERROR evaluation of constant value failed
 //~| invalid vtable: alignment `1000` is not a power of 2
 
 const INVALID_VTABLE_SIZE: &dyn Trait =
     unsafe { std::mem::transmute((&92u8, &[1usize, usize::MAX, 1usize])) };
-//~^ ERROR any use of this value will cause an error
-//~| WARNING this was previously accepted by the compiler
+//~^ ERROR evaluation of constant value failed
 //~| invalid vtable: size is bigger than largest supported object
 
 #[repr(transparent)]
diff --git a/src/test/ui/consts/const-eval/ub-nonnull.32bit.stderr b/src/test/ui/consts/const-eval/ub-nonnull.32bit.stderr
index b68b9d6a180..9d3b88e803e 100644
--- a/src/test/ui/consts/const-eval/ub-nonnull.32bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-nonnull.32bit.stderr
@@ -9,29 +9,14 @@ LL | const NULL_PTR: NonNull<u8> = unsafe { mem::transmute(0usize) };
                00 00 00 00                                     │ ....
            }
 
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
   --> $DIR/ub-nonnull.rs:19:30
    |
-LL | / const OUT_OF_BOUNDS_PTR: NonNull<u8> = { unsafe {
-LL | |     let ptr: &[u8; 256] = mem::transmute(&0u8); // &0 gets promoted so it does not dangle
-LL | |     // Use address-of-element for pointer arithmetic. This could wrap around to null!
-LL | |     let out_of_bounds_ptr = &ptr[255];
-   | |                              ^^^^^^^^ memory access failed: pointer must be in-bounds at offset 256, but is outside bounds of alloc10 which has size 1
-LL | |
-LL | |     mem::transmute(out_of_bounds_ptr)
-LL | | } };
-   | |____-
-   |
-note: the lint level is defined here
-  --> $DIR/ub-nonnull.rs:15:8
-   |
-LL | #[deny(const_err)] // this triggers a `const_err` so validation does not even happen
-   |        ^^^^^^^^^
-   = 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>
+LL |     let out_of_bounds_ptr = &ptr[255];
+   |                              ^^^^^^^^ memory access failed: pointer must be in-bounds at offset 256, but is outside bounds of alloc10 which has size 1
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-nonnull.rs:24:1
+  --> $DIR/ub-nonnull.rs:23:1
    |
 LL | const NULL_U8: NonZeroU8 = unsafe { mem::transmute(0u8) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0, but expected something greater or equal to 1
@@ -42,7 +27,7 @@ LL | const NULL_U8: NonZeroU8 = unsafe { mem::transmute(0u8) };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-nonnull.rs:26:1
+  --> $DIR/ub-nonnull.rs:25:1
    |
 LL | const NULL_USIZE: NonZeroUsize = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0, but expected something greater or equal to 1
@@ -53,7 +38,7 @@ LL | const NULL_USIZE: NonZeroUsize = unsafe { mem::transmute(0usize) };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-nonnull.rs:34:1
+  --> $DIR/ub-nonnull.rs:33:1
    |
 LL | const UNINIT: NonZeroU8 = unsafe { MaybeUninit { uninit: () }.init };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .0: encountered uninitialized bytes, but expected initialized plain (non-pointer) bytes
@@ -64,7 +49,7 @@ LL | const UNINIT: NonZeroU8 = unsafe { MaybeUninit { uninit: () }.init };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-nonnull.rs:42:1
+  --> $DIR/ub-nonnull.rs:41:1
    |
 LL | const BAD_RANGE1: RestrictedRange1 = unsafe { RestrictedRange1(42) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 42, but expected something in the range 10..=30
@@ -75,7 +60,7 @@ LL | const BAD_RANGE1: RestrictedRange1 = unsafe { RestrictedRange1(42) };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-nonnull.rs:48:1
+  --> $DIR/ub-nonnull.rs:47:1
    |
 LL | const BAD_RANGE2: RestrictedRange2 = unsafe { RestrictedRange2(20) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 20, but expected something less or equal to 10, or greater or equal to 30
diff --git a/src/test/ui/consts/const-eval/ub-nonnull.64bit.stderr b/src/test/ui/consts/const-eval/ub-nonnull.64bit.stderr
index 687d96a1831..bc230374ebf 100644
--- a/src/test/ui/consts/const-eval/ub-nonnull.64bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-nonnull.64bit.stderr
@@ -9,29 +9,14 @@ LL | const NULL_PTR: NonNull<u8> = unsafe { mem::transmute(0usize) };
                00 00 00 00 00 00 00 00                         │ ........
            }
 
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
   --> $DIR/ub-nonnull.rs:19:30
    |
-LL | / const OUT_OF_BOUNDS_PTR: NonNull<u8> = { unsafe {
-LL | |     let ptr: &[u8; 256] = mem::transmute(&0u8); // &0 gets promoted so it does not dangle
-LL | |     // Use address-of-element for pointer arithmetic. This could wrap around to null!
-LL | |     let out_of_bounds_ptr = &ptr[255];
-   | |                              ^^^^^^^^ memory access failed: pointer must be in-bounds at offset 256, but is outside bounds of alloc10 which has size 1
-LL | |
-LL | |     mem::transmute(out_of_bounds_ptr)
-LL | | } };
-   | |____-
-   |
-note: the lint level is defined here
-  --> $DIR/ub-nonnull.rs:15:8
-   |
-LL | #[deny(const_err)] // this triggers a `const_err` so validation does not even happen
-   |        ^^^^^^^^^
-   = 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>
+LL |     let out_of_bounds_ptr = &ptr[255];
+   |                              ^^^^^^^^ memory access failed: pointer must be in-bounds at offset 256, but is outside bounds of alloc10 which has size 1
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-nonnull.rs:24:1
+  --> $DIR/ub-nonnull.rs:23:1
    |
 LL | const NULL_U8: NonZeroU8 = unsafe { mem::transmute(0u8) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0, but expected something greater or equal to 1
@@ -42,7 +27,7 @@ LL | const NULL_U8: NonZeroU8 = unsafe { mem::transmute(0u8) };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-nonnull.rs:26:1
+  --> $DIR/ub-nonnull.rs:25:1
    |
 LL | const NULL_USIZE: NonZeroUsize = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0, but expected something greater or equal to 1
@@ -53,7 +38,7 @@ LL | const NULL_USIZE: NonZeroUsize = unsafe { mem::transmute(0usize) };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-nonnull.rs:34:1
+  --> $DIR/ub-nonnull.rs:33:1
    |
 LL | const UNINIT: NonZeroU8 = unsafe { MaybeUninit { uninit: () }.init };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .0: encountered uninitialized bytes, but expected initialized plain (non-pointer) bytes
@@ -64,7 +49,7 @@ LL | const UNINIT: NonZeroU8 = unsafe { MaybeUninit { uninit: () }.init };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-nonnull.rs:42:1
+  --> $DIR/ub-nonnull.rs:41:1
    |
 LL | const BAD_RANGE1: RestrictedRange1 = unsafe { RestrictedRange1(42) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 42, but expected something in the range 10..=30
@@ -75,7 +60,7 @@ LL | const BAD_RANGE1: RestrictedRange1 = unsafe { RestrictedRange1(42) };
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-nonnull.rs:48:1
+  --> $DIR/ub-nonnull.rs:47:1
    |
 LL | const BAD_RANGE2: RestrictedRange2 = unsafe { RestrictedRange2(20) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 20, but expected something less or equal to 10, or greater or equal to 30
diff --git a/src/test/ui/consts/const-eval/ub-nonnull.rs b/src/test/ui/consts/const-eval/ub-nonnull.rs
index 75c02a8da19..259707b8028 100644
--- a/src/test/ui/consts/const-eval/ub-nonnull.rs
+++ b/src/test/ui/consts/const-eval/ub-nonnull.rs
@@ -16,8 +16,7 @@ const NULL_PTR: NonNull<u8> = unsafe { mem::transmute(0usize) };
 const OUT_OF_BOUNDS_PTR: NonNull<u8> = { unsafe {
     let ptr: &[u8; 256] = mem::transmute(&0u8); // &0 gets promoted so it does not dangle
     // Use address-of-element for pointer arithmetic. This could wrap around to null!
-    let out_of_bounds_ptr = &ptr[255]; //~ ERROR any use of this value will cause an error
-    //~| WARN this was previously accepted by the compiler but is being phased out
+    let out_of_bounds_ptr = &ptr[255]; //~ ERROR evaluation of constant value failed
     mem::transmute(out_of_bounds_ptr)
 } };
 
diff --git a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr
index ae9b9bfd281..0022d19e953 100644
--- a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr
+++ b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr
@@ -1,4 +1,4 @@
-warning: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
   --> $DIR/validate_uninhabited_zsts.rs:5:14
    |
 LL |     unsafe { std::mem::transmute(()) }
@@ -6,21 +6,12 @@ LL |     unsafe { std::mem::transmute(()) }
    |              |
    |              transmuting to uninhabited type
    |              inside `foo` at $DIR/validate_uninhabited_zsts.rs:5:14
-   |              inside `FOO` at $DIR/validate_uninhabited_zsts.rs:15:26
 ...
 LL | const FOO: [Empty; 3] = [foo(); 3];
-   | -----------------------------------
-   |
-note: the lint level is defined here
-  --> $DIR/validate_uninhabited_zsts.rs:14:8
-   |
-LL | #[warn(const_err)]
-   |        ^^^^^^^^^
-   = 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>
+   |                          ----- inside `FOO` at $DIR/validate_uninhabited_zsts.rs:14:26
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/validate_uninhabited_zsts.rs:18:1
+  --> $DIR/validate_uninhabited_zsts.rs:17:1
    |
 LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at [0]: encountered a value of uninhabited type Empty
@@ -41,7 +32,7 @@ LL |     unsafe { std::mem::transmute(()) }
    = note: the `!` type has no valid value
 
 warning: the type `Empty` does not permit zero-initialization
-  --> $DIR/validate_uninhabited_zsts.rs:18:35
+  --> $DIR/validate_uninhabited_zsts.rs:17:35
    |
 LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^
@@ -51,6 +42,6 @@ LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
    |
    = note: enums with no variants have no valid value
 
-error: aborting due to previous error; 3 warnings emitted
+error: aborting due to 2 previous errors; 2 warnings emitted
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr
index ae9b9bfd281..0022d19e953 100644
--- a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr
+++ b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr
@@ -1,4 +1,4 @@
-warning: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
   --> $DIR/validate_uninhabited_zsts.rs:5:14
    |
 LL |     unsafe { std::mem::transmute(()) }
@@ -6,21 +6,12 @@ LL |     unsafe { std::mem::transmute(()) }
    |              |
    |              transmuting to uninhabited type
    |              inside `foo` at $DIR/validate_uninhabited_zsts.rs:5:14
-   |              inside `FOO` at $DIR/validate_uninhabited_zsts.rs:15:26
 ...
 LL | const FOO: [Empty; 3] = [foo(); 3];
-   | -----------------------------------
-   |
-note: the lint level is defined here
-  --> $DIR/validate_uninhabited_zsts.rs:14:8
-   |
-LL | #[warn(const_err)]
-   |        ^^^^^^^^^
-   = 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>
+   |                          ----- inside `FOO` at $DIR/validate_uninhabited_zsts.rs:14:26
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/validate_uninhabited_zsts.rs:18:1
+  --> $DIR/validate_uninhabited_zsts.rs:17:1
    |
 LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at [0]: encountered a value of uninhabited type Empty
@@ -41,7 +32,7 @@ LL |     unsafe { std::mem::transmute(()) }
    = note: the `!` type has no valid value
 
 warning: the type `Empty` does not permit zero-initialization
-  --> $DIR/validate_uninhabited_zsts.rs:18:35
+  --> $DIR/validate_uninhabited_zsts.rs:17:35
    |
 LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^
@@ -51,6 +42,6 @@ LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
    |
    = note: enums with no variants have no valid value
 
-error: aborting due to previous error; 3 warnings emitted
+error: aborting due to 2 previous errors; 2 warnings emitted
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs
index 112ace5e97f..f6b6a1f53eb 100644
--- a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs
+++ b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs
@@ -3,9 +3,8 @@
 
 const fn foo() -> ! {
     unsafe { std::mem::transmute(()) }
-    //~^ WARN any use of this value will cause an error [const_err]
+    //~^ ERROR evaluation of constant value failed
     //~| WARN the type `!` does not permit zero-initialization [invalid_value]
-    //~| WARN this was previously accepted by the compiler but is being phased out
 }
 
 #[derive(Clone, Copy)]
diff --git a/src/test/ui/consts/const-int-unchecked.rs b/src/test/ui/consts/const-int-unchecked.rs
index 2ccc5d27bbb..902a668488b 100644
--- a/src/test/ui/consts/const-int-unchecked.rs
+++ b/src/test/ui/consts/const-int-unchecked.rs
@@ -13,186 +13,137 @@ use std::intrinsics;
 // unsigned types:
 
 const SHL_U8: u8 = unsafe { intrinsics::unchecked_shl(5_u8, 8) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHL_U16: u16 = unsafe { intrinsics::unchecked_shl(5_u16, 16) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHL_U32: u32 = unsafe { intrinsics::unchecked_shl(5_u32, 32) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHL_U64: u64 = unsafe { intrinsics::unchecked_shl(5_u64, 64) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHL_U128: u128 = unsafe { intrinsics::unchecked_shl(5_u128, 128) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 
 // signed types:
 
 const SHL_I8: i8 = unsafe { intrinsics::unchecked_shl(5_i8, 8) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHL_I16: i16 = unsafe { intrinsics::unchecked_shl(5_16, 16) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHL_I32: i32 = unsafe { intrinsics::unchecked_shl(5_i32, 32) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHL_I64: i64 = unsafe { intrinsics::unchecked_shl(5_i64, 64) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHL_I128: i128 = unsafe { intrinsics::unchecked_shl(5_i128, 128) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 
 // and make sure we capture y < 0:
 
 const SHL_I8_NEG: i8 = unsafe { intrinsics::unchecked_shl(5_i8, -1) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHL_I16_NEG: i16 = unsafe { intrinsics::unchecked_shl(5_16, -1) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHL_I32_NEG: i32 = unsafe { intrinsics::unchecked_shl(5_i32, -1) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHL_I64_NEG: i64 = unsafe { intrinsics::unchecked_shl(5_i64, -1) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHL_I128_NEG: i128 = unsafe { intrinsics::unchecked_shl(5_i128, -1) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 
 // and that there's no special relation to the value -1 by picking some
 // negative values at random:
 
 const SHL_I8_NEG_RANDOM: i8 = unsafe { intrinsics::unchecked_shl(5_i8, -6) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHL_I16_NEG_RANDOM: i16 = unsafe { intrinsics::unchecked_shl(5_16, -13) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHL_I32_NEG_RANDOM: i32 = unsafe { intrinsics::unchecked_shl(5_i32, -25) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHL_I64_NEG_RANDOM: i64 = unsafe { intrinsics::unchecked_shl(5_i64, -30) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHL_I128_NEG_RANDOM: i128 = unsafe { intrinsics::unchecked_shl(5_i128, -93) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 
 // Repeat it all over for `unchecked_shr`
 
 // unsigned types:
 
 const SHR_U8: u8 = unsafe { intrinsics::unchecked_shr(5_u8, 8) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHR_U16: u16 = unsafe { intrinsics::unchecked_shr(5_u16, 16) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHR_U32: u32 = unsafe { intrinsics::unchecked_shr(5_u32, 32) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHR_U64: u64 = unsafe { intrinsics::unchecked_shr(5_u64, 64) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHR_U128: u128 = unsafe { intrinsics::unchecked_shr(5_u128, 128) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 
 // signed types:
 
 const SHR_I8: i8 = unsafe { intrinsics::unchecked_shr(5_i8, 8) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHR_I16: i16 = unsafe { intrinsics::unchecked_shr(5_16, 16) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHR_I32: i32 = unsafe { intrinsics::unchecked_shr(5_i32, 32) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHR_I64: i64 = unsafe { intrinsics::unchecked_shr(5_i64, 64) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHR_I128: i128 = unsafe { intrinsics::unchecked_shr(5_i128, 128) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 
 // and make sure we capture y < 0:
 
 const SHR_I8_NEG: i8 = unsafe { intrinsics::unchecked_shr(5_i8, -1) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHR_I16_NEG: i16 = unsafe { intrinsics::unchecked_shr(5_16, -1) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHR_I32_NEG: i32 = unsafe { intrinsics::unchecked_shr(5_i32, -1) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHR_I64_NEG: i64 = unsafe { intrinsics::unchecked_shr(5_i64, -1) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHR_I128_NEG: i128 = unsafe { intrinsics::unchecked_shr(5_i128, -1) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 
 // and that there's no special relation to the value -1 by picking some
 // negative values at random:
 
 const SHR_I8_NEG_RANDOM: i8 = unsafe { intrinsics::unchecked_shr(5_i8, -6) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHR_I16_NEG_RANDOM: i16 = unsafe { intrinsics::unchecked_shr(5_16, -13) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHR_I32_NEG_RANDOM: i32 = unsafe { intrinsics::unchecked_shr(5_i32, -25) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHR_I64_NEG_RANDOM: i64 = unsafe { intrinsics::unchecked_shr(5_i64, -30) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const SHR_I128_NEG_RANDOM: i128 = unsafe { intrinsics::unchecked_shr(5_i128, -93) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 
 // Other arithmetic functions:
 
 const _: u16 = unsafe { std::intrinsics::unchecked_add(40000u16, 30000) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 
 const _: u32 = unsafe { std::intrinsics::unchecked_sub(14u32, 22) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 
 const _: u16 = unsafe { std::intrinsics::unchecked_mul(300u16, 250u16) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 
 const _: i32 = unsafe { std::intrinsics::unchecked_div(1, 0) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const _: i32 = unsafe { std::intrinsics::unchecked_div(i32::MIN, -1) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 
 const _: i32 = unsafe { std::intrinsics::unchecked_rem(1, 0) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const _: i32 = unsafe { std::intrinsics::unchecked_rem(i32::MIN, -1) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 
 // capture fault with zero value
 
 const _: u32 = unsafe { std::intrinsics::ctlz_nonzero(0) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 const _: u32 = unsafe { std::intrinsics::cttz_nonzero(0) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
 
 fn main() {}
diff --git a/src/test/ui/consts/const-int-unchecked.stderr b/src/test/ui/consts/const-int-unchecked.stderr
index 999b26543e2..22e8c8dabc9 100644
--- a/src/test/ui/consts/const-int-unchecked.stderr
+++ b/src/test/ui/consts/const-int-unchecked.stderr
@@ -1,542 +1,297 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
   --> $DIR/const-int-unchecked.rs:15:29
    |
 LL | const SHL_U8: u8 = unsafe { intrinsics::unchecked_shl(5_u8, 8) };
-   | ----------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                             |
-   |                             overflowing shift by 8 in `unchecked_shl`
-   |
-   = 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>
+   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 8 in `unchecked_shl`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:18:31
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:17:31
    |
 LL | const SHL_U16: u16 = unsafe { intrinsics::unchecked_shl(5_u16, 16) };
-   | ------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                               |
-   |                               overflowing shift by 16 in `unchecked_shl`
-   |
-   = 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>
+   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 16 in `unchecked_shl`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:21:31
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:19:31
    |
 LL | const SHL_U32: u32 = unsafe { intrinsics::unchecked_shl(5_u32, 32) };
-   | ------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                               |
-   |                               overflowing shift by 32 in `unchecked_shl`
-   |
-   = 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>
+   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 32 in `unchecked_shl`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:24:31
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:21:31
    |
 LL | const SHL_U64: u64 = unsafe { intrinsics::unchecked_shl(5_u64, 64) };
-   | ------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                               |
-   |                               overflowing shift by 64 in `unchecked_shl`
-   |
-   = 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>
+   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 64 in `unchecked_shl`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:27:33
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:23:33
    |
 LL | const SHL_U128: u128 = unsafe { intrinsics::unchecked_shl(5_u128, 128) };
-   | --------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                 |
-   |                                 overflowing shift by 128 in `unchecked_shl`
-   |
-   = 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>
+   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 128 in `unchecked_shl`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:33:29
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:28:29
    |
 LL | const SHL_I8: i8 = unsafe { intrinsics::unchecked_shl(5_i8, 8) };
-   | ----------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                             |
-   |                             overflowing shift by 8 in `unchecked_shl`
-   |
-   = 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>
+   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 8 in `unchecked_shl`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:36:31
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:30:31
    |
 LL | const SHL_I16: i16 = unsafe { intrinsics::unchecked_shl(5_16, 16) };
-   | ------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                               |
-   |                               overflowing shift by 16 in `unchecked_shl`
-   |
-   = 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>
+   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 16 in `unchecked_shl`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:39:31
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:32:31
    |
 LL | const SHL_I32: i32 = unsafe { intrinsics::unchecked_shl(5_i32, 32) };
-   | ------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                               |
-   |                               overflowing shift by 32 in `unchecked_shl`
-   |
-   = 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>
+   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 32 in `unchecked_shl`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:42:31
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:34:31
    |
 LL | const SHL_I64: i64 = unsafe { intrinsics::unchecked_shl(5_i64, 64) };
-   | ------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                               |
-   |                               overflowing shift by 64 in `unchecked_shl`
-   |
-   = 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>
+   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 64 in `unchecked_shl`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:45:33
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:36:33
    |
 LL | const SHL_I128: i128 = unsafe { intrinsics::unchecked_shl(5_i128, 128) };
-   | --------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                 |
-   |                                 overflowing shift by 128 in `unchecked_shl`
-   |
-   = 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>
+   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 128 in `unchecked_shl`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:51:33
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:41:33
    |
 LL | const SHL_I8_NEG: i8 = unsafe { intrinsics::unchecked_shl(5_i8, -1) };
-   | --------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                 |
-   |                                 overflowing shift by 255 in `unchecked_shl`
-   |
-   = 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>
+   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 255 in `unchecked_shl`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:54:35
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:43:35
    |
 LL | const SHL_I16_NEG: i16 = unsafe { intrinsics::unchecked_shl(5_16, -1) };
-   | ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                   |
-   |                                   overflowing shift by 65535 in `unchecked_shl`
-   |
-   = 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>
+   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 65535 in `unchecked_shl`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:57:35
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:45:35
    |
 LL | const SHL_I32_NEG: i32 = unsafe { intrinsics::unchecked_shl(5_i32, -1) };
-   | ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                   |
-   |                                   overflowing shift by 4294967295 in `unchecked_shl`
-   |
-   = 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>
+   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 4294967295 in `unchecked_shl`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:60:35
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:47:35
    |
 LL | const SHL_I64_NEG: i64 = unsafe { intrinsics::unchecked_shl(5_i64, -1) };
-   | ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                   |
-   |                                   overflowing shift by 18446744073709551615 in `unchecked_shl`
-   |
-   = 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>
+   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 18446744073709551615 in `unchecked_shl`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:63:37
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:49:37
    |
 LL | const SHL_I128_NEG: i128 = unsafe { intrinsics::unchecked_shl(5_i128, -1) };
-   | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                     |
-   |                                     overflowing shift by 340282366920938463463374607431768211455 in `unchecked_shl`
-   |
-   = 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>
+   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 340282366920938463463374607431768211455 in `unchecked_shl`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:70:40
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:55:40
    |
 LL | const SHL_I8_NEG_RANDOM: i8 = unsafe { intrinsics::unchecked_shl(5_i8, -6) };
-   | ---------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                        |
-   |                                        overflowing shift by 250 in `unchecked_shl`
-   |
-   = 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>
+   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 250 in `unchecked_shl`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:73:42
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:57:42
    |
 LL | const SHL_I16_NEG_RANDOM: i16 = unsafe { intrinsics::unchecked_shl(5_16, -13) };
-   | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                          |
-   |                                          overflowing shift by 65523 in `unchecked_shl`
-   |
-   = 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>
+   |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 65523 in `unchecked_shl`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:76:42
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:59:42
    |
 LL | const SHL_I32_NEG_RANDOM: i32 = unsafe { intrinsics::unchecked_shl(5_i32, -25) };
-   | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                          |
-   |                                          overflowing shift by 4294967271 in `unchecked_shl`
-   |
-   = 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>
+   |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 4294967271 in `unchecked_shl`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:79:42
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:61:42
    |
 LL | const SHL_I64_NEG_RANDOM: i64 = unsafe { intrinsics::unchecked_shl(5_i64, -30) };
-   | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                          |
-   |                                          overflowing shift by 18446744073709551586 in `unchecked_shl`
-   |
-   = 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>
+   |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 18446744073709551586 in `unchecked_shl`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:82:44
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:63:44
    |
 LL | const SHL_I128_NEG_RANDOM: i128 = unsafe { intrinsics::unchecked_shl(5_i128, -93) };
-   | -------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                            |
-   |                                            overflowing shift by 340282366920938463463374607431768211363 in `unchecked_shl`
-   |
-   = 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>
+   |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 340282366920938463463374607431768211363 in `unchecked_shl`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:90:29
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:70:29
    |
 LL | const SHR_U8: u8 = unsafe { intrinsics::unchecked_shr(5_u8, 8) };
-   | ----------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                             |
-   |                             overflowing shift by 8 in `unchecked_shr`
-   |
-   = 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>
+   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 8 in `unchecked_shr`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:93:31
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:72:31
    |
 LL | const SHR_U16: u16 = unsafe { intrinsics::unchecked_shr(5_u16, 16) };
-   | ------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                               |
-   |                               overflowing shift by 16 in `unchecked_shr`
-   |
-   = 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>
+   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 16 in `unchecked_shr`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:96:31
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:74:31
    |
 LL | const SHR_U32: u32 = unsafe { intrinsics::unchecked_shr(5_u32, 32) };
-   | ------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                               |
-   |                               overflowing shift by 32 in `unchecked_shr`
-   |
-   = 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>
+   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 32 in `unchecked_shr`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:99:31
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:76:31
    |
 LL | const SHR_U64: u64 = unsafe { intrinsics::unchecked_shr(5_u64, 64) };
-   | ------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                               |
-   |                               overflowing shift by 64 in `unchecked_shr`
-   |
-   = 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>
+   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 64 in `unchecked_shr`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:102:33
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:78:33
    |
 LL | const SHR_U128: u128 = unsafe { intrinsics::unchecked_shr(5_u128, 128) };
-   | --------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                 |
-   |                                 overflowing shift by 128 in `unchecked_shr`
-   |
-   = 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>
+   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 128 in `unchecked_shr`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:108:29
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:83:29
    |
 LL | const SHR_I8: i8 = unsafe { intrinsics::unchecked_shr(5_i8, 8) };
-   | ----------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                             |
-   |                             overflowing shift by 8 in `unchecked_shr`
-   |
-   = 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>
+   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 8 in `unchecked_shr`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:111:31
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:85:31
    |
 LL | const SHR_I16: i16 = unsafe { intrinsics::unchecked_shr(5_16, 16) };
-   | ------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                               |
-   |                               overflowing shift by 16 in `unchecked_shr`
-   |
-   = 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>
+   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 16 in `unchecked_shr`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:114:31
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:87:31
    |
 LL | const SHR_I32: i32 = unsafe { intrinsics::unchecked_shr(5_i32, 32) };
-   | ------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                               |
-   |                               overflowing shift by 32 in `unchecked_shr`
-   |
-   = 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>
+   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 32 in `unchecked_shr`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:117:31
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:89:31
    |
 LL | const SHR_I64: i64 = unsafe { intrinsics::unchecked_shr(5_i64, 64) };
-   | ------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                               |
-   |                               overflowing shift by 64 in `unchecked_shr`
-   |
-   = 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>
+   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 64 in `unchecked_shr`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:120:33
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:91:33
    |
 LL | const SHR_I128: i128 = unsafe { intrinsics::unchecked_shr(5_i128, 128) };
-   | --------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                 |
-   |                                 overflowing shift by 128 in `unchecked_shr`
-   |
-   = 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>
+   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 128 in `unchecked_shr`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:126:33
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:96:33
    |
 LL | const SHR_I8_NEG: i8 = unsafe { intrinsics::unchecked_shr(5_i8, -1) };
-   | --------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                 |
-   |                                 overflowing shift by 255 in `unchecked_shr`
-   |
-   = 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>
+   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 255 in `unchecked_shr`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:129:35
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:98:35
    |
 LL | const SHR_I16_NEG: i16 = unsafe { intrinsics::unchecked_shr(5_16, -1) };
-   | ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                   |
-   |                                   overflowing shift by 65535 in `unchecked_shr`
-   |
-   = 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>
+   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 65535 in `unchecked_shr`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:132:35
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:100:35
    |
 LL | const SHR_I32_NEG: i32 = unsafe { intrinsics::unchecked_shr(5_i32, -1) };
-   | ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                   |
-   |                                   overflowing shift by 4294967295 in `unchecked_shr`
-   |
-   = 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>
+   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 4294967295 in `unchecked_shr`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:135:35
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:102:35
    |
 LL | const SHR_I64_NEG: i64 = unsafe { intrinsics::unchecked_shr(5_i64, -1) };
-   | ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                   |
-   |                                   overflowing shift by 18446744073709551615 in `unchecked_shr`
-   |
-   = 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>
+   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 18446744073709551615 in `unchecked_shr`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:138:37
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:104:37
    |
 LL | const SHR_I128_NEG: i128 = unsafe { intrinsics::unchecked_shr(5_i128, -1) };
-   | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                     |
-   |                                     overflowing shift by 340282366920938463463374607431768211455 in `unchecked_shr`
-   |
-   = 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>
+   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 340282366920938463463374607431768211455 in `unchecked_shr`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:145:40
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:110:40
    |
 LL | const SHR_I8_NEG_RANDOM: i8 = unsafe { intrinsics::unchecked_shr(5_i8, -6) };
-   | ---------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                        |
-   |                                        overflowing shift by 250 in `unchecked_shr`
-   |
-   = 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>
+   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 250 in `unchecked_shr`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:148:42
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:112:42
    |
 LL | const SHR_I16_NEG_RANDOM: i16 = unsafe { intrinsics::unchecked_shr(5_16, -13) };
-   | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                          |
-   |                                          overflowing shift by 65523 in `unchecked_shr`
-   |
-   = 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>
+   |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 65523 in `unchecked_shr`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:151:42
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:114:42
    |
 LL | const SHR_I32_NEG_RANDOM: i32 = unsafe { intrinsics::unchecked_shr(5_i32, -25) };
-   | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                          |
-   |                                          overflowing shift by 4294967271 in `unchecked_shr`
-   |
-   = 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>
+   |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 4294967271 in `unchecked_shr`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:154:42
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:116:42
    |
 LL | const SHR_I64_NEG_RANDOM: i64 = unsafe { intrinsics::unchecked_shr(5_i64, -30) };
-   | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                          |
-   |                                          overflowing shift by 18446744073709551586 in `unchecked_shr`
-   |
-   = 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>
+   |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 18446744073709551586 in `unchecked_shr`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:157:44
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:118:44
    |
 LL | const SHR_I128_NEG_RANDOM: i128 = unsafe { intrinsics::unchecked_shr(5_i128, -93) };
-   | -------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                                            |
-   |                                            overflowing shift by 340282366920938463463374607431768211363 in `unchecked_shr`
-   |
-   = 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>
+   |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 340282366920938463463374607431768211363 in `unchecked_shr`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:163:25
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:123:25
    |
 LL | const _: u16 = unsafe { std::intrinsics::unchecked_add(40000u16, 30000) };
-   | ------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                         |
-   |                         overflow executing `unchecked_add`
-   |
-   = 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>
+   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflow executing `unchecked_add`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:167:25
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:126:25
    |
 LL | const _: u32 = unsafe { std::intrinsics::unchecked_sub(14u32, 22) };
-   | ------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                         |
-   |                         overflow executing `unchecked_sub`
-   |
-   = 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>
+   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflow executing `unchecked_sub`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:171:25
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:129:25
    |
 LL | const _: u16 = unsafe { std::intrinsics::unchecked_mul(300u16, 250u16) };
-   | ------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                         |
-   |                         overflow executing `unchecked_mul`
-   |
-   = 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>
+   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflow executing `unchecked_mul`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:175:25
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:132:25
    |
 LL | const _: i32 = unsafe { std::intrinsics::unchecked_div(1, 0) };
-   | ------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                         |
-   |                         dividing by zero
-   |
-   = 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>
+   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dividing by zero
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:178:25
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:134:25
    |
 LL | const _: i32 = unsafe { std::intrinsics::unchecked_div(i32::MIN, -1) };
-   | ------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                         |
-   |                         overflow executing `unchecked_div`
-   |
-   = 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>
+   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflow executing `unchecked_div`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:182:25
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:137:25
    |
 LL | const _: i32 = unsafe { std::intrinsics::unchecked_rem(1, 0) };
-   | ------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                         |
-   |                         calculating the remainder with a divisor of zero
-   |
-   = 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>
+   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calculating the remainder with a divisor of zero
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:185:25
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:139:25
    |
 LL | const _: i32 = unsafe { std::intrinsics::unchecked_rem(i32::MIN, -1) };
-   | ------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                         |
-   |                         overflow executing `unchecked_rem`
-   |
-   = 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>
+   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflow executing `unchecked_rem`
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:191:25
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:144:25
    |
 LL | const _: u32 = unsafe { std::intrinsics::ctlz_nonzero(0) };
-   | ------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                         |
-   |                         `ctlz_nonzero` called on 0
-   |
-   = 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>
+   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ctlz_nonzero` called on 0
 
-error: any use of this value will cause an error
-  --> $DIR/const-int-unchecked.rs:194:25
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-int-unchecked.rs:146:25
    |
 LL | const _: u32 = unsafe { std::intrinsics::cttz_nonzero(0) };
-   | ------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
-   |                         |
-   |                         `cttz_nonzero` called on 0
-   |
-   = 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>
+   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `cttz_nonzero` called on 0
 
 error: aborting due to 49 previous errors
 
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const_unsafe_unreachable_ub.rs b/src/test/ui/consts/const_unsafe_unreachable_ub.rs
index 4ae3a88c451..8cee5b50651 100644
--- a/src/test/ui/consts/const_unsafe_unreachable_ub.rs
+++ b/src/test/ui/consts/const_unsafe_unreachable_ub.rs
@@ -1,5 +1,4 @@
-// build-fail
-
+// error-pattern: evaluation of constant value failed
 #![feature(const_unreachable_unchecked)]
 
 const unsafe fn foo(x: bool) -> bool {
@@ -9,12 +8,8 @@ const unsafe fn foo(x: bool) -> bool {
     }
 }
 
-#[warn(const_err)]
 const BAR: bool = unsafe { foo(false) };
 
 fn main() {
   assert_eq!(BAR, true);
-  //~^ ERROR E0080
-  //~| ERROR erroneous constant
-  //~| WARN this was previously accepted by the compiler but is being phased out
 }
diff --git a/src/test/ui/consts/const_unsafe_unreachable_ub.stderr b/src/test/ui/consts/const_unsafe_unreachable_ub.stderr
index fc7a53e2774..ecdd0ca3f54 100644
--- a/src/test/ui/consts/const_unsafe_unreachable_ub.stderr
+++ b/src/test/ui/consts/const_unsafe_unreachable_ub.stderr
@@ -1,4 +1,4 @@
-warning: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/hint.rs:LL:COL
    |
 LL |     unsafe { intrinsics::unreachable() }
@@ -6,39 +6,15 @@ LL |     unsafe { intrinsics::unreachable() }
    |              |
    |              entering unreachable code
    |              inside `unreachable_unchecked` at $SRC_DIR/core/src/hint.rs:LL:COL
-   |              inside `foo` at $DIR/const_unsafe_unreachable_ub.rs:8:18
-   |              inside `BAR` at $DIR/const_unsafe_unreachable_ub.rs:13:28
    | 
-  ::: $DIR/const_unsafe_unreachable_ub.rs:13:1
+  ::: $DIR/const_unsafe_unreachable_ub.rs:7:18
    |
+LL |         false => std::hint::unreachable_unchecked(),
+   |                  ---------------------------------- inside `foo` at $DIR/const_unsafe_unreachable_ub.rs:7:18
+...
 LL | const BAR: bool = unsafe { foo(false) };
-   | ----------------------------------------
-   |
-note: the lint level is defined here
-  --> $DIR/const_unsafe_unreachable_ub.rs:12:8
-   |
-LL | #[warn(const_err)]
-   |        ^^^^^^^^^
-   = 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]: evaluation of constant value failed
-  --> $DIR/const_unsafe_unreachable_ub.rs:16:14
-   |
-LL |   assert_eq!(BAR, true);
-   |              ^^^ referenced constant has errors
-
-error: erroneous constant used
-  --> $DIR/const_unsafe_unreachable_ub.rs:16:3
-   |
-LL |   assert_eq!(BAR, true);
-   |   ^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
-   |
-   = 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>
-   = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+   |                            ---------- inside `BAR` at $DIR/const_unsafe_unreachable_ub.rs:11:28
 
-error: aborting due to 2 previous errors; 1 warning emitted
+error: aborting due to previous error
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/issue-39161-bogus-error.rs b/src/test/ui/consts/issue-39161-bogus-error.rs
new file mode 100644
index 00000000000..a954385da41
--- /dev/null
+++ b/src/test/ui/consts/issue-39161-bogus-error.rs
@@ -0,0 +1,13 @@
+// check-pass
+
+pub struct X {
+    pub a: i32,
+    pub b: i32,
+}
+
+fn main() {
+    const DX: X = X { a: 0, b: 0 };
+    const _X1: X = X { a: 1, ..DX };
+    let _x2 = X { a: 1, b: 2, ..DX };
+    const _X3: X = X { a: 1, b: 2, ..DX };
+}
diff --git a/src/test/ui/consts/offset_from_ub.rs b/src/test/ui/consts/offset_from_ub.rs
index b73191d56a6..f8fa2c5f177 100644
--- a/src/test/ui/consts/offset_from_ub.rs
+++ b/src/test/ui/consts/offset_from_ub.rs
@@ -1,5 +1,8 @@
 #![feature(const_raw_ptr_deref)]
 #![feature(const_ptr_offset_from)]
+#![feature(core_intrinsics)]
+
+use std::intrinsics::ptr_offset_from;
 
 #[repr(C)]
 struct Struct {
@@ -8,39 +11,38 @@ struct Struct {
 }
 
 pub const DIFFERENT_ALLOC: usize = {
-    //~^ NOTE
     let uninit = std::mem::MaybeUninit::<Struct>::uninit();
     let base_ptr: *const Struct = &uninit as *const _ as *const Struct;
     let uninit2 = std::mem::MaybeUninit::<Struct>::uninit();
     let field_ptr: *const Struct = &uninit2 as *const _ as *const Struct;
-    let offset = unsafe { field_ptr.offset_from(base_ptr) };
+    let offset = unsafe { ptr_offset_from(field_ptr, base_ptr) }; //~ERROR evaluation of constant value failed
+    //~| cannot compute offset of pointers into different allocations.
     offset as usize
 };
 
 pub const NOT_PTR: usize = {
-    //~^ NOTE
     unsafe { (42 as *const u8).offset_from(&5u8) as usize }
 };
 
 pub const NOT_MULTIPLE_OF_SIZE: isize = {
-    //~^ NOTE
     let data = [5u8, 6, 7];
     let base_ptr = data.as_ptr();
     let field_ptr = &data[1] as *const u8 as *const u16;
-    unsafe { field_ptr.offset_from(base_ptr as *const u16) }
+    unsafe { ptr_offset_from(field_ptr, base_ptr as *const u16) } //~ERROR evaluation of constant value failed
+    //~| 1_isize cannot be divided by 2_isize without remainder
 };
 
 pub const OFFSET_FROM_NULL: isize = {
-    //~^ NOTE
     let ptr = 0 as *const u8;
-    unsafe { ptr.offset_from(ptr) }
+    unsafe { ptr_offset_from(ptr, ptr) } //~ERROR evaluation of constant value failed
+    //~| null pointer is not a valid pointer
 };
 
 pub const DIFFERENT_INT: isize = { // offset_from with two different integers: like DIFFERENT_ALLOC
-    //~^ NOTE
     let ptr1 = 8 as *const u8;
     let ptr2 = 16 as *const u8;
-    unsafe { ptr2.offset_from(ptr1) }
+    unsafe { ptr_offset_from(ptr2, ptr1) } //~ERROR any use of this value will cause an error
+    //~| WARN previously accepted
 };
 
 fn main() {}
diff --git a/src/test/ui/consts/offset_from_ub.stderr b/src/test/ui/consts/offset_from_ub.stderr
index 4254cda2a00..4c2ba9297d8 100644
--- a/src/test/ui/consts/offset_from_ub.stderr
+++ b/src/test/ui/consts/offset_from_ub.stderr
@@ -1,27 +1,8 @@
-error: any use of this value will cause an error
-  --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-   |
-LL |           unsafe { intrinsics::ptr_offset_from(self, origin) }
-   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                    |
-   |                    ptr_offset_from cannot compute offset of pointers into different allocations.
-   |                    inside `ptr::const_ptr::<impl *const Struct>::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-   |                    inside `DIFFERENT_ALLOC` at $DIR/offset_from_ub.rs:16:27
-   | 
-  ::: $DIR/offset_from_ub.rs:10:1
+error[E0080]: evaluation of constant value failed
+  --> $DIR/offset_from_ub.rs:18:27
    |
-LL | / pub const DIFFERENT_ALLOC: usize = {
-LL | |
-LL | |     let uninit = std::mem::MaybeUninit::<Struct>::uninit();
-LL | |     let base_ptr: *const Struct = &uninit as *const _ as *const Struct;
-...  |
-LL | |     offset as usize
-LL | | };
-   | |__-
-   |
-   = 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>
+LL |     let offset = unsafe { ptr_offset_from(field_ptr, base_ptr) };
+   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ptr_offset_from cannot compute offset of pointers into different allocations.
 
 error: any use of this value will cause an error
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -31,82 +12,40 @@ LL |           unsafe { intrinsics::ptr_offset_from(self, origin) }
    |                    |
    |                    unable to turn bytes into a pointer
    |                    inside `ptr::const_ptr::<impl *const u8>::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-   |                    inside `NOT_PTR` at $DIR/offset_from_ub.rs:22:14
+   |                    inside `NOT_PTR` at $DIR/offset_from_ub.rs:24:14
    | 
-  ::: $DIR/offset_from_ub.rs:20:1
+  ::: $DIR/offset_from_ub.rs:23:1
    |
 LL | / pub const NOT_PTR: usize = {
-LL | |
 LL | |     unsafe { (42 as *const u8).offset_from(&5u8) as usize }
 LL | | };
    | |__-
    |
+   = 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
-  --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-   |
-LL |           unsafe { intrinsics::ptr_offset_from(self, origin) }
-   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                    |
-   |                    exact_div: 1_isize cannot be divided by 2_isize without remainder
-   |                    inside `ptr::const_ptr::<impl *const u16>::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-   |                    inside `NOT_MULTIPLE_OF_SIZE` at $DIR/offset_from_ub.rs:30:14
-   | 
-  ::: $DIR/offset_from_ub.rs:25:1
-   |
-LL | / pub const NOT_MULTIPLE_OF_SIZE: isize = {
-LL | |
-LL | |     let data = [5u8, 6, 7];
-LL | |     let base_ptr = data.as_ptr();
-LL | |     let field_ptr = &data[1] as *const u8 as *const u16;
-LL | |     unsafe { field_ptr.offset_from(base_ptr as *const u16) }
-LL | | };
-   | |__-
+error[E0080]: evaluation of constant value failed
+  --> $DIR/offset_from_ub.rs:31:14
    |
-   = 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>
+LL |     unsafe { ptr_offset_from(field_ptr, base_ptr as *const u16) }
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ exact_div: 1_isize cannot be divided by 2_isize without remainder
 
-error: any use of this value will cause an error
-  --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-   |
-LL |           unsafe { intrinsics::ptr_offset_from(self, origin) }
-   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                    |
-   |                    null pointer is not a valid pointer for this operation
-   |                    inside `ptr::const_ptr::<impl *const u8>::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-   |                    inside `OFFSET_FROM_NULL` at $DIR/offset_from_ub.rs:36:14
-   | 
-  ::: $DIR/offset_from_ub.rs:33:1
-   |
-LL | / pub const OFFSET_FROM_NULL: isize = {
-LL | |
-LL | |     let ptr = 0 as *const u8;
-LL | |     unsafe { ptr.offset_from(ptr) }
-LL | | };
-   | |__-
+error[E0080]: evaluation of constant value failed
+  --> $DIR/offset_from_ub.rs:37:14
    |
-   = 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>
+LL |     unsafe { ptr_offset_from(ptr, ptr) }
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^ null pointer is not a valid pointer for this operation
 
 error: any use of this value will cause an error
-  --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-   |
-LL |           unsafe { intrinsics::ptr_offset_from(self, origin) }
-   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                    |
-   |                    unable to turn bytes into a pointer
-   |                    inside `ptr::const_ptr::<impl *const u8>::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-   |                    inside `DIFFERENT_INT` at $DIR/offset_from_ub.rs:43:14
-   | 
-  ::: $DIR/offset_from_ub.rs:39:1
+  --> $DIR/offset_from_ub.rs:44:14
    |
 LL | / pub const DIFFERENT_INT: isize = { // offset_from with two different integers: like DIFFERENT_ALLOC
-LL | |
 LL | |     let ptr1 = 8 as *const u8;
 LL | |     let ptr2 = 16 as *const u8;
-LL | |     unsafe { ptr2.offset_from(ptr1) }
+LL | |     unsafe { ptr_offset_from(ptr2, ptr1) }
+   | |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn bytes into a pointer
+LL | |
 LL | | };
    | |__-
    |
@@ -115,3 +54,4 @@ LL | | };
 
 error: aborting due to 5 previous errors
 
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/offset_ub.stderr b/src/test/ui/consts/offset_ub.stderr
index 45203d3e271..e25bef0624d 100644
--- a/src/test/ui/consts/offset_ub.stderr
+++ b/src/test/ui/consts/offset_ub.stderr
@@ -1,4 +1,4 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
 LL |         unsafe { intrinsics::offset(self, count) }
@@ -6,18 +6,13 @@ LL |         unsafe { intrinsics::offset(self, count) }
    |                  |
    |                  overflowing in-bounds pointer arithmetic
    |                  inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-   |                  inside `BEFORE_START` at $DIR/offset_ub.rs:6:46
    | 
-  ::: $DIR/offset_ub.rs:6:1
+  ::: $DIR/offset_ub.rs:6:46
    |
 LL | pub const BEFORE_START: *const u8 = unsafe { (&0u8 as *const u8).offset(-1) };
-   | ------------------------------------------------------------------------------
-   |
-   = 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>
+   |                                              ------------------------------ inside `BEFORE_START` at $DIR/offset_ub.rs:6:46
 
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
 LL |         unsafe { intrinsics::offset(self, count) }
@@ -25,17 +20,13 @@ LL |         unsafe { intrinsics::offset(self, count) }
    |                  |
    |                  pointer arithmetic failed: pointer must be in-bounds at offset 2, but is outside bounds of allocN which has size 1
    |                  inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-   |                  inside `AFTER_END` at $DIR/offset_ub.rs:7:43
    | 
-  ::: $DIR/offset_ub.rs:7:1
+  ::: $DIR/offset_ub.rs:7:43
    |
 LL | pub const AFTER_END: *const u8 = unsafe { (&0u8 as *const u8).offset(2) };
-   | --------------------------------------------------------------------------
-   |
-   = 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>
+   |                                           ----------------------------- inside `AFTER_END` at $DIR/offset_ub.rs:7:43
 
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
 LL |         unsafe { intrinsics::offset(self, count) }
@@ -43,17 +34,13 @@ LL |         unsafe { intrinsics::offset(self, count) }
    |                  |
    |                  pointer arithmetic failed: pointer must be in-bounds at offset 101, but is outside bounds of allocN which has size 100
    |                  inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-   |                  inside `AFTER_ARRAY` at $DIR/offset_ub.rs:8:45
    | 
-  ::: $DIR/offset_ub.rs:8:1
+  ::: $DIR/offset_ub.rs:8:45
    |
 LL | pub const AFTER_ARRAY: *const u8 = unsafe { [0u8; 100].as_ptr().offset(101) };
-   | ------------------------------------------------------------------------------
-   |
-   = 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>
+   |                                             ------------------------------- inside `AFTER_ARRAY` at $DIR/offset_ub.rs:8:45
 
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
 LL |         unsafe { intrinsics::offset(self, count) }
@@ -61,17 +48,13 @@ LL |         unsafe { intrinsics::offset(self, count) }
    |                  |
    |                  overflowing in-bounds pointer arithmetic
    |                  inside `ptr::const_ptr::<impl *const u16>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-   |                  inside `OVERFLOW` at $DIR/offset_ub.rs:10:43
    | 
-  ::: $DIR/offset_ub.rs:10:1
+  ::: $DIR/offset_ub.rs:10:43
    |
 LL | pub const OVERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::MAX) };
-   | ----------------------------------------------------------------------------------
-   |
-   = 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>
+   |                                           ------------------------------------- inside `OVERFLOW` at $DIR/offset_ub.rs:10:43
 
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
 LL |         unsafe { intrinsics::offset(self, count) }
@@ -79,17 +62,13 @@ LL |         unsafe { intrinsics::offset(self, count) }
    |                  |
    |                  overflowing in-bounds pointer arithmetic
    |                  inside `ptr::const_ptr::<impl *const u16>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-   |                  inside `UNDERFLOW` at $DIR/offset_ub.rs:11:44
    | 
-  ::: $DIR/offset_ub.rs:11:1
+  ::: $DIR/offset_ub.rs:11:44
    |
 LL | pub const UNDERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::MIN) };
-   | -----------------------------------------------------------------------------------
-   |
-   = 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>
+   |                                            ------------------------------------- inside `UNDERFLOW` at $DIR/offset_ub.rs:11:44
 
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
 LL |         unsafe { intrinsics::offset(self, count) }
@@ -97,17 +76,13 @@ LL |         unsafe { intrinsics::offset(self, count) }
    |                  |
    |                  overflowing in-bounds pointer arithmetic
    |                  inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-   |                  inside `OVERFLOW_ADDRESS_SPACE` at $DIR/offset_ub.rs:12:56
    | 
-  ::: $DIR/offset_ub.rs:12:1
+  ::: $DIR/offset_ub.rs:12:56
    |
 LL | pub const OVERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (usize::MAX as *const u8).offset(2) };
-   | ---------------------------------------------------------------------------------------------
-   |
-   = 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>
+   |                                                        ----------------------------------- inside `OVERFLOW_ADDRESS_SPACE` at $DIR/offset_ub.rs:12:56
 
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
 LL |         unsafe { intrinsics::offset(self, count) }
@@ -115,17 +90,13 @@ LL |         unsafe { intrinsics::offset(self, count) }
    |                  |
    |                  overflowing in-bounds pointer arithmetic
    |                  inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-   |                  inside `UNDERFLOW_ADDRESS_SPACE` at $DIR/offset_ub.rs:13:57
    | 
-  ::: $DIR/offset_ub.rs:13:1
+  ::: $DIR/offset_ub.rs:13:57
    |
 LL | pub const UNDERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (1 as *const u8).offset(-2) };
-   | --------------------------------------------------------------------------------------
-   |
-   = 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>
+   |                                                         --------------------------- inside `UNDERFLOW_ADDRESS_SPACE` at $DIR/offset_ub.rs:13:57
 
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
 LL |         unsafe { intrinsics::offset(self, count) }
@@ -133,15 +104,11 @@ LL |         unsafe { intrinsics::offset(self, count) }
    |                  |
    |                  pointer arithmetic failed: pointer must be in-bounds at offset 1, but is outside bounds of allocN which has size 0
    |                  inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-   |                  inside `ZERO_SIZED_ALLOC` at $DIR/offset_ub.rs:15:50
    | 
-  ::: $DIR/offset_ub.rs:15:1
+  ::: $DIR/offset_ub.rs:15:50
    |
 LL | pub const ZERO_SIZED_ALLOC: *const u8 = unsafe { [0u8; 0].as_ptr().offset(1) };
-   | -------------------------------------------------------------------------------
-   |
-   = 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>
+   |                                                  --------------------------- inside `ZERO_SIZED_ALLOC` at $DIR/offset_ub.rs:15:50
 
 error: any use of this value will cause an error
   --> $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
@@ -158,10 +125,11 @@ LL |         unsafe { intrinsics::offset(self, count) as *mut T }
 LL | pub const DANGLING: *const u8 = unsafe { ptr::NonNull::<u8>::dangling().as_ptr().offset(4) };
    | ---------------------------------------------------------------------------------------------
    |
+   = 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
+error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
 LL |         unsafe { intrinsics::offset(self, count) }
@@ -169,15 +137,11 @@ LL |         unsafe { intrinsics::offset(self, count) }
    |                  |
    |                  pointer arithmetic failed: 0x0 is not a valid pointer
    |                  inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-   |                  inside `NULL_OFFSET_ZERO` at $DIR/offset_ub.rs:19:50
    | 
-  ::: $DIR/offset_ub.rs:19:1
+  ::: $DIR/offset_ub.rs:19:50
    |
 LL | pub const NULL_OFFSET_ZERO: *const u8 = unsafe { ptr::null::<u8>().offset(0) };
-   | -------------------------------------------------------------------------------
-   |
-   = 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>
+   |                                                  --------------------------- inside `NULL_OFFSET_ZERO` at $DIR/offset_ub.rs:19:50
 
 error: any use of this value will cause an error
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -199,3 +163,4 @@ LL | pub const UNDERFLOW_ABS: *const u8 = unsafe { (usize::MAX as *const u8).off
 
 error: aborting due to 11 previous errors
 
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/ptr_comparisons.rs b/src/test/ui/consts/ptr_comparisons.rs
index 0306a55af4e..aa8f511e072 100644
--- a/src/test/ui/consts/ptr_comparisons.rs
+++ b/src/test/ui/consts/ptr_comparisons.rs
@@ -62,8 +62,8 @@ const _: *const usize = unsafe { (FOO as *const usize).offset(2) };
 
 const _: *const u8 =
     unsafe { std::ptr::addr_of!((*(FOO as *const usize as *const [u8; 1000]))[999]) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
+//~| pointer must be in-bounds
 
 const _: usize = unsafe { std::mem::transmute::<*const usize, usize>(FOO) + 4 };
 //~^ ERROR any use of this value will cause an error
diff --git a/src/test/ui/consts/ptr_comparisons.stderr b/src/test/ui/consts/ptr_comparisons.stderr
index 943de47879b..f00f40b3254 100644
--- a/src/test/ui/consts/ptr_comparisons.stderr
+++ b/src/test/ui/consts/ptr_comparisons.stderr
@@ -1,4 +1,4 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
 LL |         unsafe { intrinsics::offset(self, count) }
@@ -6,28 +6,17 @@ LL |         unsafe { intrinsics::offset(self, count) }
    |                  |
    |                  pointer arithmetic failed: pointer must be in-bounds at offset $TWO_WORDS, but is outside bounds of alloc2 which has size $WORD
    |                  inside `ptr::const_ptr::<impl *const usize>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-   |                  inside `_` at $DIR/ptr_comparisons.rs:61:34
    | 
-  ::: $DIR/ptr_comparisons.rs:61:1
+  ::: $DIR/ptr_comparisons.rs:61:34
    |
 LL | const _: *const usize = unsafe { (FOO as *const usize).offset(2) };
-   | -------------------------------------------------------------------
-   |
-   = 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>
+   |                                  ------------------------------- inside `_` at $DIR/ptr_comparisons.rs:61:34
 
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
   --> $DIR/ptr_comparisons.rs:64:33
    |
-LL | / const _: *const u8 =
-LL | |     unsafe { std::ptr::addr_of!((*(FOO as *const usize as *const [u8; 1000]))[999]) };
-   | |_________________________________^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^___-
-   |                                   |
-   |                                   memory access failed: pointer must be in-bounds at offset 1000, but is outside bounds of alloc2 which has size $WORD
-   |
-   = 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>
+LL |     unsafe { std::ptr::addr_of!((*(FOO as *const usize as *const [u8; 1000]))[999]) };
+   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: pointer must be in-bounds at offset 1000, but is outside bounds of alloc2 which has size $WORD
 
 error: any use of this value will cause an error
   --> $DIR/ptr_comparisons.rs:68:27
@@ -37,6 +26,7 @@ LL | const _: usize = unsafe { std::mem::transmute::<*const usize, usize>(FOO) +
    |                           |
    |                           cannot cast pointer to integer because it was not created by cast from integer
    |
+   = 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>
 
@@ -53,3 +43,4 @@ LL | const _: usize = unsafe { *std::mem::transmute::<&&usize, &usize>(&FOO) + 4
 
 error: aborting due to 4 previous errors
 
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/dynamically-sized-types/dst-index.rs b/src/test/ui/dynamically-sized-types/dst-index.rs
index 980d99a6d6c..8aa65bbfdc9 100644
--- a/src/test/ui/dynamically-sized-types/dst-index.rs
+++ b/src/test/ui/dynamically-sized-types/dst-index.rs
@@ -29,6 +29,6 @@ impl Index<usize> for T {
 
 fn main() {
     assert_eq!(&S[0], "hello");
-    &T[0];
+    let _ = &T[0];
     // let x = &x as &Debug;
 }
diff --git a/src/test/ui/error-codes/E0121.rs b/src/test/ui/error-codes/E0121.rs
index f8b4d61b323..98cd6d54c1f 100644
--- a/src/test/ui/error-codes/E0121.rs
+++ b/src/test/ui/error-codes/E0121.rs
@@ -2,5 +2,4 @@ fn foo() -> _ { 5 } //~ ERROR E0121
 
 static BAR: _ = "test"; //~ ERROR E0121
 
-fn main() {
-}
+fn main() {}
diff --git a/src/test/ui/function-pointer/function-pointer-comparison-issue-54685.rs b/src/test/ui/function-pointer/function-pointer-comparison-issue-54685.rs
new file mode 100644
index 00000000000..a036d10e639
--- /dev/null
+++ b/src/test/ui/function-pointer/function-pointer-comparison-issue-54685.rs
@@ -0,0 +1,31 @@
+// min-llvm-version: 12.0
+// compile-flags: -C opt-level=3
+// run-pass
+
+fn foo(_i: i32) -> i32 {
+    1
+}
+fn bar(_i: i32) -> i32 {
+    1
+}
+
+fn main() {
+    let x: fn(i32) -> i32 = foo;
+    let y: fn(i32) -> i32 = bar;
+
+    let s1;
+    if x == y {
+        s1 = "same".to_string();
+    } else {
+        s1 = format!("{:?}, {:?}", x, y);
+    }
+
+    let s2;
+    if x == y {
+        s2 = "same".to_string();
+    } else {
+        s2 = format!("{:?}, {:?}", x, y);
+    }
+
+    assert_eq!(s1, s2);
+}
diff --git a/src/test/ui/generator/too-live-local-in-immovable-gen.rs b/src/test/ui/generator/too-live-local-in-immovable-gen.rs
index 7f118c88e5e..e0b856db7a5 100644
--- a/src/test/ui/generator/too-live-local-in-immovable-gen.rs
+++ b/src/test/ui/generator/too-live-local-in-immovable-gen.rs
@@ -15,7 +15,7 @@ fn main() {
                 yield ();
                 4i32
             };
-            &a;
+            let _ = &a;
         };
     }
 }
diff --git a/src/test/ui/generator/too-live-local-in-immovable-gen.stderr b/src/test/ui/generator/too-live-local-in-immovable-gen.stderr
index 88dacff7b55..72a2bd4ebc5 100644
--- a/src/test/ui/generator/too-live-local-in-immovable-gen.stderr
+++ b/src/test/ui/generator/too-live-local-in-immovable-gen.stderr
@@ -6,7 +6,7 @@ LL | |             // Tests that the generator transformation finds out that `a`
 LL | |             // during the yield expression. Type checking will also compute liveness
 LL | |             // and it should also find out that `a` is not live.
 ...  |
-LL | |             &a;
+LL | |             let _ = &a;
 LL | |         };
    | |__________^
    |
diff --git a/src/test/ui/generator/yield-in-initializer.rs b/src/test/ui/generator/yield-in-initializer.rs
index 2f8754c9571..0cab36e5f28 100644
--- a/src/test/ui/generator/yield-in-initializer.rs
+++ b/src/test/ui/generator/yield-in-initializer.rs
@@ -11,7 +11,7 @@ fn main() {
                 yield;
                 true
             };
-            &opt;
+            let _ = &opt;
         }
     };
 }
diff --git a/src/test/ui/issues/issue-20644.rs b/src/test/ui/issues/issue-20644.rs
index 71c6746e0e0..1b90727fbc0 100644
--- a/src/test/ui/issues/issue-20644.rs
+++ b/src/test/ui/issues/issue-20644.rs
@@ -19,9 +19,7 @@ use std::path::Path;
 
 pub fn parse_summary<R: Read>(_: R, _: &Path) {
      let path_from_root = Path::new("");
-     Path::new(&iter::repeat("../")
-               .take(path_from_root.components().count() - 1)
-               .collect::<String>());
+     Path::new(&"../".repeat(path_from_root.components().count() - 1));
  }
 
 fn foo() {
diff --git a/src/test/ui/issues/issue-27895.rs b/src/test/ui/issues/issue-27895.rs
deleted file mode 100644
index 0018ac1bdf1..00000000000
--- a/src/test/ui/issues/issue-27895.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-fn main() {
-    let i = 5;
-    let index = 6;
-
-    match i {
-        0..=index => println!("winner"),
-        //~^ ERROR runtime values cannot be referenced in patterns
-        _ => println!("hello"),
-    }
-}
diff --git a/src/test/ui/issues/issue-27895.stderr b/src/test/ui/issues/issue-27895.stderr
deleted file mode 100644
index 55bd938b0bf..00000000000
--- a/src/test/ui/issues/issue-27895.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0080]: runtime values cannot be referenced in patterns
-  --> $DIR/issue-27895.rs:6:13
-   |
-LL |         0..=index => println!("winner"),
-   |             ^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/issues/issue-43205.rs b/src/test/ui/issues/issue-43205.rs
index 894a61f3eff..f47d5a347bb 100644
--- a/src/test/ui/issues/issue-43205.rs
+++ b/src/test/ui/issues/issue-43205.rs
@@ -1,5 +1,5 @@
 // run-pass
 fn main() {
-   &&[()][0];
+   let _ = &&[()][0];
    println!("{:?}", &[(),()][1]);
 }
diff --git a/src/test/ui/issues/issue-5280.rs b/src/test/ui/issues/issue-5280.rs
index 3c97dad6b14..5c5ce6c987a 100644
--- a/src/test/ui/issues/issue-5280.rs
+++ b/src/test/ui/issues/issue-5280.rs
@@ -9,7 +9,7 @@ trait FontTableTagConversions {
 
 impl FontTableTagConversions for FontTableTag {
   fn tag_to_string(self) {
-    &self;
+      let _ = &self;
   }
 }
 
diff --git a/src/test/ui/issues/issue-54696.rs b/src/test/ui/issues/issue-54696.rs
index d8408ed8549..15355d30db6 100644
--- a/src/test/ui/issues/issue-54696.rs
+++ b/src/test/ui/issues/issue-54696.rs
@@ -2,7 +2,7 @@
 
 fn main() {
     // We shouldn't promote this
-    &(main as fn() == main as fn());
+    let _ = &(main as fn() == main as fn());
     // Also check nested case
-    &(&(main as fn()) == &(main as fn()));
+    let _ = &(&(main as fn()) == &(main as fn()));
 }
diff --git a/src/test/ui/limits/issue-69485-var-size-diffs-too-large.stderr b/src/test/ui/limits/issue-69485-var-size-diffs-too-large.stderr
index c229458da47..f7923bd4743 100644
--- a/src/test/ui/limits/issue-69485-var-size-diffs-too-large.stderr
+++ b/src/test/ui/limits/issue-69485-var-size-diffs-too-large.stderr
@@ -1,8 +1,8 @@
 error: values of the type `[u8; 18446744073709551615]` are too big for the current architecture
-  --> $DIR/issue-69485-var-size-diffs-too-large.rs:6:12
+  --> $DIR/issue-69485-var-size-diffs-too-large.rs:6:5
    |
 LL |     Bug::V([0; !0]);
-   |            ^^^^^^^
+   |     ^^^^^^^^^^^^^^^
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/lint/unused-borrows.rs b/src/test/ui/lint/unused-borrows.rs
new file mode 100644
index 00000000000..4518522ae00
--- /dev/null
+++ b/src/test/ui/lint/unused-borrows.rs
@@ -0,0 +1,33 @@
+#![deny(unused_must_use)]
+
+fn foo(_: i32) -> bool { todo!() }
+
+fn bar() -> &'static i32 {
+    &42;
+    //~^ unused
+
+    &mut foo(42);
+    //~^ unused
+
+    &&42;
+    //~^ unused
+
+    &&mut 42;
+    //~^ unused
+
+    &mut &42;
+    //~^ unused
+
+    let _result = foo(4)
+        && foo(2); // Misplaced semi-colon (perhaps due to reordering of lines)
+    && foo(42);
+    //~^ unused
+
+    let _ = &42; // ok
+
+    &42 // ok
+}
+
+fn main() {
+    let _ = bar();
+}
diff --git a/src/test/ui/lint/unused-borrows.stderr b/src/test/ui/lint/unused-borrows.stderr
new file mode 100644
index 00000000000..24899fe992b
--- /dev/null
+++ b/src/test/ui/lint/unused-borrows.stderr
@@ -0,0 +1,44 @@
+error: unused borrow that must be used
+  --> $DIR/unused-borrows.rs:6:5
+   |
+LL |     &42;
+   |     ^^^
+   |
+note: the lint level is defined here
+  --> $DIR/unused-borrows.rs:1:9
+   |
+LL | #![deny(unused_must_use)]
+   |         ^^^^^^^^^^^^^^^
+
+error: unused borrow that must be used
+  --> $DIR/unused-borrows.rs:9:5
+   |
+LL |     &mut foo(42);
+   |     ^^^^^^^^^^^^
+
+error: unused borrow that must be used
+  --> $DIR/unused-borrows.rs:12:5
+   |
+LL |     &&42;
+   |     ^^^^
+
+error: unused borrow that must be used
+  --> $DIR/unused-borrows.rs:15:5
+   |
+LL |     &&mut 42;
+   |     ^^^^^^^^
+
+error: unused borrow that must be used
+  --> $DIR/unused-borrows.rs:18:5
+   |
+LL |     &mut &42;
+   |     ^^^^^^^^
+
+error: unused borrow that must be used
+  --> $DIR/unused-borrows.rs:23:5
+   |
+LL |     && foo(42);
+   |     ^^^^^^^^^^
+
+error: aborting due to 6 previous errors
+
diff --git a/src/test/ui/macros/issue-84632-eager-expansion-recursion-limit.rs b/src/test/ui/macros/issue-84632-eager-expansion-recursion-limit.rs
new file mode 100644
index 00000000000..9139775c805
--- /dev/null
+++ b/src/test/ui/macros/issue-84632-eager-expansion-recursion-limit.rs
@@ -0,0 +1,16 @@
+// Regression test for #84632: Recursion limit is ignored
+// for builtin macros that eagerly expands.
+
+#![recursion_limit = "15"]
+macro_rules! a {
+    () => ("");
+    (A) => (concat!("", a!()));
+    (A, $($A:ident),*) => (concat!("", a!($($A),*)))
+    //~^ ERROR recursion limit reached
+    //~| HELP consider adding
+}
+
+fn main() {
+    a!(A, A, A, A, A);
+    a!(A, A, A, A, A, A, A, A, A, A, A);
+}
diff --git a/src/test/ui/macros/issue-84632-eager-expansion-recursion-limit.stderr b/src/test/ui/macros/issue-84632-eager-expansion-recursion-limit.stderr
new file mode 100644
index 00000000000..e6067e33349
--- /dev/null
+++ b/src/test/ui/macros/issue-84632-eager-expansion-recursion-limit.stderr
@@ -0,0 +1,14 @@
+error: recursion limit reached while expanding `concat!`
+  --> $DIR/issue-84632-eager-expansion-recursion-limit.rs:8:28
+   |
+LL |     (A, $($A:ident),*) => (concat!("", a!($($A),*)))
+   |                            ^^^^^^^^^^^^^^^^^^^^^^^^
+...
+LL |     a!(A, A, A, A, A, A, A, A, A, A, A);
+   |     ------------------------------------ in this macro invocation
+   |
+   = help: consider adding a `#![recursion_limit="30"]` attribute to your crate (`issue_84632_eager_expansion_recursion_limit`)
+   = note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/macros/macro-or-patterns-back-compat.fixed b/src/test/ui/macros/macro-or-patterns-back-compat.fixed
index f829129d516..f4e81a6be2a 100644
--- a/src/test/ui/macros/macro-or-patterns-back-compat.fixed
+++ b/src/test/ui/macros/macro-or-patterns-back-compat.fixed
@@ -2,13 +2,22 @@
 
 #![deny(or_patterns_back_compat)]
 #![allow(unused_macros)]
-macro_rules! foo { ($x:pat_param | $y:pat) => {} } //~ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
-macro_rules! bar { ($($x:pat_param)+ | $($y:pat)+) => {} } //~ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
+
+macro_rules! foo { ($x:pat_param | $y:pat) => {} }
+//~^ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
+//~| WARN this was previously accepted
+macro_rules! bar { ($($x:pat_param)+ | $($y:pat)+) => {} }
+//~^ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
+//~| WARN this was previously accepted
 macro_rules! baz { ($x:pat_param | $y:pat_param) => {} } // should be ok
 macro_rules! qux { ($x:pat_param | $y:pat) => {} } // should be ok
-macro_rules! ogg { ($x:pat_param | $y:pat_param) => {} } //~ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
+macro_rules! ogg { ($x:pat_param | $y:pat_param) => {} }
+//~^ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
+//~| WARN this was previously accepted
 macro_rules! match_any {
-    ( $expr:expr , $( $( $pat:pat_param )|+ => $expr_arm:expr ),+ ) => { //~ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
+    ( $expr:expr , $( $( $pat:pat_param )|+ => $expr_arm:expr ),+ ) => {
+        //~^ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
+        //~| WARN this was previously accepted
         match $expr {
             $(
                 $( $pat => $expr_arm, )+
diff --git a/src/test/ui/macros/macro-or-patterns-back-compat.rs b/src/test/ui/macros/macro-or-patterns-back-compat.rs
index 1cdaa1cd631..49affdd38da 100644
--- a/src/test/ui/macros/macro-or-patterns-back-compat.rs
+++ b/src/test/ui/macros/macro-or-patterns-back-compat.rs
@@ -2,13 +2,22 @@
 
 #![deny(or_patterns_back_compat)]
 #![allow(unused_macros)]
-macro_rules! foo { ($x:pat | $y:pat) => {} } //~ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
-macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } //~ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
+
+macro_rules! foo { ($x:pat | $y:pat) => {} }
+//~^ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
+//~| WARN this was previously accepted
+macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} }
+//~^ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
+//~| WARN this was previously accepted
 macro_rules! baz { ($x:pat_param | $y:pat_param) => {} } // should be ok
 macro_rules! qux { ($x:pat_param | $y:pat) => {} } // should be ok
-macro_rules! ogg { ($x:pat | $y:pat_param) => {} } //~ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
+macro_rules! ogg { ($x:pat | $y:pat_param) => {} }
+//~^ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
+//~| WARN this was previously accepted
 macro_rules! match_any {
-    ( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => { //~ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
+    ( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => {
+        //~^ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
+        //~| WARN this was previously accepted
         match $expr {
             $(
                 $( $pat => $expr_arm, )+
diff --git a/src/test/ui/macros/macro-or-patterns-back-compat.stderr b/src/test/ui/macros/macro-or-patterns-back-compat.stderr
index 01d220dd0b1..62687eb36b8 100644
--- a/src/test/ui/macros/macro-or-patterns-back-compat.stderr
+++ b/src/test/ui/macros/macro-or-patterns-back-compat.stderr
@@ -1,5 +1,5 @@
 error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
-  --> $DIR/macro-or-patterns-back-compat.rs:5:21
+  --> $DIR/macro-or-patterns-back-compat.rs:6:21
    |
 LL | macro_rules! foo { ($x:pat | $y:pat) => {} }
    |                     ^^^^^^ help: use pat_param to preserve semantics: `$x:pat_param`
@@ -9,24 +9,35 @@ note: the lint level is defined here
    |
 LL | #![deny(or_patterns_back_compat)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+   = note: for more information, see issue #84869 <https://github.com/rust-lang/rust/issues/84869>
 
 error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
-  --> $DIR/macro-or-patterns-back-compat.rs:6:23
+  --> $DIR/macro-or-patterns-back-compat.rs:9:23
    |
 LL | macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} }
    |                       ^^^^^^ help: use pat_param to preserve semantics: `$x:pat_param`
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+   = note: for more information, see issue #84869 <https://github.com/rust-lang/rust/issues/84869>
 
 error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
-  --> $DIR/macro-or-patterns-back-compat.rs:9:21
+  --> $DIR/macro-or-patterns-back-compat.rs:14:21
    |
 LL | macro_rules! ogg { ($x:pat | $y:pat_param) => {} }
    |                     ^^^^^^ help: use pat_param to preserve semantics: `$x:pat_param`
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+   = note: for more information, see issue #84869 <https://github.com/rust-lang/rust/issues/84869>
 
 error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
-  --> $DIR/macro-or-patterns-back-compat.rs:11:26
+  --> $DIR/macro-or-patterns-back-compat.rs:18:26
    |
 LL |     ( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => {
    |                          ^^^^^^^^ help: use pat_param to preserve semantics: `$pat:pat_param`
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+   = note: for more information, see issue #84869 <https://github.com/rust-lang/rust/issues/84869>
 
 error: aborting due to 4 previous errors
 
diff --git a/src/test/ui/non-constant-in-const-path.rs b/src/test/ui/non-constant-in-const-path.rs
deleted file mode 100644
index 343bb98aeb6..00000000000
--- a/src/test/ui/non-constant-in-const-path.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-fn main() {
-    let x = 0;
-    match 1 {
-        0 ..= x => {}
-        //~^ ERROR runtime values cannot be referenced in patterns
-    };
-}
diff --git a/src/test/ui/non-constant-in-const-path.stderr b/src/test/ui/non-constant-in-const-path.stderr
deleted file mode 100644
index 5936f76b2e0..00000000000
--- a/src/test/ui/non-constant-in-const-path.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0080]: runtime values cannot be referenced in patterns
-  --> $DIR/non-constant-in-const-path.rs:4:15
-   |
-LL |         0 ..= x => {}
-   |               ^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/parser/expr-as-stmt.fixed b/src/test/ui/parser/expr-as-stmt.fixed
index 02816ef2791..c217ab9774f 100644
--- a/src/test/ui/parser/expr-as-stmt.fixed
+++ b/src/test/ui/parser/expr-as-stmt.fixed
@@ -1,4 +1,5 @@
 // run-rustfix
+// rustfix-only-machine-applicable
 #![allow(unused_variables)]
 #![allow(dead_code)]
 #![allow(unused_must_use)]
diff --git a/src/test/ui/parser/expr-as-stmt.rs b/src/test/ui/parser/expr-as-stmt.rs
index 93baa8278f8..b04025faaec 100644
--- a/src/test/ui/parser/expr-as-stmt.rs
+++ b/src/test/ui/parser/expr-as-stmt.rs
@@ -1,4 +1,5 @@
 // run-rustfix
+// rustfix-only-machine-applicable
 #![allow(unused_variables)]
 #![allow(dead_code)]
 #![allow(unused_must_use)]
diff --git a/src/test/ui/parser/expr-as-stmt.stderr b/src/test/ui/parser/expr-as-stmt.stderr
index 09a6d7cbeb1..067b7edc770 100644
--- a/src/test/ui/parser/expr-as-stmt.stderr
+++ b/src/test/ui/parser/expr-as-stmt.stderr
@@ -1,5 +1,5 @@
 error: expected expression, found `+`
-  --> $DIR/expr-as-stmt.rs:7:9
+  --> $DIR/expr-as-stmt.rs:8:9
    |
 LL |     {2} + {2}
    |     --- ^ expected expression
@@ -7,7 +7,7 @@ LL |     {2} + {2}
    |     help: parentheses are required to parse this as an expression: `({2})`
 
 error: expected expression, found `+`
-  --> $DIR/expr-as-stmt.rs:12:9
+  --> $DIR/expr-as-stmt.rs:13:9
    |
 LL |     {2} + 2
    |     --- ^ expected expression
@@ -15,7 +15,7 @@ LL |     {2} + 2
    |     help: parentheses are required to parse this as an expression: `({2})`
 
 error: expected expression, found `+`
-  --> $DIR/expr-as-stmt.rs:18:12
+  --> $DIR/expr-as-stmt.rs:19:12
    |
 LL |     { 42 } + foo;
    |     ------ ^ expected expression
@@ -23,7 +23,7 @@ LL |     { 42 } + foo;
    |     help: parentheses are required to parse this as an expression: `({ 42 })`
 
 error: expected expression, found `>`
-  --> $DIR/expr-as-stmt.rs:31:7
+  --> $DIR/expr-as-stmt.rs:32:7
    |
 LL |     } > 0
    |       ^ expected expression
@@ -36,7 +36,7 @@ LL |     }) > 0
    |
 
 error[E0308]: mismatched types
-  --> $DIR/expr-as-stmt.rs:7:6
+  --> $DIR/expr-as-stmt.rs:8:6
    |
 LL |     {2} + {2}
    |      ^ expected `()`, found integer
@@ -47,7 +47,7 @@ LL |     {return 2;} + {2}
    |      ^^^^^^  ^
 
 error[E0308]: mismatched types
-  --> $DIR/expr-as-stmt.rs:12:6
+  --> $DIR/expr-as-stmt.rs:13:6
    |
 LL |     {2} + 2
    |      ^ expected `()`, found integer
@@ -58,7 +58,7 @@ LL |     {return 2;} + 2
    |      ^^^^^^  ^
 
 error[E0308]: mismatched types
-  --> $DIR/expr-as-stmt.rs:18:7
+  --> $DIR/expr-as-stmt.rs:19:7
    |
 LL |     { 42 } + foo;
    |       ^^ expected `()`, found integer
@@ -69,7 +69,7 @@ LL |     { return 42; } + foo;
    |       ^^^^^^   ^
 
 error[E0308]: mismatched types
-  --> $DIR/expr-as-stmt.rs:24:7
+  --> $DIR/expr-as-stmt.rs:25:7
    |
 LL |     { 3 } * 3
    |       ^ expected `()`, found integer
@@ -80,7 +80,7 @@ LL |     { return 3; } * 3
    |       ^^^^^^  ^
 
 error[E0614]: type `{integer}` cannot be dereferenced
-  --> $DIR/expr-as-stmt.rs:24:11
+  --> $DIR/expr-as-stmt.rs:25:11
    |
 LL |     { 3 } * 3
    |     ----- ^^^
diff --git a/src/test/ui/pattern/issue-68394-let-pat-runtime-value.rs b/src/test/ui/pattern/issue-68394-let-pat-runtime-value.rs
deleted file mode 100644
index f10a7f2d8a5..00000000000
--- a/src/test/ui/pattern/issue-68394-let-pat-runtime-value.rs
+++ /dev/null
@@ -1,5 +0,0 @@
-fn main() {
-    let x = 255u8;
-    let 0u8..=x = 0;
-    //~^ ERROR runtime values cannot be referenced in patterns
-}
diff --git a/src/test/ui/pattern/issue-68394-let-pat-runtime-value.stderr b/src/test/ui/pattern/issue-68394-let-pat-runtime-value.stderr
deleted file mode 100644
index c1508bd71ff..00000000000
--- a/src/test/ui/pattern/issue-68394-let-pat-runtime-value.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0080]: runtime values cannot be referenced in patterns
-  --> $DIR/issue-68394-let-pat-runtime-value.rs:3:15
-   |
-LL |     let 0u8..=x = 0;
-   |               ^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/pattern/non-constant-in-const-path.rs b/src/test/ui/pattern/non-constant-in-const-path.rs
new file mode 100644
index 00000000000..3918485bacb
--- /dev/null
+++ b/src/test/ui/pattern/non-constant-in-const-path.rs
@@ -0,0 +1,18 @@
+// Checks if we emit `PatternError`s correctly.
+// This is also a regression test for #27895 and #68394.
+
+static FOO: u8 = 10;
+
+fn main() {
+    let x = 0;
+    let 0u8..=x = 0;
+    //~^ ERROR: runtime values cannot be referenced in patterns
+    let 0u8..=FOO = 0;
+    //~^ ERROR: statics cannot be referenced in patterns
+    match 1 {
+        0 ..= x => {}
+        //~^ ERROR: runtime values cannot be referenced in patterns
+        0 ..= FOO => {}
+        //~^ ERROR: statics cannot be referenced in patterns
+    };
+}
diff --git a/src/test/ui/pattern/non-constant-in-const-path.stderr b/src/test/ui/pattern/non-constant-in-const-path.stderr
new file mode 100644
index 00000000000..53c3974f780
--- /dev/null
+++ b/src/test/ui/pattern/non-constant-in-const-path.stderr
@@ -0,0 +1,28 @@
+error[E0080]: runtime values cannot be referenced in patterns
+  --> $DIR/non-constant-in-const-path.rs:8:15
+   |
+LL |     let 0u8..=x = 0;
+   |               ^
+
+error[E0158]: statics cannot be referenced in patterns
+  --> $DIR/non-constant-in-const-path.rs:10:15
+   |
+LL |     let 0u8..=FOO = 0;
+   |               ^^^
+
+error[E0080]: runtime values cannot be referenced in patterns
+  --> $DIR/non-constant-in-const-path.rs:13:15
+   |
+LL |         0 ..= x => {}
+   |               ^
+
+error[E0158]: statics cannot be referenced in patterns
+  --> $DIR/non-constant-in-const-path.rs:15:15
+   |
+LL |         0 ..= FOO => {}
+   |               ^^^
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0080, E0158.
+For more information about an error, try `rustc --explain E0080`.
diff --git a/src/test/ui/repr/issue-83505-repr-simd.rs b/src/test/ui/repr/issue-83505-repr-simd.rs
new file mode 100644
index 00000000000..280b771d015
--- /dev/null
+++ b/src/test/ui/repr/issue-83505-repr-simd.rs
@@ -0,0 +1,10 @@
+// Regression test for the ICE described in #83505.
+
+#![crate_type="lib"]
+
+#[repr(simd)]
+//~^ ERROR: attribute should be applied to a struct [E0517]
+//~| ERROR: unsupported representation for zero-variant enum [E0084]
+enum Es {}
+static CLs: Es;
+//~^ ERROR: free static item without body
diff --git a/src/test/ui/repr/issue-83505-repr-simd.stderr b/src/test/ui/repr/issue-83505-repr-simd.stderr
new file mode 100644
index 00000000000..f1390a65201
--- /dev/null
+++ b/src/test/ui/repr/issue-83505-repr-simd.stderr
@@ -0,0 +1,30 @@
+error: free static item without body
+  --> $DIR/issue-83505-repr-simd.rs:9:1
+   |
+LL | static CLs: Es;
+   | ^^^^^^^^^^^^^^-
+   |               |
+   |               help: provide a definition for the static: `= <expr>;`
+
+error[E0517]: attribute should be applied to a struct
+  --> $DIR/issue-83505-repr-simd.rs:5:8
+   |
+LL | #[repr(simd)]
+   |        ^^^^
+...
+LL | enum Es {}
+   | ---------- not a struct
+
+error[E0084]: unsupported representation for zero-variant enum
+  --> $DIR/issue-83505-repr-simd.rs:5:1
+   |
+LL | #[repr(simd)]
+   | ^^^^^^^^^^^^^
+...
+LL | enum Es {}
+   | ---------- zero-variant enum
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0084, E0517.
+For more information about an error, try `rustc --explain E0084`.
diff --git a/src/test/ui/rt-explody-panic-payloads.rs b/src/test/ui/rt-explody-panic-payloads.rs
new file mode 100644
index 00000000000..1d3a2ff8284
--- /dev/null
+++ b/src/test/ui/rt-explody-panic-payloads.rs
@@ -0,0 +1,30 @@
+// run-pass
+// ignore-emscripten no processes
+// ignore-sgx no processes
+// ignore-wasm32-bare no unwinding panic
+// ignore-avr no unwinding panic
+// ignore-nvptx64 no unwinding panic
+
+use std::env;
+use std::process::Command;
+
+struct Bomb;
+
+impl Drop for Bomb {
+    fn drop(&mut self) {
+        std::panic::panic_any(Bomb);
+    }
+}
+
+fn main() {
+    let args = env::args().collect::<Vec<_>>();
+    let output = match &args[..] {
+        [me] => Command::new(&me).arg("plant the").output(),
+        [..] => std::panic::panic_any(Bomb),
+    }.expect("running the command should have succeeded");
+    println!("{:#?}", output);
+    let stderr = std::str::from_utf8(&output.stderr);
+    assert!(stderr.map(|v| {
+        v.ends_with("drop of the panic payload panicked")
+    }).unwrap_or(false));
+}
diff --git a/src/test/ui/rust-2021/future-prelude-collision-imported.fixed b/src/test/ui/rust-2021/future-prelude-collision-imported.fixed
new file mode 100644
index 00000000000..4f8fd9b345b
--- /dev/null
+++ b/src/test/ui/rust-2021/future-prelude-collision-imported.fixed
@@ -0,0 +1,59 @@
+// run-rustfix
+// edition:2018
+// check-pass
+#![warn(future_prelude_collision)]
+#![allow(dead_code)]
+#![allow(unused_imports)]
+
+mod m {
+    pub trait TryIntoU32 {
+        fn try_into(self) -> Result<u32, ()>;
+    }
+
+    impl TryIntoU32 for u8 {
+        fn try_into(self) -> Result<u32, ()> {
+            Ok(self as u32)
+        }
+    }
+
+    pub trait AnotherTrick {}
+}
+
+mod a {
+    use crate::m::TryIntoU32;
+
+    fn main() {
+        // In this case, we can just use `TryIntoU32`
+        let _: u32 = TryIntoU32::try_into(3u8).unwrap();
+        //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+        //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+    }
+}
+
+mod b {
+    use crate::m::AnotherTrick as TryIntoU32;
+    use crate::m::TryIntoU32 as _;
+
+    fn main() {
+        // In this case, a `TryIntoU32::try_into` rewrite will not work, and we need to use
+        // the path `crate::m::TryIntoU32` (with which it was imported).
+        let _: u32 = crate::m::TryIntoU32::try_into(3u8).unwrap();
+        //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+        //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+    }
+}
+
+mod c {
+    use super::m::TryIntoU32 as _;
+    use crate::m::AnotherTrick as TryIntoU32;
+
+    fn main() {
+        // In this case, a `TryIntoU32::try_into` rewrite will not work, and we need to use
+        // the path `super::m::TryIntoU32` (with which it was imported).
+        let _: u32 = super::m::TryIntoU32::try_into(3u8).unwrap();
+        //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+        //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+    }
+}
+
+fn main() {}
diff --git a/src/test/ui/rust-2021/future-prelude-collision-imported.rs b/src/test/ui/rust-2021/future-prelude-collision-imported.rs
new file mode 100644
index 00000000000..2ce1be6151b
--- /dev/null
+++ b/src/test/ui/rust-2021/future-prelude-collision-imported.rs
@@ -0,0 +1,59 @@
+// run-rustfix
+// edition:2018
+// check-pass
+#![warn(future_prelude_collision)]
+#![allow(dead_code)]
+#![allow(unused_imports)]
+
+mod m {
+    pub trait TryIntoU32 {
+        fn try_into(self) -> Result<u32, ()>;
+    }
+
+    impl TryIntoU32 for u8 {
+        fn try_into(self) -> Result<u32, ()> {
+            Ok(self as u32)
+        }
+    }
+
+    pub trait AnotherTrick {}
+}
+
+mod a {
+    use crate::m::TryIntoU32;
+
+    fn main() {
+        // In this case, we can just use `TryIntoU32`
+        let _: u32 = 3u8.try_into().unwrap();
+        //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+        //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+    }
+}
+
+mod b {
+    use crate::m::AnotherTrick as TryIntoU32;
+    use crate::m::TryIntoU32 as _;
+
+    fn main() {
+        // In this case, a `TryIntoU32::try_into` rewrite will not work, and we need to use
+        // the path `crate::m::TryIntoU32` (with which it was imported).
+        let _: u32 = 3u8.try_into().unwrap();
+        //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+        //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+    }
+}
+
+mod c {
+    use super::m::TryIntoU32 as _;
+    use crate::m::AnotherTrick as TryIntoU32;
+
+    fn main() {
+        // In this case, a `TryIntoU32::try_into` rewrite will not work, and we need to use
+        // the path `super::m::TryIntoU32` (with which it was imported).
+        let _: u32 = 3u8.try_into().unwrap();
+        //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+        //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+    }
+}
+
+fn main() {}
diff --git a/src/test/ui/rust-2021/future-prelude-collision-imported.stderr b/src/test/ui/rust-2021/future-prelude-collision-imported.stderr
new file mode 100644
index 00000000000..3903cbfe824
--- /dev/null
+++ b/src/test/ui/rust-2021/future-prelude-collision-imported.stderr
@@ -0,0 +1,34 @@
+warning: trait method `try_into` will become ambiguous in Rust 2021
+  --> $DIR/future-prelude-collision-imported.rs:27:22
+   |
+LL |         let _: u32 = 3u8.try_into().unwrap();
+   |                      ^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(3u8)`
+   |
+note: the lint level is defined here
+  --> $DIR/future-prelude-collision-imported.rs:4:9
+   |
+LL | #![warn(future_prelude_collision)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+   = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+
+warning: trait method `try_into` will become ambiguous in Rust 2021
+  --> $DIR/future-prelude-collision-imported.rs:40:22
+   |
+LL |         let _: u32 = 3u8.try_into().unwrap();
+   |                      ^^^^^^^^^^^^^^ help: disambiguate the associated function: `crate::m::TryIntoU32::try_into(3u8)`
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+   = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+
+warning: trait method `try_into` will become ambiguous in Rust 2021
+  --> $DIR/future-prelude-collision-imported.rs:53:22
+   |
+LL |         let _: u32 = 3u8.try_into().unwrap();
+   |                      ^^^^^^^^^^^^^^ help: disambiguate the associated function: `super::m::TryIntoU32::try_into(3u8)`
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+   = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+
+warning: 3 warnings emitted
+
diff --git a/src/test/ui/rust-2021/future-prelude-collision-shadow.rs b/src/test/ui/rust-2021/future-prelude-collision-shadow.rs
new file mode 100644
index 00000000000..c9d2529341f
--- /dev/null
+++ b/src/test/ui/rust-2021/future-prelude-collision-shadow.rs
@@ -0,0 +1,32 @@
+// edition:2018
+#![warn(future_prelude_collision)]
+#![allow(dead_code)]
+#![allow(unused_imports)]
+
+mod m {
+    pub trait TryIntoU32 {
+        fn try_into(self) -> Result<u32, ()>;
+    }
+
+    impl TryIntoU32 for u8 {
+        fn try_into(self) -> Result<u32, ()> {
+            Ok(self as u32)
+        }
+    }
+
+    pub trait AnotherTrick {}
+}
+
+mod d {
+    use crate::m::AnotherTrick as TryIntoU32;
+    use crate::m::*;
+
+    fn main() {
+        // Here, `TryIntoU32` is imported but shadowed, but in that case we don't permit its methods
+        // to be available.
+        let _: u32 = 3u8.try_into().unwrap();
+        //~^ ERROR no method named `try_into` found for type `u8` in the current scope
+    }
+}
+
+fn main() {}
diff --git a/src/test/ui/rust-2021/future-prelude-collision-shadow.stderr b/src/test/ui/rust-2021/future-prelude-collision-shadow.stderr
new file mode 100644
index 00000000000..ad9b8af00e4
--- /dev/null
+++ b/src/test/ui/rust-2021/future-prelude-collision-shadow.stderr
@@ -0,0 +1,40 @@
+error[E0599]: no method named `try_into` found for type `u8` in the current scope
+  --> $DIR/future-prelude-collision-shadow.rs:27:26
+   |
+LL |         let _: u32 = 3u8.try_into().unwrap();
+   |                          ^^^^^^^^ method not found in `u8`
+   | 
+  ::: $SRC_DIR/core/src/convert/mod.rs:LL:COL
+   |
+LL |     fn try_into(self) -> Result<T, Self::Error>;
+   |        --------
+   |        |
+   |        the method is available for `Box<u8>` here
+   |        the method is available for `Pin<u8>` here
+   |        the method is available for `Arc<u8>` here
+   |        the method is available for `Rc<u8>` here
+   |
+   = help: items from traits can only be used if the trait is in scope
+   = note: the following traits are implemented but not in scope; perhaps add a `use` for one of them:
+           candidate #1: `use crate::m::TryIntoU32;`
+           candidate #2: `use std::convert::TryInto;`
+help: consider wrapping the receiver expression with the appropriate type
+   |
+LL |         let _: u32 = Box::new(3u8).try_into().unwrap();
+   |                      ^^^^^^^^^   ^
+help: consider wrapping the receiver expression with the appropriate type
+   |
+LL |         let _: u32 = Pin::new(3u8).try_into().unwrap();
+   |                      ^^^^^^^^^   ^
+help: consider wrapping the receiver expression with the appropriate type
+   |
+LL |         let _: u32 = Arc::new(3u8).try_into().unwrap();
+   |                      ^^^^^^^^^   ^
+help: consider wrapping the receiver expression with the appropriate type
+   |
+LL |         let _: u32 = Rc::new(3u8).try_into().unwrap();
+   |                      ^^^^^^^^   ^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/src/test/ui/rust-2021/future-prelude-collision.fixed b/src/test/ui/rust-2021/future-prelude-collision.fixed
new file mode 100644
index 00000000000..9ede9f3a2fb
--- /dev/null
+++ b/src/test/ui/rust-2021/future-prelude-collision.fixed
@@ -0,0 +1,96 @@
+// run-rustfix
+// edition:2018
+// check-pass
+#![warn(future_prelude_collision)]
+
+trait TryIntoU32 {
+    fn try_into(self) -> Result<u32, ()>;
+}
+
+impl TryIntoU32 for u8 {
+    fn try_into(self) -> Result<u32, ()> {
+        Ok(self as u32)
+    }
+}
+
+// needed for autoref test
+impl TryIntoU32 for &f32 {
+    fn try_into(self) -> Result<u32, ()> {
+        Ok(*self as u32)
+    }
+}
+
+trait TryFromU8: Sized {
+    fn try_from(x: u8) -> Result<Self, ()>;
+}
+
+impl TryFromU8 for u32 {
+    fn try_from(x: u8) -> Result<Self, ()> {
+        Ok(x as u32)
+    }
+}
+
+impl TryIntoU32 for *const u16 {
+    fn try_into(self) -> Result<u32, ()> {
+        Ok(unsafe { *self } as u32)
+    }
+}
+
+trait FromByteIterator {
+    fn from_iter<T>(iter: T) -> Self
+        where T: Iterator<Item = u8>;
+}
+
+impl FromByteIterator for Vec<u8> {
+    fn from_iter<T>(iter: T) -> Self
+        where T: Iterator<Item = u8>
+    {
+        iter.collect()
+    }
+}
+
+fn main() {
+    // test dot-call that will break in 2021 edition
+    let _: u32 = TryIntoU32::try_into(3u8).unwrap();
+    //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+    //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+
+    // test associated function call that will break in 2021 edition
+    let _ = <u32 as TryFromU8>::try_from(3u8).unwrap();
+    //~^ WARNING trait-associated function `try_from` will become ambiguous in Rust 2021
+    //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+
+    // test reverse turbofish too
+    let _ = <Vec<u8> as FromByteIterator>::from_iter(vec![1u8, 2, 3, 4, 5, 6].into_iter());
+    //~^ WARNING trait-associated function `from_iter` will become ambiguous in Rust 2021
+    //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+
+    // negative testing lint (this line should *not* emit a warning)
+    let _: u32 = TryFromU8::try_from(3u8).unwrap();
+
+    // test type omission
+    let _: u32 = <_ as TryFromU8>::try_from(3u8).unwrap();
+    //~^ WARNING trait-associated function `try_from` will become ambiguous in Rust 2021
+    //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+
+    // test autoderef
+    let _: u32 = TryIntoU32::try_into(*(&3u8)).unwrap();
+    //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+    //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+
+    // test autoref
+    let _: u32 = TryIntoU32::try_into(&3.0).unwrap();
+    //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+    //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+
+    let mut data = 3u16;
+    let mut_ptr = std::ptr::addr_of_mut!(data);
+    let _: u32 = TryIntoU32::try_into(mut_ptr as *const _).unwrap();
+    //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+    //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+
+    type U32Alias = u32;
+    let _ = <U32Alias as TryFromU8>::try_from(3u8).unwrap();
+    //~^ WARNING trait-associated function `try_from` will become ambiguous in Rust 2021
+    //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+}
diff --git a/src/test/ui/rust-2021/future-prelude-collision.rs b/src/test/ui/rust-2021/future-prelude-collision.rs
new file mode 100644
index 00000000000..914e910396a
--- /dev/null
+++ b/src/test/ui/rust-2021/future-prelude-collision.rs
@@ -0,0 +1,96 @@
+// run-rustfix
+// edition:2018
+// check-pass
+#![warn(future_prelude_collision)]
+
+trait TryIntoU32 {
+    fn try_into(self) -> Result<u32, ()>;
+}
+
+impl TryIntoU32 for u8 {
+    fn try_into(self) -> Result<u32, ()> {
+        Ok(self as u32)
+    }
+}
+
+// needed for autoref test
+impl TryIntoU32 for &f32 {
+    fn try_into(self) -> Result<u32, ()> {
+        Ok(*self as u32)
+    }
+}
+
+trait TryFromU8: Sized {
+    fn try_from(x: u8) -> Result<Self, ()>;
+}
+
+impl TryFromU8 for u32 {
+    fn try_from(x: u8) -> Result<Self, ()> {
+        Ok(x as u32)
+    }
+}
+
+impl TryIntoU32 for *const u16 {
+    fn try_into(self) -> Result<u32, ()> {
+        Ok(unsafe { *self } as u32)
+    }
+}
+
+trait FromByteIterator {
+    fn from_iter<T>(iter: T) -> Self
+        where T: Iterator<Item = u8>;
+}
+
+impl FromByteIterator for Vec<u8> {
+    fn from_iter<T>(iter: T) -> Self
+        where T: Iterator<Item = u8>
+    {
+        iter.collect()
+    }
+}
+
+fn main() {
+    // test dot-call that will break in 2021 edition
+    let _: u32 = 3u8.try_into().unwrap();
+    //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+    //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+
+    // test associated function call that will break in 2021 edition
+    let _ = u32::try_from(3u8).unwrap();
+    //~^ WARNING trait-associated function `try_from` will become ambiguous in Rust 2021
+    //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+
+    // test reverse turbofish too
+    let _ = <Vec<u8>>::from_iter(vec![1u8, 2, 3, 4, 5, 6].into_iter());
+    //~^ WARNING trait-associated function `from_iter` will become ambiguous in Rust 2021
+    //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+
+    // negative testing lint (this line should *not* emit a warning)
+    let _: u32 = TryFromU8::try_from(3u8).unwrap();
+
+    // test type omission
+    let _: u32 = <_>::try_from(3u8).unwrap();
+    //~^ WARNING trait-associated function `try_from` will become ambiguous in Rust 2021
+    //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+
+    // test autoderef
+    let _: u32 = (&3u8).try_into().unwrap();
+    //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+    //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+
+    // test autoref
+    let _: u32 = 3.0.try_into().unwrap();
+    //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+    //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+
+    let mut data = 3u16;
+    let mut_ptr = std::ptr::addr_of_mut!(data);
+    let _: u32 = mut_ptr.try_into().unwrap();
+    //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+    //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+
+    type U32Alias = u32;
+    let _ = U32Alias::try_from(3u8).unwrap();
+    //~^ WARNING trait-associated function `try_from` will become ambiguous in Rust 2021
+    //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+}
diff --git a/src/test/ui/rust-2021/future-prelude-collision.stderr b/src/test/ui/rust-2021/future-prelude-collision.stderr
new file mode 100644
index 00000000000..190145ef4db
--- /dev/null
+++ b/src/test/ui/rust-2021/future-prelude-collision.stderr
@@ -0,0 +1,79 @@
+warning: trait method `try_into` will become ambiguous in Rust 2021
+  --> $DIR/future-prelude-collision.rs:54:18
+   |
+LL |     let _: u32 = 3u8.try_into().unwrap();
+   |                  ^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(3u8)`
+   |
+note: the lint level is defined here
+  --> $DIR/future-prelude-collision.rs:4:9
+   |
+LL | #![warn(future_prelude_collision)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+   = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+
+warning: trait-associated function `try_from` will become ambiguous in Rust 2021
+  --> $DIR/future-prelude-collision.rs:59:13
+   |
+LL |     let _ = u32::try_from(3u8).unwrap();
+   |             ^^^^^^^^^^^^^ help: disambiguate the associated function: `<u32 as TryFromU8>::try_from`
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+   = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+
+warning: trait-associated function `from_iter` will become ambiguous in Rust 2021
+  --> $DIR/future-prelude-collision.rs:64:13
+   |
+LL |     let _ = <Vec<u8>>::from_iter(vec![1u8, 2, 3, 4, 5, 6].into_iter());
+   |             ^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<Vec<u8> as FromByteIterator>::from_iter`
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+   = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+
+warning: trait-associated function `try_from` will become ambiguous in Rust 2021
+  --> $DIR/future-prelude-collision.rs:72:18
+   |
+LL |     let _: u32 = <_>::try_from(3u8).unwrap();
+   |                  ^^^^^^^^^^^^^ help: disambiguate the associated function: `<_ as TryFromU8>::try_from`
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+   = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+
+warning: trait method `try_into` will become ambiguous in Rust 2021
+  --> $DIR/future-prelude-collision.rs:77:18
+   |
+LL |     let _: u32 = (&3u8).try_into().unwrap();
+   |                  ^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(*(&3u8))`
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+   = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+
+warning: trait method `try_into` will become ambiguous in Rust 2021
+  --> $DIR/future-prelude-collision.rs:82:18
+   |
+LL |     let _: u32 = 3.0.try_into().unwrap();
+   |                  ^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(&3.0)`
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+   = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+
+warning: trait method `try_into` will become ambiguous in Rust 2021
+  --> $DIR/future-prelude-collision.rs:88:18
+   |
+LL |     let _: u32 = mut_ptr.try_into().unwrap();
+   |                  ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(mut_ptr as *const _)`
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+   = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+
+warning: trait-associated function `try_from` will become ambiguous in Rust 2021
+  --> $DIR/future-prelude-collision.rs:93:13
+   |
+LL |     let _ = U32Alias::try_from(3u8).unwrap();
+   |             ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<U32Alias as TryFromU8>::try_from`
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+   = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+
+warning: 8 warnings emitted
+
diff --git a/src/test/ui/rust-2021/generic-type-collision.fixed b/src/test/ui/rust-2021/generic-type-collision.fixed
new file mode 100644
index 00000000000..00fb128a981
--- /dev/null
+++ b/src/test/ui/rust-2021/generic-type-collision.fixed
@@ -0,0 +1,18 @@
+// check-pass
+// run-rustfix
+// edition 2018
+#![warn(future_prelude_collision)]
+
+trait MyTrait<A> {
+    fn from_iter(x: Option<A>);
+}
+
+impl<T> MyTrait<()> for Vec<T> {
+    fn from_iter(_: Option<()>) {}
+}
+
+fn main() {
+    <Vec<i32> as MyTrait<_>>::from_iter(None);
+    //~^ WARNING trait-associated function `from_iter` will become ambiguous in Rust 2021
+    //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+}
diff --git a/src/test/ui/rust-2021/generic-type-collision.rs b/src/test/ui/rust-2021/generic-type-collision.rs
new file mode 100644
index 00000000000..406fba4d247
--- /dev/null
+++ b/src/test/ui/rust-2021/generic-type-collision.rs
@@ -0,0 +1,18 @@
+// check-pass
+// run-rustfix
+// edition 2018
+#![warn(future_prelude_collision)]
+
+trait MyTrait<A> {
+    fn from_iter(x: Option<A>);
+}
+
+impl<T> MyTrait<()> for Vec<T> {
+    fn from_iter(_: Option<()>) {}
+}
+
+fn main() {
+    <Vec<i32>>::from_iter(None);
+    //~^ WARNING trait-associated function `from_iter` will become ambiguous in Rust 2021
+    //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+}
diff --git a/src/test/ui/rust-2021/generic-type-collision.stderr b/src/test/ui/rust-2021/generic-type-collision.stderr
new file mode 100644
index 00000000000..9374379d247
--- /dev/null
+++ b/src/test/ui/rust-2021/generic-type-collision.stderr
@@ -0,0 +1,16 @@
+warning: trait-associated function `from_iter` will become ambiguous in Rust 2021
+  --> $DIR/generic-type-collision.rs:15:5
+   |
+LL |     <Vec<i32>>::from_iter(None);
+   |     ^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<Vec<i32> as MyTrait<_>>::from_iter`
+   |
+note: the lint level is defined here
+  --> $DIR/generic-type-collision.rs:4:9
+   |
+LL | #![warn(future_prelude_collision)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+   = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/rust-2021/inherent-dyn-collision.fixed b/src/test/ui/rust-2021/inherent-dyn-collision.fixed
new file mode 100644
index 00000000000..cbb6e9659df
--- /dev/null
+++ b/src/test/ui/rust-2021/inherent-dyn-collision.fixed
@@ -0,0 +1,53 @@
+// Test case where the method we want is an inherent method on a
+// dyn Trait. In that case, the fix is to insert `*` on the receiver.
+//
+// check-pass
+// run-rustfix
+// edition:2018
+
+#![warn(future_prelude_collision)]
+
+trait TryIntoU32 {
+    fn try_into(&self) -> Result<u32, ()>;
+}
+
+impl TryIntoU32 for u8 {
+    // note: &self
+    fn try_into(&self) -> Result<u32, ()> {
+        Ok(22)
+    }
+}
+
+mod inner {
+    use super::get_dyn_trait;
+
+    // note: this does nothing, but is copying from ffishim's problem of
+    // having a struct of the same name as the trait in-scope, while *also*
+    // implementing the trait for that struct but **without** importing the
+    // trait itself into scope
+    struct TryIntoU32;
+
+    impl super::TryIntoU32 for TryIntoU32 {
+        fn try_into(&self) -> Result<u32, ()> {
+            Ok(0)
+        }
+    }
+
+    // this is where the gross part happens. since `get_dyn_trait` returns
+    // a Box<dyn Trait>, it can still call the method for `dyn Trait` without
+    // `Trait` being in-scope. it might even be possible to make the trait itself
+    // entirely unreference-able from the callsite?
+    pub fn test() -> u32 {
+        (&*get_dyn_trait()).try_into().unwrap()
+        //~^ WARNING trait method `try_into` will become ambiguous
+        //~| WARNING this was previously accepted
+    }
+}
+
+fn get_dyn_trait() -> Box<dyn TryIntoU32> {
+    Box::new(3u8) as Box<dyn TryIntoU32>
+}
+
+fn main() {
+    dbg!(inner::test());
+}
diff --git a/src/test/ui/rust-2021/inherent-dyn-collision.rs b/src/test/ui/rust-2021/inherent-dyn-collision.rs
new file mode 100644
index 00000000000..1c9929eff91
--- /dev/null
+++ b/src/test/ui/rust-2021/inherent-dyn-collision.rs
@@ -0,0 +1,53 @@
+// Test case where the method we want is an inherent method on a
+// dyn Trait. In that case, the fix is to insert `*` on the receiver.
+//
+// check-pass
+// run-rustfix
+// edition:2018
+
+#![warn(future_prelude_collision)]
+
+trait TryIntoU32 {
+    fn try_into(&self) -> Result<u32, ()>;
+}
+
+impl TryIntoU32 for u8 {
+    // note: &self
+    fn try_into(&self) -> Result<u32, ()> {
+        Ok(22)
+    }
+}
+
+mod inner {
+    use super::get_dyn_trait;
+
+    // note: this does nothing, but is copying from ffishim's problem of
+    // having a struct of the same name as the trait in-scope, while *also*
+    // implementing the trait for that struct but **without** importing the
+    // trait itself into scope
+    struct TryIntoU32;
+
+    impl super::TryIntoU32 for TryIntoU32 {
+        fn try_into(&self) -> Result<u32, ()> {
+            Ok(0)
+        }
+    }
+
+    // this is where the gross part happens. since `get_dyn_trait` returns
+    // a Box<dyn Trait>, it can still call the method for `dyn Trait` without
+    // `Trait` being in-scope. it might even be possible to make the trait itself
+    // entirely unreference-able from the callsite?
+    pub fn test() -> u32 {
+        get_dyn_trait().try_into().unwrap()
+        //~^ WARNING trait method `try_into` will become ambiguous
+        //~| WARNING this was previously accepted
+    }
+}
+
+fn get_dyn_trait() -> Box<dyn TryIntoU32> {
+    Box::new(3u8) as Box<dyn TryIntoU32>
+}
+
+fn main() {
+    dbg!(inner::test());
+}
diff --git a/src/test/ui/rust-2021/inherent-dyn-collision.stderr b/src/test/ui/rust-2021/inherent-dyn-collision.stderr
new file mode 100644
index 00000000000..3d7637100c2
--- /dev/null
+++ b/src/test/ui/rust-2021/inherent-dyn-collision.stderr
@@ -0,0 +1,16 @@
+warning: trait method `try_into` will become ambiguous in Rust 2021
+  --> $DIR/inherent-dyn-collision.rs:41:9
+   |
+LL |         get_dyn_trait().try_into().unwrap()
+   |         ^^^^^^^^^^^^^^^ help: disambiguate the method call: `(&*get_dyn_trait())`
+   |
+note: the lint level is defined here
+  --> $DIR/inherent-dyn-collision.rs:8:9
+   |
+LL | #![warn(future_prelude_collision)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
+   = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/rust-2021/inherent-method-collision.rs b/src/test/ui/rust-2021/inherent-method-collision.rs
new file mode 100644
index 00000000000..c638351d5fc
--- /dev/null
+++ b/src/test/ui/rust-2021/inherent-method-collision.rs
@@ -0,0 +1,15 @@
+// Test that we do NOT warn for inherent methods invoked via `T::` form.
+//
+// check-pass
+
+#![deny(future_prelude_collision)]
+
+pub struct MySeq {}
+
+impl MySeq {
+    pub fn from_iter(_: impl IntoIterator<Item = u32>) {}
+}
+
+fn main() {
+    MySeq::from_iter(Some(22));
+}
diff --git a/src/test/ui/span/missing-unit-argument.rs b/src/test/ui/span/missing-unit-argument.rs
index b8fb332120a..5b9861da6e8 100644
--- a/src/test/ui/span/missing-unit-argument.rs
+++ b/src/test/ui/span/missing-unit-argument.rs
@@ -8,7 +8,7 @@ impl S {
 }
 
 fn main() {
-    let _: Result<(), String> = Ok(); //~ ERROR this function takes
+    let _: Result<(), String> = Ok(); //~ ERROR this enum variant takes
     foo(); //~ ERROR this function takes
     foo(()); //~ ERROR this function takes
     bar(); //~ ERROR this function takes
diff --git a/src/test/ui/span/missing-unit-argument.stderr b/src/test/ui/span/missing-unit-argument.stderr
index b15da2cb479..7a24ffbd81c 100644
--- a/src/test/ui/span/missing-unit-argument.stderr
+++ b/src/test/ui/span/missing-unit-argument.stderr
@@ -1,4 +1,4 @@
-error[E0061]: this function takes 1 argument but 0 arguments were supplied
+error[E0061]: this enum variant takes 1 argument but 0 arguments were supplied
   --> $DIR/missing-unit-argument.rs:11:33
    |
 LL |     let _: Result<(), String> = Ok();
diff --git a/src/test/ui/thread-local/thread-local-issue-37508.rs b/src/test/ui/thread-local/thread-local-issue-37508.rs
new file mode 100644
index 00000000000..219108c77f7
--- /dev/null
+++ b/src/test/ui/thread-local/thread-local-issue-37508.rs
@@ -0,0 +1,36 @@
+// only-x86_64
+// compile-flags: -Ccode-model=large --crate-type lib
+// build-pass
+//
+// Regression test for issue #37508
+
+#![no_main]
+#![no_std]
+#![feature(thread_local, lang_items)]
+
+#[lang = "eh_personality"]
+extern "C" fn eh_personality() {}
+
+use core::panic::PanicInfo;
+
+#[panic_handler]
+fn panic(_panic: &PanicInfo<'_>) -> ! {
+    loop {}
+}
+
+pub struct BB;
+
+#[thread_local]
+static mut KEY: Key = Key { inner: BB, dtor_running: false };
+
+pub unsafe fn set() -> Option<&'static BB> {
+    if KEY.dtor_running {
+        return None;
+    }
+    Some(&KEY.inner)
+}
+
+pub struct Key {
+    inner: BB,
+    dtor_running: bool,
+}
diff --git a/src/test/ui/traits/issue-78632.rs b/src/test/ui/traits/issue-78632.rs
new file mode 100644
index 00000000000..c72a2aef490
--- /dev/null
+++ b/src/test/ui/traits/issue-78632.rs
@@ -0,0 +1,59 @@
+// check-pass
+//
+// Regression test for issue #78632
+
+#![crate_type = "lib"]
+
+pub trait Corge<T> {
+    type Fred;
+}
+
+impl Corge<u8> for () {
+    type Fred = u32;
+}
+
+pub trait Waldo {
+    type Quax;
+}
+
+impl Waldo for u32 {
+    type Quax = u8;
+}
+
+pub trait Grault
+where
+    (): Corge<Self::Thud>,
+{
+    type Thud;
+    fn bar(_: <() as Corge<Self::Thud>>::Fred) {}
+}
+
+impl<T> Grault for T
+where
+    T: Waldo,
+    (): Corge<T::Quax>,
+    <() as Corge<T::Quax>>::Fred: Waldo,
+{
+    type Thud = u8;
+}
+
+pub trait Plugh<I> {
+    fn baz();
+}
+
+#[derive(Copy, Clone, Debug)]
+pub struct Qiz<T> {
+    foo: T,
+}
+
+impl<T> Plugh<<() as Corge<T::Thud>>::Fred> for Qiz<T>
+where
+    T: Grault,
+    (): Corge<T::Thud>,
+{
+    fn baz() {}
+}
+
+pub fn test() {
+    <Qiz<u32> as Plugh<u32>>::baz();
+}
diff --git a/src/test/ui/traits/operator-overloading-issue-52025.rs b/src/test/ui/traits/operator-overloading-issue-52025.rs
new file mode 100644
index 00000000000..7ce638832b0
--- /dev/null
+++ b/src/test/ui/traits/operator-overloading-issue-52025.rs
@@ -0,0 +1,57 @@
+// only-x86_64
+// build-pass
+
+use std::arch::x86_64::*;
+use std::fmt::Debug;
+use std::ops::*;
+
+pub trait Simd {
+    type Vf32: Copy + Debug + Add<Self::Vf32, Output = Self::Vf32> + Add<f32, Output = Self::Vf32>;
+
+    unsafe fn set1_ps(a: f32) -> Self::Vf32;
+    unsafe fn add_ps(a: Self::Vf32, b: Self::Vf32) -> Self::Vf32;
+}
+
+#[derive(Copy, Debug, Clone)]
+pub struct F32x4(pub __m128);
+
+impl Add<F32x4> for F32x4 {
+    type Output = F32x4;
+
+    fn add(self, rhs: F32x4) -> F32x4 {
+        F32x4(unsafe { _mm_add_ps(self.0, rhs.0) })
+    }
+}
+
+impl Add<f32> for F32x4 {
+    type Output = F32x4;
+    fn add(self, rhs: f32) -> F32x4 {
+        F32x4(unsafe { _mm_add_ps(self.0, _mm_set1_ps(rhs)) })
+    }
+}
+
+pub struct Sse2;
+impl Simd for Sse2 {
+    type Vf32 = F32x4;
+
+    #[inline(always)]
+    unsafe fn set1_ps(a: f32) -> Self::Vf32 {
+        F32x4(_mm_set1_ps(a))
+    }
+
+    #[inline(always)]
+    unsafe fn add_ps(a: Self::Vf32, b: Self::Vf32) -> Self::Vf32 {
+        F32x4(_mm_add_ps(a.0, b.0))
+    }
+}
+
+unsafe fn test<S: Simd>() -> S::Vf32 {
+    let a = S::set1_ps(3.0);
+    let b = S::set1_ps(2.0);
+    let result = a + b;
+    result
+}
+
+fn main() {
+    println!("{:?}", unsafe { test::<Sse2>() });
+}
diff --git a/src/test/ui/type-alias-impl-trait/issue-85113.rs b/src/test/ui/type-alias-impl-trait/issue-85113.rs
new file mode 100644
index 00000000000..b09833f3ed0
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-85113.rs
@@ -0,0 +1,22 @@
+#![feature(min_type_alias_impl_trait)]
+#![feature(impl_trait_in_bindings)]
+#![allow(incomplete_features)]
+
+type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
+//~^ ERROR: hidden type for `impl Trait` captures lifetime that does not appear in bounds
+//~| ERROR: the type `&'<empty> str` does not fulfill the required lifetime
+//~| ERROR: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
+
+trait Output<'a> {}
+
+impl<'a> Output<'a> for &'a str {}
+
+fn cool_fn<'a>(arg: &'a str) -> OpaqueOutputImpl<'a> {
+    let out: OpaqueOutputImpl<'a> = arg;
+    arg
+}
+
+fn main() {
+    let s = String::from("wassup");
+    cool_fn(&s);
+}
diff --git a/src/test/ui/type-alias-impl-trait/issue-85113.stderr b/src/test/ui/type-alias-impl-trait/issue-85113.stderr
new file mode 100644
index 00000000000..361d66866ef
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-85113.stderr
@@ -0,0 +1,48 @@
+error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
+  --> $DIR/issue-85113.rs:5:29
+   |
+LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
+   |                             ^^^^^^^^^^^^^^^^^^^^
+   |
+note: hidden type `&'<empty> str` captures lifetime smaller than the function body
+  --> $DIR/issue-85113.rs:5:29
+   |
+LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
+   |                             ^^^^^^^^^^^^^^^^^^^^
+
+error[E0477]: the type `&'<empty> str` does not fulfill the required lifetime
+  --> $DIR/issue-85113.rs:5:29
+   |
+LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
+   |                             ^^^^^^^^^^^^^^^^^^^^
+   |
+note: type must outlive the lifetime `'a` as defined on the item at 5:23
+  --> $DIR/issue-85113.rs:5:23
+   |
+LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
+   |                       ^^
+
+error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
+  --> $DIR/issue-85113.rs:5:29
+   |
+LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
+   |                             ^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: first, the lifetime cannot outlive the empty lifetime...
+note: ...but the lifetime must also be valid for the lifetime `'a` as defined on the item at 5:23...
+  --> $DIR/issue-85113.rs:5:23
+   |
+LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
+   |                       ^^
+note: ...so that the types are compatible
+  --> $DIR/issue-85113.rs:5:29
+   |
+LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
+   |                             ^^^^^^^^^^^^^^^^^^^^
+   = note: expected `Output<'a>`
+              found `Output<'_>`
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0477, E0495, E0700.
+For more information about an error, try `rustc --explain E0477`.
diff --git a/src/test/ui/typeck/issue-75889.rs b/src/test/ui/typeck/issue-75889.rs
new file mode 100644
index 00000000000..84c067ed0c7
--- /dev/null
+++ b/src/test/ui/typeck/issue-75889.rs
@@ -0,0 +1,6 @@
+// Regression test for #75889.
+
+const FOO: dyn Fn() -> _ = ""; //~ ERROR E0121
+static BOO: dyn Fn() -> _ = ""; //~ ERROR E0121
+
+fn main() {}
diff --git a/src/test/ui/typeck/issue-75889.stderr b/src/test/ui/typeck/issue-75889.stderr
new file mode 100644
index 00000000000..0a8a3c9e743
--- /dev/null
+++ b/src/test/ui/typeck/issue-75889.stderr
@@ -0,0 +1,15 @@
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures
+  --> $DIR/issue-75889.rs:3:24
+   |
+LL | const FOO: dyn Fn() -> _ = "";
+   |                        ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures
+  --> $DIR/issue-75889.rs:4:25
+   |
+LL | static BOO: dyn Fn() -> _ = "";
+   |                         ^ not allowed in type signatures
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0121`.
diff --git a/src/test/ui/typeck/struct-enum-wrong-args.rs b/src/test/ui/typeck/struct-enum-wrong-args.rs
new file mode 100644
index 00000000000..19de4d67729
--- /dev/null
+++ b/src/test/ui/typeck/struct-enum-wrong-args.rs
@@ -0,0 +1,14 @@
+// Regression test of #86481.
+struct Wrapper(i32);
+struct DoubleWrapper(i32, i32);
+
+fn main() {
+    let _ = Some(3, 2); //~ ERROR this enum variant takes
+    let _ = Ok(3, 6, 2); //~ ERROR this enum variant takes
+    let _ = Ok(); //~ ERROR this enum variant takes
+    let _ = Wrapper(); //~ ERROR this struct takes
+    let _ = Wrapper(5, 2); //~ ERROR this struct takes
+    let _ = DoubleWrapper(); //~ ERROR this struct takes
+    let _ = DoubleWrapper(5); //~ ERROR this struct takes
+    let _ = DoubleWrapper(5, 2, 7); //~ ERROR this struct takes
+}
diff --git a/src/test/ui/typeck/struct-enum-wrong-args.stderr b/src/test/ui/typeck/struct-enum-wrong-args.stderr
new file mode 100644
index 00000000000..d77ef73028b
--- /dev/null
+++ b/src/test/ui/typeck/struct-enum-wrong-args.stderr
@@ -0,0 +1,67 @@
+error[E0061]: this enum variant takes 1 argument but 2 arguments were supplied
+  --> $DIR/struct-enum-wrong-args.rs:6:13
+   |
+LL |     let _ = Some(3, 2);
+   |             ^^^^ -  - supplied 2 arguments
+   |             |
+   |             expected 1 argument
+
+error[E0061]: this enum variant takes 1 argument but 3 arguments were supplied
+  --> $DIR/struct-enum-wrong-args.rs:7:13
+   |
+LL |     let _ = Ok(3, 6, 2);
+   |             ^^ -  -  - supplied 3 arguments
+   |             |
+   |             expected 1 argument
+
+error[E0061]: this enum variant takes 1 argument but 0 arguments were supplied
+  --> $DIR/struct-enum-wrong-args.rs:8:13
+   |
+LL |     let _ = Ok();
+   |             ^^-- supplied 0 arguments
+   |             |
+   |             expected 1 argument
+
+error[E0061]: this struct takes 1 argument but 0 arguments were supplied
+  --> $DIR/struct-enum-wrong-args.rs:9:13
+   |
+LL |     let _ = Wrapper();
+   |             ^^^^^^^-- supplied 0 arguments
+   |             |
+   |             expected 1 argument
+
+error[E0061]: this struct takes 1 argument but 2 arguments were supplied
+  --> $DIR/struct-enum-wrong-args.rs:10:13
+   |
+LL |     let _ = Wrapper(5, 2);
+   |             ^^^^^^^ -  - supplied 2 arguments
+   |             |
+   |             expected 1 argument
+
+error[E0061]: this struct takes 2 arguments but 0 arguments were supplied
+  --> $DIR/struct-enum-wrong-args.rs:11:13
+   |
+LL |     let _ = DoubleWrapper();
+   |             ^^^^^^^^^^^^^-- supplied 0 arguments
+   |             |
+   |             expected 2 arguments
+
+error[E0061]: this struct takes 2 arguments but 1 argument was supplied
+  --> $DIR/struct-enum-wrong-args.rs:12:13
+   |
+LL |     let _ = DoubleWrapper(5);
+   |             ^^^^^^^^^^^^^ - supplied 1 argument
+   |             |
+   |             expected 2 arguments
+
+error[E0061]: this struct takes 2 arguments but 3 arguments were supplied
+  --> $DIR/struct-enum-wrong-args.rs:13:13
+   |
+LL |     let _ = DoubleWrapper(5, 2, 7);
+   |             ^^^^^^^^^^^^^ -  -  - supplied 3 arguments
+   |             |
+   |             expected 2 arguments
+
+error: aborting due to 8 previous errors
+
+For more information about this error, try `rustc --explain E0061`.
diff --git a/src/test/ui/variance/variance-btree-invariant-types.nll.stderr b/src/test/ui/variance/variance-btree-invariant-types.nll.stderr
index be18737b5f1..4b653238aa7 100644
--- a/src/test/ui/variance/variance-btree-invariant-types.nll.stderr
+++ b/src/test/ui/variance/variance-btree-invariant-types.nll.stderr
@@ -39,7 +39,47 @@ LL |     v
    = help: consider replacing `'new` with `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:18:5
+  --> $DIR/variance-btree-invariant-types.rs:17:5
+   |
+LL | fn range_cov_key<'a, 'new>(v: RangeMut<'a, &'static (), ()>) -> RangeMut<'a, &'new (), ()> {
+   |                      ---- lifetime `'new` defined here
+LL |     v
+   |     ^ returning this value requires that `'new` must outlive `'static`
+   |
+   = help: consider replacing `'new` with `'static`
+
+error: lifetime may not live long enough
+  --> $DIR/variance-btree-invariant-types.rs:20:5
+   |
+LL | fn range_cov_val<'a, 'new>(v: RangeMut<'a, (), &'static ()>) -> RangeMut<'a, (), &'new ()> {
+   |                      ---- lifetime `'new` defined here
+LL |     v
+   |     ^ returning this value requires that `'new` must outlive `'static`
+   |
+   = help: consider replacing `'new` with `'static`
+
+error: lifetime may not live long enough
+  --> $DIR/variance-btree-invariant-types.rs:23:5
+   |
+LL | fn range_contra_key<'a, 'new>(v: RangeMut<'a, &'new (), ()>) -> RangeMut<'a, &'static (), ()> {
+   |                         ---- lifetime `'new` defined here
+LL |     v
+   |     ^ returning this value requires that `'new` must outlive `'static`
+   |
+   = help: consider replacing `'new` with `'static`
+
+error: lifetime may not live long enough
+  --> $DIR/variance-btree-invariant-types.rs:26:5
+   |
+LL | fn range_contra_val<'a, 'new>(v: RangeMut<'a, (), &'new ()>) -> RangeMut<'a, (), &'static ()> {
+   |                         ---- lifetime `'new` defined here
+LL |     v
+   |     ^ returning this value requires that `'new` must outlive `'static`
+   |
+   = help: consider replacing `'new` with `'static`
+
+error: lifetime may not live long enough
+  --> $DIR/variance-btree-invariant-types.rs:31:5
    |
 LL | fn occ_cov_key<'a, 'new>(v: OccupiedEntry<'a, &'static (), ()>)
    |                    ---- lifetime `'new` defined here
@@ -50,7 +90,7 @@ LL |     v
    = help: consider replacing `'new` with `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:22:5
+  --> $DIR/variance-btree-invariant-types.rs:35:5
    |
 LL | fn occ_cov_val<'a, 'new>(v: OccupiedEntry<'a, (), &'static ()>)
    |                    ---- lifetime `'new` defined here
@@ -61,7 +101,7 @@ LL |     v
    = help: consider replacing `'new` with `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:26:5
+  --> $DIR/variance-btree-invariant-types.rs:39:5
    |
 LL | fn occ_contra_key<'a, 'new>(v: OccupiedEntry<'a, &'new (), ()>)
    |                       ---- lifetime `'new` defined here
@@ -72,7 +112,7 @@ LL |     v
    = help: consider replacing `'new` with `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:30:5
+  --> $DIR/variance-btree-invariant-types.rs:43:5
    |
 LL | fn occ_contra_val<'a, 'new>(v: OccupiedEntry<'a, (), &'new ()>)
    |                       ---- lifetime `'new` defined here
@@ -83,7 +123,7 @@ LL |     v
    = help: consider replacing `'new` with `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:35:5
+  --> $DIR/variance-btree-invariant-types.rs:48:5
    |
 LL | fn vac_cov_key<'a, 'new>(v: VacantEntry<'a, &'static (), ()>)
    |                    ---- lifetime `'new` defined here
@@ -94,7 +134,7 @@ LL |     v
    = help: consider replacing `'new` with `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:39:5
+  --> $DIR/variance-btree-invariant-types.rs:52:5
    |
 LL | fn vac_cov_val<'a, 'new>(v: VacantEntry<'a, (), &'static ()>)
    |                    ---- lifetime `'new` defined here
@@ -105,7 +145,7 @@ LL |     v
    = help: consider replacing `'new` with `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:43:5
+  --> $DIR/variance-btree-invariant-types.rs:56:5
    |
 LL | fn vac_contra_key<'a, 'new>(v: VacantEntry<'a, &'new (), ()>)
    |                       ---- lifetime `'new` defined here
@@ -116,7 +156,7 @@ LL |     v
    = help: consider replacing `'new` with `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:47:5
+  --> $DIR/variance-btree-invariant-types.rs:60:5
    |
 LL | fn vac_contra_val<'a, 'new>(v: VacantEntry<'a, (), &'new ()>)
    |                       ---- lifetime `'new` defined here
@@ -126,5 +166,5 @@ LL |     v
    |
    = help: consider replacing `'new` with `'static`
 
-error: aborting due to 12 previous errors
+error: aborting due to 16 previous errors
 
diff --git a/src/test/ui/variance/variance-btree-invariant-types.rs b/src/test/ui/variance/variance-btree-invariant-types.rs
index 2e5dc671db8..4549622f24a 100644
--- a/src/test/ui/variance/variance-btree-invariant-types.rs
+++ b/src/test/ui/variance/variance-btree-invariant-types.rs
@@ -1,4 +1,4 @@
-use std::collections::btree_map::{IterMut, OccupiedEntry, VacantEntry};
+use std::collections::btree_map::{IterMut, OccupiedEntry, RangeMut, VacantEntry};
 
 fn iter_cov_key<'a, 'new>(v: IterMut<'a, &'static (), ()>) -> IterMut<'a, &'new (), ()> {
     v //~ ERROR mismatched types
@@ -13,6 +13,19 @@ fn iter_contra_val<'a, 'new>(v: IterMut<'a, (), &'new ()>) -> IterMut<'a, (), &'
     v //~ ERROR mismatched types
 }
 
+fn range_cov_key<'a, 'new>(v: RangeMut<'a, &'static (), ()>) -> RangeMut<'a, &'new (), ()> {
+    v //~ ERROR mismatched types
+}
+fn range_cov_val<'a, 'new>(v: RangeMut<'a, (), &'static ()>) -> RangeMut<'a, (), &'new ()> {
+    v //~ ERROR mismatched types
+}
+fn range_contra_key<'a, 'new>(v: RangeMut<'a, &'new (), ()>) -> RangeMut<'a, &'static (), ()> {
+    v //~ ERROR mismatched types
+}
+fn range_contra_val<'a, 'new>(v: RangeMut<'a, (), &'new ()>) -> RangeMut<'a, (), &'static ()> {
+    v //~ ERROR mismatched types
+}
+
 fn occ_cov_key<'a, 'new>(v: OccupiedEntry<'a, &'static (), ()>)
                          -> OccupiedEntry<'a, &'new (), ()> {
     v //~ ERROR mismatched types
diff --git a/src/test/ui/variance/variance-btree-invariant-types.stderr b/src/test/ui/variance/variance-btree-invariant-types.stderr
index 8172a019b65..ba47bdff281 100644
--- a/src/test/ui/variance/variance-btree-invariant-types.stderr
+++ b/src/test/ui/variance/variance-btree-invariant-types.stderr
@@ -59,125 +59,185 @@ LL | fn iter_contra_val<'a, 'new>(v: IterMut<'a, (), &'new ()>) -> IterMut<'a, (
    = note: ...does not necessarily outlive the static lifetime
 
 error[E0308]: mismatched types
-  --> $DIR/variance-btree-invariant-types.rs:18:5
+  --> $DIR/variance-btree-invariant-types.rs:17:5
+   |
+LL |     v
+   |     ^ lifetime mismatch
+   |
+   = note: expected struct `RangeMut<'_, &'new (), _>`
+              found struct `RangeMut<'_, &'static (), _>`
+note: the lifetime `'new` as defined on the function body at 16:22...
+  --> $DIR/variance-btree-invariant-types.rs:16: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:20:5
+   |
+LL |     v
+   |     ^ lifetime mismatch
+   |
+   = note: expected struct `RangeMut<'_, _, &'new ()>`
+              found struct `RangeMut<'_, _, &'static ()>`
+note: the lifetime `'new` as defined on the function body at 19:22...
+  --> $DIR/variance-btree-invariant-types.rs:19: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:23:5
+   |
+LL |     v
+   |     ^ lifetime mismatch
+   |
+   = note: expected struct `RangeMut<'_, &'static (), _>`
+              found struct `RangeMut<'_, &'new (), _>`
+note: the lifetime `'new` as defined on the function body at 22:25...
+  --> $DIR/variance-btree-invariant-types.rs:22: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:26:5
+   |
+LL |     v
+   |     ^ lifetime mismatch
+   |
+   = note: expected struct `RangeMut<'_, _, &'static ()>`
+              found struct `RangeMut<'_, _, &'new ()>`
+note: the lifetime `'new` as defined on the function body at 25:25...
+  --> $DIR/variance-btree-invariant-types.rs:25: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:31: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 on the function body at 16:20...
-  --> $DIR/variance-btree-invariant-types.rs:16:20
+note: the lifetime `'new` as defined on the function body at 29:20...
+  --> $DIR/variance-btree-invariant-types.rs:29: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:22:5
+  --> $DIR/variance-btree-invariant-types.rs:35: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 on the function body at 20:20...
-  --> $DIR/variance-btree-invariant-types.rs:20:20
+note: the lifetime `'new` as defined on the function body at 33:20...
+  --> $DIR/variance-btree-invariant-types.rs:33: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:26:5
+  --> $DIR/variance-btree-invariant-types.rs:39: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 on the function body at 24:23...
-  --> $DIR/variance-btree-invariant-types.rs:24:23
+note: the lifetime `'new` as defined on the function body at 37:23...
+  --> $DIR/variance-btree-invariant-types.rs:37: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:30:5
+  --> $DIR/variance-btree-invariant-types.rs:43: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 on the function body at 28:23...
-  --> $DIR/variance-btree-invariant-types.rs:28:23
+note: the lifetime `'new` as defined on the function body at 41:23...
+  --> $DIR/variance-btree-invariant-types.rs:41: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:35:5
+  --> $DIR/variance-btree-invariant-types.rs:48: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 on the function body at 33:20...
-  --> $DIR/variance-btree-invariant-types.rs:33:20
+note: the lifetime `'new` as defined on the function body at 46:20...
+  --> $DIR/variance-btree-invariant-types.rs:46: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:39:5
+  --> $DIR/variance-btree-invariant-types.rs:52: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 on the function body at 37:20...
-  --> $DIR/variance-btree-invariant-types.rs:37:20
+note: the lifetime `'new` as defined on the function body at 50:20...
+  --> $DIR/variance-btree-invariant-types.rs:50: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:43:5
+  --> $DIR/variance-btree-invariant-types.rs:56: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 on the function body at 41:23...
-  --> $DIR/variance-btree-invariant-types.rs:41:23
+note: the lifetime `'new` as defined on the function body at 54:23...
+  --> $DIR/variance-btree-invariant-types.rs:54: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:47:5
+  --> $DIR/variance-btree-invariant-types.rs:60: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 on the function body at 45:23...
-  --> $DIR/variance-btree-invariant-types.rs:45:23
+note: the lifetime `'new` as defined on the function body at 58:23...
+  --> $DIR/variance-btree-invariant-types.rs:58:23
    |
 LL | fn vac_contra_val<'a, 'new>(v: VacantEntry<'a, (), &'new ()>)
    |                       ^^^^
    = note: ...does not necessarily outlive the static lifetime
 
-error: aborting due to 12 previous errors
+error: aborting due to 16 previous errors
 
 For more information about this error, try `rustc --explain E0308`.
diff --git a/src/tools/clippy/CONTRIBUTING.md b/src/tools/clippy/CONTRIBUTING.md
index 7265d1b8323..7d7b7c81173 100644
--- a/src/tools/clippy/CONTRIBUTING.md
+++ b/src/tools/clippy/CONTRIBUTING.md
@@ -342,7 +342,7 @@ We have prioritization labels and a sync-blocker label, which are described belo
 - [P-low][p-low]: Requires attention (fix/response/evaluation) by a team member but isn't urgent.
 - [P-medium][p-medium]: Should be addressed by a team member until the next sync.
 - [P-high][p-high]: Should be immediately addressed and will require an out-of-cycle sync or a backport.
-- [L-sync-blocker][l-sync-blocker]: An issue that "blocks" a sync. 
+- [L-sync-blocker][l-sync-blocker]: An issue that "blocks" a sync.
 Or rather: before the sync this should be addressed,
 e.g. by removing a lint again, so it doesn't hit beta/stable.
 
diff --git a/src/tools/clippy/README.md b/src/tools/clippy/README.md
index 6c556f579ca..bd322cc8070 100644
--- a/src/tools/clippy/README.md
+++ b/src/tools/clippy/README.md
@@ -95,7 +95,7 @@ As with `cargo check`, this includes dependencies that are members of the worksp
 If you want to run Clippy **only** on the given crate, use the `--no-deps` option like this:
 
 ```terminal
-cargo clippy -p example -- --no-deps 
+cargo clippy -p example -- --no-deps
 ```
 
 ### As a rustc replacement (`clippy-driver`)
diff --git a/src/tools/clippy/clippy_utils/src/ast_utils.rs b/src/tools/clippy/clippy_utils/src/ast_utils.rs
index e6d84bc7560..90c034bd02a 100644
--- a/src/tools/clippy/clippy_utils/src/ast_utils.rs
+++ b/src/tools/clippy/clippy_utils/src/ast_utils.rs
@@ -178,7 +178,7 @@ pub fn eq_expr(l: &Expr, r: &Expr) -> bool {
         (Path(lq, lp), Path(rq, rp)) => both(lq, rq, |l, r| eq_qself(l, r)) && eq_path(lp, rp),
         (MacCall(l), MacCall(r)) => eq_mac_call(l, r),
         (Struct(lse), Struct(rse)) => {
-            eq_maybe_qself(&lse.qself, &rse.qself) 
+            eq_maybe_qself(&lse.qself, &rse.qself)
                 && eq_path(&lse.path, &rse.path)
                 && eq_struct_rest(&lse.rest, &rse.rest)
                 && unordered_over(&lse.fields, &rse.fields, |l, r| eq_field(l, r))
diff --git a/src/tools/clippy/doc/basics.md b/src/tools/clippy/doc/basics.md
index e2e307ce4f6..ed3a2fff83f 100644
--- a/src/tools/clippy/doc/basics.md
+++ b/src/tools/clippy/doc/basics.md
@@ -96,9 +96,9 @@ cargo dev ide_setup
 
 ## lintcheck
 `cargo lintcheck` will build and run clippy on a fixed set of crates and generate a log of the results.  
-You can `git diff` the updated log against its previous version and 
+You can `git diff` the updated log against its previous version and
 see what impact your lint made on a small set of crates.  
-If you add a new lint, please audit the resulting warnings and make sure 
+If you add a new lint, please audit the resulting warnings and make sure
 there are no false positives and that the suggestions are valid.
 
 Refer to the tools [README] for more details.
diff --git a/src/tools/clippy/lintcheck/README.md b/src/tools/clippy/lintcheck/README.md
index 52bbcc0a831..a61070d8a80 100644
--- a/src/tools/clippy/lintcheck/README.md
+++ b/src/tools/clippy/lintcheck/README.md
@@ -73,5 +73,5 @@ You can run `./lintcheck/target/debug/lintcheck --fix` which will run Clippy wit
 print a warning if Clippys suggestions fail to apply (if the resulting code does not build).  
 This lets us spot bad suggestions or false positives automatically in some cases.  
 
-Please note that the target dir should be cleaned afterwards since clippy will modify 
+Please note that the target dir should be cleaned afterwards since clippy will modify
 the downloaded sources which can lead to unexpected results when running lintcheck again afterwards.
diff --git a/src/tools/clippy/tests/ui/bytes_nth.fixed b/src/tools/clippy/tests/ui/bytes_nth.fixed
index bf68a7bbbf1..46b7833f428 100644
--- a/src/tools/clippy/tests/ui/bytes_nth.fixed
+++ b/src/tools/clippy/tests/ui/bytes_nth.fixed
@@ -6,6 +6,6 @@
 fn main() {
     let s = String::from("String");
     s.as_bytes().get(3);
-    &s.as_bytes().get(3);
+    let _ = &s.as_bytes().get(3);
     s[..].as_bytes().get(3);
 }
diff --git a/src/tools/clippy/tests/ui/bytes_nth.rs b/src/tools/clippy/tests/ui/bytes_nth.rs
index 629812cc02c..c5e983d4d4e 100644
--- a/src/tools/clippy/tests/ui/bytes_nth.rs
+++ b/src/tools/clippy/tests/ui/bytes_nth.rs
@@ -6,6 +6,6 @@
 fn main() {
     let s = String::from("String");
     s.bytes().nth(3);
-    &s.bytes().nth(3);
+    let _ = &s.bytes().nth(3);
     s[..].bytes().nth(3);
 }
diff --git a/src/tools/clippy/tests/ui/bytes_nth.stderr b/src/tools/clippy/tests/ui/bytes_nth.stderr
index 9a5742928cd..536decf5e7f 100644
--- a/src/tools/clippy/tests/ui/bytes_nth.stderr
+++ b/src/tools/clippy/tests/ui/bytes_nth.stderr
@@ -7,10 +7,10 @@ LL |     s.bytes().nth(3);
    = note: `-D clippy::bytes-nth` implied by `-D warnings`
 
 error: called `.byte().nth()` on a `String`
-  --> $DIR/bytes_nth.rs:9:6
+  --> $DIR/bytes_nth.rs:9:14
    |
-LL |     &s.bytes().nth(3);
-   |      ^^^^^^^^^^^^^^^^ help: try: `s.as_bytes().get(3)`
+LL |     let _ = &s.bytes().nth(3);
+   |              ^^^^^^^^^^^^^^^^ help: try: `s.as_bytes().get(3)`
 
 error: called `.byte().nth()` on a `str`
   --> $DIR/bytes_nth.rs:10:5
diff --git a/src/tools/clippy/tests/ui/iter_count.fixed b/src/tools/clippy/tests/ui/iter_count.fixed
index b11dadda6c2..97c5929783d 100644
--- a/src/tools/clippy/tests/ui/iter_count.fixed
+++ b/src/tools/clippy/tests/ui/iter_count.fixed
@@ -50,7 +50,7 @@ fn main() {
     linked_list.push_back(1);
     binary_heap.push(1);
 
-    &vec[..].len();
+    let _ = &vec[..].len();
     vec.len();
     boxed_slice.len();
     vec_deque.len();
@@ -62,13 +62,13 @@ fn main() {
     binary_heap.len();
 
     vec.len();
-    &vec[..].len();
+    let _ = &vec[..].len();
     vec_deque.len();
     hash_map.len();
     b_tree_map.len();
     linked_list.len();
 
-    &vec[..].len();
+    let _ = &vec[..].len();
     vec.len();
     vec_deque.len();
     hash_set.len();
diff --git a/src/tools/clippy/tests/ui/iter_count.rs b/src/tools/clippy/tests/ui/iter_count.rs
index 7d49c6a3dbb..70bb734763f 100644
--- a/src/tools/clippy/tests/ui/iter_count.rs
+++ b/src/tools/clippy/tests/ui/iter_count.rs
@@ -50,7 +50,7 @@ fn main() {
     linked_list.push_back(1);
     binary_heap.push(1);
 
-    &vec[..].iter().count();
+    let _ = &vec[..].iter().count();
     vec.iter().count();
     boxed_slice.iter().count();
     vec_deque.iter().count();
@@ -62,13 +62,13 @@ fn main() {
     binary_heap.iter().count();
 
     vec.iter_mut().count();
-    &vec[..].iter_mut().count();
+    let _ = &vec[..].iter_mut().count();
     vec_deque.iter_mut().count();
     hash_map.iter_mut().count();
     b_tree_map.iter_mut().count();
     linked_list.iter_mut().count();
 
-    &vec[..].into_iter().count();
+    let _ = &vec[..].into_iter().count();
     vec.into_iter().count();
     vec_deque.into_iter().count();
     hash_set.into_iter().count();
diff --git a/src/tools/clippy/tests/ui/iter_count.stderr b/src/tools/clippy/tests/ui/iter_count.stderr
index f3fb98e65b9..1d2c22f9dfa 100644
--- a/src/tools/clippy/tests/ui/iter_count.stderr
+++ b/src/tools/clippy/tests/ui/iter_count.stderr
@@ -1,8 +1,8 @@
 error: called `.iter().count()` on a `slice`
-  --> $DIR/iter_count.rs:53:6
+  --> $DIR/iter_count.rs:53:14
    |
-LL |     &vec[..].iter().count();
-   |      ^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec[..].len()`
+LL |     let _ = &vec[..].iter().count();
+   |              ^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec[..].len()`
    |
    = note: `-D clippy::iter-count` implied by `-D warnings`
 
@@ -67,10 +67,10 @@ LL |     vec.iter_mut().count();
    |     ^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec.len()`
 
 error: called `.iter_mut().count()` on a `slice`
-  --> $DIR/iter_count.rs:65:6
+  --> $DIR/iter_count.rs:65:14
    |
-LL |     &vec[..].iter_mut().count();
-   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec[..].len()`
+LL |     let _ = &vec[..].iter_mut().count();
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec[..].len()`
 
 error: called `.iter_mut().count()` on a `VecDeque`
   --> $DIR/iter_count.rs:66:5
@@ -97,10 +97,10 @@ LL |     linked_list.iter_mut().count();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `linked_list.len()`
 
 error: called `.into_iter().count()` on a `slice`
-  --> $DIR/iter_count.rs:71:6
+  --> $DIR/iter_count.rs:71:14
    |
-LL |     &vec[..].into_iter().count();
-   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec[..].len()`
+LL |     let _ = &vec[..].into_iter().count();
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec[..].len()`
 
 error: called `.into_iter().count()` on a `Vec`
   --> $DIR/iter_count.rs:72:5
diff --git a/src/tools/clippy/util/gh-pages/index.html b/src/tools/clippy/util/gh-pages/index.html
index 27ecb532dd0..0174d3ffcbc 100644
--- a/src/tools/clippy/util/gh-pages/index.html
+++ b/src/tools/clippy/util/gh-pages/index.html
@@ -363,7 +363,7 @@
 
             $scope.bySearch = function (lint, index, array) {
                 let searchStr = $scope.search;
-                // It can be `null` I haven't missed this value 
+                // It can be `null` I haven't missed this value
                 if (searchStr == null || searchStr.length < 3) {
                     return true;
                 }
@@ -375,7 +375,7 @@
                 }
 
                 // Search the description
-                // The use of `for`-loops instead of `foreach` enables us to return early 
+                // The use of `for`-loops instead of `foreach` enables us to return early
                 let terms = searchStr.split(" ");
                 for (index = 0; index < terms.length; index++) {
                     if (lint.id.indexOf(terms[index]) !== -1) {
@@ -463,7 +463,7 @@
 
         let children = themeMenu.children;
         for (let index = 0; index < children.length; index++) {
-            let child = children[index]; 
+            let child = children[index];
             child.addEventListener("click", function(e) {
                 setTheme(child.id, true);
             });
@@ -476,7 +476,7 @@
         let enableHighlight = false;
         let enableNight = false;
         let enableAyu = false;
-        
+
         if (theme == "ayu") {
             enableAyu = true;
         } else if (theme == "coal" || theme == "navy") {
diff --git a/src/tools/compiletest/Cargo.toml b/src/tools/compiletest/Cargo.toml
index f61d61e8f9d..771e36e4d2c 100644
--- a/src/tools/compiletest/Cargo.toml
+++ b/src/tools/compiletest/Cargo.toml
@@ -14,7 +14,7 @@ tracing-subscriber = { version = "0.2", default-features = false, features = ["f
 regex = "1.0"
 serde = { version = "1.0", features = ["derive"] }
 serde_json = "1.0"
-rustfix = "0.5.0"
+rustfix = "0.6.0"
 lazy_static = "1.0"
 walkdir = "2"
 glob = "0.3.0"
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 02dffaab7b6..6a1faee1d8e 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -3328,8 +3328,11 @@ impl<'test> TestCx<'test> {
                 },
             )
             .unwrap();
-            let fixed_code = apply_suggestions(&unfixed_code, &suggestions).unwrap_or_else(|_| {
-                panic!("failed to apply suggestions for {:?} with rustfix", self.testpaths.file)
+            let fixed_code = apply_suggestions(&unfixed_code, &suggestions).unwrap_or_else(|e| {
+                panic!(
+                    "failed to apply suggestions for {:?} with rustfix: {}",
+                    self.testpaths.file, e
+                )
             });
 
             errors += self.compare_output("fixed", &fixed_code, &expected_fixed);
diff --git a/src/tools/linkchecker/main.rs b/src/tools/linkchecker/main.rs
index 47960c3f6cc..15edd628cdf 100644
--- a/src/tools/linkchecker/main.rs
+++ b/src/tools/linkchecker/main.rs
@@ -347,7 +347,7 @@ impl Checker {
                 } else {
                     report.errors += 1;
                     print!("{}:{}: broken link fragment ", pretty_path, i + 1);
-                    println!("`#{}` pointing to `{}`", fragment, pretty_path);
+                    println!("`#{}` pointing to `{}`", fragment, target_pretty_path);
                 };
             }
         });
diff --git a/src/tools/linkchecker/tests/broken_redir/redir-bad.html b/src/tools/linkchecker/tests/broken_redir/redir-bad.html
index 3e376629f74..9c580d8e07e 100644
--- a/src/tools/linkchecker/tests/broken_redir/redir-bad.html
+++ b/src/tools/linkchecker/tests/broken_redir/redir-bad.html
@@ -2,6 +2,7 @@
 <html lang="en">
 <head>
     <meta http-equiv="refresh" content="0;URL=sometarget">
+    <title>Redirection</title>
 </head>
 <body>
     <p>Redirecting to <a href="sometarget">sometarget</a>...</p>
diff --git a/src/tools/linkchecker/tests/checks.rs b/src/tools/linkchecker/tests/checks.rs
index c6ec999e5cf..1a0b1b00e0d 100644
--- a/src/tools/linkchecker/tests/checks.rs
+++ b/src/tools/linkchecker/tests/checks.rs
@@ -15,7 +15,7 @@ fn run(dirname: &str) -> (ExitStatus, String, String) {
 fn broken_test(dirname: &str, expected: &str) {
     let (status, stdout, stderr) = run(dirname);
     assert!(!status.success());
-    if !stdout.contains(expected) {
+    if !contains(expected, &stdout) {
         panic!(
             "stdout did not contain expected text: {}\n\
             --- stdout:\n\
@@ -27,6 +27,25 @@ fn broken_test(dirname: &str, expected: &str) {
     }
 }
 
+fn contains(expected: &str, actual: &str) -> bool {
+    // Normalize for Windows paths.
+    let actual = actual.replace('\\', "/");
+    actual.lines().any(|mut line| {
+        for (i, part) in expected.split("[..]").enumerate() {
+            match line.find(part) {
+                Some(j) => {
+                    if i == 0 && j != 0 {
+                        return false;
+                    }
+                    line = &line[j + part.len()..];
+                }
+                None => return false,
+            }
+        }
+        line.is_empty() || expected.ends_with("[..]")
+    })
+}
+
 fn valid_test(dirname: &str) {
     let (status, stdout, stderr) = run(dirname);
     if !status.success() {
@@ -48,30 +67,47 @@ fn valid() {
 
 #[test]
 fn basic_broken() {
-    broken_test("basic_broken", "bar.html");
+    broken_test("basic_broken", "foo.html:3: broken link - `bar.html`");
 }
 
 #[test]
 fn broken_fragment_local() {
-    broken_test("broken_fragment_local", "#somefrag");
+    broken_test(
+        "broken_fragment_local",
+        "foo.html:3: broken link fragment `#somefrag` pointing to `foo.html`",
+    );
 }
 
 #[test]
 fn broken_fragment_remote() {
-    broken_test("broken_fragment_remote/inner", "#somefrag");
+    broken_test(
+        "broken_fragment_remote/inner",
+        "foo.html:3: broken link fragment `#somefrag` pointing to \
+         `[..]/broken_fragment_remote/bar.html`",
+    );
 }
 
 #[test]
 fn broken_redir() {
-    broken_test("broken_redir", "sometarget");
+    broken_test(
+        "broken_redir",
+        "foo.html:3: broken redirect from `redir-bad.html` to `sometarget`",
+    );
 }
 
 #[test]
 fn directory_link() {
-    broken_test("directory_link", "somedir");
+    broken_test(
+        "directory_link",
+        "foo.html:3: directory link to `somedir` (directory links should use index.html instead)",
+    );
 }
 
 #[test]
 fn redirect_loop() {
-    broken_test("redirect_loop", "redir-bad.html");
+    broken_test(
+        "redirect_loop",
+        "foo.html:3: redirect from `redir-bad.html` to `[..]redirect_loop/redir-bad.html` \
+         which is also a redirect (not supported)",
+    );
 }
diff --git a/src/tools/linkchecker/tests/redirect_loop/redir-bad.html b/src/tools/linkchecker/tests/redirect_loop/redir-bad.html
index fe7780e6739..bc567caa78b 100644
--- a/src/tools/linkchecker/tests/redirect_loop/redir-bad.html
+++ b/src/tools/linkchecker/tests/redirect_loop/redir-bad.html
@@ -2,6 +2,7 @@
 <html lang="en">
 <head>
     <meta http-equiv="refresh" content="0;URL=redir-bad.html">
+    <title>Redirection</title>
 </head>
 <body>
     <p>Redirecting to <a href="redir-bad.html">redir-bad.html</a>...</p>
diff --git a/src/tools/linkchecker/tests/valid/inner/redir-bad.html b/src/tools/linkchecker/tests/valid/inner/redir-bad.html
index d21336e7e73..f32683efe67 100644
--- a/src/tools/linkchecker/tests/valid/inner/redir-bad.html
+++ b/src/tools/linkchecker/tests/valid/inner/redir-bad.html
@@ -2,6 +2,7 @@
 <html lang="en">
 <head>
     <meta http-equiv="refresh" content="0;URL=xxx">
+    <title>Redirection</title>
 </head>
 <body>
     <p>Redirecting to <a href="xxx">xxx</a>...</p>
diff --git a/src/tools/linkchecker/tests/valid/inner/redir.html b/src/tools/linkchecker/tests/valid/inner/redir.html
index 1808b23aed8..3a52a897385 100644
--- a/src/tools/linkchecker/tests/valid/inner/redir.html
+++ b/src/tools/linkchecker/tests/valid/inner/redir.html
@@ -2,6 +2,7 @@
 <html lang="en">
 <head>
     <meta http-equiv="refresh" content="0;URL=redir-target.html">
+    <title>Redirection</title>
 </head>
 <body>
     <p>Redirecting to <a href="redir-target.html">redir-target.html</a>...</p>
diff --git a/src/tools/miri b/src/tools/miri
-Subproject 5b7f1f919b9d16e414c9d31142c18578b43ab1c
+Subproject 23f05fc603252b7906bd7e44208ab24038f8da1
diff --git a/src/tools/rust-analyzer b/src/tools/rust-analyzer
-Subproject f0618a8f06a464840079f30b3e25bcdcca3922a
+Subproject 13da28cc2bc1b59f7af817eca36927a71edb023
diff --git a/src/tools/rustdoc-gui/tester.js b/src/tools/rustdoc-gui/tester.js
index 8c8d86d5e38..416d824c564 100644
--- a/src/tools/rustdoc-gui/tester.js
+++ b/src/tools/rustdoc-gui/tester.js
@@ -11,6 +11,9 @@ function showHelp() {
     console.log("rustdoc-js options:");
     console.log("  --doc-folder [PATH]        : location of the generated doc folder");
     console.log("  --file [PATH]              : file to run (can be repeated)");
+    console.log("  --debug                    : show extra information about script run");
+    console.log("  --show-text                : render font in pages");
+    console.log("  --no-headless              : disable headless mode");
     console.log("  --help                     : show this message then quit");
     console.log("  --tests-folder [PATH]      : location of the .GOML tests folder");
 }
@@ -20,10 +23,16 @@ function parseOptions(args) {
         "doc_folder": "",
         "tests_folder": "",
         "files": [],
+        "debug": false,
+        "show_text": false,
+        "no_headless": false,
     };
     var correspondances = {
         "--doc-folder": "doc_folder",
         "--tests-folder": "tests_folder",
+        "--debug": "debug",
+        "--show-text": "show_text",
+        "--no-headless": "no_headless",
     };
 
     for (var i = 0; i < args.length; ++i) {
@@ -43,6 +52,8 @@ function parseOptions(args) {
         } else if (args[i] === "--help") {
             showHelp();
             process.exit(0);
+        } else if (correspondances[args[i]]) {
+            opts[correspondances[args[i]]] = true;
         } else {
             console.log("Unknown option `" + args[i] + "`.");
             console.log("Use `--help` to see the list of options");
@@ -68,17 +79,20 @@ async function main(argv) {
     const options = new Options();
     try {
         // This is more convenient that setting fields one by one.
-        options.parseArguments([
+        let args = [
             "--no-screenshot",
-            // This option shows what puppeteer "code" is run
-            // "--debug",
-            // This option disable the headless mode, allowing you to see what's going on.
-            // "--no-headless",
-            // The text isn't rendered by default because of a lot of small differences
-            // between hosts.
-            // "--show-text",
             "--variable", "DOC_PATH", opts["doc_folder"],
-        ]);
+        ];
+        if (opts["debug"]) {
+            args.push("--debug");
+        }
+        if (opts["show_text"]) {
+            args.push("--show-text");
+        }
+        if (opts["no_headless"]) {
+            args.push("--no-headless");
+        }
+        options.parseArguments(args);
     } catch (error) {
         console.error(`invalid argument: ${error}`);
         process.exit(1);
diff --git a/src/tools/rustfmt/CHANGELOG.md b/src/tools/rustfmt/CHANGELOG.md
index 0f23663d6c2..68354b6ceaf 100644
--- a/src/tools/rustfmt/CHANGELOG.md
+++ b/src/tools/rustfmt/CHANGELOG.md
@@ -176,7 +176,7 @@ https://rust-lang.github.io/rustfmt/?version=v1.4.33&search=#imports_granularity
 
 ### Changed
 
-- Original comment indentation for trailing comments within an `if` is now taken into account when determining the indentation level to use for the trailing comment in formatted code. This does not modify any existing code formatted with rustfmt; it simply gives the programmer discretion to specify whether the comment is associated to the `else` block, or if the trailing comment is just a member of the `if` block. ([#1575](https://github.com/rust-lang/rustfmt/issues/1575), [#4120](https://github.com/rust-lang/rustfmt/issues/4120), [#4506](https://github.com/rust-lang/rustfmt/issues/4506)) 
+- Original comment indentation for trailing comments within an `if` is now taken into account when determining the indentation level to use for the trailing comment in formatted code. This does not modify any existing code formatted with rustfmt; it simply gives the programmer discretion to specify whether the comment is associated to the `else` block, or if the trailing comment is just a member of the `if` block. ([#1575](https://github.com/rust-lang/rustfmt/issues/1575), [#4120](https://github.com/rust-lang/rustfmt/issues/4120), [#4506](https://github.com/rust-lang/rustfmt/issues/4506))
 
 In this example the `// else comment` refers to the `else`:
 ```rust
@@ -213,7 +213,7 @@ if toks.eat_token(Token::Word("modify"))? && toks.eat_token(Token::Word("labels"
 
 ### Fixed
 - Formatting of empty blocks with attributes which only contained comments is no longer butchered.([#4475](https://github.com/rust-lang/rustfmt/issues/4475), [#4467](https://github.com/rust-lang/rustfmt/issues/4467), [#4452](https://github.com/rust-lang/rustfmt/issues/4452#issuecomment-705886282), [#4522](https://github.com/rust-lang/rustfmt/issues/4522))
-- Indentation of trailing comments in non-empty extern blocks is now correct. ([#4120](https://github.com/rust-lang/rustfmt/issues/4120#issuecomment-696491872)) 
+- Indentation of trailing comments in non-empty extern blocks is now correct. ([#4120](https://github.com/rust-lang/rustfmt/issues/4120#issuecomment-696491872))
 
 ### Install/Download Options
 - **crates.io package** - *pending*
@@ -297,7 +297,7 @@ if toks.eat_token(Token::Word("modify"))? && toks.eat_token(Token::Word("labels"
 - Fix aligning comments of different group
 - Fix flattening imports with a single `self`.
 - Fix removing attributes on function parameters.
-- Fix removing `impl` keyword from opaque type. 
+- Fix removing `impl` keyword from opaque type.
 
 ## [1.4.8] 2019-09-08
 
@@ -329,7 +329,7 @@ if toks.eat_token(Token::Word("modify"))? && toks.eat_token(Token::Word("labels"
 
 - Add `--message-format` command line option to `cargo-fmt`.
 - Add `-l,--files-with-diff` command line option to `rustfmt`.
-- Add `json` emit mode. 
+- Add `json` emit mode.
 
 ### Fixed
 
@@ -380,7 +380,7 @@ if toks.eat_token(Token::Word("modify"))? && toks.eat_token(Token::Word("labels"
 
 ### Added
 
-- Add new attribute `rustfmt::skip::attributes` to prevent rustfmt 
+- Add new attribute `rustfmt::skip::attributes` to prevent rustfmt
 from formatting an attribute #3665
 
 ### Changed
diff --git a/src/tools/rustfmt/Configurations.md b/src/tools/rustfmt/Configurations.md
index 37cb7474130..9daa7065379 100644
--- a/src/tools/rustfmt/Configurations.md
+++ b/src/tools/rustfmt/Configurations.md
@@ -17,7 +17,7 @@ To enable unstable options, set `unstable_features = true` in `rustfmt.toml` or
 
 Below you find a detailed visual guide on all the supported configuration options of rustfmt:
 
-## `array_width` 
+## `array_width`
 
 Maximum width of an array literal before falling back to vertical formatting.
 
@@ -25,11 +25,11 @@ Maximum width of an array literal before falling back to vertical formatting.
 - **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
 - **Stable**: Yes
 
-By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `array_width` will take precedence. 
+By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `array_width` will take precedence.
 
 See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics)
 
-## `attr_fn_like_width` 
+## `attr_fn_like_width`
 
 Maximum width of the args of a function-like attributes before falling back to vertical formatting.
 
@@ -37,7 +37,7 @@ Maximum width of the args of a function-like attributes before falling back to v
 - **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
 - **Stable**: Yes
 
-By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `attr_fn_like_width` will take precedence. 
+By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `attr_fn_like_width` will take precedence.
 
 See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics)
 
@@ -295,7 +295,7 @@ where
 }
 ```
 
-## `chain_width` 
+## `chain_width`
 
 Maximum width of a chain to fit on one line.
 
@@ -303,7 +303,7 @@ Maximum width of a chain to fit on one line.
 - **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
 - **Stable**: Yes
 
-By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `chain_width` will take precedence. 
+By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `chain_width` will take precedence.
 
 See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics)
 
@@ -751,7 +751,7 @@ trait Lorem {
 }
 ```
 
-## `fn_call_width` 
+## `fn_call_width`
 
 Maximum width of the args of a function call before falling back to vertical formatting.
 
@@ -759,7 +759,7 @@ Maximum width of the args of a function call before falling back to vertical for
 - **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
 - **Stable**: Yes
 
-By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `fn_call_width` will take precedence. 
+By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `fn_call_width` will take precedence.
 
 See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics)
 
@@ -2124,7 +2124,7 @@ Don't reformat out of line modules
 - **Possible values**: `true`, `false`
 - **Stable**: No (tracking issue: #3389)
 
-## `single_line_if_else_max_width` 
+## `single_line_if_else_max_width`
 
 Maximum line length for single line if-else expressions. A value of `0` (zero) results in if-else expressions always being broken into multiple lines. Note this occurs when `use_small_heuristics` is set to `Off`.
 
@@ -2132,7 +2132,7 @@ Maximum line length for single line if-else expressions. A value of `0` (zero) r
 - **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
 - **Stable**: Yes
 
-By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `single_line_if_else_max_width` will take precedence. 
+By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `single_line_if_else_max_width` will take precedence.
 
 See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics)
 
@@ -2313,7 +2313,7 @@ fn main() {
 
 See also: [`indent_style`](#indent_style).
 
-## `struct_lit_width` 
+## `struct_lit_width`
 
 Maximum width in the body of a struct literal before falling back to vertical formatting. A value of `0` (zero) results in struct literals always being broken into multiple lines. Note this occurs when `use_small_heuristics` is set to `Off`.
 
@@ -2321,11 +2321,11 @@ Maximum width in the body of a struct literal before falling back to vertical fo
 - **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
 - **Stable**: Yes
 
-By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `struct_lit_width` will take precedence. 
+By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `struct_lit_width` will take precedence.
 
 See also [`max_width`](#max_width), [`use_small_heuristics`](#use_small_heuristics), and [`struct_lit_single_line`](#struct_lit_single_line)
 
-## `struct_variant_width` 
+## `struct_variant_width`
 
 Maximum width in the body of a struct variant before falling back to vertical formatting. A value of `0` (zero) results in struct literals always being broken into multiple lines. Note this occurs when `use_small_heuristics` is set to `Off`.
 
@@ -2333,7 +2333,7 @@ Maximum width in the body of a struct variant before falling back to vertical fo
 - **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
 - **Stable**: Yes
 
-By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `struct_variant_width` will take precedence. 
+By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `struct_variant_width` will take precedence.
 
 See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics)
 
@@ -2530,7 +2530,7 @@ fn main() {
 
 This option can be used to simplify the management and bulk updates of the granular width configuration settings ([`fn_call_width`](#fn_call_width), [`attr_fn_like_width`](#attr_fn_like_width), [`struct_lit_width`](#struct_lit_width), [`struct_variant_width`](#struct_variant_width), [`array_width`](#array_width), [`chain_width`](#chain_width), [`single_line_if_else_max_width`](#single_line_if_else_max_width)), that respectively control when formatted constructs are multi-lined/vertical based on width.
 
-Note that explicitly provided values for the width configuration settings take precedence and override the calculated values determined by `use_small_heuristics`. 
+Note that explicitly provided values for the width configuration settings take precedence and override the calculated values determined by `use_small_heuristics`.
 
 - **Default value**: `"Default"`
 - **Possible values**: `"Default"`, `"Off"`, `"Max"`
@@ -2595,7 +2595,7 @@ fn main() {
 ```
 
 #### `Off`:
-When `use_small_heuristics` is set to `Off`, the granular width settings are functionally disabled and ignored. See the documentation for the respective width config options for specifics. 
+When `use_small_heuristics` is set to `Off`, the granular width settings are functionally disabled and ignored. See the documentation for the respective width config options for specifics.
 
 ```rust
 enum Lorem {
diff --git a/src/tools/rustfmt/Contributing.md b/src/tools/rustfmt/Contributing.md
index 131f38dd06a..1b77dad11f0 100644
--- a/src/tools/rustfmt/Contributing.md
+++ b/src/tools/rustfmt/Contributing.md
@@ -38,7 +38,7 @@ colourised diff will be printed so that the offending line(s) can quickly be
 identified.
 
 Without explicit settings, the tests will be run using rustfmt's default
-configuration. It is possible to run a test using non-default settings in several 
+configuration. It is possible to run a test using non-default settings in several
 ways. Firstly, you can include configuration parameters in comments at the top
 of the file. For example: to use 3 spaces per tab, start your test with
 `// rustfmt-tab_spaces: 3`. Just remember that the comment is part of the input,
diff --git a/src/tools/rustfmt/Design.md b/src/tools/rustfmt/Design.md
index 00a7652aee0..7a4dcf8773b 100644
--- a/src/tools/rustfmt/Design.md
+++ b/src/tools/rustfmt/Design.md
@@ -150,8 +150,8 @@ for its configuration.
 
 Our visitor keeps track of the desired current indent due to blocks (
 `block_indent`). Each `visit_*` method reformats code according to this indent,
-`config.comment_width()` and `config.max_width()`. Most reformatting that is done 
-in the `visit_*` methods is a bit hacky and is meant to be temporary until it can 
+`config.comment_width()` and `config.max_width()`. Most reformatting that is done
+in the `visit_*` methods is a bit hacky and is meant to be temporary until it can
 be done properly.
 
 There are a bunch of methods called `rewrite_*`. They do the bulk of the
diff --git a/src/tools/rustfmt/README.md b/src/tools/rustfmt/README.md
index 7a97d31bab9..500a9f9a37c 100644
--- a/src/tools/rustfmt/README.md
+++ b/src/tools/rustfmt/README.md
@@ -180,13 +180,13 @@ needs to be specified in `rustfmt.toml`, e.g., with `edition = "2018"`.
 
 * For things you do not want rustfmt to mangle, use `#[rustfmt::skip]`
 * To prevent rustfmt from formatting a macro or an attribute,
-  use `#[rustfmt::skip::macros(target_macro_name)]` or 
+  use `#[rustfmt::skip::macros(target_macro_name)]` or
   `#[rustfmt::skip::attributes(target_attribute_name)]`
 
   Example:
 
     ```rust
-    #![rustfmt::skip::attributes(custom_attribute)]   
+    #![rustfmt::skip::attributes(custom_attribute)]
 
     #[custom_attribute(formatting , here , should , be , Skipped)]
     #[rustfmt::skip::macros(html)]
diff --git a/src/tools/rustfmt/ci/integration.sh b/src/tools/rustfmt/ci/integration.sh
index 13a3ecaa196..0269e3ee4af 100755
--- a/src/tools/rustfmt/ci/integration.sh
+++ b/src/tools/rustfmt/ci/integration.sh
@@ -15,7 +15,7 @@ set -ex
 # it again.
 #
 #which cargo-fmt || cargo install --force
-CFG_RELEASE=nightly CFG_RELEASE_CHANNEL=nightly cargo install --path . --force 
+CFG_RELEASE=nightly CFG_RELEASE_CHANNEL=nightly cargo install --path . --force
 
 echo "Integration tests for: ${INTEGRATION}"
 cargo fmt -- --version
diff --git a/src/tools/rustfmt/docs/index.html b/src/tools/rustfmt/docs/index.html
index 2a12da3881f..56d1917e2b6 100644
--- a/src/tools/rustfmt/docs/index.html
+++ b/src/tools/rustfmt/docs/index.html
@@ -85,7 +85,7 @@
                 outputHtml() {
                   const ast = this.configurationDescriptions
                                   .filter(({ head, text, stable }) => {
-                                    
+
                                     if (
                                       text.includes(this.searchCondition) === false &&
                                       head.includes(this.searchCondition) === false
@@ -105,7 +105,7 @@
               },
               created: async function() {
                 const res = await axios.get(ConfigurationMdUrl);
-                const { 
+                const {
                   about,
                   configurationAbout,
                   configurationDescriptions
@@ -144,7 +144,7 @@
                   const lastIndex = stack.length - 1;
                   stack[lastIndex].push(next);
                   return stack;
-                }, 
+                },
                 [[]]);
               });
             }
@@ -179,7 +179,7 @@
                 configurationAbout, ...configurationDescriptions
               ] = configurations;
               configurationAbout.value.links = {};
-              
+
               return {
                 about,
                 configurationAbout: configurationAbout.value,
diff --git a/src/tools/rustfmt/src/modules.rs b/src/tools/rustfmt/src/modules.rs
index c3f44068601..5de0575b5cd 100644
--- a/src/tools/rustfmt/src/modules.rs
+++ b/src/tools/rustfmt/src/modules.rs
@@ -318,7 +318,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
             self.directory = directory;
         }
         match (sub_mod.ast_mod_kind, sub_mod.items) {
-            (Some(Cow::Borrowed(ast::ModKind::Loaded(items, ast::Inline::No, _))), _) => {
+            (Some(Cow::Borrowed(ast::ModKind::Loaded(items, _, _))), _) => {
                 self.visit_mod_from_ast(&items)
             }
             (Some(Cow::Owned(..)), Cow::Owned(items)) => self.visit_mod_outside_ast(items),
diff --git a/src/tools/rustfmt/src/test/mod.rs b/src/tools/rustfmt/src/test/mod.rs
index ce56a223f2b..cb52346a13a 100644
--- a/src/tools/rustfmt/src/test/mod.rs
+++ b/src/tools/rustfmt/src/test/mod.rs
@@ -16,6 +16,7 @@ use crate::source_file;
 use crate::{is_nightly_channel, FormatReport, FormatReportFormatterBuilder, Input, Session};
 
 mod configuration_snippet;
+mod mod_resolver;
 mod parser;
 
 const DIFF_CONTEXT_SIZE: usize = 3;
diff --git a/src/tools/rustfmt/src/test/mod_resolver.rs b/src/tools/rustfmt/src/test/mod_resolver.rs
new file mode 100644
index 00000000000..e0b55e3efb2
--- /dev/null
+++ b/src/tools/rustfmt/src/test/mod_resolver.rs
@@ -0,0 +1,25 @@
+use std::io;
+use std::path::PathBuf;
+
+use super::read_config;
+
+use crate::{FileName, Input, Session};
+
+#[test]
+fn nested_out_of_line_mods_loaded() {
+    // See also https://github.com/rust-lang/rustfmt/issues/4874
+    let filename = "tests/mod-resolver/issue-4874/main.rs";
+    let input_file = PathBuf::from(filename);
+    let config = read_config(&input_file);
+    let mut session = Session::<io::Stdout>::new(config, None);
+    let report = session
+        .format(Input::File(filename.into()))
+        .expect("Should not have had any execution errors");
+    let errors_by_file = &report.internal.borrow().0;
+    assert!(errors_by_file.contains_key(&FileName::Real(PathBuf::from(
+        "tests/mod-resolver/issue-4874/bar/baz.rs",
+    ))));
+    assert!(errors_by_file.contains_key(&FileName::Real(PathBuf::from(
+        "tests/mod-resolver/issue-4874/foo/qux.rs",
+    ))));
+}
diff --git a/src/tools/rustfmt/tests/mod-resolver/issue-4874/bar/baz.rs b/src/tools/rustfmt/tests/mod-resolver/issue-4874/bar/baz.rs
new file mode 100644
index 00000000000..d31b675ea26
--- /dev/null
+++ b/src/tools/rustfmt/tests/mod-resolver/issue-4874/bar/baz.rs
@@ -0,0 +1,5 @@
+fn 
+     fail_fmt_check
+   (
+
+   ) {}
\ No newline at end of file
diff --git a/src/tools/rustfmt/tests/mod-resolver/issue-4874/foo.rs b/src/tools/rustfmt/tests/mod-resolver/issue-4874/foo.rs
new file mode 100644
index 00000000000..246d847869a
--- /dev/null
+++ b/src/tools/rustfmt/tests/mod-resolver/issue-4874/foo.rs
@@ -0,0 +1 @@
+mod qux;
\ No newline at end of file
diff --git a/src/tools/rustfmt/tests/mod-resolver/issue-4874/foo/qux.rs b/src/tools/rustfmt/tests/mod-resolver/issue-4874/foo/qux.rs
new file mode 100644
index 00000000000..d8bb610a64d
--- /dev/null
+++ b/src/tools/rustfmt/tests/mod-resolver/issue-4874/foo/qux.rs
@@ -0,0 +1,5 @@
+ fn 
+ badly_formatted
+    (
+
+    ) {}
\ No newline at end of file
diff --git a/src/tools/rustfmt/tests/mod-resolver/issue-4874/main.rs b/src/tools/rustfmt/tests/mod-resolver/issue-4874/main.rs
new file mode 100644
index 00000000000..3609415b146
--- /dev/null
+++ b/src/tools/rustfmt/tests/mod-resolver/issue-4874/main.rs
@@ -0,0 +1,8 @@
+fn main() {
+    println!("Hello, world!");
+}
+
+mod foo;
+mod bar {
+    mod baz;
+}
\ No newline at end of file
diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs
index 06cec1964a0..ea587210b4f 100644
--- a/src/tools/tidy/src/deps.rs
+++ b/src/tools/tidy/src/deps.rs
@@ -287,6 +287,7 @@ pub fn check(root: &Path, cargo: &Path, bad: &mut bool) {
     check_exceptions(&metadata, EXCEPTIONS, runtime_ids, bad);
     check_dependencies(&metadata, PERMITTED_DEPENDENCIES, RESTRICTED_DEPENDENCY_CRATES, bad);
     check_crate_duplicate(&metadata, FORBIDDEN_TO_HAVE_DUPLICATES, bad);
+    check_rustfix(&metadata, bad);
 
     // Check rustc_codegen_cranelift independently as it has it's own workspace.
     let mut cmd = cargo_metadata::MetadataCommand::new();
@@ -547,3 +548,22 @@ fn normal_deps_of_r<'a>(
         normal_deps_of_r(resolve, &dep.pkg, result);
     }
 }
+
+fn check_rustfix(metadata: &Metadata, bad: &mut bool) {
+    let cargo = pkg_from_name(metadata, "cargo");
+    let compiletest = pkg_from_name(metadata, "compiletest");
+    let cargo_deps = deps_of(metadata, &cargo.id);
+    let compiletest_deps = deps_of(metadata, &compiletest.id);
+    let cargo_rustfix = cargo_deps.iter().find(|p| p.name == "rustfix").unwrap();
+    let compiletest_rustfix = compiletest_deps.iter().find(|p| p.name == "rustfix").unwrap();
+    if cargo_rustfix.version != compiletest_rustfix.version {
+        tidy_error!(
+            bad,
+            "cargo's rustfix version {} does not match compiletest's rustfix version {}\n\
+             rustfix should be kept in sync, update the cargo side first, and then update \
+             compiletest along with cargo.",
+            cargo_rustfix.version,
+            compiletest_rustfix.version
+        );
+    }
+}
diff --git a/src/tools/tidy/src/pal.rs b/src/tools/tidy/src/pal.rs
index db177f75cea..31cdc6865a4 100644
--- a/src/tools/tidy/src/pal.rs
+++ b/src/tools/tidy/src/pal.rs
@@ -56,7 +56,6 @@ const EXCEPTION_PATHS: &[&str] = &[
     "library/std/src/f32.rs",
     "library/std/src/f64.rs",
     "library/std/src/path.rs",
-    "library/std/src/thread/available_concurrency.rs",
     "library/std/src/sys_common", // Should only contain abstractions over platforms
     "library/std/src/net/test.rs", // Utility helpers for tests
 ];