Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
nstoddard opened this issue May 13, 2015 · 0 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-frontend Area: Compiler frontend (errors, parsing and HIR) C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@nstoddard
Copy link

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.

@steveklabnik steveklabnik added A-diagnostics Area: Messages for errors, warnings, and lints A-frontend Area: Compiler frontend (errors, parsing and HIR) C-enhancement Category: An issue proposing an enhancement or a PR with one. labels May 13, 2015
birkenfeld added a commit to birkenfeld/rust that referenced this issue May 12, 2016
Limit of 4 taken consistent with limit for "similar impl candidates"
in rustc::traits::error_reporting.

Fixes: rust-lang#25356
bors added a commit that referenced this issue May 12, 2016
typeck: limit number of candidates shown for a single error

No idea if 10/11 is a good limit. Are there any other such limits in rustc currently?

Fixes: #25356
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-frontend Area: Compiler frontend (errors, parsing and HIR) C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

2 participants