lint: Deny #[no_mangle] const items
This renames the PrivateNoMangleFns lint to allow both to happen in a single pass, since they do roughly the same work.
This commit is contained in:
parent
eaf4c5c784
commit
51ed1ecefd
3 changed files with 26 additions and 6 deletions
|
|
@ -8,13 +8,20 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags:-F private_no_mangle_fns
|
||||
// compile-flags:-F private_no_mangle_fns -F no_mangle_const_items
|
||||
|
||||
// FIXME(#19495) no_mangle'ing main ICE's.
|
||||
#[no_mangle]
|
||||
fn foo() { //~ ERROR function foo is marked #[no_mangle], but not exported
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[no_mangle]
|
||||
const FOO: u64 = 1; //~ ERROR const items should never be #[no_mangle]
|
||||
|
||||
#[no_mangle]
|
||||
pub const PUB_FOO: u64 = 1; //~ ERROR const items should never be #[no_mangle]
|
||||
|
||||
#[no_mangle]
|
||||
pub fn bar() {
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue