File tree 1 file changed +38
-0
lines changed
1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ //@ revisions: legacy v0
2
+ //@[v0] compile-flags: -C symbol-mangling-version=v0
3
+ //@[legacy] compile-flags: -C symbol-mangling-version=legacy -Zunstable-options
4
+ //@ build-pass
5
+
6
+ pub struct Vec2 ;
7
+
8
+ pub trait Point {
9
+ type S ;
10
+ }
11
+ impl Point for Vec2 {
12
+ type S = f32 ;
13
+ }
14
+
15
+ pub trait Point2 : Point < S = Self :: S2 > {
16
+ type S2 ;
17
+ }
18
+ impl Point2 for Vec2 {
19
+ type S2 = Self :: S ;
20
+ }
21
+
22
+ trait MyFrom < T > {
23
+ fn my_from ( ) ;
24
+ }
25
+ impl < P : Point2 > MyFrom < P :: S > for P {
26
+ fn my_from ( ) {
27
+ // This is just a really dumb way to force the legacy symbol mangling to
28
+ // mangle the closure's parent impl def path *with* args. Otherwise,
29
+ // legacy symbol mangling will strip the args from the instance, meaning
30
+ // that we don't trigger the bug.
31
+ let c = || { } ;
32
+ let x = Box :: new ( c) as Box < dyn Fn ( ) > ;
33
+ }
34
+ }
35
+
36
+ fn main ( ) {
37
+ <Vec2 as MyFrom < _ > >:: my_from ( ) ;
38
+ }
You can’t perform that action at this time.
0 commit comments