1
Fork 0

Rollup merge of #91478 - estebank:fix-newline-in-cast-suggestion, r=camelid

Remove incorrect newline from float cast suggestion
This commit is contained in:
Matthias Krüger 2021-12-04 02:26:24 +01:00 committed by GitHub
commit f9587b60b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View file

@ -1223,7 +1223,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// Missing try_into implementation for `{integer}` to `{float}`
err.multipart_suggestion_verbose(
&format!(
"{}, producing the floating point representation of the integer,
"{}, producing the floating point representation of the integer, \
rounded if necessary",
cast_msg,
),

View file

@ -994,8 +994,8 @@ error[E0308]: mismatched types
LL | foo::<f64>(x_usize);
| ^^^^^^^ expected `f64`, found `usize`
|
help: you can cast a `usize` to an `f64`, producing the floating point representation of the integer,
| rounded if necessary
help: you can cast a `usize` to an `f64`, producing the floating point representation of the integer, rounded if necessary
|
LL | foo::<f64>(x_usize as f64);
| ++++++
@ -1005,8 +1005,8 @@ error[E0308]: mismatched types
LL | foo::<f64>(x_u64);
| ^^^^^ expected `f64`, found `u64`
|
help: you can cast a `u64` to an `f64`, producing the floating point representation of the integer,
| rounded if necessary
help: you can cast a `u64` to an `f64`, producing the floating point representation of the integer, rounded if necessary
|
LL | foo::<f64>(x_u64 as f64);
| ++++++
@ -1115,8 +1115,8 @@ error[E0308]: mismatched types
LL | foo::<f32>(x_usize);
| ^^^^^^^ expected `f32`, found `usize`
|
help: you can cast a `usize` to an `f32`, producing the floating point representation of the integer,
| rounded if necessary
help: you can cast a `usize` to an `f32`, producing the floating point representation of the integer, rounded if necessary
|
LL | foo::<f32>(x_usize as f32);
| ++++++
@ -1126,8 +1126,8 @@ error[E0308]: mismatched types
LL | foo::<f32>(x_u64);
| ^^^^^ expected `f32`, found `u64`
|
help: you can cast a `u64` to an `f32`, producing the floating point representation of the integer,
| rounded if necessary
help: you can cast a `u64` to an `f32`, producing the floating point representation of the integer, rounded if necessary
|
LL | foo::<f32>(x_u64 as f32);
| ++++++
@ -1137,8 +1137,8 @@ error[E0308]: mismatched types
LL | foo::<f32>(x_u32);
| ^^^^^ expected `f32`, found `u32`
|
help: you can cast a `u32` to an `f32`, producing the floating point representation of the integer,
| rounded if necessary
help: you can cast a `u32` to an `f32`, producing the floating point representation of the integer, rounded if necessary
|
LL | foo::<f32>(x_u32 as f32);
| ++++++