Skip to content

Amusing and wrong error message #51874

Closed
Closed
@bjorn3

Description

@bjorn3
fn main() {
    let a = (1.0).pow(1.0);
}
error[E0689]: can't call method `pow` on ambiguous numeric type `{float}`
 --> src/main.rs:2:19
  |
2 |     let a = (1.0).pow(1.0);
  |                   ^^^
help: you must specify a concrete type for this numeric value, like `f32`
  |
2 |     let a = (1.0)_f32.pow(1.0);
  |             ^^^^^^^^^

Please note the (1.0)_f32

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions