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

Fix #12760 #12790

Merged
merged 1 commit into from May 15, 2024
Merged

Fix #12760 #12790

merged 1 commit into from May 15, 2024

Conversation

c410-f3r
Copy link
Contributor

Fix #12760

changelog: [missing_panics_doc]: Ignore panics in compile time

@rustbot
Copy link
Collaborator

rustbot commented May 11, 2024

r? @dswij

rustbot has assigned @dswij.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label May 11, 2024
Comment on lines 839 to 842
if let ExprKind::ConstBlock(_) = expr.kind {
self.is_const = true;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If a ConstBlock exists within the initial expression, then it is possible to assume a constant environment.

Let me know if there is a better alternative.

Copy link
Member

Choose a reason for hiding this comment

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

An alternative would be using clippy_utils::is_const before the visitor

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly what I was looking for. Thanks!

@dswij
Copy link
Member

dswij commented May 15, 2024

Thank you.

@bors r+

@bors
Copy link
Collaborator

bors commented May 15, 2024

📌 Commit 12ec009 has been approved by dswij

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented May 15, 2024

⌛ Testing commit 12ec009 with merge a9b5c8c...

@bors
Copy link
Collaborator

bors commented May 15, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: dswij
Pushing a9b5c8c to master...

1 similar comment
@bors
Copy link
Collaborator

bors commented May 15, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: dswij
Pushing a9b5c8c to master...

@bors bors merged commit a9b5c8c into rust-lang:master May 15, 2024
5 checks passed
@bors
Copy link
Collaborator

bors commented May 15, 2024

👀 Test was successful, but fast-forwarding failed: 422 Changes must be made through a pull request.

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.

missing_panics_doc shouldn't be triggered in constant environments
5 participants