-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #90989 - notriddle:notriddle/rustc-suggest-float-endi…
…ng-in-dot, r=sanxiyn Avoid suggesting literal formatting that turns into member access Fixes #90974
- Loading branch information
Showing
3 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
println!("{}", (3.).recip()); //~ERROR | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error[E0689]: can't call method `recip` on ambiguous numeric type `{float}` | ||
--> $DIR/issue-90974.rs:2:25 | ||
| | ||
LL | println!("{}", (3.).recip()); | ||
| ^^^^^ | ||
| | ||
help: you must specify a concrete type for this numeric value, like `f32` | ||
| | ||
LL | println!("{}", (3_f32).recip()); | ||
| ~~~~~ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0689`. |