-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Don't fire CONST_ITEM_MUTATION
lint when borrowing a deref
#78865
Conversation
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.
r? @varkor (rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this 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.
@varkor: I've addressed your comment in a separate commit. |
@bors r+ rollup |
📌 Commit bd3f3fa has been approved by |
Rollup of 19 pull requests Successful merges: - rust-lang#76097 (Stabilize hint::spin_loop) - rust-lang#76227 (Stabilize `Poll::is_ready` and `is_pending` as const) - rust-lang#78065 (make concurrency helper more pleasant to read) - rust-lang#78570 (Remove FIXME comment in print_type_sizes ui test suite) - rust-lang#78572 (Use SOCK_CLOEXEC and accept4() on more platforms.) - rust-lang#78658 (Add a tool to run `x.py` from any subdirectory) - rust-lang#78706 (Fix run-make tests running when LLVM is disabled) - rust-lang#78728 (Constantify `UnsafeCell::into_inner` and related) - rust-lang#78775 (Bump Rustfmt and RLS) - rust-lang#78788 (Correct unsigned equivalent of isize to be usize) - rust-lang#78811 (Make some std::io functions `const`) - rust-lang#78828 (use single char patterns for split() (clippy::single_char_pattern)) - rust-lang#78841 (Small cleanup in `TypeFoldable` derive macro) - rust-lang#78842 (Honor the rustfmt setting in config.toml) - rust-lang#78843 (Less verbose debug logging from inlining integrator) - rust-lang#78852 (Convert a bunch of intra-doc links) - rust-lang#78860 (rustc_resolve: Use `#![feature(format_args_capture)]`) - rust-lang#78861 (typo and formatting) - rust-lang#78865 (Don't fire `CONST_ITEM_MUTATION` lint when borrowing a deref) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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.