summary refs log tree commit diff
path: root/src/test/ui/generics/generic-no-mangle.rs
blob: 146896cdc3d024f66fb42f17352800de86a4a897 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// run-rustfix

#![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 "C" 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 }

fn main() {}