about summary refs log tree commit diff
path: root/src/librustc_parse/parser
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2020-06-14 21:36:25 -0700
committerEsteban Küber <esteban@kuber.com.ar>2020-06-15 08:57:20 -0700
commite857696cf8c3b4a4381d00424f165c10f93a9ebd (patch)
tree0da7c7f3617583ad133b881c0fffab9df5c94ab9 /src/librustc_parse/parser
parentbb8674837a9cc5225020e07fc3f164762bb4c11c (diff)
Tweak "non-primitive cast" error
- Suggest borrowing expression if it would allow cast to work.
- Suggest using `<Type>::from(<expr>)` when appropriate.
- Minor tweak to `;` typo suggestion.

Partily address #47136.
Diffstat (limited to 'src/librustc_parse/parser')
-rw-r--r--src/librustc_parse/parser/diagnostics.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_parse/parser/diagnostics.rs b/src/librustc_parse/parser/diagnostics.rs
index 660a63841bc..dafc0a9e048 100644
--- a/src/librustc_parse/parser/diagnostics.rs
+++ b/src/librustc_parse/parser/diagnostics.rs
@@ -961,7 +961,7 @@ impl<'a> Parser<'a> {
             self.bump();
             let sp = self.prev_token.span;
             self.struct_span_err(sp, &msg)
-                .span_suggestion(sp, "change this to `;`", ";".to_string(), appl)
+                .span_suggestion_short(sp, "change this to `;`", ";".to_string(), appl)
                 .emit();
             return Ok(());
         } else if self.look_ahead(0, |t| {