about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2023-09-28 00:37:20 +0000
committerEsteban Küber <esteban@kuber.com.ar>2023-09-28 00:37:20 +0000
commit3848ffcee7ae74e15e4b68ad0f45a29f1fc170c7 (patch)
tree49e4bf0b4bd37b1503dd77754a6f3613a73e7add /tests
parent5899a80ae60ec0959dcd4a7eca6eb02ce2866632 (diff)
downloadrust-3848ffcee7ae74e15e4b68ad0f45a29f1fc170c7.tar.gz
rust-3848ffcee7ae74e15e4b68ad0f45a29f1fc170c7.zip
Tweak wording of missing angle backets in qualified path
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/did_you_mean/bad-assoc-expr.stderr62
-rw-r--r--tests/ui/did_you_mean/bad-assoc-pat.stderr41
-rw-r--r--tests/ui/did_you_mean/bad-assoc-ty.stderr62
-rw-r--r--tests/ui/parser/issues/issue-89388.stderr7
4 files changed, 147 insertions, 25 deletions
diff --git a/tests/ui/did_you_mean/bad-assoc-expr.stderr b/tests/ui/did_you_mean/bad-assoc-expr.stderr
index c295cac9aa4..b83078e21b6 100644
--- a/tests/ui/did_you_mean/bad-assoc-expr.stderr
+++ b/tests/ui/did_you_mean/bad-assoc-expr.stderr
@@ -2,60 +2,104 @@ error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-expr.rs:3:5
    |
 LL |     [i32; 4]::clone(&a);
-   |     ^^^^^^^^^^^^^^^ help: try: `<[i32; 4]>::clone`
+   |     ^^^^^^^^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL |     <[i32; 4]>::clone(&a);
+   |     +        +
 
 error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-expr.rs:6:5
    |
 LL |     [i32]::as_ref(&a);
-   |     ^^^^^^^^^^^^^ help: try: `<[i32]>::as_ref`
+   |     ^^^^^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL |     <[i32]>::as_ref(&a);
+   |     +     +
 
 error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-expr.rs:9:5
    |
 LL |     (u8)::clone(&0);
-   |     ^^^^^^^^^^^ help: try: `<(u8)>::clone`
+   |     ^^^^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL |     <(u8)>::clone(&0);
+   |     +    +
 
 error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-expr.rs:12:5
    |
 LL |     (u8, u8)::clone(&(0, 0));
-   |     ^^^^^^^^^^^^^^^ help: try: `<(u8, u8)>::clone`
+   |     ^^^^^^^^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL |     <(u8, u8)>::clone(&(0, 0));
+   |     +        +
 
 error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-expr.rs:15:6
    |
 LL |     &(u8)::clone(&0);
-   |      ^^^^^^^^^^^ help: try: `<(u8)>::clone`
+   |      ^^^^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL |     &<(u8)>::clone(&0);
+   |      +    +
 
 error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-expr.rs:18:10
    |
 LL |     10 + (u8)::clone(&0);
-   |          ^^^^^^^^^^^ help: try: `<(u8)>::clone`
+   |          ^^^^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL |     10 + <(u8)>::clone(&0);
+   |          +    +
 
 error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-expr.rs:32:13
    |
 LL |     let _ = ty!()::clone(&0);
-   |             ^^^^^^^^^^^^ help: try: `<ty!()>::clone`
+   |             ^^^^^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL |     let _ = <ty!()>::clone(&0);
+   |             +     +
 
 error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-expr.rs:34:5
    |
 LL |     ty!()::clone(&0);
-   |     ^^^^^^^^^^^^ help: try: `<ty!()>::clone`
+   |     ^^^^^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL |     <ty!()>::clone(&0);
+   |     +     +
 
 error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-expr.rs:23:19
    |
 LL |     ($ty: ty) => ($ty::clone(&0))
-   |                   ^^^^^^^^^^ help: try: `<$ty>::clone`
+   |                   ^^^
 ...
 LL |     expr!(u8);
    |     --------- in this macro invocation
    |
    = note: this error originates in the macro `expr` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL |     ($ty: ty) => (<$ty>::clone(&0))
+   |                   +   +
 
 error: aborting due to 9 previous errors
 
diff --git a/tests/ui/did_you_mean/bad-assoc-pat.stderr b/tests/ui/did_you_mean/bad-assoc-pat.stderr
index 19d173f1b42..8bdeb8ffdd0 100644
--- a/tests/ui/did_you_mean/bad-assoc-pat.stderr
+++ b/tests/ui/did_you_mean/bad-assoc-pat.stderr
@@ -2,42 +2,71 @@ error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-pat.rs:3:9
    |
 LL |         [u8]::AssocItem => {}
-   |         ^^^^^^^^^^^^^^^ help: try: `<[u8]>::AssocItem`
+   |         ^^^^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL |         <[u8]>::AssocItem => {}
+   |         +    +
 
 error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-pat.rs:6:9
    |
 LL |         (u8, u8)::AssocItem => {}
-   |         ^^^^^^^^^^^^^^^^^^^ help: try: `<(u8, u8)>::AssocItem`
+   |         ^^^^^^^^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL |         <(u8, u8)>::AssocItem => {}
+   |         +        +
 
 error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-pat.rs:9:9
    |
 LL |         _::AssocItem => {}
-   |         ^^^^^^^^^^^^ help: try: `<_>::AssocItem`
+   |         ^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL |         <_>::AssocItem => {}
+   |         + +
 
 error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-pat.rs:14:10
    |
 LL |         &(u8,)::AssocItem => {}
-   |          ^^^^^^^^^^^^^^^^ help: try: `<(u8,)>::AssocItem`
+   |          ^^^^^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL |         &<(u8,)>::AssocItem => {}
+   |          +     +
 
 error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-pat.rs:32:9
    |
 LL |         ty!()::AssocItem => {}
-   |         ^^^^^^^^^^^^^^^^ help: try: `<ty!()>::AssocItem`
+   |         ^^^^^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL |         <ty!()>::AssocItem => {}
+   |         +     +
 
 error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-pat.rs:21:19
    |
 LL |     ($ty: ty) => ($ty::AssocItem)
-   |                   ^^^^^^^^^^^^^^ help: try: `<$ty>::AssocItem`
+   |                   ^^^
 ...
 LL |         pat!(u8) => {}
    |         -------- in this macro invocation
    |
    = note: this error originates in the macro `pat` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL |     ($ty: ty) => (<$ty>::AssocItem)
+   |                   +   +
 
 error[E0599]: no associated item named `AssocItem` found for slice `[u8]` in the current scope
   --> $DIR/bad-assoc-pat.rs:3:15
diff --git a/tests/ui/did_you_mean/bad-assoc-ty.stderr b/tests/ui/did_you_mean/bad-assoc-ty.stderr
index 55096e95df7..efa6bb66824 100644
--- a/tests/ui/did_you_mean/bad-assoc-ty.stderr
+++ b/tests/ui/did_you_mean/bad-assoc-ty.stderr
@@ -2,60 +2,104 @@ error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-ty.rs:1:10
    |
 LL | type A = [u8; 4]::AssocTy;
-   |          ^^^^^^^^^^^^^^^^ help: try: `<[u8; 4]>::AssocTy`
+   |          ^^^^^^^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL | type A = <[u8; 4]>::AssocTy;
+   |          +       +
 
 error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-ty.rs:5:10
    |
 LL | type B = [u8]::AssocTy;
-   |          ^^^^^^^^^^^^^ help: try: `<[u8]>::AssocTy`
+   |          ^^^^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL | type B = <[u8]>::AssocTy;
+   |          +    +
 
 error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-ty.rs:9:10
    |
 LL | type C = (u8)::AssocTy;
-   |          ^^^^^^^^^^^^^ help: try: `<(u8)>::AssocTy`
+   |          ^^^^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL | type C = <(u8)>::AssocTy;
+   |          +    +
 
 error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-ty.rs:13:10
    |
 LL | type D = (u8, u8)::AssocTy;
-   |          ^^^^^^^^^^^^^^^^^ help: try: `<(u8, u8)>::AssocTy`
+   |          ^^^^^^^^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL | type D = <(u8, u8)>::AssocTy;
+   |          +        +
 
 error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-ty.rs:17:10
    |
 LL | type E = _::AssocTy;
-   |          ^^^^^^^^^^ help: try: `<_>::AssocTy`
+   |          ^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL | type E = <_>::AssocTy;
+   |          + +
 
 error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-ty.rs:21:19
    |
 LL | type F = &'static (u8)::AssocTy;
-   |                   ^^^^^^^^^^^^^ help: try: `<(u8)>::AssocTy`
+   |                   ^^^^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL | type F = &'static <(u8)>::AssocTy;
+   |                   +    +
 
 error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-ty.rs:27:10
    |
 LL | type G = dyn 'static + (Send)::AssocTy;
-   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `<dyn 'static + (Send)>::AssocTy`
+   |          ^^^^^^^^^^^^^^^^^^^^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL | type G = <dyn 'static + (Send)>::AssocTy;
+   |          +                    +
 
 error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-ty.rs:46:10
    |
 LL | type I = ty!()::AssocTy;
-   |          ^^^^^^^^^^^^^^ help: try: `<ty!()>::AssocTy`
+   |          ^^^^^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL | type I = <ty!()>::AssocTy;
+   |          +     +
 
 error: missing angle brackets in associated item path
   --> $DIR/bad-assoc-ty.rs:39:19
    |
 LL |     ($ty: ty) => ($ty::AssocTy);
-   |                   ^^^^^^^^^^^^ help: try: `<$ty>::AssocTy`
+   |                   ^^^
 ...
 LL | type J = ty!(u8);
    |          ------- in this macro invocation
    |
    = note: this error originates in the macro `ty` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL |     ($ty: ty) => (<$ty>::AssocTy);
+   |                   +   +
 
 error[E0223]: ambiguous associated type
   --> $DIR/bad-assoc-ty.rs:1:10
diff --git a/tests/ui/parser/issues/issue-89388.stderr b/tests/ui/parser/issues/issue-89388.stderr
index cf28bef0f4a..366d05c2d94 100644
--- a/tests/ui/parser/issues/issue-89388.stderr
+++ b/tests/ui/parser/issues/issue-89388.stderr
@@ -2,7 +2,12 @@ error: missing angle brackets in associated item path
   --> $DIR/issue-89388.rs:5:24
    |
 LL |     let _ = option.map([_]::to_vec);
-   |                        ^^^^^^^^^^^ help: try: `<[_]>::to_vec`
+   |                        ^^^
+   |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+   |
+LL |     let _ = option.map(<[_]>::to_vec);
+   |                        +   +
 
 error: aborting due to previous error