fn main() {
let _: &dyn Iterator<Item=i32> = &vec![1].into_iter();
}
When coercing &'?0 <Vec<{integer}> as IntoIterator>::IntoIter
into &'?1 dyn Iterator<Item=i32>
, we end up with two responses.
The first has a type-outlives constraint like <Vec<{integer}> as IntoIterator>::IntoIter: &'?1
, and the second has one like std::vec::IntoIter<{integer}>: &'?1
. These are identical except for their types being normalized, but that causes us to flounder.
Activity
compiler-errors commentedon Aug 7, 2023
Interestingly, the code with
Box
doesn't fail because theBox::new
constructor causes the type to be normalized due to the argument being a coercion point:compiler-errors commentedon Aug 8, 2023
This may be a problem somewhat specific to
T -> dyn Trait
unsizing -- we could perhaps consider those goals separately withinassemble_blanket_impl_candidates
, and not inassemble_candidates_via_self_ty
.lcnr commentedon Aug 8, 2023
I think we should consider the three way split of "assemble blanket candidates", "assemble_normalization_step_candidates" and "assemble_candidates_via_self_ty" or whatever
consider_unsize_to_dyn_candidate
from other unsize candidates rust#114829Rollup merge of rust-lang#114829 - compiler-errors:next-solver-only-u…