3 #![deny(no_mangle_generic_items)]
6 pub fn foo<T>() {} //~ ERROR functions generic over types or consts must be mangled
9 pub extern "C" fn bar<T>() {} //~ ERROR functions generic over types or consts must be mangled
12 pub fn baz(x: &i32) -> &i32 { x }
15 pub fn qux<'a>(x: &'a i32) -> &i32 { x }
21 pub fn foo<T>() {} //~ ERROR functions generic over types or consts must be mangled
24 pub extern "C" fn bar<T>() {} //~ ERROR functions generic over types or consts must be mangled
27 pub fn baz(x: &i32) -> &i32 { x }
30 pub fn qux<'a>(x: &'a i32) -> &i32 { x }
35 extern "C" fn bar<T>();
36 fn baz(x: &i32) -> &i32;
37 fn qux<'a>(x: &'a i32) -> &i32;
42 fn foo<T>() {} //~ ERROR functions generic over types or consts must be mangled
45 extern "C" fn bar<T>() {} //~ ERROR functions generic over types or consts must be mangled
48 fn baz(x: &i32) -> &i32 { x }
51 fn qux<'a>(x: &'a i32) -> &i32 { x }
58 fn baz(x: &i32) -> &i32;
59 fn qux<'a>(x: &'a i32) -> &i32;
62 impl<T> Trait2<T> for Foo {
64 fn foo() {} //~ ERROR functions generic over types or consts must be mangled
67 fn foo2<U>() {} //~ ERROR functions generic over types or consts must be mangled
70 extern "C" fn bar() {} //~ ERROR functions generic over types or consts must be mangled
73 fn baz(x: &i32) -> &i32 { x } //~ ERROR functions generic over types or consts must be mangled
76 fn qux<'a>(x: &'a i32) -> &i32 { x } //~ ERROR functions generic over types or consts must be mangled
83 pub fn foo() {} //~ ERROR functions generic over types or consts must be mangled
86 pub extern "C" fn bar() {} //~ ERROR functions generic over types or consts must be mangled
89 pub fn baz<U>() {} //~ ERROR functions generic over types or consts must be mangled
103 impl<T> Trait3 for Bar<T> {
105 fn foo() {} //~ ERROR functions generic over types or consts must be mangled
108 extern "C" fn bar() {} //~ ERROR functions generic over types or consts must be mangled
111 fn baz<U>() {} //~ ERROR functions generic over types or consts must be mangled
114 pub struct Baz<'a>(&'a i32);
121 pub fn bar<'b>(x: &'b i32) -> &i32 { x }
126 fn bar<'a>(x: &'a i32) -> &i32;
129 impl Trait4 for Bar<i32> {
134 fn bar<'b>(x: &'b i32) -> &i32 { x }
137 impl<'a> Trait4 for Baz<'a> {
142 fn bar<'b>(x: &'b i32) -> &i32 { x }
149 impl Trait5<i32> for Foo {
154 impl Trait5<i32> for Bar<i32> {