Skip to content

f32 seen as ambiguous associated type #26760

Description

@pfalabella

see http://stackoverflow.com/questions/31208465/pi-constant-is-ambiguous

   fn main() {
        let _ = f32::consts::PI;
    }

fails to compile with:

$ rustc -
<anon>:2:13: 2:28 error: ambiguous associated type; specify the type using the syntax `<f32 as Trait>::consts` [E0223]
<anon>:2     let i = f32::consts::PI;
                     ^~~~~~~~~~~~~~~
error: aborting due to previous error

on rust 1.0 stable and 1.1 stable

using the full path std::f32::consts::PI; works. The compilation error looks wrong (why is f32 an associated type)?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.WG-diagnosticsWorking group: Diagnostics

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions