Skip to content

Conversation

@est31
Copy link
Member

@est31 est31 commented May 31, 2017

Extends the unused macro lint (added in PR #41907) to macros 2.0 (added in PR #40847).

r? @jseyfried

@est31
Copy link
Member Author

est31 commented May 31, 2017

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

@jseyfried
Copy link
Contributor

jseyfried commented May 31, 2017

@est31 Thanks!

Is it a problem if the PR gets merged with that flaw?

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.

Copy link
Contributor

@jseyfried jseyfried left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me modulo optional comment


// 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "declarative macros" or "macros 2.0"

@jseyfried
Copy link
Contributor

Also looks like Travis is failing because an existing test with an unused declarative macro needs updating.

@est31
Copy link
Member Author

est31 commented May 31, 2017

r? @jseyfried

@aidanhs aidanhs added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 1, 2017
@steveklabnik
Copy link
Contributor

@bors: r=jseyfried #42334 (review)

@bors
Copy link
Collaborator

bors commented Jun 1, 2017

📌 Commit 03876ec has been approved by jseyfried

@retep998 retep998 added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 1, 2017
@bors
Copy link
Collaborator

bors commented Jun 3, 2017

⌛ Testing commit 03876ec with merge a8dc246...

bors added a commit that referenced this pull request Jun 3, 2017
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
@bors
Copy link
Collaborator

bors commented Jun 3, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: jseyfried
Pushing a8dc246 to master...

@bors bors merged commit 03876ec into rust-lang:master Jun 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants