File tree 3 files changed +57
-3
lines changed
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> {
89
89
pub fn baz<U>() {} //~ ERROR functions generic over types or consts must be mangled
90
90
}
91
91
92
+ impl Bar<i32> {
93
+ #[no_mangle]
94
+ pub fn qux() {}
95
+ }
96
+
92
97
trait Trait3 {
93
98
fn foo();
94
99
extern "C" fn bar();
@@ -121,6 +126,14 @@ trait Trait4 {
121
126
fn bar<'a>(x: &'a i32) -> &i32;
122
127
}
123
128
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
+
124
137
impl<'a> Trait4 for Baz<'a> {
125
138
#[no_mangle]
126
139
fn foo() {}
@@ -129,4 +142,18 @@ impl<'a> Trait4 for Baz<'a> {
129
142
fn bar<'b>(x: &'b i32) -> &i32 { x }
130
143
}
131
144
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
+
132
159
fn main() {}
Original file line number Diff line number Diff line change @@ -89,6 +89,11 @@ impl<T> Bar<T> {
89
89
pub fn baz < U > ( ) { } //~ ERROR functions generic over types or consts must be mangled
90
90
}
91
91
92
+ impl Bar < i32 > {
93
+ #[ no_mangle]
94
+ pub fn qux ( ) { }
95
+ }
96
+
92
97
trait Trait3 {
93
98
fn foo ( ) ;
94
99
extern "C" fn bar ( ) ;
@@ -121,6 +126,14 @@ trait Trait4 {
121
126
fn bar < ' a > ( x : & ' a i32 ) -> & i32 ;
122
127
}
123
128
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
+
124
137
impl < ' a > Trait4 for Baz < ' a > {
125
138
#[ no_mangle]
126
139
fn foo ( ) { }
@@ -129,4 +142,18 @@ impl<'a> Trait4 for Baz<'a> {
129
142
fn bar < ' b > ( x : & ' b i32 ) -> & i32 { x }
130
143
}
131
144
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
+
132
159
fn main ( ) { }
Original file line number Diff line number Diff line change @@ -117,23 +117,23 @@ LL | pub fn baz<U>() {}
117
117
| ^^^^^^^^^^^^^^^^^^
118
118
119
119
error: 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
121
121
|
122
122
LL | #[no_mangle]
123
123
| ------------ help: remove this attribute
124
124
LL | fn foo() {}
125
125
| ^^^^^^^^^^^
126
126
127
127
error: 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
129
129
|
130
130
LL | #[no_mangle]
131
131
| ------------ help: remove this attribute
132
132
LL | extern "C" fn bar() {}
133
133
| ^^^^^^^^^^^^^^^^^^^^^^
134
134
135
135
error: 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
137
137
|
138
138
LL | #[no_mangle]
139
139
| ------------ help: remove this attribute
You can’t perform that action at this time.
0 commit comments