Skip to content

Commit

Permalink
phew, tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
Ranjit Jhala committed Oct 29, 2023
1 parent 0b537d0 commit 6be28d7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
6 changes: 3 additions & 3 deletions crates/flux-fhir-analysis/src/wf/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,11 @@ impl<'a, 'tcx> Wf<'a, 'tcx> {
fhir::TyKind::BaseTy(_) | fhir::TyKind::Indexed(_, _) => Ok(()),
fhir::TyKind::Tuple(tys) => {
for ty in tys {
self.check_ty_is_base(&ty)?
self.check_ty_is_base(ty)?;
}
Ok(())
}
fhir::TyKind::Constr(_, ty) | fhir::TyKind::Exists(_, ty) => self.check_ty_is_base(&ty),
fhir::TyKind::Constr(_, ty) | fhir::TyKind::Exists(_, ty) => self.check_ty_is_base(ty),

fhir::TyKind::Ptr(_, _)
| fhir::TyKind::Ref(_, _)
Expand All @@ -415,7 +415,7 @@ impl<'a, 'tcx> Wf<'a, 'tcx> {
for (arg, param) in args.iter().zip(generics.params.iter()) {
if param.kind == GenericParamDefKind::SplTy {
if let fhir::GenericArg::Type(ty) = arg {
self.check_ty_is_base(ty)?
self.check_ty_is_base(ty)?;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/flux-middle/src/fhir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ impl Generics {
} else {
param.kind
};
params.push(GenericParam { def_id: param.def_id, kind })
params.push(GenericParam { def_id: param.def_id, kind });
}
Generics { params }
}
Expand Down
6 changes: 3 additions & 3 deletions crates/flux-middle/src/fhir/lift.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ pub fn lift_refined_by(tcx: TyCtxt, owner_id: OwnerId) -> fhir::RefinedBy {
}
}

pub fn lift_generics<'a, 'tcx>(
tcx: TyCtxt<'tcx>,
sess: &'a FluxSession,
pub fn lift_generics(
tcx: TyCtxt,
sess: &FluxSession,
owner_id: OwnerId,
) -> Result<fhir::Generics, ErrorGuaranteed> {
LiftCtxt::new(tcx, sess, owner_id, None).lift_generics()
Expand Down
6 changes: 2 additions & 4 deletions crates/flux-middle/src/rty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,13 +440,11 @@ impl GenericArg {
}
}
pub fn is_valid_base_arg(&self) -> bool {
let res = match self {
match self {
GenericArg::Ty(ty) => ty.kind().is_valid_base_ty(),
GenericArg::BaseTy(bty) => bty.skip_binder_as_ref().kind().is_valid_base_ty(),
_ => false,
};
// println!("TRACE: is_valid_base arg: {:?} => {res:?}", self);
res
}
}

fn from_param_def(param: &GenericParamDef) -> Self {
Expand Down

0 comments on commit 6be28d7

Please sign in to comment.