about summary refs log tree commit diff
path: root/tests/ui/const-generics/generic_const_exprs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-07-09 22:30:26 +0000
committerEsteban Küber <esteban@kuber.com.ar>2025-02-10 20:21:39 +0000
commitf0845adb0c1b7a7fa1bef73e749b2d7e1d7f374d (patch)
treee97d87013709bda13934fdc452a2a459a069876a /tests/ui/const-generics/generic_const_exprs
parent8c04e395952022a451138dc4dbead6dd6ae65203 (diff)
downloadrust-f0845adb0c1b7a7fa1bef73e749b2d7e1d7f374d.tar.gz
rust-f0845adb0c1b7a7fa1bef73e749b2d7e1d7f374d.zip
Show diff suggestion format on verbose replacement
```
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
  --> $DIR/attempted-access-non-fatal.rs:7:15
   |
LL |     let _ = 2.l;
   |               ^
   |
help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix
   |
LL -     let _ = 2.l;
LL +     let _ = 2.0f64;
   |
```
Diffstat (limited to 'tests/ui/const-generics/generic_const_exprs')
-rw-r--r--tests/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr20
-rw-r--r--tests/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.stderr5
-rw-r--r--tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.stderr5
-rw-r--r--tests/ui/const-generics/generic_const_exprs/const_kind_expr/wf_obligation.stderr5
-rw-r--r--tests/ui/const-generics/generic_const_exprs/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.stderr15
5 files changed, 30 insertions, 20 deletions
diff --git a/tests/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr b/tests/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr
index 3622ef16a96..9cb71ad8a09 100644
--- a/tests/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr
@@ -16,8 +16,9 @@ LL |     fn assert_impl<T: Trait>() {}
    |                       ^^^^^ required by this bound in `assert_impl`
 help: try adding a `where` bound
    |
-LL |     EvaluatableU128<{N as u128}>:, [(); { O as u128 } as usize]: {
-   |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     EvaluatableU128<{N as u128}>:, {
+LL +     EvaluatableU128<{N as u128}>:, [(); { O as u128 } as usize]: {
+   |
 
 error[E0308]: mismatched types
   --> $DIR/abstract-const-as-cast-3.rs:17:5
@@ -51,8 +52,9 @@ LL |     fn assert_impl<T: Trait>() {}
    |                       ^^^^^ required by this bound in `assert_impl`
 help: try adding a `where` bound
    |
-LL |     EvaluatableU128<{N as u128}>:, [(); { O as u128 } as usize]: {
-   |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     EvaluatableU128<{N as u128}>:, {
+LL +     EvaluatableU128<{N as u128}>:, [(); { O as u128 } as usize]: {
+   |
 
 error[E0308]: mismatched types
   --> $DIR/abstract-const-as-cast-3.rs:20:5
@@ -114,8 +116,9 @@ LL |     fn assert_impl<T: Trait>() {}
    |                       ^^^^^ required by this bound in `assert_impl`
 help: try adding a `where` bound
    |
-LL |     EvaluatableU128<{N as _}>:, [(); { O as u128 } as usize]: {
-   |                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     EvaluatableU128<{N as _}>:, {
+LL +     EvaluatableU128<{N as _}>:, [(); { O as u128 } as usize]: {
+   |
 
 error[E0308]: mismatched types
   --> $DIR/abstract-const-as-cast-3.rs:35:5
@@ -149,8 +152,9 @@ LL |     fn assert_impl<T: Trait>() {}
    |                       ^^^^^ required by this bound in `assert_impl`
 help: try adding a `where` bound
    |
-LL |     EvaluatableU128<{N as _}>:, [(); { O as u128 } as usize]: {
-   |                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     EvaluatableU128<{N as _}>:, {
+LL +     EvaluatableU128<{N as _}>:, [(); { O as u128 } as usize]: {
+   |
 
 error[E0308]: mismatched types
   --> $DIR/abstract-const-as-cast-3.rs:38:5
diff --git a/tests/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.stderr b/tests/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.stderr
index f3a38fcc005..b43ce5eca43 100644
--- a/tests/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.stderr
@@ -6,8 +6,9 @@ LL |     bar::<{ T::ASSOC }>();
    |
 help: try adding a `where` bound
    |
-LL | fn foo<T: Trait, U: Trait>() where [(); U::ASSOC]:, [(); { T::ASSOC }]: {
-   |                                                   ~~~~~~~~~~~~~~~~~~~~~
+LL - fn foo<T: Trait, U: Trait>() where [(); U::ASSOC]:, {
+LL + fn foo<T: Trait, U: Trait>() where [(); U::ASSOC]:, [(); { T::ASSOC }]: {
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.stderr b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.stderr
index 4d1fb02b59e..86e35e17a07 100644
--- a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.stderr
@@ -26,8 +26,9 @@ LL |     foo::<_, L>([(); L + 1 + L]);
    |
 help: try adding a `where` bound
    |
-LL |     [(); (L - 1) + 1 + L]:, [(); L + 1 + L]:
-   |                           ~~~~~~~~~~~~~~~~~~
+LL -     [(); (L - 1) + 1 + L]:,
+LL +     [(); (L - 1) + 1 + L]:, [(); L + 1 + L]:
+   |
 
 error: unconstrained generic constant
   --> $DIR/issue_114151.rs:17:17
diff --git a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/wf_obligation.stderr b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/wf_obligation.stderr
index 99eab935a09..c63a79e64ed 100644
--- a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/wf_obligation.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/wf_obligation.stderr
@@ -15,8 +15,9 @@ LL |     foo::<_, L>([(); L + 1 + L]);
    |
 help: try adding a `where` bound
    |
-LL |     [(); (L - 1) + 1 + L]:, [(); L + 1 + L]:
-   |                           ~~~~~~~~~~~~~~~~~~
+LL -     [(); (L - 1) + 1 + L]:,
+LL +     [(); (L - 1) + 1 + L]:, [(); L + 1 + L]:
+   |
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/const-generics/generic_const_exprs/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.stderr b/tests/ui/const-generics/generic_const_exprs/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.stderr
index 80d711ca844..c63beeac367 100644
--- a/tests/ui/const-generics/generic_const_exprs/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.stderr
@@ -9,8 +9,9 @@ LL |          let f: F = async { 1 };
    |
 help: a trait with a similar name exists
    |
-LL |          let f: Fn = async { 1 };
-   |                 ~~
+LL -          let f: F = async { 1 };
+LL +          let f: Fn = async { 1 };
+   |
 help: you might be missing a type parameter
    |
 LL | fn f<T, F>(
@@ -28,8 +29,9 @@ LL | ) -> impl Iterator<Item = dyn SubAssign> {
    |                           +++
 help: you might have meant to write a bound here
    |
-LL | ) -> impl Iterator<Item: SubAssign> {
-   |                        ~
+LL - ) -> impl Iterator<Item = SubAssign> {
+LL + ) -> impl Iterator<Item: SubAssign> {
+   |
 
 error[E0782]: expected a type, found a trait
   --> $DIR/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.rs:16:27
@@ -44,8 +46,9 @@ LL | ) -> impl Iterator<Item = dyn SubAssign> {
    |                           +++
 help: you might have meant to write a bound here
    |
-LL | ) -> impl Iterator<Item: SubAssign> {
-   |                        ~
+LL - ) -> impl Iterator<Item = SubAssign> {
+LL + ) -> impl Iterator<Item: SubAssign> {
+   |
 
 error[E0277]: `()` is not an iterator
   --> $DIR/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.rs:16:6