about summary refs log tree commit diff
path: root/tests/ui/parser
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-02-14 19:18:28 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-02-14 20:15:13 +0000
commit8d4d572e4d8e41f9963dad997214a54df05baabf (patch)
tree9b70d6558b9c36a935608c9b71ea64ec8354bb91 /tests/ui/parser
parenteaff1af8fdd18ee3eb05167b2836042b7d4315f6 (diff)
downloadrust-8d4d572e4d8e41f9963dad997214a54df05baabf.tar.gz
rust-8d4d572e4d8e41f9963dad997214a54df05baabf.zip
Fix msg for verbose suggestions with confusable capitalization
When encountering a verbose/multipart suggestion that has changes
that are only caused by different capitalization of ASCII letters that have
little differenciation, expand the message to highlight that fact (like we
already do for inline suggestions).

The logic to do this was already present, but implemented incorrectly.
Diffstat (limited to 'tests/ui/parser')
-rw-r--r--tests/ui/parser/kw-in-trait-bounds.stderr8
-rw-r--r--tests/ui/parser/recover/recover-fn-trait-from-fn-kw.stderr4
-rw-r--r--tests/ui/parser/typod-const-in-const-param-def.stderr8
3 files changed, 10 insertions, 10 deletions
diff --git a/tests/ui/parser/kw-in-trait-bounds.stderr b/tests/ui/parser/kw-in-trait-bounds.stderr
index 2d3aad4d6ba..3c54e031950 100644
--- a/tests/ui/parser/kw-in-trait-bounds.stderr
+++ b/tests/ui/parser/kw-in-trait-bounds.stderr
@@ -4,7 +4,7 @@ error: expected identifier, found keyword `fn`
 LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
    |          ^^
    |
-help: use `Fn` to refer to the trait
+help: use `Fn` to refer to the trait (notice the capitalization difference)
    |
 LL | fn _f<F: Fn(), G>(_: impl fn(), _: &dyn fn())
    |          ~~
@@ -15,7 +15,7 @@ error: expected identifier, found keyword `fn`
 LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
    |                           ^^
    |
-help: use `Fn` to refer to the trait
+help: use `Fn` to refer to the trait (notice the capitalization difference)
    |
 LL | fn _f<F: fn(), G>(_: impl Fn(), _: &dyn fn())
    |                           ~~
@@ -26,7 +26,7 @@ error: expected identifier, found keyword `fn`
 LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
    |                                         ^^
    |
-help: use `Fn` to refer to the trait
+help: use `Fn` to refer to the trait (notice the capitalization difference)
    |
 LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn Fn())
    |                                         ~~
@@ -37,7 +37,7 @@ error: expected identifier, found keyword `fn`
 LL | G: fn(),
    |    ^^
    |
-help: use `Fn` to refer to the trait
+help: use `Fn` to refer to the trait (notice the capitalization difference)
    |
 LL | G: Fn(),
    |    ~~
diff --git a/tests/ui/parser/recover/recover-fn-trait-from-fn-kw.stderr b/tests/ui/parser/recover/recover-fn-trait-from-fn-kw.stderr
index 17138a6f079..aee31d08fe0 100644
--- a/tests/ui/parser/recover/recover-fn-trait-from-fn-kw.stderr
+++ b/tests/ui/parser/recover/recover-fn-trait-from-fn-kw.stderr
@@ -4,7 +4,7 @@ error: expected identifier, found keyword `fn`
 LL | fn foo(_: impl fn() -> i32) {}
    |                ^^
    |
-help: use `Fn` to refer to the trait
+help: use `Fn` to refer to the trait (notice the capitalization difference)
    |
 LL | fn foo(_: impl Fn() -> i32) {}
    |                ~~
@@ -15,7 +15,7 @@ error: expected identifier, found keyword `fn`
 LL | fn foo2<T: fn(i32)>(_: T) {}
    |            ^^
    |
-help: use `Fn` to refer to the trait
+help: use `Fn` to refer to the trait (notice the capitalization difference)
    |
 LL | fn foo2<T: Fn(i32)>(_: T) {}
    |            ~~
diff --git a/tests/ui/parser/typod-const-in-const-param-def.stderr b/tests/ui/parser/typod-const-in-const-param-def.stderr
index 75d73c6ea87..80c0f1deae6 100644
--- a/tests/ui/parser/typod-const-in-const-param-def.stderr
+++ b/tests/ui/parser/typod-const-in-const-param-def.stderr
@@ -4,7 +4,7 @@ error: `const` keyword was mistyped as `Const`
 LL | pub fn foo<Const N: u8>() {}
    |            ^^^^^
    |
-help: use the `const` keyword
+help: use the `const` keyword (notice the capitalization difference)
    |
 LL | pub fn foo<const N: u8>() {}
    |            ~~~~~
@@ -15,7 +15,7 @@ error: `const` keyword was mistyped as `Const`
 LL | pub fn baz<Const N: u8, T>() {}
    |            ^^^^^
    |
-help: use the `const` keyword
+help: use the `const` keyword (notice the capitalization difference)
    |
 LL | pub fn baz<const N: u8, T>() {}
    |            ~~~~~
@@ -26,7 +26,7 @@ error: `const` keyword was mistyped as `Const`
 LL | pub fn qux<T, Const N: u8>() {}
    |               ^^^^^
    |
-help: use the `const` keyword
+help: use the `const` keyword (notice the capitalization difference)
    |
 LL | pub fn qux<T, const N: u8>() {}
    |               ~~~~~
@@ -37,7 +37,7 @@ error: `const` keyword was mistyped as `Const`
 LL | pub fn quux<T, Const N: u8, U>() {}
    |                ^^^^^
    |
-help: use the `const` keyword
+help: use the `const` keyword (notice the capitalization difference)
    |
 LL | pub fn quux<T, const N: u8, U>() {}
    |                ~~~~~