Extend the unused macro lint to macros 2.0#42334
Conversation
|
Right now, this is not recognized as unused yet: mod foo {
pub macro bar {
() => {}
}
}Is it a problem if the PR gets merged with that flaw? I saw code that does a similar trade off: https://github.com/rust-lang/rust/blob/master/src/librustc_resolve/check_unused.rs#L81-L85 |
|
@est31 Thanks!
I don't think so. Ideally we'd do reachability analysis, but it makes sense to land this first since it's also an issue with other items. |
jseyfried
left a comment
There was a problem hiding this comment.
r=me modulo optional comment
src/librustc_resolve/lib.rs
Outdated
|
|
||
| // List of crate local macros that we need to warn about as being unused. | ||
| // Right now this only includes macro_rules! macros. | ||
| // Right now this only includes macro_rules! macros, and 2.0 macros. |
There was a problem hiding this comment.
nit: "declarative macros" or "macros 2.0"
|
Also looks like Travis is failing because an existing test with an unused declarative macro needs updating. |
|
r? @jseyfried |
|
@bors: r=jseyfried #42334 (review) |
|
📌 Commit 03876ec has been approved by |
|
⌛ Testing commit 03876ec with merge a8dc246... |
Extend the unused macro lint to macros 2.0 Extends the unused macro lint (added in PR #41907) to macros 2.0 (added in PR #40847). r? @jseyfried
|
☀️ Test successful - status-appveyor, status-travis |
Extends the unused macro lint (added in PR #41907) to macros 2.0 (added in PR #40847).
r? @jseyfried