File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -77,3 +77,45 @@ fn float_kind_trait() {
77
77
}
78
78
}
79
79
}
80
+
81
+ /// You can still get ambiguous results with integer variables
82
+ #[ test]
83
+ fn integer_ambiguity ( ) {
84
+ test ! {
85
+ program {
86
+ trait Foo { }
87
+
88
+ impl Foo for usize { }
89
+ impl Foo for isize { }
90
+ }
91
+
92
+ goal {
93
+ exists<int N > {
94
+ N : Foo
95
+ }
96
+ } yields {
97
+ "Ambiguous; no inference guidance"
98
+ }
99
+ }
100
+ }
101
+
102
+ /// You can still get ambiguous results with float variables
103
+ #[ test]
104
+ fn float_ambiguity ( ) {
105
+ test ! {
106
+ program {
107
+ trait Foo { }
108
+
109
+ impl Foo for f32 { }
110
+ impl Foo for f64 { }
111
+ }
112
+
113
+ goal {
114
+ exists<float N > {
115
+ N : Foo
116
+ }
117
+ } yields {
118
+ "Ambiguous; no inference guidance"
119
+ }
120
+ }
121
+ }
You can’t perform that action at this time.
0 commit comments