diff --git a/src/libstd/rt/unwind.rs b/src/libstd/rt/unwind.rs index dd4d3bbc5fc..757aecaaaff 100644 --- a/src/libstd/rt/unwind.rs +++ b/src/libstd/rt/unwind.rs @@ -254,7 +254,6 @@ pub mod eabi { } #[no_mangle] // referenced from rust_try.ll - #[allow(unexported_no_mangle)] pub extern "C" fn rust_eh_personality_catch( _version: c_int, actions: uw::_Unwind_Action, @@ -293,7 +292,7 @@ pub mod eabi { #[lang="eh_personality"] #[no_mangle] // referenced from rust_try.ll - #[allow(unexported_no_mangle)] + #[allow(private_no_mangle_fns)] pub extern "C" fn rust_eh_personality( version: c_int, actions: uw::_Unwind_Action, @@ -309,7 +308,6 @@ pub mod eabi { } #[no_mangle] // referenced from rust_try.ll - #[allow(unexported_no_mangle)] pub extern "C" fn rust_eh_personality_catch( _version: c_int, actions: uw::_Unwind_Action, @@ -348,7 +346,7 @@ pub mod eabi { #[lang="eh_personality"] #[no_mangle] // referenced from rust_try.ll - #[allow(unexported_no_mangle)] + #[allow(private_no_mangle_fns)] extern "C" fn rust_eh_personality( state: uw::_Unwind_State, ue_header: *mut uw::_Unwind_Exception, @@ -361,7 +359,6 @@ pub mod eabi { } #[no_mangle] // referenced from rust_try.ll - #[allow(unexported_no_mangle)] pub extern "C" fn rust_eh_personality_catch( state: uw::_Unwind_State, _ue_header: *mut uw::_Unwind_Exception, @@ -439,7 +436,7 @@ pub mod eabi { #[lang="eh_personality"] #[no_mangle] // referenced from rust_try.ll - #[allow(unexported_no_mangle)] + #[allow(private_no_mangle_fns)] extern "C" fn rust_eh_personality( exceptionRecord: *mut EXCEPTION_RECORD, establisherFrame: *mut c_void, @@ -454,7 +451,6 @@ pub mod eabi { } #[no_mangle] // referenced from rust_try.ll - #[allow(unexported_no_mangle)] pub extern "C" fn rust_eh_personality_catch( exceptionRecord: *mut EXCEPTION_RECORD, establisherFrame: *mut c_void, diff --git a/src/test/compile-fail/lint-unexported-no-mangle.rs b/src/test/compile-fail/lint-unexported-no-mangle.rs new file mode 100644 index 00000000000..3227a78c2ef --- /dev/null +++ b/src/test/compile-fail/lint-unexported-no-mangle.rs @@ -0,0 +1,25 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags:-F private_no_mangle_fns + +// FIXME(#19495) no_mangle'ing main ICE's. +#[no_mangle] +fn foo() { //~ ERROR function foo is marked #[no_mangle], but not exported +} + +#[no_mangle] +pub fn bar() { +} + +fn main() { + foo(); + bar(); +}