about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_hir_analysis/src/coherence/inherent_impls.rs33
-rw-r--r--compiler/rustc_infer/src/infer/error_reporting/mod.rs34
-rw-r--r--compiler/rustc_infer/src/infer/error_reporting/suggest.rs31
-rw-r--r--compiler/rustc_middle/src/ty/error.rs2
-rw-r--r--library/std/src/sys/windows/fs.rs7
-rw-r--r--src/bootstrap/format.rs40
m---------src/doc/book0
m---------src/doc/embedded-book0
m---------src/doc/nomicon0
m---------src/doc/reference0
m---------src/doc/rust-by-example0
m---------src/doc/rustc-dev-guide0
-rw-r--r--src/doc/style-guide/src/cargo.md3
-rw-r--r--src/librustdoc/formats/item_type.rs1
-rw-r--r--src/librustdoc/html/render/search_index.rs11
-rw-r--r--src/librustdoc/html/static/js/search.js9
-rw-r--r--tests/mir-opt/copy-prop/mutate_through_pointer.rs10
-rw-r--r--tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff2
-rw-r--r--tests/mir-opt/dataflow-const-prop/sibling_ptr.rs9
-rw-r--r--tests/mir-opt/sroa.escaping.ScalarReplacementOfAggregates.diff48
-rw-r--r--tests/mir-opt/sroa.rs7
-rw-r--r--tests/ui/async-await/dont-suggest-missing-await.stderr9
-rw-r--r--tests/ui/async-await/generator-desc.stderr4
-rw-r--r--tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr2
-rw-r--r--tests/ui/async-await/issue-61076.rs2
-rw-r--r--tests/ui/async-await/issue-61076.stderr2
-rw-r--r--tests/ui/async-await/issue-98634.stderr12
-rw-r--r--tests/ui/async-await/issues/issue-102206.stderr4
-rw-r--r--tests/ui/async-await/suggest-missing-await-closure.stderr9
-rw-r--r--tests/ui/async-await/suggest-missing-await.stderr28
-rw-r--r--tests/ui/coherence/issue-85026.stderr8
-rw-r--r--tests/ui/const-generics/wrong-normalization.stderr4
-rw-r--r--tests/ui/error-codes/E0116.stderr2
-rw-r--r--tests/ui/error-codes/E0118.stderr4
-rw-r--r--tests/ui/error-codes/E0390.stderr8
-rw-r--r--tests/ui/impl-trait/issue-102605.stderr9
-rw-r--r--tests/ui/impl-trait/issue-99914.stderr4
-rw-r--r--tests/ui/impl-trait/where-allowed.stderr4
-rw-r--r--tests/ui/incoherent-inherent-impls/needs-has-incoherent-impls.stderr78
-rw-r--r--tests/ui/incoherent-inherent-impls/no-attr-empty-impl.stderr12
-rw-r--r--tests/ui/kinds-of-primitive-impl.stderr16
-rw-r--r--tests/ui/privacy/private-in-public-ill-formed.stderr8
-rw-r--r--tests/ui/suggestions/if-then-neeing-semi.rs11
-rw-r--r--tests/ui/suggestions/if-then-neeing-semi.stderr24
-rw-r--r--tests/ui/suggestions/issue-81839.stderr5
-rw-r--r--tests/ui/suggestions/match-prev-arm-needing-semi.rs11
-rw-r--r--tests/ui/suggestions/match-prev-arm-needing-semi.stderr24
-rw-r--r--tests/ui/suggestions/opaque-type-error.stderr8
-rw-r--r--tests/ui/traits/trait-or-new-type-instead.stderr7
-rw-r--r--tests/ui/type-alias-impl-trait/issue-98604.stderr4
-rw-r--r--tests/ui/typeck/issue-90027-async-fn-return-suggestion.stderr9
51 files changed, 316 insertions, 263 deletions
diff --git a/compiler/rustc_hir_analysis/src/coherence/inherent_impls.rs b/compiler/rustc_hir_analysis/src/coherence/inherent_impls.rs
index c1b0237b2d1..940a450101c 100644
--- a/compiler/rustc_hir_analysis/src/coherence/inherent_impls.rs
+++ b/compiler/rustc_hir_analysis/src/coherence/inherent_impls.rs
@@ -57,7 +57,7 @@ const ADD_ATTR: &str =
     "alternatively add `#[rustc_allow_incoherent_impl]` to the relevant impl items";
 
 impl<'tcx> InherentCollect<'tcx> {
-    fn check_def_id(&mut self, item: &hir::Item<'_>, self_ty: Ty<'tcx>, def_id: DefId) {
+    fn check_def_id(&mut self, item: &hir::Item<'_>, self_ty: Ty<'tcx>, def_id: DefId, span: Span) {
         let impl_def_id = item.owner_id;
         if let Some(def_id) = def_id.as_local() {
             // Add the implementation to the mapping from implementation to base
@@ -76,12 +76,12 @@ impl<'tcx> InherentCollect<'tcx> {
             if !self.tcx.has_attr(def_id, sym::rustc_has_incoherent_inherent_impls) {
                 struct_span_err!(
                     self.tcx.sess,
-                    item.span,
+                    span,
                     E0390,
                     "cannot define inherent `impl` for a type outside of the crate where the type is defined",
                 )
                 .help(INTO_DEFINING_CRATE)
-                .span_help(item.span, ADD_ATTR_TO_TY)
+                .span_help(span, ADD_ATTR_TO_TY)
                 .emit();
                 return;
             }
@@ -93,12 +93,12 @@ impl<'tcx> InherentCollect<'tcx> {
                 {
                     struct_span_err!(
                         self.tcx.sess,
-                        item.span,
+                        span,
                         E0390,
                         "cannot define inherent `impl` for a type outside of the crate where the type is defined",
                     )
                     .help(INTO_DEFINING_CRATE)
-                    .span_help(impl_item.span, ADD_ATTR)
+                    .span_help(self.tcx.hir().span(impl_item.id.hir_id()), ADD_ATTR)
                     .emit();
                     return;
                 }
@@ -112,12 +112,12 @@ impl<'tcx> InherentCollect<'tcx> {
         } else {
             struct_span_err!(
                 self.tcx.sess,
-                item.span,
+                span,
                 E0116,
                 "cannot define inherent `impl` for a type outside of the crate \
                               where the type is defined"
             )
-            .span_label(item.span, "impl for type defined outside of crate.")
+            .span_label(span, "impl for type defined outside of crate.")
             .note("define and implement a trait or new type instead")
             .emit();
         }
@@ -182,29 +182,30 @@ impl<'tcx> InherentCollect<'tcx> {
         }
 
         let item = self.tcx.hir().item(id);
-        let hir::ItemKind::Impl(hir::Impl { of_trait: None, self_ty: ty, items, .. }) = item.kind else {
+        let impl_span = self.tcx.hir().span(id.hir_id());
+        let hir::ItemKind::Impl(hir::Impl { of_trait: None, items, .. }) = item.kind else {
             return;
         };
 
         let self_ty = self.tcx.type_of(item.owner_id);
         match *self_ty.kind() {
             ty::Adt(def, _) => {
-                self.check_def_id(item, self_ty, def.did());
+                self.check_def_id(item, self_ty, def.did(), impl_span);
             }
             ty::Foreign(did) => {
-                self.check_def_id(item, self_ty, did);
+                self.check_def_id(item, self_ty, did, impl_span);
             }
             ty::Dynamic(data, ..) if data.principal_def_id().is_some() => {
-                self.check_def_id(item, self_ty, data.principal_def_id().unwrap());
+                self.check_def_id(item, self_ty, data.principal_def_id().unwrap(), impl_span);
             }
             ty::Dynamic(..) => {
                 struct_span_err!(
                     self.tcx.sess,
-                    ty.span,
+                    impl_span,
                     E0785,
                     "cannot define inherent `impl` for a dyn auto trait"
                 )
-                .span_label(ty.span, "impl requires at least one non-auto trait")
+                .span_label(impl_span, "impl requires at least one non-auto trait")
                 .note("define and implement a new trait or type instead")
                 .emit();
             }
@@ -221,17 +222,17 @@ impl<'tcx> InherentCollect<'tcx> {
             | ty::Never
             | ty::FnPtr(_)
             | ty::Tuple(..) => {
-                self.check_primitive_impl(item.owner_id.def_id, self_ty, items, ty.span)
+                self.check_primitive_impl(item.owner_id.def_id, self_ty, items, impl_span)
             }
             ty::Alias(..) | ty::Param(_) => {
                 let mut err = struct_span_err!(
                     self.tcx.sess,
-                    ty.span,
+                    impl_span,
                     E0118,
                     "no nominal type found for inherent implementation"
                 );
 
-                err.span_label(ty.span, "impl requires a nominal type")
+                err.span_label(impl_span, "impl requires a nominal type")
                     .note("either implement a trait on it or create a newtype to wrap it instead");
 
                 err.emit();
diff --git a/compiler/rustc_infer/src/infer/error_reporting/mod.rs b/compiler/rustc_infer/src/infer/error_reporting/mod.rs
index 9841c3141c9..c56149c1149 100644
--- a/compiler/rustc_infer/src/infer/error_reporting/mod.rs
+++ b/compiler/rustc_infer/src/infer/error_reporting/mod.rs
@@ -1783,14 +1783,24 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
                             }
                         }))
                     {
-                        diag.note_expected_found_extra(
-                            &expected_label,
-                            expected,
-                            &found_label,
-                            found,
-                            &sort_string(values.expected, exp_p),
-                            &sort_string(values.found, found_p),
-                        );
+                        if let Some(ExpectedFound { found: found_ty, .. }) = exp_found {
+                            // `Future` is a special opaque type that the compiler
+                            // will try to hide in some case such as `async fn`, so
+                            // to make an error more use friendly we will
+                            // avoid to suggest a mismatch type with a
+                            // type that the user usually are not usign
+                            // directly such as `impl Future<Output = u8>`.
+                            if !self.tcx.ty_is_opaque_future(found_ty) {
+                                diag.note_expected_found_extra(
+                                    &expected_label,
+                                    expected,
+                                    &found_label,
+                                    found,
+                                    &sort_string(values.expected, exp_p),
+                                    &sort_string(values.found, found_p),
+                                );
+                            }
+                        }
                     }
                 }
                 _ => {
@@ -2854,6 +2864,7 @@ impl IntoDiagnosticArg for ObligationCauseAsDiagArg<'_> {
 pub enum TyCategory {
     Closure,
     Opaque,
+    OpaqueFuture,
     Generator(hir::GeneratorKind),
     Foreign,
 }
@@ -2863,6 +2874,7 @@ impl TyCategory {
         match self {
             Self::Closure => "closure",
             Self::Opaque => "opaque type",
+            Self::OpaqueFuture => "future",
             Self::Generator(gk) => gk.descr(),
             Self::Foreign => "foreign type",
         }
@@ -2871,7 +2883,11 @@ impl TyCategory {
     pub fn from_ty(tcx: TyCtxt<'_>, ty: Ty<'_>) -> Option<(Self, DefId)> {
         match *ty.kind() {
             ty::Closure(def_id, _) => Some((Self::Closure, def_id)),
-            ty::Alias(ty::Opaque, ty::AliasTy { def_id, .. }) => Some((Self::Opaque, def_id)),
+            ty::Alias(ty::Opaque, ty::AliasTy { def_id, .. }) => {
+                let kind =
+                    if tcx.ty_is_opaque_future(ty) { Self::OpaqueFuture } else { Self::Opaque };
+                Some((kind, def_id))
+            }
             ty::Generator(def_id, ..) => {
                 Some((Self::Generator(tcx.generator_kind(def_id).unwrap()), def_id))
             }
diff --git a/compiler/rustc_infer/src/infer/error_reporting/suggest.rs b/compiler/rustc_infer/src/infer/error_reporting/suggest.rs
index 73859aca424..7d9a53d1c02 100644
--- a/compiler/rustc_infer/src/infer/error_reporting/suggest.rs
+++ b/compiler/rustc_infer/src/infer/error_reporting/suggest.rs
@@ -238,31 +238,17 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
                 }
             },
             (_, Some(ty)) if self.same_type_modulo_infer(exp_found.expected, ty) => {
-                diag.span_suggestion_verbose(
-                    exp_span.shrink_to_hi(),
-                    "consider `await`ing on the `Future`",
-                    ".await",
-                    Applicability::MaybeIncorrect,
-                );
+                self.suggest_await_on_future(diag, exp_span);
+                diag.span_note(exp_span, "calling an async function returns a future");
             }
             (Some(ty), _) if self.same_type_modulo_infer(ty, exp_found.found) => match cause.code()
             {
                 ObligationCauseCode::Pattern { span: Some(then_span), .. } => {
-                    diag.span_suggestion_verbose(
-                        then_span.shrink_to_hi(),
-                        "consider `await`ing on the `Future`",
-                        ".await",
-                        Applicability::MaybeIncorrect,
-                    );
+                    self.suggest_await_on_future(diag, then_span.shrink_to_hi());
                 }
                 ObligationCauseCode::IfExpression(box IfExpressionCause { then_id, .. }) => {
                     let then_span = self.find_block_span_from_hir_id(*then_id);
-                    diag.span_suggestion_verbose(
-                        then_span.shrink_to_hi(),
-                        "consider `await`ing on the `Future`",
-                        ".await",
-                        Applicability::MaybeIncorrect,
-                    );
+                    self.suggest_await_on_future(diag, then_span.shrink_to_hi());
                 }
                 ObligationCauseCode::MatchExpressionArm(box MatchExpressionArmCause {
                     ref prior_arms,
@@ -283,6 +269,15 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
         }
     }
 
+    pub fn suggest_await_on_future(&self, diag: &mut Diagnostic, sp: Span) {
+        diag.span_suggestion_verbose(
+            sp.shrink_to_hi(),
+            "consider `await`ing on the `Future`",
+            ".await",
+            Applicability::MaybeIncorrect,
+        );
+    }
+
     pub(super) fn suggest_accessing_field_where_appropriate(
         &self,
         cause: &ObligationCause<'tcx>,
diff --git a/compiler/rustc_middle/src/ty/error.rs b/compiler/rustc_middle/src/ty/error.rs
index bd78705cdb5..9c171a69d06 100644
--- a/compiler/rustc_middle/src/ty/error.rs
+++ b/compiler/rustc_middle/src/ty/error.rs
@@ -271,7 +271,7 @@ impl<'tcx> Ty<'tcx> {
             ty::Infer(ty::FreshFloatTy(_)) => "fresh floating-point type".into(),
             ty::Alias(ty::Projection, _) => "associated type".into(),
             ty::Param(p) => format!("type parameter `{p}`").into(),
-            ty::Alias(ty::Opaque, ..) => "opaque type".into(),
+            ty::Alias(ty::Opaque, ..) => if tcx.ty_is_opaque_future(self) { "future".into() } else { "opaque type".into() },
             ty::Error(_) => "type error".into(),
             _ => {
                 let width = tcx.sess.diagnostic_width();
diff --git a/library/std/src/sys/windows/fs.rs b/library/std/src/sys/windows/fs.rs
index f1a784b5fd2..d2c597664fa 100644
--- a/library/std/src/sys/windows/fs.rs
+++ b/library/std/src/sys/windows/fs.rs
@@ -1266,7 +1266,12 @@ fn metadata(path: &Path, reparse: ReparsePoint) -> io::Result<FileAttr> {
     // If the fallback fails for any reason we return the original error.
     match File::open(path, &opts) {
         Ok(file) => file.file_attr(),
-        Err(e) if e.raw_os_error() == Some(c::ERROR_SHARING_VIOLATION as _) => {
+        Err(e)
+            if [Some(c::ERROR_SHARING_VIOLATION as _), Some(c::ERROR_ACCESS_DENIED as _)]
+                .contains(&e.raw_os_error()) =>
+        {
+            // `ERROR_ACCESS_DENIED` is returned when the user doesn't have permission for the resource.
+            // One such example is `System Volume Information` as default but can be created as well
             // `ERROR_SHARING_VIOLATION` will almost never be returned.
             // Usually if a file is locked you can still read some metadata.
             // However, there are special system files, such as
diff --git a/src/bootstrap/format.rs b/src/bootstrap/format.rs
index 6c9c26faef6..615794958d0 100644
--- a/src/bootstrap/format.rs
+++ b/src/bootstrap/format.rs
@@ -193,10 +193,46 @@ pub fn format(build: &Builder<'_>, check: bool, paths: &[PathBuf]) {
     let (tx, rx): (SyncSender<PathBuf>, _) = std::sync::mpsc::sync_channel(128);
     let walker = match paths.get(0) {
         Some(first) => {
-            let mut walker = WalkBuilder::new(first);
+            let find_shortcut_candidates = |p: &PathBuf| {
+                let mut candidates = Vec::new();
+                for candidate in WalkBuilder::new(src.clone()).max_depth(Some(3)).build() {
+                    if let Ok(entry) = candidate {
+                        if let Some(dir_name) = p.file_name() {
+                            if entry.path().is_dir() && entry.file_name() == dir_name {
+                                candidates.push(entry.into_path());
+                            }
+                        }
+                    }
+                }
+                candidates
+            };
+
+            // Only try to look for shortcut candidates for single component paths like
+            // `std` and not for e.g. relative paths like `../library/std`.
+            let should_look_for_shortcut_dir = |p: &PathBuf| p.components().count() == 1;
+
+            let mut walker = if should_look_for_shortcut_dir(first) {
+                if let [single_candidate] = &find_shortcut_candidates(first)[..] {
+                    WalkBuilder::new(single_candidate)
+                } else {
+                    WalkBuilder::new(first)
+                }
+            } else {
+                WalkBuilder::new(first)
+            };
+
             for path in &paths[1..] {
-                walker.add(path);
+                if should_look_for_shortcut_dir(path) {
+                    if let [single_candidate] = &find_shortcut_candidates(path)[..] {
+                        walker.add(single_candidate);
+                    } else {
+                        walker.add(path);
+                    }
+                } else {
+                    walker.add(path);
+                }
             }
+
             walker
         }
         None => WalkBuilder::new(src.clone()),
diff --git a/src/doc/book b/src/doc/book
-Subproject f2a78f64b668f63f581203c6bac509903f7c00e
+Subproject d94e03a18a2590ed3f1c67b859cb11528d2a2d5
diff --git a/src/doc/embedded-book b/src/doc/embedded-book
-Subproject f1a4614aa41cc544b91b79760a709e113f3451d
+Subproject 701d1551429da4cb609082c0ac99df569e33671
diff --git a/src/doc/nomicon b/src/doc/nomicon
-Subproject bd1829d235296952bf72ca55635e360584b8805
+Subproject 79b53665a7c61d171fb8c5ad0b73b371f9ee6ba
diff --git a/src/doc/reference b/src/doc/reference
-Subproject 22882fb3f7b4d69fdc0d1731e8b9cfcb6910537
+Subproject e5adb99c04817b7fbe08f4ffce5b36702667345
diff --git a/src/doc/rust-by-example b/src/doc/rust-by-example
-Subproject 134376872e8c387ef369507e0ee9b5a0e327271
+Subproject efe23c4fe12e06351b8dc8c3d18312c76145510
diff --git a/src/doc/rustc-dev-guide b/src/doc/rustc-dev-guide
-Subproject e359ee27fc3da3356d71a732128c0a1abe02e53
+Subproject 41a96ab971cb45e2a184df20619ad1829765c99
diff --git a/src/doc/style-guide/src/cargo.md b/src/doc/style-guide/src/cargo.md
index f4993ba06a8..13b96ca8c5e 100644
--- a/src/doc/style-guide/src/cargo.md
+++ b/src/doc/style-guide/src/cargo.md
@@ -17,8 +17,7 @@ followed by the `description` at the end of that section.
 Don't use quotes around any standard key names; use bare keys. Only use quoted
 keys for non-standard keys whose names require them, and avoid introducing such
 key names when possible.  See the [TOML
-specification](https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.4.0.md#table)
-for details.
+specification](https://toml.io/en/v1.0.0#keys) for details.
 
 Put a single space both before and after the `=` between a key and value. Do
 not indent any key names; start all key names at the start of a line.
diff --git a/src/librustdoc/formats/item_type.rs b/src/librustdoc/formats/item_type.rs
index 2f1f4cbf359..aafedc17499 100644
--- a/src/librustdoc/formats/item_type.rs
+++ b/src/librustdoc/formats/item_type.rs
@@ -21,6 +21,7 @@ use crate::clean;
 /// a heading, edit the listing in `html/render.rs`, function `sidebar_module`. This uses an
 /// ordering based on a helper function inside `item_module`, in the same file.
 #[derive(Copy, PartialEq, Eq, Hash, Clone, Debug, PartialOrd, Ord)]
+#[repr(u8)]
 pub(crate) enum ItemType {
     Module = 0,
     ExternCrate = 1,
diff --git a/src/librustdoc/html/render/search_index.rs b/src/librustdoc/html/render/search_index.rs
index 5b0caac099b..090ea2cb157 100644
--- a/src/librustdoc/html/render/search_index.rs
+++ b/src/librustdoc/html/render/search_index.rs
@@ -236,7 +236,16 @@ pub(crate) fn build_index<'tcx>(
             crate_data.serialize_field("doc", &self.doc)?;
             crate_data.serialize_field(
                 "t",
-                &self.items.iter().map(|item| &item.ty).collect::<Vec<_>>(),
+                &self
+                    .items
+                    .iter()
+                    .map(|item| {
+                        let n = item.ty as u8;
+                        let c = char::try_from(n + b'A').expect("item types must fit in ASCII");
+                        assert!(c <= 'z', "item types must fit within ASCII printables");
+                        c
+                    })
+                    .collect::<String>(),
             )?;
             crate_data.serialize_field(
                 "n",
diff --git a/src/librustdoc/html/static/js/search.js b/src/librustdoc/html/static/js/search.js
index ea1875d8e27..1e6c94d29ba 100644
--- a/src/librustdoc/html/static/js/search.js
+++ b/src/librustdoc/html/static/js/search.js
@@ -1939,6 +1939,7 @@ function initSearch(rawSearchIndex) {
          * @type {Array<string>}
          */
         const searchWords = [];
+        const charA = "A".charCodeAt(0);
         let i, word;
         let currentIndex = 0;
         let id = 0;
@@ -1953,7 +1954,7 @@ function initSearch(rawSearchIndex) {
             /**
              * The raw search data for a given crate. `n`, `t`, `d`, and `q`, `i`, and `f`
              * are arrays with the same length. n[i] contains the name of an item.
-             * t[i] contains the type of that item (as a small integer that represents an
+             * t[i] contains the type of that item (as a string of characters that represent an
              * offset in `itemTypes`). d[i] contains the description of that item.
              *
              * q[i] contains the full path of the item, or an empty string indicating
@@ -1980,7 +1981,7 @@ function initSearch(rawSearchIndex) {
              *   doc: string,
              *   a: Object,
              *   n: Array<string>,
-             *   t: Array<Number>,
+             *   t: String,
              *   d: Array<string>,
              *   q: Array<string>,
              *   i: Array<Number>,
@@ -2009,7 +2010,7 @@ function initSearch(rawSearchIndex) {
             searchIndex.push(crateRow);
             currentIndex += 1;
 
-            // an array of (Number) item types
+            // a String of one character item type codes
             const itemTypes = crateCorpus.t;
             // an array of (String) item names
             const itemNames = crateCorpus.n;
@@ -2060,7 +2061,7 @@ function initSearch(rawSearchIndex) {
                 }
                 const row = {
                     crate: crate,
-                    ty: itemTypes[i],
+                    ty: itemTypes.charCodeAt(i) - charA,
                     name: itemNames[i],
                     path: itemPaths[i] ? itemPaths[i] : lastPath,
                     desc: itemDescs[i],
diff --git a/tests/mir-opt/copy-prop/mutate_through_pointer.rs b/tests/mir-opt/copy-prop/mutate_through_pointer.rs
index 609e49d6bc9..da142e33948 100644
--- a/tests/mir-opt/copy-prop/mutate_through_pointer.rs
+++ b/tests/mir-opt/copy-prop/mutate_through_pointer.rs
@@ -1,3 +1,13 @@
+// This attempts to mutate `a` via a pointer derived from `addr_of!(a)`. That is UB
+// according to Miri. However, the decision to make this UB - and to allow
+// rustc to rely on that fact for the purpose of optimizations - has not been
+// finalized.
+//
+// As such, we include this test to ensure that copy prop does not rely on that
+// fact. Specifically, if `addr_of!(a)` could not be used to modify a, it would
+// be correct for CopyProp to replace all occurrences of `a` with `c` - but that
+// would cause `f(true)` to output `false` instead of `true`.
+
 #![feature(custom_mir, core_intrinsics)]
 #![allow(unused_assignments)]
 extern crate core;
diff --git a/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff
index a91a755830d..004643e36f1 100644
--- a/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff
@@ -32,7 +32,7 @@
           _5 = _3;                         // scope 3 at $DIR/sibling_ptr.rs:+4:10: +4:11
           _4 = ptr::mut_ptr::<impl *mut u8>::add(move _5, const 1_usize) -> bb1; // scope 3 at $DIR/sibling_ptr.rs:+4:10: +4:18
                                            // mir::Constant
-                                           // + span: $DIR/sibling_ptr.rs:8:12: 8:15
+                                           // + span: $DIR/sibling_ptr.rs:15:12: 15:15
                                            // + literal: Const { ty: unsafe fn(*mut u8, usize) -> *mut u8 {ptr::mut_ptr::<impl *mut u8>::add}, val: Value(<ZST>) }
       }
   
diff --git a/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs b/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs
index 87ef00d1829..6dfb3a4ed30 100644
--- a/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs
+++ b/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs
@@ -1,3 +1,10 @@
+// This attempts to modify `x.1` via a pointer derived from `addr_of_mut!(x.0)`.
+// According to Miri, that is UB. However, T-opsem has not finalized that
+// decision and as such we cannot rely on it in optimizations. Consequently,
+// DataflowConstProp must treat the `addr_of_mut!(x.0)` as potentially being
+// used to modify `x.1` - if it did not, then it might incorrectly assume that it
+// can infer the value of `x.1` at the end of this function.
+
 // unit-test: DataflowConstProp
 
 // EMIT_MIR sibling_ptr.main.DataflowConstProp.diff
@@ -7,5 +14,5 @@ fn main() {
         let p = std::ptr::addr_of_mut!(x.0);
         *p.add(1) = 1;
     }
-    let x1 = x.1;  // should not be propagated
+    let x1 = x.1; // should not be propagated
 }
diff --git a/tests/mir-opt/sroa.escaping.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa.escaping.ScalarReplacementOfAggregates.diff
index ea7f5007224..fd691fdd153 100644
--- a/tests/mir-opt/sroa.escaping.ScalarReplacementOfAggregates.diff
+++ b/tests/mir-opt/sroa.escaping.ScalarReplacementOfAggregates.diff
@@ -3,42 +3,42 @@
   
   fn escaping() -> () {
       let mut _0: ();                      // return place in scope 0 at $DIR/sroa.rs:+0:19: +0:19
-      let _1: ();                          // in scope 0 at $DIR/sroa.rs:+2:5: +2:42
-      let mut _2: *const u32;              // in scope 0 at $DIR/sroa.rs:+2:7: +2:41
-      let _3: &u32;                        // in scope 0 at $DIR/sroa.rs:+2:7: +2:41
-      let _4: Escaping;                    // in scope 0 at $DIR/sroa.rs:+2:8: +2:39
-      let mut _5: u32;                     // in scope 0 at $DIR/sroa.rs:+2:34: +2:37
+      let _1: ();                          // in scope 0 at $DIR/sroa.rs:+1:5: +1:42
+      let mut _2: *const u32;              // in scope 0 at $DIR/sroa.rs:+1:7: +1:41
+      let _3: &u32;                        // in scope 0 at $DIR/sroa.rs:+1:7: +1:41
+      let _4: Escaping;                    // in scope 0 at $DIR/sroa.rs:+1:8: +1:39
+      let mut _5: u32;                     // in scope 0 at $DIR/sroa.rs:+1:34: +1:37
   
       bb0: {
-          StorageLive(_1);                 // scope 0 at $DIR/sroa.rs:+2:5: +2:42
-          StorageLive(_2);                 // scope 0 at $DIR/sroa.rs:+2:7: +2:41
-          StorageLive(_3);                 // scope 0 at $DIR/sroa.rs:+2:7: +2:41
-          StorageLive(_4);                 // scope 0 at $DIR/sroa.rs:+2:8: +2:39
-          StorageLive(_5);                 // scope 0 at $DIR/sroa.rs:+2:34: +2:37
-          _5 = g() -> bb1;                 // scope 0 at $DIR/sroa.rs:+2:34: +2:37
+          StorageLive(_1);                 // scope 0 at $DIR/sroa.rs:+1:5: +1:42
+          StorageLive(_2);                 // scope 0 at $DIR/sroa.rs:+1:7: +1:41
+          StorageLive(_3);                 // scope 0 at $DIR/sroa.rs:+1:7: +1:41
+          StorageLive(_4);                 // scope 0 at $DIR/sroa.rs:+1:8: +1:39
+          StorageLive(_5);                 // scope 0 at $DIR/sroa.rs:+1:34: +1:37
+          _5 = g() -> bb1;                 // scope 0 at $DIR/sroa.rs:+1:34: +1:37
                                            // mir::Constant
-                                           // + span: $DIR/sroa.rs:73:34: 73:35
+                                           // + span: $DIR/sroa.rs:78:34: 78:35
                                            // + literal: Const { ty: fn() -> u32 {g}, val: Value(<ZST>) }
       }
   
       bb1: {
-          _4 = Escaping { a: const 1_u32, b: const 2_u32, c: move _5 }; // scope 0 at $DIR/sroa.rs:+2:8: +2:39
-          StorageDead(_5);                 // scope 0 at $DIR/sroa.rs:+2:38: +2:39
-          _3 = &(_4.0: u32);               // scope 0 at $DIR/sroa.rs:+2:7: +2:41
-          _2 = &raw const (*_3);           // scope 0 at $DIR/sroa.rs:+2:7: +2:41
-          _1 = f(move _2) -> bb2;          // scope 0 at $DIR/sroa.rs:+2:5: +2:42
+          _4 = Escaping { a: const 1_u32, b: const 2_u32, c: move _5 }; // scope 0 at $DIR/sroa.rs:+1:8: +1:39
+          StorageDead(_5);                 // scope 0 at $DIR/sroa.rs:+1:38: +1:39
+          _3 = &(_4.0: u32);               // scope 0 at $DIR/sroa.rs:+1:7: +1:41
+          _2 = &raw const (*_3);           // scope 0 at $DIR/sroa.rs:+1:7: +1:41
+          _1 = f(move _2) -> bb2;          // scope 0 at $DIR/sroa.rs:+1:5: +1:42
                                            // mir::Constant
-                                           // + span: $DIR/sroa.rs:73:5: 73:6
+                                           // + span: $DIR/sroa.rs:78:5: 78:6
                                            // + literal: Const { ty: fn(*const u32) {f}, val: Value(<ZST>) }
       }
   
       bb2: {
-          StorageDead(_2);                 // scope 0 at $DIR/sroa.rs:+2:41: +2:42
-          StorageDead(_4);                 // scope 0 at $DIR/sroa.rs:+2:42: +2:43
-          StorageDead(_3);                 // scope 0 at $DIR/sroa.rs:+2:42: +2:43
-          StorageDead(_1);                 // scope 0 at $DIR/sroa.rs:+2:42: +2:43
-          _0 = const ();                   // scope 0 at $DIR/sroa.rs:+0:19: +3:2
-          return;                          // scope 0 at $DIR/sroa.rs:+3:2: +3:2
+          StorageDead(_2);                 // scope 0 at $DIR/sroa.rs:+1:41: +1:42
+          StorageDead(_4);                 // scope 0 at $DIR/sroa.rs:+1:42: +1:43
+          StorageDead(_3);                 // scope 0 at $DIR/sroa.rs:+1:42: +1:43
+          StorageDead(_1);                 // scope 0 at $DIR/sroa.rs:+1:42: +1:43
+          _0 = const ();                   // scope 0 at $DIR/sroa.rs:+0:19: +2:2
+          return;                          // scope 0 at $DIR/sroa.rs:+2:2: +2:2
       }
   }
   
diff --git a/tests/mir-opt/sroa.rs b/tests/mir-opt/sroa.rs
index b69de2e124e..fff92cf8d9f 100644
--- a/tests/mir-opt/sroa.rs
+++ b/tests/mir-opt/sroa.rs
@@ -68,8 +68,13 @@ fn f(a: *const u32) {
     println!("{}", unsafe { *a.add(2) });
 }
 
+// `f` uses the `&e.a` to access `e.c`. This is UB according to Miri today; however,
+// T-opsem has not finalized that decision and as such rustc should not rely on
+// it. If SROA were to rely on it, it would be (almost) correct to turn `e` into
+// three distinct locals - one for each field - and pass a reference to only one
+// of them to `f`. However, this would lead to a miscompilation because `b` and `c`
+// might no longer appear right after `a` in memory.
 pub fn escaping() {
-    // Verify this struct is not flattened.
     f(&Escaping { a: 1, b: 2, c: g() }.a);
 }
 
diff --git a/tests/ui/async-await/dont-suggest-missing-await.stderr b/tests/ui/async-await/dont-suggest-missing-await.stderr
index 8e2d42c8f13..1fa4e5db0cb 100644
--- a/tests/ui/async-await/dont-suggest-missing-await.stderr
+++ b/tests/ui/async-await/dont-suggest-missing-await.stderr
@@ -2,12 +2,15 @@ error[E0308]: mismatched types
   --> $DIR/dont-suggest-missing-await.rs:14:18
    |
 LL |         take_u32(x)
-   |         -------- ^ expected `u32`, found opaque type
+   |         -------- ^ expected `u32`, found future
    |         |
    |         arguments to this function are incorrect
    |
-   = note:     expected type `u32`
-           found opaque type `impl Future<Output = u32>`
+note: calling an async function returns a future
+  --> $DIR/dont-suggest-missing-await.rs:14:18
+   |
+LL |         take_u32(x)
+   |                  ^
 note: function defined here
   --> $DIR/dont-suggest-missing-await.rs:5:4
    |
diff --git a/tests/ui/async-await/generator-desc.stderr b/tests/ui/async-await/generator-desc.stderr
index 9fdb1ce47d7..51ac9d86bfb 100644
--- a/tests/ui/async-await/generator-desc.stderr
+++ b/tests/ui/async-await/generator-desc.stderr
@@ -17,12 +17,10 @@ error[E0308]: mismatched types
   --> $DIR/generator-desc.rs:12:16
    |
 LL |     fun(one(), two());
-   |     ---        ^^^^^ expected opaque type, found a different opaque type
+   |     ---        ^^^^^ expected future, found a different future
    |     |
    |     arguments to this function are incorrect
    |
-   = note: expected opaque type `impl Future<Output = ()>` (opaque type at <$DIR/generator-desc.rs:5:16>)
-              found opaque type `impl Future<Output = ()>` (opaque type at <$DIR/generator-desc.rs:6:16>)
    = help: consider `await`ing on both `Future`s
    = note: distinct uses of `impl Trait` result in different opaque types
 note: function defined here
diff --git a/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr b/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr
index 3c01fca2f4d..168ef8e9ee4 100644
--- a/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr
+++ b/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr
@@ -2,7 +2,7 @@ error[E0053]: method `foo` has an incompatible type for trait
   --> $DIR/async-example-desugared-boxed-in-trait.rs:15:28
    |
 LL |     async fn foo(&self) -> i32 {
-   |                            ^^^ expected `Pin<Box<dyn Future<Output = i32>>>`, found opaque type
+   |                            ^^^ expected `Pin<Box<dyn Future<Output = i32>>>`, found future
    |
 note: type in trait
   --> $DIR/async-example-desugared-boxed-in-trait.rs:11:22
diff --git a/tests/ui/async-await/issue-61076.rs b/tests/ui/async-await/issue-61076.rs
index 9c4acbe0a5b..cf6e5b4e436 100644
--- a/tests/ui/async-await/issue-61076.rs
+++ b/tests/ui/async-await/issue-61076.rs
@@ -86,7 +86,7 @@ async fn match_() {
     match tuple() { //~ HELP consider `await`ing on the `Future`
         //~^ NOTE this expression has type `impl Future<Output = Tuple>`
         Tuple(_) => {} //~ ERROR mismatched types
-        //~^ NOTE expected opaque type, found `Tuple`
+        //~^ NOTE expected future, found `Tuple`
         //~| NOTE expected opaque type `impl Future<Output = Tuple>`
     }
 }
diff --git a/tests/ui/async-await/issue-61076.stderr b/tests/ui/async-await/issue-61076.stderr
index b25b29bf50c..44de282988b 100644
--- a/tests/ui/async-await/issue-61076.stderr
+++ b/tests/ui/async-await/issue-61076.stderr
@@ -62,7 +62,7 @@ LL |     match tuple() {
    |           ------- this expression has type `impl Future<Output = Tuple>`
 LL |
 LL |         Tuple(_) => {}
-   |         ^^^^^^^^ expected opaque type, found `Tuple`
+   |         ^^^^^^^^ expected future, found `Tuple`
    |
    = note: expected opaque type `impl Future<Output = Tuple>`
                    found struct `Tuple`
diff --git a/tests/ui/async-await/issue-98634.stderr b/tests/ui/async-await/issue-98634.stderr
index 4c5dfeed9ba..5b7f18a98b5 100644
--- a/tests/ui/async-await/issue-98634.stderr
+++ b/tests/ui/async-await/issue-98634.stderr
@@ -2,10 +2,8 @@ error[E0271]: expected `callback` to be a fn item that returns `Pin<Box<dyn Futu
   --> $DIR/issue-98634.rs:45:23
    |
 LL |         StructAsync { callback }.await;
-   |                       ^^^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found opaque type
+   |                       ^^^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found future
    |
-   = note:   expected struct `Pin<Box<(dyn Future<Output = ()> + 'static)>>`
-           found opaque type `impl Future<Output = ()>`
 note: required by a bound in `StructAsync`
   --> $DIR/issue-98634.rs:9:35
    |
@@ -16,10 +14,8 @@ error[E0271]: expected `callback` to be a fn item that returns `Pin<Box<dyn Futu
   --> $DIR/issue-98634.rs:45:9
    |
 LL |         StructAsync { callback }.await;
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found opaque type
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found future
    |
-   = note:   expected struct `Pin<Box<(dyn Future<Output = ()> + 'static)>>`
-           found opaque type `impl Future<Output = ()>`
 note: required by a bound in `StructAsync`
   --> $DIR/issue-98634.rs:9:35
    |
@@ -30,10 +26,8 @@ error[E0271]: expected `callback` to be a fn item that returns `Pin<Box<dyn Futu
   --> $DIR/issue-98634.rs:45:33
    |
 LL |         StructAsync { callback }.await;
-   |                                 ^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found opaque type
+   |                                 ^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found future
    |
-   = note:   expected struct `Pin<Box<(dyn Future<Output = ()> + 'static)>>`
-           found opaque type `impl Future<Output = ()>`
 note: required by a bound in `StructAsync`
   --> $DIR/issue-98634.rs:9:35
    |
diff --git a/tests/ui/async-await/issues/issue-102206.stderr b/tests/ui/async-await/issues/issue-102206.stderr
index ebb80f6e07e..750b7a886ef 100644
--- a/tests/ui/async-await/issues/issue-102206.stderr
+++ b/tests/ui/async-await/issues/issue-102206.stderr
@@ -4,12 +4,10 @@ error[E0308]: mismatched types
 LL |     std::mem::size_of_val(foo());
    |     --------------------- ^^^^^
    |     |                     |
-   |     |                     expected `&_`, found opaque type
+   |     |                     expected `&_`, found future
    |     |                     help: consider borrowing here: `&foo()`
    |     arguments to this function are incorrect
    |
-   = note: expected reference `&_`
-            found opaque type `impl Future<Output = ()>`
 note: function defined here
   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
 
diff --git a/tests/ui/async-await/suggest-missing-await-closure.stderr b/tests/ui/async-await/suggest-missing-await-closure.stderr
index e47325cb4ae..d44af5b8dd8 100644
--- a/tests/ui/async-await/suggest-missing-await-closure.stderr
+++ b/tests/ui/async-await/suggest-missing-await-closure.stderr
@@ -2,12 +2,15 @@ error[E0308]: mismatched types
   --> $DIR/suggest-missing-await-closure.rs:16:18
    |
 LL |         take_u32(x)
-   |         -------- ^ expected `u32`, found opaque type
+   |         -------- ^ expected `u32`, found future
    |         |
    |         arguments to this function are incorrect
    |
-   = note:     expected type `u32`
-           found opaque type `impl Future<Output = u32>`
+note: calling an async function returns a future
+  --> $DIR/suggest-missing-await-closure.rs:16:18
+   |
+LL |         take_u32(x)
+   |                  ^
 note: function defined here
   --> $DIR/suggest-missing-await-closure.rs:6:4
    |
diff --git a/tests/ui/async-await/suggest-missing-await.stderr b/tests/ui/async-await/suggest-missing-await.stderr
index 4ed0272ac1a..f0ec34a6a55 100644
--- a/tests/ui/async-await/suggest-missing-await.stderr
+++ b/tests/ui/async-await/suggest-missing-await.stderr
@@ -2,12 +2,15 @@ error[E0308]: mismatched types
   --> $DIR/suggest-missing-await.rs:12:14
    |
 LL |     take_u32(x)
-   |     -------- ^ expected `u32`, found opaque type
+   |     -------- ^ expected `u32`, found future
    |     |
    |     arguments to this function are incorrect
    |
-   = note:     expected type `u32`
-           found opaque type `impl Future<Output = u32>`
+note: calling an async function returns a future
+  --> $DIR/suggest-missing-await.rs:12:14
+   |
+LL |     take_u32(x)
+   |              ^
 note: function defined here
   --> $DIR/suggest-missing-await.rs:3:4
    |
@@ -22,10 +25,13 @@ error[E0308]: mismatched types
   --> $DIR/suggest-missing-await.rs:22:5
    |
 LL |     dummy()
-   |     ^^^^^^^ expected `()`, found opaque type
+   |     ^^^^^^^ expected `()`, found future
    |
-   = note: expected unit type `()`
-            found opaque type `impl Future<Output = ()>`
+note: calling an async function returns a future
+  --> $DIR/suggest-missing-await.rs:22:5
+   |
+LL |     dummy()
+   |     ^^^^^^^
 help: consider `await`ing on the `Future`
    |
 LL |     dummy().await
@@ -45,7 +51,7 @@ LL | |         dummy()
 LL | |
 LL | |     } else {
 LL | |         dummy().await
-   | |         ^^^^^^^^^^^^^ expected opaque type, found `()`
+   | |         ^^^^^^^^^^^^^ expected future, found `()`
 LL | |
 LL | |     };
    | |_____- `if` and `else` have incompatible types
@@ -67,7 +73,7 @@ LL | |         0 => dummy(),
 LL | |         1 => dummy(),
    | |              ------- this is found to be of type `impl Future<Output = ()>`
 LL | |         2 => dummy().await,
-   | |              ^^^^^^^^^^^^^ expected opaque type, found `()`
+   | |              ^^^^^^^^^^^^^ expected future, found `()`
 LL | |
 LL | |     };
    | |_____- `match` arms have incompatible types
@@ -86,7 +92,7 @@ error[E0308]: mismatched types
 LL |     let _x = match dummy() {
    |                    ------- this expression has type `impl Future<Output = ()>`
 LL |         () => {}
-   |         ^^ expected opaque type, found `()`
+   |         ^^ expected future, found `()`
    |
    = note: expected opaque type `impl Future<Output = ()>`
                 found unit type `()`
@@ -102,7 +108,7 @@ LL |     match dummy_result() {
    |           -------------- this expression has type `impl Future<Output = Result<(), ()>>`
 ...
 LL |         Ok(_) => {}
-   |         ^^^^^ expected opaque type, found `Result<_, _>`
+   |         ^^^^^ expected future, found `Result<_, _>`
    |
    = note: expected opaque type `impl Future<Output = Result<(), ()>>`
                      found enum `Result<_, _>`
@@ -118,7 +124,7 @@ LL |     match dummy_result() {
    |           -------------- this expression has type `impl Future<Output = Result<(), ()>>`
 ...
 LL |         Err(_) => {}
-   |         ^^^^^^ expected opaque type, found `Result<_, _>`
+   |         ^^^^^^ expected future, found `Result<_, _>`
    |
    = note: expected opaque type `impl Future<Output = Result<(), ()>>`
                      found enum `Result<_, _>`
diff --git a/tests/ui/coherence/issue-85026.stderr b/tests/ui/coherence/issue-85026.stderr
index a5da19bbfaa..fb6e9976583 100644
--- a/tests/ui/coherence/issue-85026.stderr
+++ b/tests/ui/coherence/issue-85026.stderr
@@ -1,16 +1,16 @@
 error[E0785]: cannot define inherent `impl` for a dyn auto trait
-  --> $DIR/issue-85026.rs:5:6
+  --> $DIR/issue-85026.rs:5:1
    |
 LL | impl dyn AutoTrait {}
-   |      ^^^^^^^^^^^^^ impl requires at least one non-auto trait
+   | ^^^^^^^^^^^^^^^^^^ impl requires at least one non-auto trait
    |
    = note: define and implement a new trait or type instead
 
 error[E0785]: cannot define inherent `impl` for a dyn auto trait
-  --> $DIR/issue-85026.rs:8:6
+  --> $DIR/issue-85026.rs:8:1
    |
 LL | impl dyn Unpin {}
-   |      ^^^^^^^^^ impl requires at least one non-auto trait
+   | ^^^^^^^^^^^^^^ impl requires at least one non-auto trait
    |
    = note: define and implement a new trait or type instead
 
diff --git a/tests/ui/const-generics/wrong-normalization.stderr b/tests/ui/const-generics/wrong-normalization.stderr
index fb806bdb1e7..658a8406608 100644
--- a/tests/ui/const-generics/wrong-normalization.stderr
+++ b/tests/ui/const-generics/wrong-normalization.stderr
@@ -1,8 +1,8 @@
 error[E0118]: no nominal type found for inherent implementation
-  --> $DIR/wrong-normalization.rs:16:6
+  --> $DIR/wrong-normalization.rs:16:1
    |
 LL | impl <I8<{i8::MIN}> as Identity>::Identity {
-   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl requires a nominal type
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl requires a nominal type
    |
    = note: either implement a trait on it or create a newtype to wrap it instead
 
diff --git a/tests/ui/error-codes/E0116.stderr b/tests/ui/error-codes/E0116.stderr
index a5ceeb4a55d..8a027686760 100644
--- a/tests/ui/error-codes/E0116.stderr
+++ b/tests/ui/error-codes/E0116.stderr
@@ -2,7 +2,7 @@ error[E0116]: cannot define inherent `impl` for a type outside of the crate wher
   --> $DIR/E0116.rs:1:1
    |
 LL | impl Vec<u8> {}
-   | ^^^^^^^^^^^^^^^ impl for type defined outside of crate.
+   | ^^^^^^^^^^^^ impl for type defined outside of crate.
    |
    = note: define and implement a trait or new type instead
 
diff --git a/tests/ui/error-codes/E0118.stderr b/tests/ui/error-codes/E0118.stderr
index 8c6fa7947a8..442f8a4f870 100644
--- a/tests/ui/error-codes/E0118.stderr
+++ b/tests/ui/error-codes/E0118.stderr
@@ -1,8 +1,8 @@
 error[E0118]: no nominal type found for inherent implementation
-  --> $DIR/E0118.rs:1:9
+  --> $DIR/E0118.rs:1:1
    |
 LL | impl<T> T {
-   |         ^ impl requires a nominal type
+   | ^^^^^^^^^ impl requires a nominal type
    |
    = note: either implement a trait on it or create a newtype to wrap it instead
 
diff --git a/tests/ui/error-codes/E0390.stderr b/tests/ui/error-codes/E0390.stderr
index 0e5a9ca762b..ec4b5758c5b 100644
--- a/tests/ui/error-codes/E0390.stderr
+++ b/tests/ui/error-codes/E0390.stderr
@@ -1,16 +1,16 @@
 error[E0390]: cannot define inherent `impl` for primitive types
-  --> $DIR/E0390.rs:5:6
+  --> $DIR/E0390.rs:5:1
    |
 LL | impl *mut Foo {}
-   |      ^^^^^^^^
+   | ^^^^^^^^^^^^^
    |
    = help: consider using an extension trait instead
 
 error[E0390]: cannot define inherent `impl` for primitive types
-  --> $DIR/E0390.rs:7:6
+  --> $DIR/E0390.rs:7:1
    |
 LL | impl fn(Foo) {}
-   |      ^^^^^^^
+   | ^^^^^^^^^^^^
    |
    = help: consider using an extension trait instead
 
diff --git a/tests/ui/impl-trait/issue-102605.stderr b/tests/ui/impl-trait/issue-102605.stderr
index 8ff08968008..dfe18e43eee 100644
--- a/tests/ui/impl-trait/issue-102605.stderr
+++ b/tests/ui/impl-trait/issue-102605.stderr
@@ -2,12 +2,15 @@ error[E0308]: mismatched types
   --> $DIR/issue-102605.rs:13:20
    |
 LL |     convert_result(foo())
-   |     -------------- ^^^^^ expected `Result<(), _>`, found opaque type
+   |     -------------- ^^^^^ expected `Result<(), _>`, found future
    |     |
    |     arguments to this function are incorrect
    |
-   = note:     expected enum `Result<(), _>`
-           found opaque type `impl Future<Output = Result<(), String>>`
+note: calling an async function returns a future
+  --> $DIR/issue-102605.rs:13:20
+   |
+LL |     convert_result(foo())
+   |                    ^^^^^
 note: function defined here
   --> $DIR/issue-102605.rs:7:4
    |
diff --git a/tests/ui/impl-trait/issue-99914.stderr b/tests/ui/impl-trait/issue-99914.stderr
index a4b7fc1f5bc..c86e9eadc87 100644
--- a/tests/ui/impl-trait/issue-99914.stderr
+++ b/tests/ui/impl-trait/issue-99914.stderr
@@ -2,10 +2,8 @@ error[E0308]: mismatched types
   --> $DIR/issue-99914.rs:9:27
    |
 LL |     t.and_then(|t| -> _ { bar(t) });
-   |                           ^^^^^^ expected `Result<_, Error>`, found opaque type
+   |                           ^^^^^^ expected `Result<_, Error>`, found future
    |
-   = note:     expected enum `Result<_, Error>`
-           found opaque type `impl Future<Output = ()>`
 help: try wrapping the expression in `Ok`
    |
 LL |     t.and_then(|t| -> _ { Ok(bar(t)) });
diff --git a/tests/ui/impl-trait/where-allowed.stderr b/tests/ui/impl-trait/where-allowed.stderr
index 3ad0a9f9d5c..e3a9caa6460 100644
--- a/tests/ui/impl-trait/where-allowed.stderr
+++ b/tests/ui/impl-trait/where-allowed.stderr
@@ -303,10 +303,10 @@ LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
    = note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
 
 error[E0118]: no nominal type found for inherent implementation
-  --> $DIR/where-allowed.rs:233:23
+  --> $DIR/where-allowed.rs:233:1
    |
 LL | impl <T = impl Debug> T {}
-   |                       ^ impl requires a nominal type
+   | ^^^^^^^^^^^^^^^^^^^^^^^ impl requires a nominal type
    |
    = note: either implement a trait on it or create a newtype to wrap it instead
 
diff --git a/tests/ui/incoherent-inherent-impls/needs-has-incoherent-impls.stderr b/tests/ui/incoherent-inherent-impls/needs-has-incoherent-impls.stderr
index 8f70825115d..f5900afe2dc 100644
--- a/tests/ui/incoherent-inherent-impls/needs-has-incoherent-impls.stderr
+++ b/tests/ui/incoherent-inherent-impls/needs-has-incoherent-impls.stderr
@@ -1,114 +1,80 @@
 error[E0390]: cannot define inherent `impl` for a type outside of the crate where the type is defined
   --> $DIR/needs-has-incoherent-impls.rs:5:1
    |
-LL | / impl extern_crate::StructWithAttr {
-LL | |
-LL | |     fn foo() {}
-LL | | }
-   | |_^
+LL | impl extern_crate::StructWithAttr {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: consider moving this inherent impl into the crate defining the type if possible
 help: alternatively add `#[rustc_allow_incoherent_impl]` to the relevant impl items
   --> $DIR/needs-has-incoherent-impls.rs:7:5
    |
 LL |     fn foo() {}
-   |     ^^^^^^^^^^^
+   |     ^^^^^^^^
 
 error[E0390]: cannot define inherent `impl` for a type outside of the crate where the type is defined
   --> $DIR/needs-has-incoherent-impls.rs:13:1
    |
-LL | / impl extern_crate::StructNoAttr {
-LL | |
-LL | |     fn foo() {}
-LL | | }
-   | |_^
+LL | impl extern_crate::StructNoAttr {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: consider moving this inherent impl into the crate defining the type if possible
 help: alternatively add `#[rustc_has_incoherent_inherent_impls]` to the type and `#[rustc_allow_incoherent_impl]` to the relevant impl items
   --> $DIR/needs-has-incoherent-impls.rs:13:1
    |
-LL | / impl extern_crate::StructNoAttr {
-LL | |
-LL | |     fn foo() {}
-LL | | }
-   | |_^
+LL | impl extern_crate::StructNoAttr {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0390]: cannot define inherent `impl` for a type outside of the crate where the type is defined
   --> $DIR/needs-has-incoherent-impls.rs:17:1
    |
-LL | / impl extern_crate::StructNoAttr {
-LL | |
-LL | |     #[rustc_allow_incoherent_impl]
-LL | |     fn bar() {}
-LL | | }
-   | |_^
+LL | impl extern_crate::StructNoAttr {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: consider moving this inherent impl into the crate defining the type if possible
 help: alternatively add `#[rustc_has_incoherent_inherent_impls]` to the type and `#[rustc_allow_incoherent_impl]` to the relevant impl items
   --> $DIR/needs-has-incoherent-impls.rs:17:1
    |
-LL | / impl extern_crate::StructNoAttr {
-LL | |
-LL | |     #[rustc_allow_incoherent_impl]
-LL | |     fn bar() {}
-LL | | }
-   | |_^
+LL | impl extern_crate::StructNoAttr {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0390]: cannot define inherent `impl` for a type outside of the crate where the type is defined
   --> $DIR/needs-has-incoherent-impls.rs:22:1
    |
-LL | / impl extern_crate::EnumWithAttr {
-LL | |
-LL | |     fn foo() {}
-LL | | }
-   | |_^
+LL | impl extern_crate::EnumWithAttr {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: consider moving this inherent impl into the crate defining the type if possible
 help: alternatively add `#[rustc_allow_incoherent_impl]` to the relevant impl items
   --> $DIR/needs-has-incoherent-impls.rs:24:5
    |
 LL |     fn foo() {}
-   |     ^^^^^^^^^^^
+   |     ^^^^^^^^
 
 error[E0390]: cannot define inherent `impl` for a type outside of the crate where the type is defined
   --> $DIR/needs-has-incoherent-impls.rs:30:1
    |
-LL | / impl extern_crate::EnumNoAttr {
-LL | |
-LL | |     fn foo() {}
-LL | | }
-   | |_^
+LL | impl extern_crate::EnumNoAttr {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: consider moving this inherent impl into the crate defining the type if possible
 help: alternatively add `#[rustc_has_incoherent_inherent_impls]` to the type and `#[rustc_allow_incoherent_impl]` to the relevant impl items
   --> $DIR/needs-has-incoherent-impls.rs:30:1
    |
-LL | / impl extern_crate::EnumNoAttr {
-LL | |
-LL | |     fn foo() {}
-LL | | }
-   | |_^
+LL | impl extern_crate::EnumNoAttr {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0390]: cannot define inherent `impl` for a type outside of the crate where the type is defined
   --> $DIR/needs-has-incoherent-impls.rs:34:1
    |
-LL | / impl extern_crate::EnumNoAttr {
-LL | |
-LL | |     #[rustc_allow_incoherent_impl]
-LL | |     fn bar() {}
-LL | | }
-   | |_^
+LL | impl extern_crate::EnumNoAttr {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: consider moving this inherent impl into the crate defining the type if possible
 help: alternatively add `#[rustc_has_incoherent_inherent_impls]` to the type and `#[rustc_allow_incoherent_impl]` to the relevant impl items
   --> $DIR/needs-has-incoherent-impls.rs:34:1
    |
-LL | / impl extern_crate::EnumNoAttr {
-LL | |
-LL | |     #[rustc_allow_incoherent_impl]
-LL | |     fn bar() {}
-LL | | }
-   | |_^
+LL | impl extern_crate::EnumNoAttr {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 6 previous errors
 
diff --git a/tests/ui/incoherent-inherent-impls/no-attr-empty-impl.stderr b/tests/ui/incoherent-inherent-impls/no-attr-empty-impl.stderr
index b3f8b51d0ea..6dc1680cf89 100644
--- a/tests/ui/incoherent-inherent-impls/no-attr-empty-impl.stderr
+++ b/tests/ui/incoherent-inherent-impls/no-attr-empty-impl.stderr
@@ -2,7 +2,7 @@ error[E0116]: cannot define inherent `impl` for a type outside of the crate wher
   --> $DIR/no-attr-empty-impl.rs:4:1
    |
 LL | impl extern_crate::StructWithAttr {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl for type defined outside of crate.
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl for type defined outside of crate.
    |
    = note: define and implement a trait or new type instead
 
@@ -10,7 +10,7 @@ error[E0116]: cannot define inherent `impl` for a type outside of the crate wher
   --> $DIR/no-attr-empty-impl.rs:7:1
    |
 LL | impl extern_crate::StructNoAttr {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl for type defined outside of crate.
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl for type defined outside of crate.
    |
    = note: define and implement a trait or new type instead
 
@@ -18,7 +18,7 @@ error[E0116]: cannot define inherent `impl` for a type outside of the crate wher
   --> $DIR/no-attr-empty-impl.rs:10:1
    |
 LL | impl extern_crate::EnumWithAttr {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl for type defined outside of crate.
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl for type defined outside of crate.
    |
    = note: define and implement a trait or new type instead
 
@@ -26,15 +26,15 @@ error[E0116]: cannot define inherent `impl` for a type outside of the crate wher
   --> $DIR/no-attr-empty-impl.rs:13:1
    |
 LL | impl extern_crate::EnumNoAttr {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl for type defined outside of crate.
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl for type defined outside of crate.
    |
    = note: define and implement a trait or new type instead
 
 error[E0390]: cannot define inherent `impl` for primitive types
-  --> $DIR/no-attr-empty-impl.rs:16:6
+  --> $DIR/no-attr-empty-impl.rs:16:1
    |
 LL | impl f32 {}
-   |      ^^^
+   | ^^^^^^^^
    |
    = help: consider using an extension trait instead
 
diff --git a/tests/ui/kinds-of-primitive-impl.stderr b/tests/ui/kinds-of-primitive-impl.stderr
index f4dbd1c40e8..21aac58f1f2 100644
--- a/tests/ui/kinds-of-primitive-impl.stderr
+++ b/tests/ui/kinds-of-primitive-impl.stderr
@@ -1,32 +1,32 @@
 error[E0390]: cannot define inherent `impl` for primitive types
-  --> $DIR/kinds-of-primitive-impl.rs:1:6
+  --> $DIR/kinds-of-primitive-impl.rs:1:1
    |
 LL | impl u8 {
-   |      ^^
+   | ^^^^^^^
    |
    = help: consider using an extension trait instead
 
 error[E0390]: cannot define inherent `impl` for primitive types
-  --> $DIR/kinds-of-primitive-impl.rs:6:6
+  --> $DIR/kinds-of-primitive-impl.rs:6:1
    |
 LL | impl str {
-   |      ^^^
+   | ^^^^^^^^
    |
    = help: consider using an extension trait instead
 
 error[E0390]: cannot define inherent `impl` for primitive types
-  --> $DIR/kinds-of-primitive-impl.rs:12:6
+  --> $DIR/kinds-of-primitive-impl.rs:12:1
    |
 LL | impl char {
-   |      ^^^^
+   | ^^^^^^^^^
    |
    = help: consider using an extension trait instead
 
 error[E0390]: cannot define inherent `impl` for primitive types
-  --> $DIR/kinds-of-primitive-impl.rs:21:6
+  --> $DIR/kinds-of-primitive-impl.rs:21:1
    |
 LL | impl &MyType {
-   |      ^^^^^^^
+   | ^^^^^^^^^^^^
    |
    = help: consider using an extension trait instead
    = note: you could also try moving the reference to uses of `MyType` (such as `self`) within the implementation
diff --git a/tests/ui/privacy/private-in-public-ill-formed.stderr b/tests/ui/privacy/private-in-public-ill-formed.stderr
index e7c94bc301b..abc8538e5b3 100644
--- a/tests/ui/privacy/private-in-public-ill-formed.stderr
+++ b/tests/ui/privacy/private-in-public-ill-formed.stderr
@@ -1,16 +1,16 @@
 error[E0118]: no nominal type found for inherent implementation
-  --> $DIR/private-in-public-ill-formed.rs:14:10
+  --> $DIR/private-in-public-ill-formed.rs:14:5
    |
 LL |     impl <Priv as PrivTr>::AssocAlias {
-   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl requires a nominal type
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl requires a nominal type
    |
    = note: either implement a trait on it or create a newtype to wrap it instead
 
 error[E0118]: no nominal type found for inherent implementation
-  --> $DIR/private-in-public-ill-formed.rs:31:10
+  --> $DIR/private-in-public-ill-formed.rs:31:5
    |
 LL |     impl <Priv as PrivTr>::AssocAlias {
-   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl requires a nominal type
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl requires a nominal type
    |
    = note: either implement a trait on it or create a newtype to wrap it instead
 
diff --git a/tests/ui/suggestions/if-then-neeing-semi.rs b/tests/ui/suggestions/if-then-neeing-semi.rs
index 7be4312bfba..a4eefb41508 100644
--- a/tests/ui/suggestions/if-then-neeing-semi.rs
+++ b/tests/ui/suggestions/if-then-neeing-semi.rs
@@ -26,8 +26,8 @@ async fn async_extra_semicolon_same() {
         //~^ HELP consider removing this semicolon
     } else {
         async_dummy() //~ ERROR `if` and `else` have incompatible types
-        //~^ NOTE expected `()`, found opaque type
-        //~| NOTE expected unit type `()`
+        //~^ NOTE expected `()`, found future
+        //~| NOTE calling an async function returns a future
         //~| HELP consider `await`ing on the `Future`
     };
 }
@@ -39,8 +39,8 @@ async fn async_extra_semicolon_different() {
         //~^ HELP consider removing this semicolon
     } else {
         async_dummy2() //~ ERROR `if` and `else` have incompatible types
-        //~^ NOTE expected `()`, found opaque type
-        //~| NOTE expected unit type `()`
+        //~^ NOTE expected `()`, found future
+        //~| NOTE calling an async function returns a future
         //~| HELP consider `await`ing on the `Future`
     };
 }
@@ -52,8 +52,7 @@ async fn async_different_futures() {
         //~| HELP consider `await`ing on both `Future`s
     } else {
         async_dummy2() //~ ERROR `if` and `else` have incompatible types
-        //~^ NOTE expected opaque type, found a different opaque type
-        //~| NOTE expected opaque type `impl Future<Output = ()>`
+        //~^ NOTE expected future, found a different future
         //~| NOTE distinct uses of `impl Trait` result in different opaque types
     };
 }
diff --git a/tests/ui/suggestions/if-then-neeing-semi.stderr b/tests/ui/suggestions/if-then-neeing-semi.stderr
index 567deb405fc..6833e0bab2b 100644
--- a/tests/ui/suggestions/if-then-neeing-semi.stderr
+++ b/tests/ui/suggestions/if-then-neeing-semi.stderr
@@ -9,14 +9,17 @@ LL | |         async_dummy();
 LL | |
 LL | |     } else {
 LL | |         async_dummy()
-   | |         ^^^^^^^^^^^^^ expected `()`, found opaque type
+   | |         ^^^^^^^^^^^^^ expected `()`, found future
 ...  |
 LL | |
 LL | |     };
    | |_____- `if` and `else` have incompatible types
    |
-   = note: expected unit type `()`
-            found opaque type `impl Future<Output = ()>`
+note: calling an async function returns a future
+  --> $DIR/if-then-neeing-semi.rs:28:9
+   |
+LL |         async_dummy()
+   |         ^^^^^^^^^^^^^
 help: consider `await`ing on the `Future`
    |
 LL |         async_dummy().await
@@ -38,14 +41,17 @@ LL | |         async_dummy();
 LL | |
 LL | |     } else {
 LL | |         async_dummy2()
-   | |         ^^^^^^^^^^^^^^ expected `()`, found opaque type
+   | |         ^^^^^^^^^^^^^^ expected `()`, found future
 ...  |
 LL | |
 LL | |     };
    | |_____- `if` and `else` have incompatible types
    |
-   = note: expected unit type `()`
-            found opaque type `impl Future<Output = ()>`
+note: calling an async function returns a future
+  --> $DIR/if-then-neeing-semi.rs:41:9
+   |
+LL |         async_dummy2()
+   |         ^^^^^^^^^^^^^^
 help: consider `await`ing on the `Future`
    |
 LL |         async_dummy2().await
@@ -69,14 +75,12 @@ LL | |         async_dummy()
 LL | |
 LL | |     } else {
 LL | |         async_dummy2()
-   | |         ^^^^^^^^^^^^^^ expected opaque type, found a different opaque type
-...  |
+   | |         ^^^^^^^^^^^^^^ expected future, found a different future
+LL | |
 LL | |
 LL | |     };
    | |_____- `if` and `else` have incompatible types
    |
-   = note: expected opaque type `impl Future<Output = ()>` (opaque type at <$DIR/if-then-neeing-semi.rs:18:24>)
-              found opaque type `impl Future<Output = ()>` (opaque type at <$DIR/if-then-neeing-semi.rs:20:25>)
    = note: distinct uses of `impl Trait` result in different opaque types
 help: consider `await`ing on both `Future`s
    |
diff --git a/tests/ui/suggestions/issue-81839.stderr b/tests/ui/suggestions/issue-81839.stderr
index 4af7cc9f8ec..6d0a0c7b3fa 100644
--- a/tests/ui/suggestions/issue-81839.stderr
+++ b/tests/ui/suggestions/issue-81839.stderr
@@ -10,12 +10,9 @@ LL | |             cx.answer_str("hi");
    | |             this is found to be of type `()`
 LL | |         }
 LL | |         _ => cx.answer_str("hi"),
-   | |              ^^^^^^^^^^^^^^^^^^^ expected `()`, found opaque type
+   | |              ^^^^^^^^^^^^^^^^^^^ expected `()`, found future
 LL | |     }
    | |_____- `match` arms have incompatible types
-   |
-   = note: expected unit type `()`
-            found opaque type `impl Future<Output = Test>`
 
 error: aborting due to previous error
 
diff --git a/tests/ui/suggestions/match-prev-arm-needing-semi.rs b/tests/ui/suggestions/match-prev-arm-needing-semi.rs
index 3f863cb104e..11463c453d4 100644
--- a/tests/ui/suggestions/match-prev-arm-needing-semi.rs
+++ b/tests/ui/suggestions/match-prev-arm-needing-semi.rs
@@ -24,8 +24,8 @@ async fn async_extra_semicolon_same() {
             //~^ HELP consider removing this semicolon
         }
         false => async_dummy(), //~ ERROR `match` arms have incompatible types
-        //~^ NOTE expected `()`, found opaque type
-        //~| NOTE expected unit type `()`
+        //~^ NOTE expected `()`, found future
+        //~| NOTE calling an async function returns a future
         //~| HELP consider `await`ing on the `Future`
     };
 }
@@ -37,8 +37,8 @@ async fn async_extra_semicolon_different() {
             //~^ HELP consider removing this semicolon
         }
         false => async_dummy2(), //~ ERROR `match` arms have incompatible types
-        //~^ NOTE expected `()`, found opaque type
-        //~| NOTE expected unit type `()`
+        //~^ NOTE expected `()`, found future
+        //~| NOTE calling an async function returns a future
         //~| HELP consider `await`ing on the `Future`
     };
 }
@@ -48,8 +48,7 @@ async fn async_different_futures() {
         true => async_dummy(), //~ NOTE this is found to be
         //~| HELP consider `await`ing on both `Future`s
         false => async_dummy2(), //~ ERROR `match` arms have incompatible types
-        //~^ NOTE expected opaque type, found a different opaque type
-        //~| NOTE expected opaque type `impl Future<Output = ()>`
+        //~^ NOTE expected future, found a different future
         //~| NOTE distinct uses of `impl Trait` result in different opaque types
     };
 }
diff --git a/tests/ui/suggestions/match-prev-arm-needing-semi.stderr b/tests/ui/suggestions/match-prev-arm-needing-semi.stderr
index df18c7b0b23..cf3cf45ef40 100644
--- a/tests/ui/suggestions/match-prev-arm-needing-semi.stderr
+++ b/tests/ui/suggestions/match-prev-arm-needing-semi.stderr
@@ -9,14 +9,17 @@ LL | |             async_dummy();
 LL | |
 LL | |         }
 LL | |         false => async_dummy(),
-   | |                  ^^^^^^^^^^^^^ expected `()`, found opaque type
+   | |                  ^^^^^^^^^^^^^ expected `()`, found future
 ...  |
 LL | |
 LL | |     };
    | |_____- `match` arms have incompatible types
    |
-   = note: expected unit type `()`
-            found opaque type `impl Future<Output = ()>`
+note: calling an async function returns a future
+  --> $DIR/match-prev-arm-needing-semi.rs:26:18
+   |
+LL |         false => async_dummy(),
+   |                  ^^^^^^^^^^^^^
 help: consider `await`ing on the `Future`
    |
 LL |         false => async_dummy().await,
@@ -38,14 +41,17 @@ LL | |             async_dummy();
 LL | |
 LL | |         }
 LL | |         false => async_dummy2(),
-   | |                  ^^^^^^^^^^^^^^ expected `()`, found opaque type
+   | |                  ^^^^^^^^^^^^^^ expected `()`, found future
 ...  |
 LL | |
 LL | |     };
    | |_____- `match` arms have incompatible types
    |
-   = note: expected unit type `()`
-            found opaque type `impl Future<Output = ()>`
+note: calling an async function returns a future
+  --> $DIR/match-prev-arm-needing-semi.rs:39:18
+   |
+LL |         false => async_dummy2(),
+   |                  ^^^^^^^^^^^^^^
 help: consider `await`ing on the `Future`
    |
 LL |         false => async_dummy2().await,
@@ -67,14 +73,12 @@ LL | |         true => async_dummy(),
    | |                 ------------- this is found to be of type `impl Future<Output = ()>`
 LL | |
 LL | |         false => async_dummy2(),
-   | |                  ^^^^^^^^^^^^^^ expected opaque type, found a different opaque type
-...  |
+   | |                  ^^^^^^^^^^^^^^ expected future, found a different future
+LL | |
 LL | |
 LL | |     };
    | |_____- `match` arms have incompatible types
    |
-   = note: expected opaque type `impl Future<Output = ()>` (opaque type at <$DIR/match-prev-arm-needing-semi.rs:16:24>)
-              found opaque type `impl Future<Output = ()>` (opaque type at <$DIR/match-prev-arm-needing-semi.rs:18:25>)
    = note: distinct uses of `impl Trait` result in different opaque types
 help: consider `await`ing on both `Future`s
    |
diff --git a/tests/ui/suggestions/opaque-type-error.stderr b/tests/ui/suggestions/opaque-type-error.stderr
index 133ffb05873..5c90d3012ab 100644
--- a/tests/ui/suggestions/opaque-type-error.stderr
+++ b/tests/ui/suggestions/opaque-type-error.stderr
@@ -2,22 +2,20 @@ error[E0308]: `if` and `else` have incompatible types
   --> $DIR/opaque-type-error.rs:20:9
    |
 LL |   fn thing_one() -> impl Future<Output = Result<(), ()>> {
-   |                     ------------------------------------ the expected opaque type
+   |                     ------------------------------------ the expected future
 ...
 LL |   fn thing_two() -> impl Future<Output = Result<(), ()>> {
-   |                     ------------------------------------ the found opaque type
+   |                     ------------------------------------ the found future
 ...
 LL | /     if true {
 LL | |         thing_one()
    | |         ----------- expected because of this
 LL | |     } else {
 LL | |         thing_two()
-   | |         ^^^^^^^^^^^ expected opaque type, found a different opaque type
+   | |         ^^^^^^^^^^^ expected future, found a different future
 LL | |     }.await
    | |_____- `if` and `else` have incompatible types
    |
-   = note: expected opaque type `impl Future<Output = Result<(), ()>>` (opaque type at <$DIR/opaque-type-error.rs:8:19>)
-              found opaque type `impl Future<Output = Result<(), ()>>` (opaque type at <$DIR/opaque-type-error.rs:12:19>)
    = note: distinct uses of `impl Trait` result in different opaque types
 help: consider `await`ing on both `Future`s
    |
diff --git a/tests/ui/traits/trait-or-new-type-instead.stderr b/tests/ui/traits/trait-or-new-type-instead.stderr
index 4726b0668e5..6fd8a03fd8f 100644
--- a/tests/ui/traits/trait-or-new-type-instead.stderr
+++ b/tests/ui/traits/trait-or-new-type-instead.stderr
@@ -1,11 +1,8 @@
 error[E0116]: cannot define inherent `impl` for a type outside of the crate where the type is defined
   --> $DIR/trait-or-new-type-instead.rs:1:1
    |
-LL | / impl<T> Option<T> {
-LL | |
-LL | |     pub fn foo(&self) { }
-LL | | }
-   | |_^ impl for type defined outside of crate.
+LL | impl<T> Option<T> {
+   | ^^^^^^^^^^^^^^^^^ impl for type defined outside of crate.
    |
    = note: define and implement a trait or new type instead
 
diff --git a/tests/ui/type-alias-impl-trait/issue-98604.stderr b/tests/ui/type-alias-impl-trait/issue-98604.stderr
index bb9dd2365ea..fa16d321890 100644
--- a/tests/ui/type-alias-impl-trait/issue-98604.stderr
+++ b/tests/ui/type-alias-impl-trait/issue-98604.stderr
@@ -2,10 +2,8 @@ error[E0271]: expected `test` to be a fn item that returns `Pin<Box<dyn Future<O
   --> $DIR/issue-98604.rs:9:5
    |
 LL |     Box::new(test) as AsyncFnPtr;
-   |     ^^^^^^^^^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found opaque type
+   |     ^^^^^^^^^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found future
    |
-   = note:   expected struct `Pin<Box<(dyn Future<Output = ()> + 'static)>>`
-           found opaque type `impl Future<Output = ()>`
    = note: required for the cast from `fn() -> impl Future<Output = ()> {test}` to the object type `dyn Fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>>`
 
 error: aborting due to previous error
diff --git a/tests/ui/typeck/issue-90027-async-fn-return-suggestion.stderr b/tests/ui/typeck/issue-90027-async-fn-return-suggestion.stderr
index 6a1a9f45bc6..0d72ae118f3 100644
--- a/tests/ui/typeck/issue-90027-async-fn-return-suggestion.stderr
+++ b/tests/ui/typeck/issue-90027-async-fn-return-suggestion.stderr
@@ -18,10 +18,13 @@ error[E0308]: mismatched types
   --> $DIR/issue-90027-async-fn-return-suggestion.rs:14:5
    |
 LL |     hello()
-   |     ^^^^^^^ expected `()`, found opaque type
+   |     ^^^^^^^ expected `()`, found future
    |
-   = note: expected unit type `()`
-            found opaque type `impl Future<Output = ()>`
+note: calling an async function returns a future
+  --> $DIR/issue-90027-async-fn-return-suggestion.rs:14:5
+   |
+LL |     hello()
+   |     ^^^^^^^
 help: consider `await`ing on the `Future`
    |
 LL |     hello().await