-
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
explicit_auto_deref
suggestion leads to non compiling code
#9101
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
Comments
jonasbb
added
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
labels
Jul 2, 2022
rustbot
added
the
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
label
Jul 2, 2022
jonasbb
added a commit
to jonasbb/serde_with
that referenced
this issue
Jul 2, 2022
bors bot
added a commit
to jonasbb/serde_with
that referenced
this issue
Jul 2, 2022
489: Suppress issue with `clippy::explicit_auto_deref` r=jonasbb a=jonasbb rust-lang/rust-clippy#9101 bors r+ Co-authored-by: Jonas Bushart <[email protected]>
@rustbot claim |
According to RFC, I think clippy's suggestion is correct. In code below, changing line 3 to fn main() {
let a: &&[u8; 2] = &&[1, 2];
let _: &[u8] = *a;
} |
MingweiSamuel
added a commit
to MingweiSamuel/hydroflow
that referenced
this issue
Jul 6, 2022
MingweiSamuel
added a commit
to hydro-project/hydroflow
that referenced
this issue
Jul 6, 2022
MaxVerevkin
added a commit
to greshake/i3status-rust
that referenced
this issue
Jul 7, 2022
bors
added a commit
that referenced
this issue
Aug 8, 2022
`explicit_auto_deref` changes fixes #9123 fixes #9109 fixes #9143 fixes #9101 This avoid suggesting code which hits a rustc bug. Basically `&{x}` won't use auto-deref if the target type is `Sized`. changelog: Don't suggest using auto deref for block expressions when the target type is `Sized` changelog: Include the borrow in the suggestion for `explicit_auto_deref` changelog: Don't lint `explicit_auto_deref` on `dyn Trait` return changelog: Don't lint `explicit_auto_deref` when other adjustments are required
nickjiang2378
pushed a commit
to nickjiang2378/hydroflow
that referenced
this issue
Jan 24, 2024
nickjiang2378
pushed a commit
to nickjiang2378/hydroflow
that referenced
this issue
Jan 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
Summary
The new
explicit_auto_deref
creates suggestions which do not compile. The lint already got ignored in serde serde-rs/serde@0ee71c7.Lint Name
explicit_auto_deref
Reproducer
I tried this code:
Playground
I saw this happen:
I expected to see this happen:
No lint should be emitted, since otherwise the function does not compile.
Version
Additional Labels
@rustbot label +I-suggestion-causes-error
The text was updated successfully, but these errors were encountered: