Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ where
(
RerunCondition::OpaqueInStorageOrAnyOpaqueHasInferAsHidden(_),
TypingMode::PostAnalysis | TypingMode::Codegen,
) => RerunDecision::No,
) => RerunDecision::Yes,
(
RerunCondition::OpaqueInStorageOrAnyOpaqueHasInferAsHidden(defids),
TypingMode::Typeck { defining_opaque_types_and_generators: opaques },
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//@ compile-flags: -Znext-solver
//@ check-pass

fn mk_vec() -> Vec<Vec<&'static str>> {
loop {}
}

fn parse_feature(feature: &str) -> impl Iterator<Item = &str> {
std::iter::once(feature)
}

fn main() {
// In `codegen_select_candidate`, we try to find impl for `FlatMap::into_iter`
// We try to prove `FlatMap<...>: IntoIterator`.
// The blanket impl requires `FlatMap<...>: Iterator`.
// The `Iterator` impl of `FlatMap` has nested goals:
// `Projection(Fn::Output<parse_feature, (?assoc,)>, iter::Once`.
// We normalize this goal and set rerun condition to `AnyOpaqueHasInferAsHidden`
// with reason `SelfTyInfer` because we instantiated impls with infers when
// assembling candidates for intermediate goals.
// Then we evaluate the normalized goal:
// `Projection(Fn::Output<parse_feature, (&str,)>, iter::Once`.
// The alias term is normalized to rigid alias `impl Iterator<Item = &str>` as
// we're in erased typing mode.
// But the expected term is revealed `iter::Once` thus relating failed.
// The goal fails with rerun condition `OpaqueInStorage(parse_feature::opaque)`.
// I expect this goal to be rerun in `Codegen` typing mode but
// `AnyOpaqueHasInferAsHidden + OpaqueInStorage = OpaqueInStorageOrAnyOpaqueHasInferAsHidden`
// which didn't trigger rerun in codegen typing mode previously.
mk_vec()
.into_iter()
.flatten()
.flat_map(parse_feature).into_iter();
}
Loading