-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when appliedIssue: The suggestions provided by this Lint cause an ICE/error when applied
Description
struct S<'a>(&'a str);
impl<'a> std::fmt::Debug for S<'a> {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match *self {
// This suggests changing `ref s` to `s`, which won't compile
// (`field` takes a `&Debug`).
S(ref s) => f.debug_tuple("S").field(s).finish()
// I'm aware you can do this.
//S(s) => f.debug_tuple("S").field(&s).finish()
}
}
}
Playground link: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=21db39fed7d5b0778b382e206fa45f1b
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when appliedIssue: The suggestions provided by this Lint cause an ICE/error when applied