Skip to content
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

manual_map should not expand macros in suggestion #6811

Closed
matthiaskrgr opened this issue Feb 27, 2021 · 0 comments · Fixed by #6801
Closed

manual_map should not expand macros in suggestion #6811

matthiaskrgr opened this issue Feb 27, 2021 · 0 comments · Fixed by #6801
Labels
C-bug Category: Clippy is not doing the correct thing I-suggestion-causes-error Issue: The suggestions provided by this Lint cause an ICE/error when applied L-suggestion Lint: Improving, adding or fixing lint suggestions

Comments

@matthiaskrgr
Copy link
Member

pub fn main() {
    let x = Some(3);
    let y = match x {
        Some(i) => Some(vec![i]),
        None => None,
    };
}
warning: manual implementation of `Option::map`
 --> manual_map.rs:3:13
  |
3 |       let y = match x {
  |  _____________^
4 | |         Some(i) => Some(vec![i]),
5 | |         None => None,
6 | |     };
  | |_____^ help: try this: `x.map(|i| <[_]>::into_vec(box [$($x),+]))`
  |
@matthiaskrgr matthiaskrgr added C-bug Category: Clippy is not doing the correct thing L-suggestion Lint: Improving, adding or fixing lint suggestions I-suggestion-causes-error Issue: The suggestions provided by this Lint cause an ICE/error when applied labels Feb 27, 2021
@bors bors closed this as completed in ece3543 Mar 2, 2021
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-suggestion-causes-error Issue: The suggestions provided by this Lint cause an ICE/error when applied L-suggestion Lint: Improving, adding or fixing lint suggestions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant