Skip to content

Commit f9587b6

Browse files
authored
Rollup merge of #91478 - estebank:fix-newline-in-cast-suggestion, r=camelid
Remove incorrect newline from float cast suggestion
2 parents 2b64476 + 5b5df0f commit f9587b6

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

compiler/rustc_typeck/src/check/demand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
12231223
// Missing try_into implementation for `{integer}` to `{float}`
12241224
err.multipart_suggestion_verbose(
12251225
&format!(
1226-
"{}, producing the floating point representation of the integer,
1226+
"{}, producing the floating point representation of the integer, \
12271227
rounded if necessary",
12281228
cast_msg,
12291229
),

src/test/ui/numeric/numeric-cast.stderr

+10-10
Original file line numberDiff line numberDiff line change
@@ -994,8 +994,8 @@ error[E0308]: mismatched types
994994
LL | foo::<f64>(x_usize);
995995
| ^^^^^^^ expected `f64`, found `usize`
996996
|
997-
help: you can cast a `usize` to an `f64`, producing the floating point representation of the integer,
998-
| rounded if necessary
997+
help: you can cast a `usize` to an `f64`, producing the floating point representation of the integer, rounded if necessary
998+
|
999999
LL | foo::<f64>(x_usize as f64);
10001000
| ++++++
10011001

@@ -1005,8 +1005,8 @@ error[E0308]: mismatched types
10051005
LL | foo::<f64>(x_u64);
10061006
| ^^^^^ expected `f64`, found `u64`
10071007
|
1008-
help: you can cast a `u64` to an `f64`, producing the floating point representation of the integer,
1009-
| rounded if necessary
1008+
help: you can cast a `u64` to an `f64`, producing the floating point representation of the integer, rounded if necessary
1009+
|
10101010
LL | foo::<f64>(x_u64 as f64);
10111011
| ++++++
10121012

@@ -1115,8 +1115,8 @@ error[E0308]: mismatched types
11151115
LL | foo::<f32>(x_usize);
11161116
| ^^^^^^^ expected `f32`, found `usize`
11171117
|
1118-
help: you can cast a `usize` to an `f32`, producing the floating point representation of the integer,
1119-
| rounded if necessary
1118+
help: you can cast a `usize` to an `f32`, producing the floating point representation of the integer, rounded if necessary
1119+
|
11201120
LL | foo::<f32>(x_usize as f32);
11211121
| ++++++
11221122

@@ -1126,8 +1126,8 @@ error[E0308]: mismatched types
11261126
LL | foo::<f32>(x_u64);
11271127
| ^^^^^ expected `f32`, found `u64`
11281128
|
1129-
help: you can cast a `u64` to an `f32`, producing the floating point representation of the integer,
1130-
| rounded if necessary
1129+
help: you can cast a `u64` to an `f32`, producing the floating point representation of the integer, rounded if necessary
1130+
|
11311131
LL | foo::<f32>(x_u64 as f32);
11321132
| ++++++
11331133

@@ -1137,8 +1137,8 @@ error[E0308]: mismatched types
11371137
LL | foo::<f32>(x_u32);
11381138
| ^^^^^ expected `f32`, found `u32`
11391139
|
1140-
help: you can cast a `u32` to an `f32`, producing the floating point representation of the integer,
1141-
| rounded if necessary
1140+
help: you can cast a `u32` to an `f32`, producing the floating point representation of the integer, rounded if necessary
1141+
|
11421142
LL | foo::<f32>(x_u32 as f32);
11431143
| ++++++
11441144

0 commit comments

Comments
 (0)