rust/src/test/ui/generics/generic-no-mangle.rs

18 lines
370 B
Rust
Raw Normal View History

2020-07-02 00:32:12 -05:00
// run-rustfix
2015-12-08 10:48:40 -06:00
#![deny(no_mangle_generic_items)]
#[no_mangle]
pub fn foo<T>() {} //~ ERROR functions generic over types or consts must be mangled
#[no_mangle]
pub extern fn bar<T>() {} //~ ERROR functions generic over types or consts must be mangled
#[no_mangle]
pub fn baz(x: &i32) -> &i32 { x }
#[no_mangle]
pub fn qux<'a>(x: &'a i32) -> &i32 { x }
2015-12-08 10:48:40 -06:00
fn main() {}