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

Clippy suggests macro expanded code #3333

Closed
pravic opened this issue Oct 18, 2018 · 0 comments
Closed

Clippy suggests macro expanded code #3333

pravic opened this issue Oct 18, 2018 · 0 comments
Labels
good-first-issue These issues are a good way to get started with Clippy L-suggestion Lint: Improving, adding or fixing lint suggestions T-macros Type: Issues with macros and macro expansion

Comments

@pravic
Copy link

pravic commented Oct 18, 2018

Playground link:

#[macro_use]
extern crate log;

fn main() {
    let r: Result<(), ()> = Ok(());
    match r {
        Err(_) => error!(""),
        _ => {}
    }
}

clippy 0.0.212 (9d33731 2018-10-11)

@flip1995 flip1995 added good-first-issue These issues are a good way to get started with Clippy L-suggestion Lint: Improving, adding or fixing lint suggestions labels Oct 18, 2018
@phansch phansch added the T-macros Type: Issues with macros and macro expansion label Oct 26, 2018
bors bot added a commit that referenced this issue Oct 27, 2018
3366: Don't expand macros in some suggestions r=oli-obk a=phansch

Fixes #1148 
Fixes #1628
Fixes #2455
Fixes #3023
Fixes #3333
Fixes #3360

Co-authored-by: Philipp Hansch <dev@phansch.net>
bors bot added a commit that referenced this issue Oct 28, 2018
3217: Fix string_lit_as_bytes lint for macros r=phansch a=yaahallo

Prior to this change, string_lit_as_bytes would trigger for constructs
like `include_str!("filename").as_bytes()` and would recommend fixing it
by rewriting as `binclude_str!("filename")`.

This change updates the lint to act as an EarlyLintPass lint. It then
differentiates between string literals and macros that have bytes
yielding alternatives.

Closes #3205

3366: Don't expand macros in some suggestions r=oli-obk a=phansch

Fixes #1148 
Fixes #1628
Fixes #2455
Fixes #3023
Fixes #3333
Fixes #3360

Co-authored-by: Jane Lusby <jlusby42@gmail.com>
Co-authored-by: Philipp Hansch <dev@phansch.net>
@bors bors bot closed this as completed in #3366 Oct 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue These issues are a good way to get started with Clippy L-suggestion Lint: Improving, adding or fixing lint suggestions T-macros Type: Issues with macros and macro expansion
Projects
None yet
Development

No branches or pull requests

3 participants