Skip to content

When 'multiple applicable methods in scope', limit the number of possibilities that are printed #25356

Closed
@nstoddard

Description

@nstoddard

I have some code with this error:

src\main.rs:206:9: 206:35 error: multiple applicable methods in scope [E0034]
src\main.rs:206     0.0.max(normal.dot(light_dir)) * res
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
src\main.rs:206:9: 206:35 note: candidate #1 is defined in an impl of the trait `core::iter::Iterator` for the type `std::ascii::EscapeDefault`
src\main.rs:206     0.0.max(normal.dot(light_dir)) * res
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
src\main.rs:206:9: 206:35 note: candidate #2 is defined in an impl of the trait `core::iter::Iterator` for the type `std::collections::hash::table::RawBuckets<'_, _, _>`
src\main.rs:206     0.0.max(normal.dot(light_dir)) * res
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
...
<hundreds of these>
...
src\main.rs:206:9: 206:35 note: candidate #209 is defined in an impl of the trait `vecmat::num_ext::MaxMin` for the type `f32`
src\main.rs:206     0.0.max(normal.dot(light_dir)) * res
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
src\main.rs:206:9: 206:35 note: candidate #210 is defined in an impl of the trait `vecmat::num_ext::MaxMin` for the type `f64`
src\main.rs:206     0.0.max(normal.dot(light_dir)) * res

Needless to say, giving this many options isn't helpful. It should be limited to displaying only around 5-10 possibilities, giving more only if requested with an option like --verbose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-frontendArea: Compiler frontend (errors, parsing and HIR)C-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions