mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
Add a (currently failing) test for #11242
This commit is contained in:
parent
a55dd29e88
commit
82fe1c77b5
@ -555,8 +555,10 @@ impl<'a> InferenceContext<'a> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
Solution::Ambig(Guidance::Definite(subst)) => {
|
Solution::Ambig(Guidance::Definite(subst)) => {
|
||||||
|
// FIXME need to record an obligation here
|
||||||
canonicalized.apply_solution(&mut self.table, subst)
|
canonicalized.apply_solution(&mut self.table, subst)
|
||||||
}
|
}
|
||||||
|
// FIXME actually we maybe should also accept unknown guidance here
|
||||||
_ => return Err(TypeError),
|
_ => return Err(TypeError),
|
||||||
};
|
};
|
||||||
let unsize =
|
let unsize =
|
||||||
|
@ -1267,3 +1267,34 @@ fn test() {
|
|||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn bug_11242() {
|
||||||
|
// FIXME: wrong, should be u32
|
||||||
|
check_types(
|
||||||
|
r#"
|
||||||
|
fn foo<A, B>()
|
||||||
|
where
|
||||||
|
A: IntoIterator<Item = u32>,
|
||||||
|
B: IntoIterator<Item = usize>,
|
||||||
|
{
|
||||||
|
let _x: <A as IntoIterator>::Item;
|
||||||
|
// ^^ {unknown}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub trait Iterator {
|
||||||
|
type Item;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub trait IntoIterator {
|
||||||
|
type Item;
|
||||||
|
type IntoIter: Iterator<Item = Self::Item>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<I: Iterator> IntoIterator for I {
|
||||||
|
type Item = I::Item;
|
||||||
|
type IntoIter = I;
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user