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

[question_mark]: don't lint inside of try block #11001

Merged
merged 2 commits into from Jun 28, 2023
Merged

Conversation

y21
Copy link
Member

@y21 y21 commented Jun 21, 2023

Fixes #8628.

Diff looks a bit noisy because I had to move the two functions into an impl, because they now need to access the structs try_block_depth field to see if they're inside a try block.

changelog: [question_mark]: don't lint inside of try block

@rustbot
Copy link
Collaborator

rustbot commented Jun 21, 2023

r? @Jarcho

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

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jun 21, 2023
@Jarcho
Copy link
Contributor

Jarcho commented Jun 28, 2023

Well that diff was useless. Nowhere near the most useless I've seen.

This doesn't handle nested functions (e.g. fn f() { try { fn f2() {} }). You'll have to keep a stack of try block depths for this.

@y21
Copy link
Member Author

y21 commented Jun 28, 2023

Well that diff was useless. Nowhere near the most useless I've seen.

Yeah, with hindsight maybe it would've been better to split it up into two commits (the relevant stuff that changed in the first commit and just passing the try depth as a param, and in the second commit moving the function into the impl). Would've probably made the relevant diff way easier to read in the first commit

This doesn't handle nested functions (e.g. fn f() { try { fn f2() {} }). You'll have to keep a stack of try block depths for this.

Fixed this in the last commit

@Jarcho
Copy link
Contributor

Jarcho commented Jun 28, 2023

Thank you. @bors r+

@bors
Copy link
Collaborator

bors commented Jun 28, 2023

📌 Commit 70610c0 has been approved by Jarcho

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Jun 28, 2023

⌛ Testing commit 70610c0 with merge 10ce1a6...

@bors
Copy link
Collaborator

bors commented Jun 28, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Jarcho
Pushing 10ce1a6 to master...

@bors bors merged commit 10ce1a6 into rust-lang:master Jun 28, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

question_mark inside try blocks
4 participants