From 5b5df0fa17a36ab1a182313c2cb4db0799b9249f Mon Sep 17 00:00:00 2001 From: Esteban Kuber Date: Fri, 3 Dec 2021 01:00:09 +0000 Subject: [PATCH] Remove incorrect newline from float cast suggestion --- compiler/rustc_typeck/src/check/demand.rs | 2 +- src/test/ui/numeric/numeric-cast.stderr | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/compiler/rustc_typeck/src/check/demand.rs b/compiler/rustc_typeck/src/check/demand.rs index 12cd7ad184892..b210c78cae007 100644 --- a/compiler/rustc_typeck/src/check/demand.rs +++ b/compiler/rustc_typeck/src/check/demand.rs @@ -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, ), diff --git a/src/test/ui/numeric/numeric-cast.stderr b/src/test/ui/numeric/numeric-cast.stderr index 3e2bc5bc82d42..b8f2d88ab4957 100644 --- a/src/test/ui/numeric/numeric-cast.stderr +++ b/src/test/ui/numeric/numeric-cast.stderr @@ -994,8 +994,8 @@ error[E0308]: mismatched types LL | foo::(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::(x_usize as f64); | ++++++ @@ -1005,8 +1005,8 @@ error[E0308]: mismatched types LL | foo::(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::(x_u64 as f64); | ++++++ @@ -1115,8 +1115,8 @@ error[E0308]: mismatched types LL | foo::(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::(x_usize as f32); | ++++++ @@ -1126,8 +1126,8 @@ error[E0308]: mismatched types LL | foo::(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::(x_u64 as f32); | ++++++ @@ -1137,8 +1137,8 @@ error[E0308]: mismatched types LL | foo::(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::(x_u32 as f32); | ++++++