Skip to content

typeck: limit number of candidates shown for a single error - #33338

Merged
bors merged 1 commit into
rust-lang:masterfrom
birkenfeld:issue-25356
May 12, 2016
Merged

typeck: limit number of candidates shown for a single error#33338
bors merged 1 commit into
rust-lang:masterfrom
birkenfeld:issue-25356

Conversation

@birkenfeld

Copy link
Copy Markdown
Contributor

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

Fixes: #25356

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @Aatch

(rust_highfive has picked a reviewer for you, use r? to override)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea

@Manishearth

Copy link
Copy Markdown
Member

LGTM. I'd like someone else (@jonathandturner?) to rubber-stamp the number 10 as well, though 😄

@sophiajt

Copy link
Copy Markdown
Contributor

How difficult would it be to show an elision?

Something like:

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
^~~~~~~~~~~~~~~~~~~~~~~~~~
src\main.rs:206:9: 206:35 note: additional candidates elided.

FWIW, I'm fine stopping at 10, but I think it'd be good to let the user know there were others, they just aren't shown.

@birkenfeld

Copy link
Copy Markdown
ContributorAuthor

@jonathandturner it should already say "N more candidates not shown" at the end.

I just found another example in

fnreport_similar_impl_candidates(span:Span,
- it stops at 4 and says "and N others" at the end. I could adapt to this.

@sophiajt

Copy link
Copy Markdown
Contributor

Great, I missed that. If it has the message, I'm fine stopping even sooner than 10. 4 sounds good.

@Manishearth

Copy link
Copy Markdown
Member

sgtm either way. I'd like to switch to "and N others" though, let's keep things uniform.

@bors delegate+

@bors

bors commented May 2, 2016

Copy link
Copy Markdown
Collaborator

✌️ @birkenfeld can now approve this pull request

@birkenfeld

Copy link
Copy Markdown
ContributorAuthor

@bors r=Manishearth

@bors

bors commented May 3, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit 9508180 has been approved by Manishearth

@bors

bors commented May 3, 2016

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 9508180 with merge db2531f...

@Manishearth

Copy link
Copy Markdown
Member

@bors clean force

@Manishearth

Copy link
Copy Markdown
Member

@bors r- clean force

(something's wrong with the queue)

@Manishearth

Copy link
Copy Markdown
Member

@bors r+ clean

@bors

bors commented May 3, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit 9508180 has been approved by Manishearth

@alexcrichton

Copy link
Copy Markdown
Member

@bors: retry force clean

bors added a commit that referenced this pull request May 3, 2016
@steveklabnik

Copy link
Copy Markdown
Contributor

Is the travis failure here legitimate?

@birkenfeld

Copy link
Copy Markdown
ContributorAuthor

Yes; the diagnostics API changed on master. I'll fix it soon.

bors added a commit that referenced this pull request May 3, 2016
bors added a commit that referenced this pull request May 4, 2016
bors added a commit that referenced this pull request May 4, 2016
@bors

bors commented May 11, 2016

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #33425) made this pull request unmergeable. Please resolve the merge conflicts.

Limit of 4 taken consistent with limit for "similar impl candidates"
in rustc::traits::error_reporting.
Fixes: rust-lang#25356
@birkenfeld

Copy link
Copy Markdown
ContributorAuthor

Rebased.

@jseyfried

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented May 12, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit 6ab93d7 has been approved by jseyfried

@bors

bors commented May 12, 2016

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 6ab93d7 with merge e88defe...

bors added a commit that referenced this pull request 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
@bors
bors merged commit 6ab93d7 into rust-lang:masterMay 12, 2016
@birkenfeld
birkenfeld deleted the issue-25356 branch May 12, 2016 17:36
@blussbluss added the relnotes Marks issues that should be documented in the release notes of the next release. label May 13, 2016
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

relnotesMarks issues that should be documented in the release notes of the next release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants

@birkenfeld@rust-highfive@Manishearth@sophiajt@bors@alexcrichton@steveklabnik@jseyfried@Aatch@bluss