Warn no_mangle on generic functions

This commit is contained in:
Seo Sanghyeon 2015-12-09 01:48:40 +09:00
parent 7b77f67d19
commit 55ffc33b10
2 changed files with 25 additions and 10 deletions

View file

@ -8,10 +8,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// ignore-test this should fail to compile (#15844)
#![deny(no_mangle_generic_items)]
#[no_mangle]
fn foo<T>() {} //~ ERROR generic functions must be mangled
pub fn foo<T>() {} //~ ERROR generic functions must be mangled
#[no_mangle]
extern fn foo<T>() {} //~ ERROR generic functions must be mangled
pub extern fn bar<T>() {} //~ ERROR generic functions must be mangled
fn main() {}