Skip to content

Don't fire CONST_ITEM_MUTATION lint when borrowing a deref #78865

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
Nov 8, 2020

Conversation

Aaron1011
Copy link
Member

Fixes #78819

This extends the check for dereferences added in PR #77324
to cover mutable borrows, as well as direct writes. If we're operating
on a dereference of a const item, we shouldn't be firing the lint.

Fixes rust-lang#78819

This extends the check for dereferences added in PR rust-lang#77324
to cover mutable borrows, as well as direct writes. If we're operating
on a dereference of a `const` item, we shouldn't be firing the lint.
@rust-highfive
Copy link
Contributor

r? @varkor

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 8, 2020
Copy link
Member

@varkor varkor left a comment

Choose a reason for hiding this comment

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

The PR itself looks good. Could you make a quick drive-by fix? The hyphen is incorrect here; a semicolon would be more appropriate.

@Aaron1011
Copy link
Member Author

@varkor: I've addressed your comment in a separate commit.

@varkor
Copy link
Member

varkor commented Nov 8, 2020

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Nov 8, 2020

📌 Commit bd3f3fa has been approved by varkor

@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 Nov 8, 2020
@bors bors merged commit 91759b2 into rust-lang:master Nov 8, 2020
@rustbot rustbot added this to the 1.49.0 milestone Nov 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

const_item_mutation incorrectly fires when using raw pointers
5 participants