Skip to content

Commit 2adc6da

Browse files
committed
Fix incremental compilation of cdylib emitting spurious unused_attributes lint
1 parent 80e7cde commit 2adc6da

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/libsyntax/feature_gate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
998998
(sym::repr, Normal, template!(List: "C, packed, ..."), Ungated),
999999
(sym::path, Normal, template!(NameValueStr: "file"), Ungated),
10001000
(sym::automatically_derived, Normal, template!(Word), Ungated),
1001-
(sym::no_mangle, Normal, template!(Word), Ungated),
1001+
(sym::no_mangle, Whitelisted, template!(Word), Ungated),
10021002
(sym::no_link, Normal, template!(Word), Ungated),
10031003
(sym::derive, Normal, template!(List: "Trait1, Trait2, ..."), Ungated),
10041004
(

src/test/incremental/no_mangle.rs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// revisions:rpass1 rpass2
2+
// compile-flags: --crate-type cdylib
3+
// skip-codegen
4+
5+
#![deny(unused_attributes)]
6+
7+
#[no_mangle]
8+
pub extern "C" fn rust_no_mangle() -> i32 {
9+
42
10+
}

0 commit comments

Comments
 (0)