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

deref_addrof checks across external macro boundary #4289

Closed
oxalica opened this issue Jul 20, 2019 · 1 comment · Fixed by #4487
Closed

deref_addrof checks across external macro boundary #4289

oxalica opened this issue Jul 20, 2019 · 1 comment · Fixed by #4487
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

@oxalica
Copy link
Contributor

oxalica commented Jul 20, 2019

The code below suggests [$(($x, stringify!(x)),)*] to change the macro, even though it is from another crate.

Playground (one crate)

macro_rules! m {
    ($($x:tt),*) => { &[$(($x, stringify!(x)),)*] };
}

pub fn f() -> [(i32, &'static str); 3] {
    *m![1, 2, 3]
}

Well, I don't think it should check across macro boundary no matter where it is from.

@flip1995 flip1995 added L-suggestion Lint: Improving, adding or fixing lint suggestions good-first-issue These issues are a good way to get started with Clippy T-macros Type: Issues with macros and macro expansion labels Jul 22, 2019
@flip1995
Copy link
Member

Just needs a macro check.

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

Successfully merging a pull request may close this issue.

2 participants