From 96d4b127a8e9ccadf32c4fbdbb5bdb4a12ccb99e Mon Sep 17 00:00:00 2001 From: Justus Adam Date: Mon, 29 Jan 2024 16:56:42 -0500 Subject: [PATCH] Clippy suggestions --- library/kani_macros/src/lib.rs | 2 +- library/kani_macros/src/sysroot/contracts.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/library/kani_macros/src/lib.rs b/library/kani_macros/src/lib.rs index 491d5c2c9df1..32bd44d2ea38 100644 --- a/library/kani_macros/src/lib.rs +++ b/library/kani_macros/src/lib.rs @@ -190,7 +190,7 @@ pub fn modifies(attr: TokenStream, item: TokenStream) -> TokenStream { /// This module implements Kani attributes in a way that only Kani's compiler can understand. /// This code should only be activated when pre-building Kani's sysroot. -//#[cfg(kani_sysroot)] +#[cfg(kani_sysroot)] mod sysroot { use proc_macro_error::{abort, abort_call_site}; diff --git a/library/kani_macros/src/sysroot/contracts.rs b/library/kani_macros/src/sysroot/contracts.rs index 73ce50d179d4..3aeb8c1788d9 100644 --- a/library/kani_macros/src/sysroot/contracts.rs +++ b/library/kani_macros/src/sysroot/contracts.rs @@ -856,9 +856,9 @@ fn is_replace_return_havoc(stmt: &syn::Stmt) -> bool { /// For each argument create an expression that passes this argument along unmodified. /// /// Reconstructs structs that may have been deconstructed with patterns. -fn exprs_for_args<'a, T>( - args: &'a syn::punctuated::Punctuated, -) -> impl Iterator + Clone + 'a { +fn exprs_for_args( + args: &syn::punctuated::Punctuated, +) -> impl Iterator + Clone + '_ { args.iter().map(|arg| match arg { FnArg::Receiver(_) => Expr::Verbatim(quote!(self)), FnArg::Typed(typed) => pat_to_expr(&typed.pat), @@ -1351,7 +1351,7 @@ fn chunks_by<'a, T, C: Default + Extend>( std::iter::from_fn(move || { let mut new = C::default(); let mut empty = true; - while let Some(tok) = iter.next() { + for tok in iter.by_ref() { empty = false; if pred(&tok) { break;