Skip to content

Associated item module hints #55089

Closed
Closed
@leonardo-m

Description

@leonardo-m
fn foo(n: usize) {
    assert!(n <= u32::MAX as usize);
}
fn main() {}

Gives:

error[E0599]: no associated item named `MAX` found for type `u32` in the current scope
 --> ...\test.rs:2:18
  |
2 |     assert!(n <= u32::MAX as usize);
  |                  ^^^^^^^^ associated item not found in `u32`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0599`.

Perhaps here we want to give a hint where to find the u32::MAX?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-associated-itemsArea: Associated items (types, constants & functions)A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions