Skip to content

Don't warn about dead foreign items if the 'allow(dead_code)' attribute is present #38791

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

Merged
merged 1 commit into from
Jan 3, 2017

Conversation

dylanmckay
Copy link
Contributor

This functionality was missing, and should have existed previously.

Fixes #38780

…te is present

This functionality was missing, and should have existed previously.

Fixes rust-lang#38780
@rust-highfive
Copy link
Contributor

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@@ -445,6 +445,11 @@ impl<'a, 'tcx> DeadVisitor<'a, 'tcx> {
&& !has_allow_dead_code_or_lang_attr(&variant.attrs)
}

fn should_warn_about_foreign_item(&mut self, fi: &hir::ForeignItem) -> bool {
!self.symbol_is_live(fi.id, None)
&& !has_allow_dead_code_or_lang_attr(&fi.attrs)
Copy link
Member

Choose a reason for hiding this comment

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

Pre-existing but why do we snoop lint attributes instead of registering the lints and letting the lint pass track them? cc @rust-lang/compiler

@eddyb
Copy link
Member

eddyb commented Jan 3, 2017

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 3, 2017

📌 Commit 09178e4 has been approved by eddyb

@bors
Copy link
Collaborator

bors commented Jan 3, 2017

⌛ Testing commit 09178e4 with merge 7766b50...

bors added a commit that referenced this pull request Jan 3, 2017
Don't warn about dead foreign items if the 'allow(dead_code)' attribute is present

This functionality was missing, and should have existed previously.

Fixes #38780
@bors
Copy link
Collaborator

bors commented Jan 3, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: eddyb
Pushing 7766b50 to master...

@bors bors merged commit 09178e4 into rust-lang:master Jan 3, 2017
@dylanmckay dylanmckay deleted the foreign-item-dc branch January 3, 2017 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants