diff --git a/rr_frontend/.cargo/config.toml b/rr_frontend/.cargo/config.toml index ad1bf08cd48fdd1eae7a92b06b54bb71f1130540..87aa305236897fbd121091d74053be62b458a274 100644 --- a/rr_frontend/.cargo/config.toml +++ b/rr_frontend/.cargo/config.toml @@ -32,7 +32,6 @@ rustflags = [ "-Aclippy::string_lit_as_bytes", # clippy::pedantic - "-Aclippy::semicolon_if_nothing_returned", "-Aclippy::trivially_copy_pass_by_ref", "-Aclippy::unnecessary_wraps", "-Aclippy::unused_self", diff --git a/rr_frontend/attribute_parse/src/parse.rs b/rr_frontend/attribute_parse/src/parse.rs index 6f868f2bafcdfa9e2397db574051aa4f2ff182cc..cb9366a9add8f67d2f193ec8a65c3539c25584a7 100644 --- a/rr_frontend/attribute_parse/src/parse.rs +++ b/rr_frontend/attribute_parse/src/parse.rs @@ -150,7 +150,7 @@ impl ParseBuffer { } pub fn advance(&self, n: usize) { - self.index.set(self.index.get() + n) + self.index.set(self.index.get() + n); } pub fn advance_get(&self) -> ParseResult<&TokenTree> { diff --git a/rr_frontend/radium/src/code.rs b/rr_frontend/radium/src/code.rs index e2d20b509f17e09728b575cba37f9101ad38fce1..1bb4a2eb7d440cc86776ede4d1d13a63cc596245 100644 --- a/rr_frontend/radium/src/code.rs +++ b/rr_frontend/radium/src/code.rs @@ -1348,7 +1348,7 @@ impl<'def> FunctionBuilder<'def> { /// Add a manual tactic used for a sidecondition proof. pub fn add_manual_tactic(&mut self, tac: &str) { - self.tactics.push(tac.to_string()) + self.tactics.push(tac.to_string()); } /// Add a generic type used by this function. diff --git a/rr_frontend/radium/src/coq.rs b/rr_frontend/radium/src/coq.rs index 31cb615c05799e870d436822347489d4e821bce5..df073166ffd350f6becff0c644cc7972e1a0da1f 100644 --- a/rr_frontend/radium/src/coq.rs +++ b/rr_frontend/radium/src/coq.rs @@ -473,7 +473,7 @@ impl CoqTopLevelAssertions { } pub fn push(&mut self, a: CoqTopLevelAssertion) { - self.0.push(a) + self.0.push(a); } } diff --git a/rr_frontend/radium/src/specs.rs b/rr_frontend/radium/src/specs.rs index 966144fc9ec5719e8250bd354c7a312f41d54d07..ba6c80bbe8db6d037b058c24db5be1c0df6d63c5 100644 --- a/rr_frontend/radium/src/specs.rs +++ b/rr_frontend/radium/src/specs.rs @@ -653,7 +653,7 @@ impl<'def> Type<'def> { Self::MutRef(box ty, lft) | Self::ShrRef(box ty, lft) => { s.insert(lft.to_string()); - ty.get_ty_lfts(s) + ty.get_ty_lfts(s); }, Self::BoxType(box ty) => ty.get_ty_lfts(s), @@ -684,7 +684,7 @@ impl<'def> Type<'def> { | Self::RawPtr => (), Self::MutRef(box ty, _) | Self::ShrRef(box ty, _) | Self::BoxType(box ty) => { - ty.get_ty_wf_elctx(s) + ty.get_ty_wf_elctx(s); }, Self::Literal(lit) => lit.get_ty_wf_elctx(s), @@ -718,16 +718,19 @@ impl<'def> Type<'def> { { match self { Self::MutRef(box t, _) | Self::ShrRef(box t, _) | Self::BoxType(box t) => { - t.subst_core(substi, to_type) + t.subst_core(substi, to_type); }, + Self::Struct(s) => { // the struct def itself should be closed, but the arguments to it may contain // further variables s.ty_params.iter_mut().map(|a| a.subst_core(substi, to_type)).count(); }, + Self::Enum(s) => { s.ty_params.iter_mut().map(|a| a.subst_core(substi, to_type)).count(); }, + Self::Var(i) => { if let Some(Some(ta)) = substi.get(*i) { let ta_ty: Type<'def> = to_type(ta); @@ -735,6 +738,7 @@ impl<'def> Type<'def> { *self = ta_ty; } }, + _ => (), } } @@ -744,12 +748,12 @@ impl<'def> Type<'def> { /// The types in `substi` should not contain variables themselves, as this substitution /// operation is capture-incurring! pub fn subst(&mut self, substi: &[Option<Type<'def>>]) { - self.subst_core(substi, &Clone::clone) + self.subst_core(substi, &Clone::clone); } /// Substitute variables `Var` with `substi`. See `subst` for documentation. pub fn subst_params(&mut self, substi: &[Option<LiteralTyParam>]) { - self.subst_core(substi, &|x| Type::LiteralParam(x.clone())) + self.subst_core(substi, &|x| Type::LiteralParam(x.clone())); } } diff --git a/rr_frontend/translation/src/environment/borrowck/regions.rs b/rr_frontend/translation/src/environment/borrowck/regions.rs index a6ddc213baa88b6e0bd47f9ddcd64b375ee652ce..b7a7de6833100f403295d0fe17623d75fab42bd1 100644 --- a/rr_frontend/translation/src/environment/borrowck/regions.rs +++ b/rr_frontend/translation/src/environment/borrowck/regions.rs @@ -109,7 +109,7 @@ fn extract_region(place_regions: &mut PlaceRegions, local: mir::Local, ty: ty::T for (i, ty) in types.iter().enumerate() { match ty.kind() { ty::TyKind::Ref(region, _, _) => { - place_regions.add(local, vec![i], extract_region_id(region)) + place_regions.add(local, vec![i], extract_region_id(region)); }, _ => { // TODO descend into nested types (nested tuples/structs) ? diff --git a/rr_frontend/translation/src/environment/collect_closure_defs_visitor.rs b/rr_frontend/translation/src/environment/collect_closure_defs_visitor.rs index a6e092b08cec1880a2e7a6dfed8a3cd1937468c7..295c4ed10950d722d7f0f363452b0155dda9a6c8 100644 --- a/rr_frontend/translation/src/environment/collect_closure_defs_visitor.rs +++ b/rr_frontend/translation/src/environment/collect_closure_defs_visitor.rs @@ -48,6 +48,6 @@ impl<'env, 'tcx> Visitor<'tcx> for CollectClosureDefsVisitor<'env, 'tcx> { self.result.push(*local_def_id); } - walk_expr(self, expr) + walk_expr(self, expr); } } diff --git a/rr_frontend/translation/src/traits.rs b/rr_frontend/translation/src/traits.rs index 33039e07a79bf41b2058a6129139bbfb2eff17e2..a0fe5d11bc42d471e7c53963fcf05ea1a9ce1a1f 100644 --- a/rr_frontend/translation/src/traits.rs +++ b/rr_frontend/translation/src/traits.rs @@ -42,24 +42,21 @@ pub fn resolve_impl_source<'tcx>( let substs = tcx.normalize_erasing_regions(param_env, substs); // Check if the `did` is an associated item - let trait_ref; - if let Some(item) = tcx.opt_associated_item(did) { + let trait_ref = if let Some(item) = tcx.opt_associated_item(did) { match item.container { - AssocItemContainer::TraitContainer => - // this is part of a trait declaration - { - trait_ref = TraitRef::new(tcx, item.container_id(tcx), substs) + AssocItemContainer::TraitContainer => { + // this is part of a trait declaration + TraitRef::new(tcx, item.container_id(tcx), substs) }, - AssocItemContainer::ImplContainer => - // this is part of an implementation of a trait - { - trait_ref = tcx.impl_trait_ref(item.container_id(tcx))?.instantiate(tcx, substs) + AssocItemContainer::ImplContainer => { + // this is part of an implementation of a trait + tcx.impl_trait_ref(item.container_id(tcx))?.instantiate(tcx, substs) }, } } else { // Otherwise, check if it's a reference to a trait itself if tcx.is_trait(did) { - trait_ref = TraitRef::new(tcx, did, substs) + TraitRef::new(tcx, did, substs) } else { return None; }