about summary refs log tree commit diff
path: root/src/test/ui/parser
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2020-07-09 11:50:50 -0700
committerGitHub <noreply@github.com>2020-07-09 11:50:50 -0700
commit9353e21bfdea148e910b2530270a3418db836bf3 (patch)
tree7bafe998869c457ebaa9f82179f49c37baf7a551 /src/test/ui/parser
parent31d53decd06f9cd854bbfe11f03abcd398e396b6 (diff)
parente771a4f989644fd6397c391af1db94d459980b2e (diff)
downloadrust-9353e21bfdea148e910b2530270a3418db836bf3.tar.gz
rust-9353e21bfdea148e910b2530270a3418db836bf3.zip
Rollup merge of #74188 - estebank:tweak-ascription-typo-heuristic, r=petrochenkov
Tweak `::` -> `:` typo heuristic and reduce verbosity

Do not trigger on correct type ascription expressions with trailing
operators and _do_ trigger on likely path typos where a turbofish is
used.

On likely path typos, remove note explaining type ascription.

Clean up indentation.

r? @petrochenkov
Diffstat (limited to 'src/test/ui/parser')
-rw-r--r--src/test/ui/parser/issue-35813-postfix-after-cast.stderr20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/test/ui/parser/issue-35813-postfix-after-cast.stderr b/src/test/ui/parser/issue-35813-postfix-after-cast.stderr
index 255e9f40921..9ccf17a6cb1 100644
--- a/src/test/ui/parser/issue-35813-postfix-after-cast.stderr
+++ b/src/test/ui/parser/issue-35813-postfix-after-cast.stderr
@@ -280,12 +280,12 @@ error: casts cannot be followed by ?
   --> $DIR/issue-35813-postfix-after-cast.rs:121:5
    |
 LL |     Err(0u64): Result<u64,u64>?;
-   |     ^^^^^^^^^-^^^^^^^^^^^^^^^^
-   |              |
-   |              help: maybe write a path separator here: `::`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>`
-   = note: see issue #23416 <https://github.com/rust-lang/rust/issues/23416> for more information
+help: try surrounding the expression in parentheses
+   |
+LL |     (Err(0u64): Result<u64,u64>)?;
+   |     ^                          ^
 
 error: casts cannot be followed by a function call
   --> $DIR/issue-35813-postfix-after-cast.rs:145:5
@@ -324,12 +324,12 @@ error: casts cannot be followed by `.await`
   --> $DIR/issue-35813-postfix-after-cast.rs:155:5
    |
 LL |     Box::pin(noop()): Pin<Box<_>>.await;
-   |     ^^^^^^^^^^^^^^^^-^^^^^^^^^^^^
-   |                     |
-   |                     help: maybe write a path separator here: `::`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: try surrounding the expression in parentheses
    |
-   = note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>`
-   = note: see issue #23416 <https://github.com/rust-lang/rust/issues/23416> for more information
+LL |     (Box::pin(noop()): Pin<Box<_>>).await;
+   |     ^                             ^
 
 error: casts cannot be followed by a field access
   --> $DIR/issue-35813-postfix-after-cast.rs:167:5