Closed MaikKlein closed 6 years ago
env RUSTFLAGS="-Z treat-err-as-bug" RUST_BACKTRACE=1 cargo build
revealed that it is most likely the impl trait that causes this error. Sadly I use the impl trait feature pretty often.
0 [normalize_projection_ty] normalizing
Canonical { variables: Slice([CanonicalVarInfo { kind: Region }, CanonicalVarInfo { kind: Region }, CanonicalVarInfo { kind: Region }]), value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: Slice([]), reveal: UserFacing }, value: ProjectionTy { substs: Slice([std::iter::FlatMap<std::slice::Iter<'_, EntryPoint<'_, '_>>, impl std::iter::Iterator, fn(&'_ EntryPoint<'_, '_>) -> impl std::iter::Iterator {EntryPoint<'_, '_>::input_iter}>]), item_def_id: DefId(2/0:1904 ~ core[fc79]::iter[0]::iterator[0]::Iterator[0]::Item[0]) } } }
1 [mir_const] processing
<Entry<'tcx, Input<'tcx>>>::input
2 [mir_validated] processing
<Entry<'tcx, Input<'tcx>>>::input
3 [borrowck] processing
<Entry<'tcx, Input<'tcx>>>::input
After a long debugging session, I could reduce the error to the following lines
let set: HashSet<_> = entry_points
.iter()
.flat_map(EntryPoint::input_iter)
.collect();
Where input_iter
uses the impl trait
Hm this seems to fix the error
let set: HashSet<_> = entry_points
.iter()
.flat_map(|entry| EntryPoint::input_iter(entry))
.collect();