Skip to content

Commit

Permalink
Rustfmt dictatorship.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhjourdan committed Jul 29, 2024
1 parent fe8811d commit 574b909
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 27 deletions.
20 changes: 6 additions & 14 deletions creusot/src/lints/experimental_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,15 @@ impl<'tcx> LateLintPass<'tcx> for Experimental {
}

if is_str_ty(cx, e) {
cx.opt_span_lint(
EXPERIMENTAL,
Some(e.span),
|lint| {
lint.primary_message("support for string types is limited and experimental");
},
);
cx.opt_span_lint(EXPERIMENTAL, Some(e.span), |lint| {
lint.primary_message("support for string types is limited and experimental");
});
}

if is_dyn_ty(cx, e) {
cx.opt_span_lint(
EXPERIMENTAL,
Some(e.span),
|lint| {
lint.primary_message("support for trait objects (dyn) is limited and experimental");
},
);
cx.opt_span_lint(EXPERIMENTAL, Some(e.span), |lint| {
lint.primary_message("support for trait objects (dyn) is limited and experimental");
});
}
}
}
4 changes: 2 additions & 2 deletions creusot/src/translation/pearlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ impl<'a, 'tcx> ThirTerm<'a, 'tcx> {
Eq => unreachable!(),
Offset => todo!(),
Cmp => todo!(),
AddWithOverflow | SubWithOverflow | MulWithOverflow => todo!()
AddWithOverflow | SubWithOverflow | MulWithOverflow => todo!(),
};
Ok(Term {
ty,
Expand All @@ -398,7 +398,7 @@ impl<'a, 'tcx> ThirTerm<'a, 'tcx> {
let op = match op {
Not => UnOp::Not,
Neg => UnOp::Neg,
PtrMetadata => todo!()
PtrMetadata => todo!(),
};
Ok(Term { ty, span, kind: TermKind::Unary { op, arg: Box::new(arg) } })
}
Expand Down
25 changes: 14 additions & 11 deletions creusot/src/validate_terminates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ pub(crate) fn validate_terminates(ctx: &mut TranslationCtx) {
.try_normalize_erasing_regions(param_env, subst)
{
Ok(subst) => {
match tcx.resolve_instance_raw(param_env.and((item_id, subst))) {
match tcx.resolve_instance_raw(param_env.and((item_id, subst)))
{
Ok(Some(instance)) => {
(instance.def.def_id(), instance.args)
}
Expand Down Expand Up @@ -376,17 +377,19 @@ impl<'thir, 'tcx> thir::visit::Visitor<'thir, 'tcx> for FunctionCalls<'thir, 'tc
if let &FnDef(def_id, subst) = self.thir[fun].ty.kind() {
let subst = EarlyBinder::bind(self.tcx.erase_regions(subst))
.instantiate(self.tcx, self.generic_args);
let (def_id, args) =
match self.tcx.try_normalize_erasing_regions(self.param_env, subst) {
Ok(subst) => {
match self.tcx.resolve_instance_raw(self.param_env.and((def_id, subst)))
{
Ok(Some(instance)) => (instance.def.def_id(), instance.args),
_ => (def_id, subst),
}
let (def_id, args) = match self
.tcx
.try_normalize_erasing_regions(self.param_env, subst)
{
Ok(subst) => {
match self.tcx.resolve_instance_raw(self.param_env.and((def_id, subst)))
{
Ok(Some(instance)) => (instance.def.def_id(), instance.args),
_ => (def_id, subst),
}
Err(_) => (def_id, subst),
};
}
Err(_) => (def_id, subst),
};
self.calls.insert((def_id, fn_span, args));
}
}
Expand Down

0 comments on commit 574b909

Please sign in to comment.