Skip to content

Commit

Permalink
Rollup merge of rust-lang#60823 - oli-obk:used_unused_no_mangle, r=mi…
Browse files Browse the repository at this point in the history
…chaelwoerister

Fix incremental compilation of cdylib emitting spurious unused_attributes lint

fixes rust-lang#60050
  • Loading branch information
Centril authored May 20, 2019
2 parents a34dae3 + e92d13e commit 36b5724
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
(sym::repr, Normal, template!(List: "C, packed, ..."), Ungated),
(sym::path, Normal, template!(NameValueStr: "file"), Ungated),
(sym::automatically_derived, Normal, template!(Word), Ungated),
(sym::no_mangle, Normal, template!(Word), Ungated),
(sym::no_mangle, Whitelisted, template!(Word), Ungated),
(sym::no_link, Normal, template!(Word), Ungated),
(sym::derive, Normal, template!(List: "Trait1, Trait2, ..."), Ungated),
(
Expand Down
10 changes: 10 additions & 0 deletions src/test/incremental/no_mangle.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// revisions:rpass1 rpass2
// compile-flags: --crate-type cdylib
// skip-codegen

#![deny(unused_attributes)]

#[no_mangle]
pub extern "C" fn rust_no_mangle() -> i32 {
42
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
//~^ WARN unused attribute
#![path = "3800"] //~ WARN unused attribute
#![automatically_derived] //~ WARN unused attribute
#![no_mangle] //~ WARN unused attribute
#![no_mangle]
#![no_link] //~ WARN unused attribute
// see issue-43106-gating-of-derive.rs
#![should_panic] //~ WARN unused attribute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1152,12 +1152,6 @@ warning: unused attribute
LL | #![automatically_derived]
| ^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:55:1
|
LL | #![no_mangle]
| ^^^^^^^^^^^^^

warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:56:1
|
Expand Down

0 comments on commit 36b5724

Please sign in to comment.