File tree 2 files changed +33
-0
lines changed
2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -555,8 +555,10 @@ impl<'a> InferenceContext<'a> {
555
555
) ;
556
556
}
557
557
Solution :: Ambig ( Guidance :: Definite ( subst) ) => {
558
+ // FIXME need to record an obligation here
558
559
canonicalized. apply_solution ( & mut self . table , subst)
559
560
}
561
+ // FIXME actually we maybe should also accept unknown guidance here
560
562
_ => return Err ( TypeError ) ,
561
563
} ;
562
564
let unsize =
Original file line number Diff line number Diff line change @@ -1267,3 +1267,34 @@ fn test() {
1267
1267
"# ] ] ,
1268
1268
) ;
1269
1269
}
1270
+
1271
+ #[ test]
1272
+ fn bug_11242 ( ) {
1273
+ // FIXME: wrong, should be u32
1274
+ check_types (
1275
+ r#"
1276
+ fn foo<A, B>()
1277
+ where
1278
+ A: IntoIterator<Item = u32>,
1279
+ B: IntoIterator<Item = usize>,
1280
+ {
1281
+ let _x: <A as IntoIterator>::Item;
1282
+ // ^^ {unknown}
1283
+ }
1284
+
1285
+ pub trait Iterator {
1286
+ type Item;
1287
+ }
1288
+
1289
+ pub trait IntoIterator {
1290
+ type Item;
1291
+ type IntoIter: Iterator<Item = Self::Item>;
1292
+ }
1293
+
1294
+ impl<I: Iterator> IntoIterator for I {
1295
+ type Item = I::Item;
1296
+ type IntoIter = I;
1297
+ }
1298
+ "# ,
1299
+ ) ;
1300
+ }
You can’t perform that action at this time.
0 commit comments