about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/assembly/x86_64-bigint-add.rs33
-rw-r--r--tests/rustdoc-ui/coverage/doc-examples-json.stdout2
-rw-r--r--tests/rustdoc-ui/coverage/doc-examples.stdout4
-rw-r--r--tests/rustdoc-ui/coverage/json.stdout2
-rw-r--r--tests/rustdoc-ui/lints/check.rs1
-rw-r--r--tests/rustdoc-ui/lints/check.stderr28
-rw-r--r--tests/rustdoc-ui/lints/doc-without-codeblock.rs3
-rw-r--r--tests/rustdoc-ui/lints/doc-without-codeblock.stderr26
-rw-r--r--tests/rustdoc-ui/lints/lint-missing-doc-code-example.rs2
-rw-r--r--tests/rustdoc-ui/lints/lint-missing-doc-code-example.stderr14
-rw-r--r--tests/rustdoc-ui/show-coverage-json.stdout2
-rw-r--r--tests/rustdoc-ui/show-coverage.stdout4
-rw-r--r--tests/ui/consts/const-block-const-bound.stderr12
-rw-r--r--tests/ui/consts/constifconst-call-in-const-position.stderr4
-rw-r--r--tests/ui/consts/fn_trait_refs.stderr75
-rw-r--r--tests/ui/consts/missing_span_in_backtrace.rs2
-rw-r--r--tests/ui/impl-trait/normalize-tait-in-const.stderr12
-rw-r--r--tests/ui/lifetimes/raw/immediately-followed-by-lt.e2021.stderr (renamed from tests/ui/lifetimes/raw/immediately-followed-by-lt.stderr)2
-rw-r--r--tests/ui/lifetimes/raw/immediately-followed-by-lt.rs8
-rw-r--r--tests/ui/never_type/lint-breaking-2024-assign-underscore.fixed17
-rw-r--r--tests/ui/never_type/lint-breaking-2024-assign-underscore.rs17
-rw-r--r--tests/ui/never_type/lint-breaking-2024-assign-underscore.stderr26
-rw-r--r--tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.stderr4
-rw-r--r--tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.stderr4
-rw-r--r--tests/ui/traits/const-traits/call-const-closure.stderr4
-rw-r--r--tests/ui/traits/const-traits/call-const-in-tilde-const.stderr2
-rw-r--r--tests/ui/traits/const-traits/call-const-trait-method-fail.stderr2
-rw-r--r--tests/ui/traits/const-traits/call-generic-method-nonconst.stderr12
-rw-r--r--tests/ui/traits/const-traits/const-default-method-bodies.stderr4
-rw-r--r--tests/ui/traits/const-traits/const-drop-bound.stderr12
-rw-r--r--tests/ui/traits/const-traits/const-drop-fail-2.precise.stderr16
-rw-r--r--tests/ui/traits/const-traits/const-drop-fail-2.stock.stderr16
-rw-r--r--tests/ui/traits/const-traits/const-drop-fail.precise.stderr39
-rw-r--r--tests/ui/traits/const-traits/const-drop-fail.rs4
-rw-r--r--tests/ui/traits/const-traits/const-drop-fail.stock.stderr39
-rw-r--r--tests/ui/traits/const-traits/const-opaque.no.stderr16
-rw-r--r--tests/ui/traits/const-traits/cross-crate.gatednc.stderr4
-rw-r--r--tests/ui/traits/const-traits/default-method-body-is-const-body-checking.stderr10
-rw-r--r--tests/ui/traits/const-traits/default-method-body-is-const-same-trait-ck.stderr4
-rw-r--r--tests/ui/traits/const-traits/effects/minicore-fn-fail.stderr12
-rw-r--r--tests/ui/traits/const-traits/effects/no-explicit-const-params.stderr4
-rw-r--r--tests/ui/traits/const-traits/specializing-constness-2.stderr4
-rw-r--r--tests/ui/traits/const-traits/super-traits-fail-2.yn.stderr4
-rw-r--r--tests/ui/traits/const-traits/super-traits-fail-2.yy.stderr4
-rw-r--r--tests/ui/traits/const-traits/super-traits-fail-3.yn.stderr4
-rw-r--r--tests/ui/traits/const-traits/tilde-const-and-const-params.stderr4
-rw-r--r--tests/ui/traits/const-traits/trait-where-clause-const.stderr18
-rw-r--r--tests/ui/traits/const-traits/unsatisfied-const-trait-bound.stderr8
48 files changed, 369 insertions, 181 deletions
diff --git a/tests/assembly/x86_64-bigint-add.rs b/tests/assembly/x86_64-bigint-add.rs
new file mode 100644
index 00000000000..4bcb9732c64
--- /dev/null
+++ b/tests/assembly/x86_64-bigint-add.rs
@@ -0,0 +1,33 @@
+//@ only-x86_64
+//@ assembly-output: emit-asm
+//@ compile-flags: --crate-type=lib -O -C target-cpu=x86-64-v4
+//@ compile-flags: -C llvm-args=-x86-asm-syntax=intel
+
+#![no_std]
+#![feature(bigint_helper_methods)]
+
+// This checks that the `carrying_add` implementation successfully chains, to catch
+// issues like <https://github.com/rust-lang/rust/issues/85532#issuecomment-2495119815>
+
+// This forces the ABI to avoid the windows-vs-linux ABI differences.
+
+// CHECK-LABEL: bigint_chain_carrying_add:
+#[no_mangle]
+pub unsafe extern "sysv64" fn bigint_chain_carrying_add(
+    dest: *mut u64,
+    src1: *const u64,
+    src2: *const u64,
+    n: usize,
+    mut carry: bool,
+) -> bool {
+    // CHECK: mov [[TEMP:r..]], qword ptr [rsi + 8*[[IND:r..]] + 8]
+    // CHECK: adc [[TEMP]], qword ptr [rdx + 8*[[IND]] + 8]
+    // CHECK: mov qword ptr [rdi + 8*[[IND]] + 8], [[TEMP]]
+    // CHECK: mov [[TEMP]], qword ptr [rsi + 8*[[IND]] + 16]
+    // CHECK: adc [[TEMP]], qword ptr [rdx + 8*[[IND]] + 16]
+    // CHECK: mov qword ptr [rdi + 8*[[IND]] + 16], [[TEMP]]
+    for i in 0..n {
+        (*dest.add(i), carry) = u64::carrying_add(*src1.add(i), *src2.add(i), carry);
+    }
+    carry
+}
diff --git a/tests/rustdoc-ui/coverage/doc-examples-json.stdout b/tests/rustdoc-ui/coverage/doc-examples-json.stdout
index 92f58556975..070fed0783e 100644
--- a/tests/rustdoc-ui/coverage/doc-examples-json.stdout
+++ b/tests/rustdoc-ui/coverage/doc-examples-json.stdout
@@ -1 +1 @@
-{"$DIR/doc-examples-json.rs":{"total":3,"with_docs":2,"total_examples":2,"with_examples":1}}
+{"$DIR/doc-examples-json.rs":{"total":3,"with_docs":2,"total_examples":1,"with_examples":1}}
diff --git a/tests/rustdoc-ui/coverage/doc-examples.stdout b/tests/rustdoc-ui/coverage/doc-examples.stdout
index 8188740f873..793adeb3518 100644
--- a/tests/rustdoc-ui/coverage/doc-examples.stdout
+++ b/tests/rustdoc-ui/coverage/doc-examples.stdout
@@ -1,7 +1,7 @@
 +-------------------------------------+------------+------------+------------+------------+
 | File                                | Documented | Percentage |   Examples | Percentage |
 +-------------------------------------+------------+------------+------------+------------+
-| ...tdoc-ui/coverage/doc-examples.rs |          4 |     100.0% |          1 |      25.0% |
+| ...tdoc-ui/coverage/doc-examples.rs |          4 |     100.0% |          1 |      33.3% |
 +-------------------------------------+------------+------------+------------+------------+
-| Total                               |          4 |     100.0% |          1 |      25.0% |
+| Total                               |          4 |     100.0% |          1 |      33.3% |
 +-------------------------------------+------------+------------+------------+------------+
diff --git a/tests/rustdoc-ui/coverage/json.stdout b/tests/rustdoc-ui/coverage/json.stdout
index c2be73ce3ed..25fd896baf1 100644
--- a/tests/rustdoc-ui/coverage/json.stdout
+++ b/tests/rustdoc-ui/coverage/json.stdout
@@ -1 +1 @@
-{"$DIR/json.rs":{"total":17,"with_docs":12,"total_examples":15,"with_examples":6}}
+{"$DIR/json.rs":{"total":17,"with_docs":12,"total_examples":13,"with_examples":6}}
diff --git a/tests/rustdoc-ui/lints/check.rs b/tests/rustdoc-ui/lints/check.rs
index 391ba517077..058c5d6c468 100644
--- a/tests/rustdoc-ui/lints/check.rs
+++ b/tests/rustdoc-ui/lints/check.rs
@@ -4,7 +4,6 @@
 
 #![feature(rustdoc_missing_doc_code_examples)]
 //~^ WARN
-//~^^ WARN
 
 #![warn(missing_docs)]
 #![warn(rustdoc::missing_doc_code_examples)]
diff --git a/tests/rustdoc-ui/lints/check.stderr b/tests/rustdoc-ui/lints/check.stderr
index acdb8128443..f1f36e8830d 100644
--- a/tests/rustdoc-ui/lints/check.stderr
+++ b/tests/rustdoc-ui/lints/check.stderr
@@ -4,19 +4,20 @@ warning: missing documentation for the crate
 LL | / #![feature(rustdoc_missing_doc_code_examples)]
 LL | |
 LL | |
+LL | | #![warn(missing_docs)]
 ...  |
 LL | |
 LL | | pub fn foo() {}
    | |_______________^
    |
 note: the lint level is defined here
-  --> $DIR/check.rs:9:9
+  --> $DIR/check.rs:8:9
    |
 LL | #![warn(missing_docs)]
    |         ^^^^^^^^^^^^
 
 warning: missing documentation for a function
-  --> $DIR/check.rs:13:1
+  --> $DIR/check.rs:12:1
    |
 LL | pub fn foo() {}
    | ^^^^^^^^^^^^
@@ -26,34 +27,23 @@ warning: no documentation found for this crate's top-level module
    = help: The following guide may be of use:
            https://doc.rust-lang.org/$CHANNEL/rustdoc/how-to-write-documentation.html
 note: the lint level is defined here
-  --> $DIR/check.rs:11:9
+  --> $DIR/check.rs:10:9
    |
 LL | #![warn(rustdoc::all)]
    |         ^^^^^^^^^^^^
    = note: `#[warn(rustdoc::missing_crate_level_docs)]` implied by `#[warn(rustdoc::all)]`
 
 warning: missing code example in this documentation
-  --> $DIR/check.rs:5:1
+  --> $DIR/check.rs:12:1
    |
-LL | / #![feature(rustdoc_missing_doc_code_examples)]
-LL | |
-LL | |
-...  |
-LL | |
-LL | | pub fn foo() {}
-   | |_______________^
+LL | pub fn foo() {}
+   | ^^^^^^^^^^^^^^^
    |
 note: the lint level is defined here
-  --> $DIR/check.rs:10:9
+  --> $DIR/check.rs:9:9
    |
 LL | #![warn(rustdoc::missing_doc_code_examples)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-warning: missing code example in this documentation
-  --> $DIR/check.rs:13:1
-   |
-LL | pub fn foo() {}
-   | ^^^^^^^^^^^^^^^
-
-warning: 5 warnings emitted
+warning: 4 warnings emitted
 
diff --git a/tests/rustdoc-ui/lints/doc-without-codeblock.rs b/tests/rustdoc-ui/lints/doc-without-codeblock.rs
index 86d7c83d335..ccb241d4037 100644
--- a/tests/rustdoc-ui/lints/doc-without-codeblock.rs
+++ b/tests/rustdoc-ui/lints/doc-without-codeblock.rs
@@ -1,4 +1,4 @@
-#![feature(rustdoc_missing_doc_code_examples)] //~ ERROR missing code example in this documentation
+#![feature(rustdoc_missing_doc_code_examples)]
 #![deny(rustdoc::missing_doc_code_examples)]
 
 /// Some docs.
@@ -6,7 +6,6 @@
 pub struct Foo;
 
 /// And then, the princess died.
-//~^ ERROR missing code example in this documentation
 pub mod foo {
     /// Or maybe not because she saved herself!
     //~^ ERROR missing code example in this documentation
diff --git a/tests/rustdoc-ui/lints/doc-without-codeblock.stderr b/tests/rustdoc-ui/lints/doc-without-codeblock.stderr
index ebf2a2d54f7..d230f160693 100644
--- a/tests/rustdoc-ui/lints/doc-without-codeblock.stderr
+++ b/tests/rustdoc-ui/lints/doc-without-codeblock.stderr
@@ -1,14 +1,8 @@
 error: missing code example in this documentation
-  --> $DIR/doc-without-codeblock.rs:1:1
+  --> $DIR/doc-without-codeblock.rs:10:5
    |
-LL | / #![feature(rustdoc_missing_doc_code_examples)]
-LL | | #![deny(rustdoc::missing_doc_code_examples)]
-LL | |
-LL | | /// Some docs.
-...  |
-LL | |     }
-LL | | }
-   | |_^
+LL |     /// Or maybe not because she saved herself!
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: the lint level is defined here
   --> $DIR/doc-without-codeblock.rs:2:9
@@ -17,22 +11,10 @@ LL | #![deny(rustdoc::missing_doc_code_examples)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: missing code example in this documentation
-  --> $DIR/doc-without-codeblock.rs:8:1
-   |
-LL | /// And then, the princess died.
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: missing code example in this documentation
-  --> $DIR/doc-without-codeblock.rs:11:5
-   |
-LL |     /// Or maybe not because she saved herself!
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: missing code example in this documentation
   --> $DIR/doc-without-codeblock.rs:4:1
    |
 LL | /// Some docs.
    | ^^^^^^^^^^^^^^
 
-error: aborting due to 4 previous errors
+error: aborting due to 2 previous errors
 
diff --git a/tests/rustdoc-ui/lints/lint-missing-doc-code-example.rs b/tests/rustdoc-ui/lints/lint-missing-doc-code-example.rs
index 40f35728d79..8e5c31d50ed 100644
--- a/tests/rustdoc-ui/lints/lint-missing-doc-code-example.rs
+++ b/tests/rustdoc-ui/lints/lint-missing-doc-code-example.rs
@@ -17,7 +17,7 @@ pub fn test() {
 }
 
 #[allow(missing_docs)]
-pub mod module1 { //~ ERROR
+pub mod module1 {
 }
 
 #[allow(rustdoc::missing_doc_code_examples)]
diff --git a/tests/rustdoc-ui/lints/lint-missing-doc-code-example.stderr b/tests/rustdoc-ui/lints/lint-missing-doc-code-example.stderr
index f9331250154..22533b9816a 100644
--- a/tests/rustdoc-ui/lints/lint-missing-doc-code-example.stderr
+++ b/tests/rustdoc-ui/lints/lint-missing-doc-code-example.stderr
@@ -1,8 +1,8 @@
 error: missing code example in this documentation
-  --> $DIR/lint-missing-doc-code-example.rs:20:1
+  --> $DIR/lint-missing-doc-code-example.rs:38:3
    |
-LL | pub mod module1 {
-   | ^^^^^^^^^^^^^^^
+LL |   /// doc
+   |   ^^^^^^^
    |
 note: the lint level is defined here
   --> $DIR/lint-missing-doc-code-example.rs:3:9
@@ -11,12 +11,6 @@ LL | #![deny(rustdoc::missing_doc_code_examples)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: missing code example in this documentation
-  --> $DIR/lint-missing-doc-code-example.rs:38:3
-   |
-LL |   /// doc
-   |   ^^^^^^^
-
-error: missing code example in this documentation
   --> $DIR/lint-missing-doc-code-example.rs:50:1
    |
 LL | /// Doc
@@ -34,5 +28,5 @@ error: missing code example in this documentation
 LL | /// Doc
    | ^^^^^^^
 
-error: aborting due to 5 previous errors
+error: aborting due to 4 previous errors
 
diff --git a/tests/rustdoc-ui/show-coverage-json.stdout b/tests/rustdoc-ui/show-coverage-json.stdout
index ed5b5a60212..e6e882b2c57 100644
--- a/tests/rustdoc-ui/show-coverage-json.stdout
+++ b/tests/rustdoc-ui/show-coverage-json.stdout
@@ -1 +1 @@
-{"$DIR/show-coverage-json.rs":{"total":2,"with_docs":1,"total_examples":2,"with_examples":1}}
+{"$DIR/show-coverage-json.rs":{"total":2,"with_docs":1,"total_examples":1,"with_examples":1}}
diff --git a/tests/rustdoc-ui/show-coverage.stdout b/tests/rustdoc-ui/show-coverage.stdout
index b3b7679771f..b9e0316545e 100644
--- a/tests/rustdoc-ui/show-coverage.stdout
+++ b/tests/rustdoc-ui/show-coverage.stdout
@@ -1,7 +1,7 @@
 +-------------------------------------+------------+------------+------------+------------+
 | File                                | Documented | Percentage |   Examples | Percentage |
 +-------------------------------------+------------+------------+------------+------------+
-| ...ests/rustdoc-ui/show-coverage.rs |          1 |      50.0% |          1 |      50.0% |
+| ...ests/rustdoc-ui/show-coverage.rs |          1 |      50.0% |          1 |     100.0% |
 +-------------------------------------+------------+------------+------------+------------+
-| Total                               |          1 |      50.0% |          1 |      50.0% |
+| Total                               |          1 |      50.0% |          1 |     100.0% |
 +-------------------------------------+------------+------------+------------+------------+
diff --git a/tests/ui/consts/const-block-const-bound.stderr b/tests/ui/consts/const-block-const-bound.stderr
index b2b2f62c58f..0931eff2175 100644
--- a/tests/ui/consts/const-block-const-bound.stderr
+++ b/tests/ui/consts/const-block-const-bound.stderr
@@ -1,8 +1,16 @@
 error[E0277]: the trait bound `UnconstDrop: const Destruct` is not satisfied
-  --> $DIR/const-block-const-bound.rs:18:9
+  --> $DIR/const-block-const-bound.rs:18:11
    |
 LL |         f(UnconstDrop);
-   |         ^^^^^^^^^^^^^^
+   |         - ^^^^^^^^^^^
+   |         |
+   |         required by a bound introduced by this call
+   |
+note: required by a bound in `f`
+  --> $DIR/const-block-const-bound.rs:8:15
+   |
+LL | const fn f<T: ~const Destruct>(x: T) {}
+   |               ^^^^^^ required by this bound in `f`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/consts/constifconst-call-in-const-position.stderr b/tests/ui/consts/constifconst-call-in-const-position.stderr
index 6add83dc52c..c778299560f 100644
--- a/tests/ui/consts/constifconst-call-in-const-position.stderr
+++ b/tests/ui/consts/constifconst-call-in-const-position.stderr
@@ -2,13 +2,13 @@ error[E0277]: the trait bound `T: const Tr` is not satisfied
   --> $DIR/constifconst-call-in-const-position.rs:17:38
    |
 LL | const fn foo<T: ~const Tr>() -> [u8; T::a()] {
-   |                                      ^^^^^^
+   |                                      ^
 
 error[E0277]: the trait bound `T: const Tr` is not satisfied
   --> $DIR/constifconst-call-in-const-position.rs:18:9
    |
 LL |     [0; T::a()]
-   |         ^^^^^^
+   |         ^
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/consts/fn_trait_refs.stderr b/tests/ui/consts/fn_trait_refs.stderr
index 10850021713..11e13c3efdd 100644
--- a/tests/ui/consts/fn_trait_refs.stderr
+++ b/tests/ui/consts/fn_trait_refs.stderr
@@ -121,34 +121,89 @@ LL |     T: ~const FnMut<()> + ~const Destruct,
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error[E0277]: the trait bound `fn() -> i32 {one}: const Destruct` is not satisfied
-  --> $DIR/fn_trait_refs.rs:70:24
+  --> $DIR/fn_trait_refs.rs:70:32
    |
 LL |         let test_one = test_fn(one);
-   |                        ^^^^^^^^^^^^
+   |                        ------- ^^^
+   |                        |
+   |                        required by a bound introduced by this call
+   |
+note: required by a bound in `test_fn`
+  --> $DIR/fn_trait_refs.rs:35:24
+   |
+LL | const fn test_fn<T>(mut f: T) -> (T::Output, T::Output, T::Output)
+   |          ------- required by a bound in this function
+LL | where
+LL |     T: ~const Fn<()> + ~const Destruct,
+   |                        ^^^^^^ required by this bound in `test_fn`
 
 error[E0277]: the trait bound `fn() -> i32 {two}: const Destruct` is not satisfied
-  --> $DIR/fn_trait_refs.rs:73:24
+  --> $DIR/fn_trait_refs.rs:73:36
    |
 LL |         let test_two = test_fn_mut(two);
-   |                        ^^^^^^^^^^^^^^^^
+   |                        ----------- ^^^
+   |                        |
+   |                        required by a bound introduced by this call
+   |
+note: required by a bound in `test_fn_mut`
+  --> $DIR/fn_trait_refs.rs:49:27
+   |
+LL | const fn test_fn_mut<T>(mut f: T) -> (T::Output, T::Output)
+   |          ----------- required by a bound in this function
+LL | where
+LL |     T: ~const FnMut<()> + ~const Destruct,
+   |                           ^^^^^^ required by this bound in `test_fn_mut`
 
 error[E0277]: the trait bound `&T: ~const Destruct` is not satisfied
-  --> $DIR/fn_trait_refs.rs:39:9
+  --> $DIR/fn_trait_refs.rs:39:19
    |
 LL |         tester_fn(&f),
-   |         ^^^^^^^^^^^^^
+   |         --------- ^^
+   |         |
+   |         required by a bound introduced by this call
+   |
+note: required by a bound in `tester_fn`
+  --> $DIR/fn_trait_refs.rs:14:24
+   |
+LL | const fn tester_fn<T>(f: T) -> T::Output
+   |          --------- required by a bound in this function
+LL | where
+LL |     T: ~const Fn<()> + ~const Destruct,
+   |                        ^^^^^^ required by this bound in `tester_fn`
 
 error[E0277]: the trait bound `&T: ~const Destruct` is not satisfied
-  --> $DIR/fn_trait_refs.rs:41:9
+  --> $DIR/fn_trait_refs.rs:41:23
    |
 LL |         tester_fn_mut(&f),
-   |         ^^^^^^^^^^^^^^^^^
+   |         ------------- ^^
+   |         |
+   |         required by a bound introduced by this call
+   |
+note: required by a bound in `tester_fn_mut`
+  --> $DIR/fn_trait_refs.rs:21:27
+   |
+LL | const fn tester_fn_mut<T>(mut f: T) -> T::Output
+   |          ------------- required by a bound in this function
+LL | where
+LL |     T: ~const FnMut<()> + ~const Destruct,
+   |                           ^^^^^^ required by this bound in `tester_fn_mut`
 
 error[E0277]: the trait bound `&mut T: ~const Destruct` is not satisfied
-  --> $DIR/fn_trait_refs.rs:53:9
+  --> $DIR/fn_trait_refs.rs:53:23
    |
 LL |         tester_fn_mut(&mut f),
-   |         ^^^^^^^^^^^^^^^^^^^^^
+   |         ------------- ^^^^^^
+   |         |
+   |         required by a bound introduced by this call
+   |
+note: required by a bound in `tester_fn_mut`
+  --> $DIR/fn_trait_refs.rs:21:27
+   |
+LL | const fn tester_fn_mut<T>(mut f: T) -> T::Output
+   |          ------------- required by a bound in this function
+LL | where
+LL |     T: ~const FnMut<()> + ~const Destruct,
+   |                           ^^^^^^ required by this bound in `tester_fn_mut`
 
 error[E0015]: cannot call non-const closure in constant functions
   --> $DIR/fn_trait_refs.rs:16:5
diff --git a/tests/ui/consts/missing_span_in_backtrace.rs b/tests/ui/consts/missing_span_in_backtrace.rs
index ea457c96f15..703cc7fbf89 100644
--- a/tests/ui/consts/missing_span_in_backtrace.rs
+++ b/tests/ui/consts/missing_span_in_backtrace.rs
@@ -1,7 +1,7 @@
 //@ compile-flags: -Z ui-testing=no
 
 
-#![feature(const_swap)]
+#![feature(const_swap_nonoverlapping)]
 use std::{
     mem::{self, MaybeUninit},
     ptr,
diff --git a/tests/ui/impl-trait/normalize-tait-in-const.stderr b/tests/ui/impl-trait/normalize-tait-in-const.stderr
index bb874cbe41b..203fbfc1d2c 100644
--- a/tests/ui/impl-trait/normalize-tait-in-const.stderr
+++ b/tests/ui/impl-trait/normalize-tait-in-const.stderr
@@ -13,10 +13,18 @@ LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruc
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error[E0277]: the trait bound `for<'a, 'b> fn(&'a foo::Alias<'b>) {foo}: const Destruct` is not satisfied
-  --> $DIR/normalize-tait-in-const.rs:33:5
+  --> $DIR/normalize-tait-in-const.rs:33:19
    |
 LL |     with_positive(foo);
-   |     ^^^^^^^^^^^^^^^^^^
+   |     ------------- ^^^
+   |     |
+   |     required by a bound introduced by this call
+   |
+note: required by a bound in `with_positive`
+  --> $DIR/normalize-tait-in-const.rs:26:62
+   |
+LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
+   |                                                              ^^^^^^ required by this bound in `with_positive`
 
 error[E0015]: cannot call non-const closure in constant functions
   --> $DIR/normalize-tait-in-const.rs:27:5
diff --git a/tests/ui/lifetimes/raw/immediately-followed-by-lt.stderr b/tests/ui/lifetimes/raw/immediately-followed-by-lt.e2021.stderr
index 1caeec84b22..e600cc37fc4 100644
--- a/tests/ui/lifetimes/raw/immediately-followed-by-lt.stderr
+++ b/tests/ui/lifetimes/raw/immediately-followed-by-lt.e2021.stderr
@@ -1,5 +1,5 @@
 error: character literal may only contain one codepoint
-  --> $DIR/immediately-followed-by-lt.rs:11:4
+  --> $DIR/immediately-followed-by-lt.rs:15:4
    |
 LL | w!('r#long'id);
    |    ^^^^^^^^
diff --git a/tests/ui/lifetimes/raw/immediately-followed-by-lt.rs b/tests/ui/lifetimes/raw/immediately-followed-by-lt.rs
index fe2b6de7bb3..eb161f9c855 100644
--- a/tests/ui/lifetimes/raw/immediately-followed-by-lt.rs
+++ b/tests/ui/lifetimes/raw/immediately-followed-by-lt.rs
@@ -1,4 +1,8 @@
-//@ edition: 2021
+//@ revisions: e2015 e2021
+
+//@[e2021] edition: 2021
+//@[e2015] edition: 2015
+//@[e2015] check-pass
 
 // Make sure we reject the case where a raw lifetime is immediately followed by another
 // lifetime. This reserves a modest amount of space for changing lexing to, for example,
@@ -9,6 +13,6 @@ macro_rules! w {
 }
 
 w!('r#long'id);
-//~^ ERROR character literal may only contain one codepoint
+//[e2021]~^ ERROR character literal may only contain one codepoint
 
 fn main() {}
diff --git a/tests/ui/never_type/lint-breaking-2024-assign-underscore.fixed b/tests/ui/never_type/lint-breaking-2024-assign-underscore.fixed
new file mode 100644
index 00000000000..f9f2b59a8c2
--- /dev/null
+++ b/tests/ui/never_type/lint-breaking-2024-assign-underscore.fixed
@@ -0,0 +1,17 @@
+//@ run-rustfix
+
+#![allow(unused)]
+#![deny(dependency_on_unit_never_type_fallback)]
+
+fn foo<T: Default>() -> Result<T, ()> {
+    Err(())
+}
+
+fn test() -> Result<(), ()> {
+    //~^ ERROR this function depends on never type fallback being `()`
+    //~| WARN this was previously accepted by the compiler but is being phased out
+    _ = foo::<()>()?;
+    Ok(())
+}
+
+fn main() {}
diff --git a/tests/ui/never_type/lint-breaking-2024-assign-underscore.rs b/tests/ui/never_type/lint-breaking-2024-assign-underscore.rs
new file mode 100644
index 00000000000..8a2f3d311ab
--- /dev/null
+++ b/tests/ui/never_type/lint-breaking-2024-assign-underscore.rs
@@ -0,0 +1,17 @@
+//@ run-rustfix
+
+#![allow(unused)]
+#![deny(dependency_on_unit_never_type_fallback)]
+
+fn foo<T: Default>() -> Result<T, ()> {
+    Err(())
+}
+
+fn test() -> Result<(), ()> {
+    //~^ ERROR this function depends on never type fallback being `()`
+    //~| WARN this was previously accepted by the compiler but is being phased out
+    _ = foo()?;
+    Ok(())
+}
+
+fn main() {}
diff --git a/tests/ui/never_type/lint-breaking-2024-assign-underscore.stderr b/tests/ui/never_type/lint-breaking-2024-assign-underscore.stderr
new file mode 100644
index 00000000000..dc4ffa0d6f4
--- /dev/null
+++ b/tests/ui/never_type/lint-breaking-2024-assign-underscore.stderr
@@ -0,0 +1,26 @@
+error: this function depends on never type fallback being `()`
+  --> $DIR/lint-breaking-2024-assign-underscore.rs:10:1
+   |
+LL | fn test() -> Result<(), ()> {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
+   = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
+   = help: specify the types explicitly
+note: in edition 2024, the requirement `!: Default` will fail
+  --> $DIR/lint-breaking-2024-assign-underscore.rs:13:9
+   |
+LL |     _ = foo()?;
+   |         ^^^^^
+note: the lint level is defined here
+  --> $DIR/lint-breaking-2024-assign-underscore.rs:4:9
+   |
+LL | #![deny(dependency_on_unit_never_type_fallback)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: use `()` annotations to avoid fallback changes
+   |
+LL |     _ = foo::<()>()?;
+   |            ++++++
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.stderr b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.stderr
index 86bd07a5f59..c7af0a220ca 100644
--- a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.stderr
+++ b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.stderr
@@ -2,13 +2,13 @@ error[E0277]: the trait bound `<T as Trait>::Assoc<U>: ~const Trait` is not sati
   --> $DIR/assoc-type-const-bound-usage-fail-2.rs:23:5
    |
 LL |     T::Assoc::<U>::func();
-   |     ^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^
 
 error[E0277]: the trait bound `<T as Trait>::Assoc<U>: ~const Trait` is not satisfied
   --> $DIR/assoc-type-const-bound-usage-fail-2.rs:25:5
    |
 LL |     <T as Trait>::Assoc::<U>::func();
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.stderr b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.stderr
index 145fe2c41dd..99fc924ad06 100644
--- a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.stderr
+++ b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.stderr
@@ -2,13 +2,13 @@ error[E0277]: the trait bound `T: ~const Trait` is not satisfied
   --> $DIR/assoc-type-const-bound-usage-fail.rs:16:5
    |
 LL |     T::Assoc::func();
-   |     ^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^
 
 error[E0277]: the trait bound `T: ~const Trait` is not satisfied
   --> $DIR/assoc-type-const-bound-usage-fail.rs:18:5
    |
 LL |     <T as Trait>::Assoc::func();
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/traits/const-traits/call-const-closure.stderr b/tests/ui/traits/const-traits/call-const-closure.stderr
index 3fed67f5d08..fe7c115aaab 100644
--- a/tests/ui/traits/const-traits/call-const-closure.stderr
+++ b/tests/ui/traits/const-traits/call-const-closure.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the trait bound `(): ~const Bar` is not satisfied
-  --> $DIR/call-const-closure.rs:17:15
+  --> $DIR/call-const-closure.rs:17:18
    |
 LL |     (const || ().foo())();
-   |               ^^^^^^^^
+   |                  ^^^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/traits/const-traits/call-const-in-tilde-const.stderr b/tests/ui/traits/const-traits/call-const-in-tilde-const.stderr
index e56968b9097..b9dabceb5de 100644
--- a/tests/ui/traits/const-traits/call-const-in-tilde-const.stderr
+++ b/tests/ui/traits/const-traits/call-const-in-tilde-const.stderr
@@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: const Foo` is not satisfied
   --> $DIR/call-const-in-tilde-const.rs:9:13
    |
 LL |     const { T::foo() }
-   |             ^^^^^^^^
+   |             ^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/traits/const-traits/call-const-trait-method-fail.stderr b/tests/ui/traits/const-traits/call-const-trait-method-fail.stderr
index b461fd9e39e..64850335c2a 100644
--- a/tests/ui/traits/const-traits/call-const-trait-method-fail.stderr
+++ b/tests/ui/traits/const-traits/call-const-trait-method-fail.stderr
@@ -2,7 +2,7 @@ error[E0277]: the trait bound `u32: ~const Plus` is not satisfied
   --> $DIR/call-const-trait-method-fail.rs:26:5
    |
 LL |     a.plus(b)
-   |     ^^^^^^^^^
+   |     ^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/traits/const-traits/call-generic-method-nonconst.stderr b/tests/ui/traits/const-traits/call-generic-method-nonconst.stderr
index d881bd5f4de..74a22186a16 100644
--- a/tests/ui/traits/const-traits/call-generic-method-nonconst.stderr
+++ b/tests/ui/traits/const-traits/call-generic-method-nonconst.stderr
@@ -1,8 +1,16 @@
 error[E0277]: the trait bound `S: const Foo` is not satisfied
-  --> $DIR/call-generic-method-nonconst.rs:24:22
+  --> $DIR/call-generic-method-nonconst.rs:24:34
    |
 LL | pub const EQ: bool = equals_self(&S);
-   |                      ^^^^^^^^^^^^^^^
+   |                      ----------- ^^
+   |                      |
+   |                      required by a bound introduced by this call
+   |
+note: required by a bound in `equals_self`
+  --> $DIR/call-generic-method-nonconst.rs:17:25
+   |
+LL | const fn equals_self<T: ~const Foo>(t: &T) -> bool {
+   |                         ^^^^^^ required by this bound in `equals_self`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/traits/const-traits/const-default-method-bodies.stderr b/tests/ui/traits/const-traits/const-default-method-bodies.stderr
index 5879330f158..903f7d37f9d 100644
--- a/tests/ui/traits/const-traits/const-default-method-bodies.stderr
+++ b/tests/ui/traits/const-traits/const-default-method-bodies.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the trait bound `NonConstImpl: ~const ConstDefaultFn` is not satisfied
-  --> $DIR/const-default-method-bodies.rs:25:5
+  --> $DIR/const-default-method-bodies.rs:25:18
    |
 LL |     NonConstImpl.a();
-   |     ^^^^^^^^^^^^^^^^
+   |                  ^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/traits/const-traits/const-drop-bound.stderr b/tests/ui/traits/const-traits/const-drop-bound.stderr
index 60718cc84c1..78ba0279566 100644
--- a/tests/ui/traits/const-traits/const-drop-bound.stderr
+++ b/tests/ui/traits/const-traits/const-drop-bound.stderr
@@ -1,8 +1,16 @@
 error[E0277]: the trait bound `Foo<E>: ~const Destruct` is not satisfied
-  --> $DIR/const-drop-bound.rs:23:5
+  --> $DIR/const-drop-bound.rs:23:9
    |
 LL |     foo(res)
-   |     ^^^^^^^^
+   |     --- ^^^
+   |     |
+   |     required by a bound introduced by this call
+   |
+note: required by a bound in `foo`
+  --> $DIR/const-drop-bound.rs:9:61
+   |
+LL | const fn foo<T, E>(res: Result<T, E>) -> Option<T> where E: ~const Destruct {
+   |                                                             ^^^^^^ required by this bound in `foo`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/traits/const-traits/const-drop-fail-2.precise.stderr b/tests/ui/traits/const-traits/const-drop-fail-2.precise.stderr
index bb9966c7ec3..7b2cafb6124 100644
--- a/tests/ui/traits/const-traits/const-drop-fail-2.precise.stderr
+++ b/tests/ui/traits/const-traits/const-drop-fail-2.precise.stderr
@@ -1,12 +1,14 @@
 error[E0277]: the trait bound `ConstDropImplWithBounds<NonTrivialDrop>: const Destruct` is not satisfied
-  --> $DIR/const-drop-fail-2.rs:31:15
+  --> $DIR/const-drop-fail-2.rs:31:23
    |
-LL |   const _: () = check::<ConstDropImplWithBounds<NonTrivialDrop>>(
-   |  _______________^
-LL | |
-LL | |     ConstDropImplWithBounds(PhantomData)
-LL | | );
-   | |_^
+LL | const _: () = check::<ConstDropImplWithBounds<NonTrivialDrop>>(
+   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: required by a bound in `check`
+  --> $DIR/const-drop-fail-2.rs:21:19
+   |
+LL | const fn check<T: ~const Destruct>(_: T) {}
+   |                   ^^^^^^ required by this bound in `check`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/traits/const-traits/const-drop-fail-2.stock.stderr b/tests/ui/traits/const-traits/const-drop-fail-2.stock.stderr
index bb9966c7ec3..7b2cafb6124 100644
--- a/tests/ui/traits/const-traits/const-drop-fail-2.stock.stderr
+++ b/tests/ui/traits/const-traits/const-drop-fail-2.stock.stderr
@@ -1,12 +1,14 @@
 error[E0277]: the trait bound `ConstDropImplWithBounds<NonTrivialDrop>: const Destruct` is not satisfied
-  --> $DIR/const-drop-fail-2.rs:31:15
+  --> $DIR/const-drop-fail-2.rs:31:23
    |
-LL |   const _: () = check::<ConstDropImplWithBounds<NonTrivialDrop>>(
-   |  _______________^
-LL | |
-LL | |     ConstDropImplWithBounds(PhantomData)
-LL | | );
-   | |_^
+LL | const _: () = check::<ConstDropImplWithBounds<NonTrivialDrop>>(
+   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: required by a bound in `check`
+  --> $DIR/const-drop-fail-2.rs:21:19
+   |
+LL | const fn check<T: ~const Destruct>(_: T) {}
+   |                   ^^^^^^ required by this bound in `check`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/traits/const-traits/const-drop-fail.precise.stderr b/tests/ui/traits/const-traits/const-drop-fail.precise.stderr
index 67e774fbd05..8b3e777a0b0 100644
--- a/tests/ui/traits/const-traits/const-drop-fail.precise.stderr
+++ b/tests/ui/traits/const-traits/const-drop-fail.precise.stderr
@@ -1,31 +1,32 @@
 error[E0277]: the trait bound `NonTrivialDrop: const Destruct` is not satisfied
-  --> $DIR/const-drop-fail.rs:27:23
+  --> $DIR/const-drop-fail.rs:32:5
    |
-LL |           const _: () = check($exp);
-   |                         ^^^^^^^^^^^
+LL |         const _: () = check($exp);
+   |                       ----- required by a bound introduced by this call
 ...
-LL | / check_all! {
-LL | |     NonTrivialDrop,
-LL | |     ConstImplWithDropGlue(NonTrivialDrop),
-LL | | }
-   | |_- in this macro invocation
+LL |     NonTrivialDrop,
+   |     ^^^^^^^^^^^^^^
    |
-   = note: this error originates in the macro `check_all` (in Nightly builds, run with -Z macro-backtrace for more info)
+note: required by a bound in `check`
+  --> $DIR/const-drop-fail.rs:23:19
+   |
+LL | const fn check<T: ~const Destruct>(_: T) {}
+   |                   ^^^^^^ required by this bound in `check`
 
 error[E0277]: the trait bound `NonTrivialDrop: const Destruct` is not satisfied
-  --> $DIR/const-drop-fail.rs:27:23
+  --> $DIR/const-drop-fail.rs:34:5
    |
-LL |           const _: () = check($exp);
-   |                         ^^^^^^^^^^^
+LL |         const _: () = check($exp);
+   |                       ----- required by a bound introduced by this call
 ...
-LL | / check_all! {
-LL | |     NonTrivialDrop,
-LL | |     ConstImplWithDropGlue(NonTrivialDrop),
-LL | | }
-   | |_- in this macro invocation
+LL |     ConstImplWithDropGlue(NonTrivialDrop),
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: required by a bound in `check`
+  --> $DIR/const-drop-fail.rs:23:19
    |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-   = note: this error originates in the macro `check_all` (in Nightly builds, run with -Z macro-backtrace for more info)
+LL | const fn check<T: ~const Destruct>(_: T) {}
+   |                   ^^^^^^ required by this bound in `check`
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/traits/const-traits/const-drop-fail.rs b/tests/ui/traits/const-traits/const-drop-fail.rs
index 08435266e1f..5e05b9db474 100644
--- a/tests/ui/traits/const-traits/const-drop-fail.rs
+++ b/tests/ui/traits/const-traits/const-drop-fail.rs
@@ -25,14 +25,14 @@ const fn check<T: ~const Destruct>(_: T) {}
 macro_rules! check_all {
     ($($exp:expr),*$(,)?) => {$(
         const _: () = check($exp);
-        //~^ ERROR the trait bound `NonTrivialDrop: const Destruct` is not satisfied
-        //~| ERROR the trait bound `NonTrivialDrop: const Destruct` is not satisfied
     )*};
 }
 
 check_all! {
     NonTrivialDrop,
+    //~^ ERROR the trait bound `NonTrivialDrop: const Destruct` is not satisfied
     ConstImplWithDropGlue(NonTrivialDrop),
+    //~^ ERROR the trait bound `NonTrivialDrop: const Destruct` is not satisfied
 }
 
 fn main() {}
diff --git a/tests/ui/traits/const-traits/const-drop-fail.stock.stderr b/tests/ui/traits/const-traits/const-drop-fail.stock.stderr
index 67e774fbd05..8b3e777a0b0 100644
--- a/tests/ui/traits/const-traits/const-drop-fail.stock.stderr
+++ b/tests/ui/traits/const-traits/const-drop-fail.stock.stderr
@@ -1,31 +1,32 @@
 error[E0277]: the trait bound `NonTrivialDrop: const Destruct` is not satisfied
-  --> $DIR/const-drop-fail.rs:27:23
+  --> $DIR/const-drop-fail.rs:32:5
    |
-LL |           const _: () = check($exp);
-   |                         ^^^^^^^^^^^
+LL |         const _: () = check($exp);
+   |                       ----- required by a bound introduced by this call
 ...
-LL | / check_all! {
-LL | |     NonTrivialDrop,
-LL | |     ConstImplWithDropGlue(NonTrivialDrop),
-LL | | }
-   | |_- in this macro invocation
+LL |     NonTrivialDrop,
+   |     ^^^^^^^^^^^^^^
    |
-   = note: this error originates in the macro `check_all` (in Nightly builds, run with -Z macro-backtrace for more info)
+note: required by a bound in `check`
+  --> $DIR/const-drop-fail.rs:23:19
+   |
+LL | const fn check<T: ~const Destruct>(_: T) {}
+   |                   ^^^^^^ required by this bound in `check`
 
 error[E0277]: the trait bound `NonTrivialDrop: const Destruct` is not satisfied
-  --> $DIR/const-drop-fail.rs:27:23
+  --> $DIR/const-drop-fail.rs:34:5
    |
-LL |           const _: () = check($exp);
-   |                         ^^^^^^^^^^^
+LL |         const _: () = check($exp);
+   |                       ----- required by a bound introduced by this call
 ...
-LL | / check_all! {
-LL | |     NonTrivialDrop,
-LL | |     ConstImplWithDropGlue(NonTrivialDrop),
-LL | | }
-   | |_- in this macro invocation
+LL |     ConstImplWithDropGlue(NonTrivialDrop),
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: required by a bound in `check`
+  --> $DIR/const-drop-fail.rs:23:19
    |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-   = note: this error originates in the macro `check_all` (in Nightly builds, run with -Z macro-backtrace for more info)
+LL | const fn check<T: ~const Destruct>(_: T) {}
+   |                   ^^^^^^ required by this bound in `check`
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/traits/const-traits/const-opaque.no.stderr b/tests/ui/traits/const-traits/const-opaque.no.stderr
index e43a6b603fd..1278e125746 100644
--- a/tests/ui/traits/const-traits/const-opaque.no.stderr
+++ b/tests/ui/traits/const-traits/const-opaque.no.stderr
@@ -1,14 +1,22 @@
 error[E0277]: the trait bound `(): const Foo` is not satisfied
-  --> $DIR/const-opaque.rs:31:18
+  --> $DIR/const-opaque.rs:31:22
    |
 LL |     let opaque = bar(());
-   |                  ^^^^^^^
+   |                  --- ^^
+   |                  |
+   |                  required by a bound introduced by this call
+   |
+note: required by a bound in `bar`
+  --> $DIR/const-opaque.rs:26:17
+   |
+LL | const fn bar<T: ~const Foo>(t: T) -> impl ~const Foo {
+   |                 ^^^^^^ required by this bound in `bar`
 
 error[E0277]: the trait bound `(): const Foo` is not satisfied
-  --> $DIR/const-opaque.rs:33:5
+  --> $DIR/const-opaque.rs:33:12
    |
 LL |     opaque.method();
-   |     ^^^^^^^^^^^^^^^
+   |            ^^^^^^
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/traits/const-traits/cross-crate.gatednc.stderr b/tests/ui/traits/const-traits/cross-crate.gatednc.stderr
index b6f2434140d..4d5abf643a8 100644
--- a/tests/ui/traits/const-traits/cross-crate.gatednc.stderr
+++ b/tests/ui/traits/const-traits/cross-crate.gatednc.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the trait bound `cross_crate::NonConst: ~const cross_crate::MyTrait` is not satisfied
-  --> $DIR/cross-crate.rs:19:5
+  --> $DIR/cross-crate.rs:19:14
    |
 LL |     NonConst.func();
-   |     ^^^^^^^^^^^^^^^
+   |              ^^^^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/traits/const-traits/default-method-body-is-const-body-checking.stderr b/tests/ui/traits/const-traits/default-method-body-is-const-body-checking.stderr
index 0534f3eb8d2..8c284bde67e 100644
--- a/tests/ui/traits/const-traits/default-method-body-is-const-body-checking.stderr
+++ b/tests/ui/traits/const-traits/default-method-body-is-const-body-checking.stderr
@@ -1,8 +1,14 @@
 error[E0277]: the trait bound `(): ~const Tr` is not satisfied
-  --> $DIR/default-method-body-is-const-body-checking.rs:12:9
+  --> $DIR/default-method-body-is-const-body-checking.rs:12:15
    |
 LL |         foo::<()>();
-   |         ^^^^^^^^^^^
+   |               ^^
+   |
+note: required by a bound in `foo`
+  --> $DIR/default-method-body-is-const-body-checking.rs:7:28
+   |
+LL | const fn foo<T>() where T: ~const Tr {}
+   |                            ^^^^^^ required by this bound in `foo`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/traits/const-traits/default-method-body-is-const-same-trait-ck.stderr b/tests/ui/traits/const-traits/default-method-body-is-const-same-trait-ck.stderr
index d987cad6f14..2bd71c940e7 100644
--- a/tests/ui/traits/const-traits/default-method-body-is-const-same-trait-ck.stderr
+++ b/tests/ui/traits/const-traits/default-method-body-is-const-same-trait-ck.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the trait bound `(): ~const Tr` is not satisfied
-  --> $DIR/default-method-body-is-const-same-trait-ck.rs:9:9
+  --> $DIR/default-method-body-is-const-same-trait-ck.rs:9:12
    |
 LL |         ().a()
-   |         ^^^^^^
+   |            ^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/traits/const-traits/effects/minicore-fn-fail.stderr b/tests/ui/traits/const-traits/effects/minicore-fn-fail.stderr
index cf158643b34..fa8be631a26 100644
--- a/tests/ui/traits/const-traits/effects/minicore-fn-fail.stderr
+++ b/tests/ui/traits/const-traits/effects/minicore-fn-fail.stderr
@@ -1,8 +1,16 @@
 error[E0277]: the trait bound `(): ~const Foo` is not satisfied
-  --> $DIR/minicore-fn-fail.rs:19:5
+  --> $DIR/minicore-fn-fail.rs:19:19
    |
 LL |     call_indirect(&foo::<()>);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     ------------- ^^^^^^^^^^
+   |     |
+   |     required by a bound introduced by this call
+   |
+note: required by a bound in `call_indirect`
+  --> $DIR/minicore-fn-fail.rs:11:27
+   |
+LL | const fn call_indirect<T: ~const Fn()>(t: &T) { t() }
+   |                           ^^^^^^ required by this bound in `call_indirect`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/traits/const-traits/effects/no-explicit-const-params.stderr b/tests/ui/traits/const-traits/effects/no-explicit-const-params.stderr
index 0b8e4696c46..9bd2c2cb8da 100644
--- a/tests/ui/traits/const-traits/effects/no-explicit-const-params.stderr
+++ b/tests/ui/traits/const-traits/effects/no-explicit-const-params.stderr
@@ -27,10 +27,10 @@ LL | trait Bar {
    |       ^^^
 
 error[E0277]: the trait bound `(): const Bar` is not satisfied
-  --> $DIR/no-explicit-const-params.rs:24:5
+  --> $DIR/no-explicit-const-params.rs:24:6
    |
 LL |     <() as Bar<false>>::bar();
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
+   |      ^^
 
 error[E0107]: function takes 0 generic arguments but 1 generic argument was supplied
   --> $DIR/no-explicit-const-params.rs:15:5
diff --git a/tests/ui/traits/const-traits/specializing-constness-2.stderr b/tests/ui/traits/const-traits/specializing-constness-2.stderr
index 4ad5e3157d4..edba836aac3 100644
--- a/tests/ui/traits/const-traits/specializing-constness-2.stderr
+++ b/tests/ui/traits/const-traits/specializing-constness-2.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the trait bound `T: ~const A` is not satisfied
-  --> $DIR/specializing-constness-2.rs:27:5
+  --> $DIR/specializing-constness-2.rs:27:6
    |
 LL |     <T as A>::a();
-   |     ^^^^^^^^^^^^^
+   |      ^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/traits/const-traits/super-traits-fail-2.yn.stderr b/tests/ui/traits/const-traits/super-traits-fail-2.yn.stderr
index 01ae209016a..ee49810bace 100644
--- a/tests/ui/traits/const-traits/super-traits-fail-2.yn.stderr
+++ b/tests/ui/traits/const-traits/super-traits-fail-2.yn.stderr
@@ -11,10 +11,10 @@ LL | trait Bar: ~const Foo {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0277]: the trait bound `T: ~const Foo` is not satisfied
-  --> $DIR/super-traits-fail-2.rs:20:5
+  --> $DIR/super-traits-fail-2.rs:20:7
    |
 LL |     x.a();
-   |     ^^^^^
+   |       ^
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/traits/const-traits/super-traits-fail-2.yy.stderr b/tests/ui/traits/const-traits/super-traits-fail-2.yy.stderr
index ae4c65e4aee..a213273c1c7 100644
--- a/tests/ui/traits/const-traits/super-traits-fail-2.yy.stderr
+++ b/tests/ui/traits/const-traits/super-traits-fail-2.yy.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the trait bound `T: ~const Foo` is not satisfied
-  --> $DIR/super-traits-fail-2.rs:20:5
+  --> $DIR/super-traits-fail-2.rs:20:7
    |
 LL |     x.a();
-   |     ^^^^^
+   |       ^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.yn.stderr b/tests/ui/traits/const-traits/super-traits-fail-3.yn.stderr
index 8fcada1bfd1..ecee348222d 100644
--- a/tests/ui/traits/const-traits/super-traits-fail-3.yn.stderr
+++ b/tests/ui/traits/const-traits/super-traits-fail-3.yn.stderr
@@ -25,10 +25,10 @@ LL | const fn foo<T: ~const Bar>(x: &T) {
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error[E0277]: the trait bound `T: ~const Foo` is not satisfied
-  --> $DIR/super-traits-fail-3.rs:24:5
+  --> $DIR/super-traits-fail-3.rs:24:7
    |
 LL |     x.a();
-   |     ^^^^^
+   |       ^
 
 error: aborting due to 4 previous errors
 
diff --git a/tests/ui/traits/const-traits/tilde-const-and-const-params.stderr b/tests/ui/traits/const-traits/tilde-const-and-const-params.stderr
index 78bf85e9c6d..f77d63db054 100644
--- a/tests/ui/traits/const-traits/tilde-const-and-const-params.stderr
+++ b/tests/ui/traits/const-traits/tilde-const-and-const-params.stderr
@@ -26,13 +26,13 @@ error[E0277]: the trait bound `A: const Add42` is not satisfied
   --> $DIR/tilde-const-and-const-params.rs:27:61
    |
 LL | fn bar<A: ~const Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> {
-   |                                                             ^^^^^^^^^
+   |                                                             ^
 
 error[E0277]: the trait bound `A: const Add42` is not satisfied
   --> $DIR/tilde-const-and-const-params.rs:9:44
    |
 LL |     fn add<A: ~const Add42>(self) -> Foo<{ A::add(N) }> {
-   |                                            ^^^^^^^^^
+   |                                            ^
 
 error: aborting due to 4 previous errors
 
diff --git a/tests/ui/traits/const-traits/trait-where-clause-const.stderr b/tests/ui/traits/const-traits/trait-where-clause-const.stderr
index d7735ef282f..4100ae1c6bf 100644
--- a/tests/ui/traits/const-traits/trait-where-clause-const.stderr
+++ b/tests/ui/traits/const-traits/trait-where-clause-const.stderr
@@ -2,13 +2,25 @@ error[E0277]: the trait bound `T: ~const Bar` is not satisfied
   --> $DIR/trait-where-clause-const.rs:21:5
    |
 LL |     T::b();
-   |     ^^^^^^
+   |     ^
+   |
+note: required by a bound in `Foo::b`
+  --> $DIR/trait-where-clause-const.rs:15:24
+   |
+LL |     fn b() where Self: ~const Bar;
+   |                        ^^^^^^ required by this bound in `Foo::b`
 
 error[E0277]: the trait bound `T: ~const Bar` is not satisfied
-  --> $DIR/trait-where-clause-const.rs:23:5
+  --> $DIR/trait-where-clause-const.rs:23:12
    |
 LL |     T::c::<T>();
-   |     ^^^^^^^^^^^
+   |            ^
+   |
+note: required by a bound in `Foo::c`
+  --> $DIR/trait-where-clause-const.rs:16:13
+   |
+LL |     fn c<T: ~const Bar>();
+   |             ^^^^^^ required by this bound in `Foo::c`
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/traits/const-traits/unsatisfied-const-trait-bound.stderr b/tests/ui/traits/const-traits/unsatisfied-const-trait-bound.stderr
index d04143fc464..bda6a029cc2 100644
--- a/tests/ui/traits/const-traits/unsatisfied-const-trait-bound.stderr
+++ b/tests/ui/traits/const-traits/unsatisfied-const-trait-bound.stderr
@@ -10,19 +10,19 @@ error[E0277]: the trait bound `T: const Trait` is not satisfied
   --> $DIR/unsatisfied-const-trait-bound.rs:29:37
    |
 LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {}
-   |                                     ^^^^^^^^^
+   |                                     ^
 
 error[E0277]: the trait bound `T: const Trait` is not satisfied
   --> $DIR/unsatisfied-const-trait-bound.rs:33:50
    |
 LL | const fn accept1<T: ~const Trait>(_: Container<{ T::make() }>) {}
-   |                                                  ^^^^^^^^^
+   |                                                  ^
 
 error[E0277]: the trait bound `Ty: const Trait` is not satisfied
-  --> $DIR/unsatisfied-const-trait-bound.rs:22:5
+  --> $DIR/unsatisfied-const-trait-bound.rs:22:15
    |
 LL |     require::<Ty>();
-   |     ^^^^^^^^^^^^^^^
+   |               ^^
    |
 note: required by a bound in `require`
   --> $DIR/unsatisfied-const-trait-bound.rs:8:15