Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conv generic predicates of all items before sortck #986

Merged
merged 1 commit into from
Feb 4, 2025
Merged
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
5 changes: 5 additions & 0 deletions crates/flux-fhir-analysis/src/wf/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,15 @@ impl<'a, 'genv, 'tcx> Wf<'a, 'genv, 'tcx> {
match &item.kind {
fhir::ItemKind::Enum(enum_def) => {
cx.conv_enum_variants(def_id, enum_def)?;
cx.conv_generic_predicates(def_id, &item.generics)?;
}
fhir::ItemKind::Struct(struct_def) => {
cx.conv_struct_variant(def_id, struct_def)?;
cx.conv_generic_predicates(def_id, &item.generics)?;
}
fhir::ItemKind::TyAlias(ty_alias) => {
cx.conv_type_alias(def_id, ty_alias)?;
cx.conv_generic_predicates(def_id, &item.generics)?;
}
fhir::ItemKind::Trait(trait_) => {
for assoc_reft in trait_.assoc_refinements {
Expand All @@ -223,6 +226,7 @@ impl<'a, 'genv, 'tcx> Wf<'a, 'genv, 'tcx> {
)?;
}
}
cx.conv_generic_predicates(def_id, &item.generics)?;
}
fhir::ItemKind::Impl(impl_) => {
for assoc_reft in impl_.assoc_refinements {
Expand All @@ -232,6 +236,7 @@ impl<'a, 'genv, 'tcx> Wf<'a, 'genv, 'tcx> {
&assoc_reft.output,
)?;
}
cx.conv_generic_predicates(def_id, &item.generics)?;
}
fhir::ItemKind::Fn(fn_sig) => {
cx.conv_fn_sig(def_id, fn_sig)?;
Expand Down
3 changes: 3 additions & 0 deletions tests/tests/pos/surface/issue-983.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub struct FromFn<F>(F)
where
F: Fn(&mut core::fmt::Formatter<'_>) -> core::fmt::Result;
Loading