File tree Expand file tree Collapse file tree 3 files changed +57
-3
lines changed Expand file tree Collapse file tree 3 files changed +57
-3
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,11 @@ impl<T> Bar<T> {
8989 pub fn baz<U>() {} //~ ERROR functions generic over types or consts must be mangled
9090}
9191
92+ impl Bar<i32> {
93+ #[no_mangle]
94+ pub fn qux() {}
95+ }
96+
9297trait Trait3 {
9398 fn foo();
9499 extern "C" fn bar();
@@ -121,6 +126,14 @@ trait Trait4 {
121126 fn bar<'a>(x: &'a i32) -> &i32;
122127}
123128
129+ impl Trait4 for Bar<i32> {
130+ #[no_mangle]
131+ fn foo() {}
132+
133+ #[no_mangle]
134+ fn bar<'b>(x: &'b i32) -> &i32 { x }
135+ }
136+
124137impl<'a> Trait4 for Baz<'a> {
125138 #[no_mangle]
126139 fn foo() {}
@@ -129,4 +142,18 @@ impl<'a> Trait4 for Baz<'a> {
129142 fn bar<'b>(x: &'b i32) -> &i32 { x }
130143}
131144
145+ trait Trait5<T> {
146+ fn foo();
147+ }
148+
149+ impl Trait5<i32> for Foo {
150+ #[no_mangle]
151+ fn foo() {}
152+ }
153+
154+ impl Trait5<i32> for Bar<i32> {
155+ #[no_mangle]
156+ fn foo() {}
157+ }
158+
132159fn main() {}
Original file line number Diff line number Diff line change @@ -89,6 +89,11 @@ impl<T> Bar<T> {
8989 pub fn baz < U > ( ) { } //~ ERROR functions generic over types or consts must be mangled
9090}
9191
92+ impl Bar < i32 > {
93+ #[ no_mangle]
94+ pub fn qux ( ) { }
95+ }
96+
9297trait Trait3 {
9398 fn foo ( ) ;
9499 extern "C" fn bar ( ) ;
@@ -121,6 +126,14 @@ trait Trait4 {
121126 fn bar < ' a > ( x : & ' a i32 ) -> & i32 ;
122127}
123128
129+ impl Trait4 for Bar < i32 > {
130+ #[ no_mangle]
131+ fn foo ( ) { }
132+
133+ #[ no_mangle]
134+ fn bar < ' b > ( x : & ' b i32 ) -> & i32 { x }
135+ }
136+
124137impl < ' a > Trait4 for Baz < ' a > {
125138 #[ no_mangle]
126139 fn foo ( ) { }
@@ -129,4 +142,18 @@ impl<'a> Trait4 for Baz<'a> {
129142 fn bar < ' b > ( x : & ' b i32 ) -> & i32 { x }
130143}
131144
145+ trait Trait5 < T > {
146+ fn foo ( ) ;
147+ }
148+
149+ impl Trait5 < i32 > for Foo {
150+ #[ no_mangle]
151+ fn foo ( ) { }
152+ }
153+
154+ impl Trait5 < i32 > for Bar < i32 > {
155+ #[ no_mangle]
156+ fn foo ( ) { }
157+ }
158+
132159fn main ( ) { }
Original file line number Diff line number Diff line change @@ -117,23 +117,23 @@ LL | pub fn baz<U>() {}
117117 | ^^^^^^^^^^^^^^^^^^
118118
119119error: functions generic over types or consts must be mangled
120- --> $DIR/generic-no-mangle.rs:100 :5
120+ --> $DIR/generic-no-mangle.rs:105 :5
121121 |
122122LL | #[no_mangle]
123123 | ------------ help: remove this attribute
124124LL | fn foo() {}
125125 | ^^^^^^^^^^^
126126
127127error: functions generic over types or consts must be mangled
128- --> $DIR/generic-no-mangle.rs:103 :5
128+ --> $DIR/generic-no-mangle.rs:108 :5
129129 |
130130LL | #[no_mangle]
131131 | ------------ help: remove this attribute
132132LL | extern "C" fn bar() {}
133133 | ^^^^^^^^^^^^^^^^^^^^^^
134134
135135error: functions generic over types or consts must be mangled
136- --> $DIR/generic-no-mangle.rs:106 :5
136+ --> $DIR/generic-no-mangle.rs:111 :5
137137 |
138138LL | #[no_mangle]
139139 | ------------ help: remove this attribute
You can’t perform that action at this time.
0 commit comments