Skip to content

Commit

Permalink
Rollup merge of rust-lang#91478 - estebank:fix-newline-in-cast-sugges…
Browse files Browse the repository at this point in the history
…tion, r=camelid

Remove incorrect newline from float cast suggestion
  • Loading branch information
matthiaskrgr authored Dec 4, 2021
2 parents 2b64476 + 5b5df0f commit f9587b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/check/demand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
Expand Down
20 changes: 10 additions & 10 deletions src/test/ui/numeric/numeric-cast.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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);
| ++++++

Expand All @@ -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);
| ++++++

Expand Down Expand Up @@ -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);
| ++++++

Expand All @@ -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);
| ++++++

Expand All @@ -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);
| ++++++

Expand Down

0 comments on commit f9587b6

Please sign in to comment.