Skip to content

Emits non-overlapping suggestions for arguments with wrong types #109850

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

Merged
merged 2 commits into from
Apr 11, 2023

Conversation

mu001999
Copy link
Contributor

@mu001999 mu001999 commented Apr 2, 2023

Fixes #109831

@rustbot
Copy link
Collaborator

rustbot commented Apr 2, 2023

r? @compiler-errors

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 2, 2023
@compiler-errors
Copy link
Member

Can you leave a bit more information of what this PR is doing, either in the PR description or in the comments in the code itself? The logic is pretty dense already, and I'm really not sure what this exactly fixes.

@mu001999
Copy link
Contributor Author

mu001999 commented Apr 2, 2023

@compiler-errors This check suggests expected types for arguments with wrong types, but relies on the idx (prev) of previous arguments with expected types.

In the previous logic, prev would only be updated only when meeting arguments with expected types, and the wrong arguments between them would share an idx (prev + 1), which would result in overlapping suggestions and the debug assertions would fail.

This PR fixes it through updating the prev after each suggestions, which makes suggestions not overlapped.

@mu001999 mu001999 changed the title Make each idx is used only once Emits non-overlapping suggestions for arguments with wrong types Apr 4, 2023
@mu001999
Copy link
Contributor Author

mu001999 commented Apr 7, 2023

r? @estebank

I found the author of this snippet ;)

@rustbot rustbot assigned estebank and unassigned compiler-errors Apr 7, 2023
@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 10, 2023

📌 Commit 80e4285 has been approved by estebank

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 10, 2023
@bors
Copy link
Collaborator

bors commented Apr 11, 2023

⌛ Testing commit 80e4285 with merge b80ee39...

@bors
Copy link
Collaborator

bors commented Apr 11, 2023

☀️ Test successful - checks-actions
Approved by: estebank
Pushing b80ee39 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 11, 2023
@bors bors merged commit b80ee39 into rust-lang:master Apr 11, 2023
@rustbot rustbot added this to the 1.70.0 milestone Apr 11, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b80ee39): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.2% [1.2%, 1.2%] 1
Improvements ✅
(primary)
-0.4% [-0.4%, -0.4%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.4% [-0.4%, -0.4%] 1

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.0% [1.0%, 7.0%] 2
Improvements ✅
(primary)
-0.6% [-0.6%, -0.5%] 2
Improvements ✅
(secondary)
-3.5% [-3.5%, -3.5%] 1
All ❌✅ (primary) -0.6% [-0.6%, -0.5%] 2

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.5% [0.4%, 0.7%] 2
Regressions ❌
(secondary)
2.7% [2.5%, 2.9%] 3
Improvements ✅
(primary)
-0.5% [-0.5%, -0.5%] 1
Improvements ✅
(secondary)
-4.4% [-5.2%, -3.5%] 4
All ❌✅ (primary) 0.2% [-0.5%, 0.7%] 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: debug assertions: E0061: suggestion must not have overlapping parts
6 participants