Rollup merge of #60823 - oli-obk:used_unused_no_mangle, r=michaelwoerister

Fix incremental compilation of cdylib emitting spurious unused_attributes lint

fixes #60050
This commit is contained in:
Mazdak Farrokhzad 2019-05-20 23:03:00 +02:00 committed by GitHub
commit 36b5724e0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 8 deletions

View File

@ -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),
(

View File

@ -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
}

View File

@ -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

View File

@ -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
|