about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2018-01-09 18:41:24 -0800
committerEsteban Küber <esteban@kuber.com.ar>2018-01-14 22:46:24 -0800
commit09efaaf0764ddfd366bf6627533ecd1ea6ffb234 (patch)
tree4090b3600132cd94b26b60a56a7b8562df1281af /src/test
parent509ea8efc630d4e329dc2a440a2c0fc2a3fea236 (diff)
downloadrust-09efaaf0764ddfd366bf6627533ecd1ea6ffb234.tar.gz
rust-09efaaf0764ddfd366bf6627533ecd1ea6ffb234.zip
Use `s::u::p::expr_precedence` and fix message
 - Use `syntax::util::parser::expr_precedence` to determine wether
   parenthesis are needed around the casting target.
 - Update message to not incorrectly mention rounding on `.into()`
   suggestions, as those types that do have that implemented will never
   round.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/suggestions/numeric-cast.stderr20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/test/ui/suggestions/numeric-cast.stderr b/src/test/ui/suggestions/numeric-cast.stderr
index 9c05dacf4ec..0ce3d087f35 100644
--- a/src/test/ui/suggestions/numeric-cast.stderr
+++ b/src/test/ui/suggestions/numeric-cast.stderr
@@ -723,7 +723,7 @@ error[E0308]: mismatched types
     |
 272 |     foo::<f64>(x_u32);
     |                ^^^^^ expected f64, found u32
-help: you can cast an `u32` to `f64`, producing the floating point representation of the integer, rounded if necessary
+help: you can cast an `u32` to `f64`, producing the floating point representation of the integer
     |
 272 |     foo::<f64>(x_u32.into());
     |                ^^^^^^^^^^^^
@@ -733,7 +733,7 @@ error[E0308]: mismatched types
     |
 274 |     foo::<f64>(x_u16);
     |                ^^^^^ expected f64, found u16
-help: you can cast an `u16` to `f64`, producing the floating point representation of the integer, rounded if necessary
+help: you can cast an `u16` to `f64`, producing the floating point representation of the integer
     |
 274 |     foo::<f64>(x_u16.into());
     |                ^^^^^^^^^^^^
@@ -743,7 +743,7 @@ error[E0308]: mismatched types
     |
 276 |     foo::<f64>(x_u8);
     |                ^^^^ expected f64, found u8
-help: you can cast an `u8` to `f64`, producing the floating point representation of the integer, rounded if necessary
+help: you can cast an `u8` to `f64`, producing the floating point representation of the integer
     |
 276 |     foo::<f64>(x_u8.into());
     |                ^^^^^^^^^^^
@@ -765,7 +765,7 @@ error[E0308]: mismatched types
     |
 282 |     foo::<f64>(x_i32);
     |                ^^^^^ expected f64, found i32
-help: you can cast an `i32` to `f64`, producing the floating point representation of the integer, rounded if necessary
+help: you can cast an `i32` to `f64`, producing the floating point representation of the integer
     |
 282 |     foo::<f64>(x_i32.into());
     |                ^^^^^^^^^^^^
@@ -775,7 +775,7 @@ error[E0308]: mismatched types
     |
 284 |     foo::<f64>(x_i16);
     |                ^^^^^ expected f64, found i16
-help: you can cast an `i16` to `f64`, producing the floating point representation of the integer, rounded if necessary
+help: you can cast an `i16` to `f64`, producing the floating point representation of the integer
     |
 284 |     foo::<f64>(x_i16.into());
     |                ^^^^^^^^^^^^
@@ -785,7 +785,7 @@ error[E0308]: mismatched types
     |
 286 |     foo::<f64>(x_i8);
     |                ^^^^ expected f64, found i8
-help: you can cast an `i8` to `f64`, producing the floating point representation of the integer, rounded if necessary
+help: you can cast an `i8` to `f64`, producing the floating point representation of the integer
     |
 286 |     foo::<f64>(x_i8.into());
     |                ^^^^^^^^^^^
@@ -823,7 +823,7 @@ error[E0308]: mismatched types
     |
 298 |     foo::<f32>(x_u16);
     |                ^^^^^ expected f32, found u16
-help: you can cast an `u16` to `f32`, producing the floating point representation of the integer, rounded if necessary
+help: you can cast an `u16` to `f32`, producing the floating point representation of the integer
     |
 298 |     foo::<f32>(x_u16.into());
     |                ^^^^^^^^^^^^
@@ -833,7 +833,7 @@ error[E0308]: mismatched types
     |
 300 |     foo::<f32>(x_u8);
     |                ^^^^ expected f32, found u8
-help: you can cast an `u8` to `f32`, producing the floating point representation of the integer, rounded if necessary
+help: you can cast an `u8` to `f32`, producing the floating point representation of the integer
     |
 300 |     foo::<f32>(x_u8.into());
     |                ^^^^^^^^^^^
@@ -861,7 +861,7 @@ error[E0308]: mismatched types
     |
 308 |     foo::<f32>(x_i16);
     |                ^^^^^ expected f32, found i16
-help: you can cast an `i16` to `f32`, producing the floating point representation of the integer, rounded if necessary
+help: you can cast an `i16` to `f32`, producing the floating point representation of the integer
     |
 308 |     foo::<f32>(x_i16.into());
     |                ^^^^^^^^^^^^
@@ -871,7 +871,7 @@ error[E0308]: mismatched types
     |
 310 |     foo::<f32>(x_i8);
     |                ^^^^ expected f32, found i8
-help: you can cast an `i8` to `f32`, producing the floating point representation of the integer, rounded if necessary
+help: you can cast an `i8` to `f32`, producing the floating point representation of the integer
     |
 310 |     foo::<f32>(x_i8.into());
     |                ^^^^^^^^^^^