-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Downgrade string_lit_as_bytes to nursery #6117
Conversation
(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.
CI failure appears unrelated.
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> clippy_lints/src/redundant_clone.rs:89:14
|
89 | .into_engine(cx.tcx, mir, def_id.to_def_id())
| ^^^^^^^^^^^ ------ --- ------------------ supplied 3 arguments
| |
| expected 2 arguments
5e96daf
to
a5ef305
Compare
|
Passed! |
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.
I agree that the suggestion is broken so it seems fair to downgrade it.
Could you please add a small note in the Known problems
section explaining why it's in the nursery?
Added documentation of known problems.
|
@bors r+ Thanks for the nice explanation of the problem |
📌 Commit c81bea4 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Between #1402 (regarding
to_owned
) and #4494 (regardingimpl Read
), as well as other confusion I've seen hit in my work codebase involving string_lit_as_bytes ("...".as_bytes().into()
), I don't think this lint is at a quality to be enabled by default.I would consider re-enabling this lint after it is updated to understand when the surrounding type information is sufficient to unsize
b"..."
to &[u8] without causing a type error.As currently implemented, this lint is pushing people to write
&b"_"[..]
which is not an improvement over"_".as_bytes()
as far as I am concerned.changelog: Remove string_lit_as_bytes from default set of enabled lints