Skip to content

Commit

Permalink
fix unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
carolynzech committed Sep 19, 2024
1 parent 33b9d2f commit 20696bf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
7 changes: 3 additions & 4 deletions library/contracts/safety/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

use proc_macro::TokenStream;
use proc_macro_error::proc_macro_error;
use syn::{Fields, ItemStruct, parse_macro_input};
use syn::spanned::Spanned;
use quote::{quote, quote_spanned};
use syn::{ItemStruct, parse_macro_input};
use quote::quote;

#[cfg(kani_host)]
#[path = "kani.rs"]
Expand All @@ -20,7 +19,7 @@ mod tool;
pub fn invariant(attr: TokenStream, item: TokenStream) -> TokenStream {
let safe_body = proc_macro2::TokenStream::from(attr);
let item = parse_macro_input!(item as ItemStruct);
let mut item_name = &item.ident;
let item_name = &item.ident;
let (impl_generics, ty_generics, where_clause) = item.generics.split_for_impl();

let expanded = quote! {
Expand Down
4 changes: 3 additions & 1 deletion library/core/src/alloc/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ use safety::{invariant, requires};
use crate::error::Error;
use crate::ptr::{Alignment, NonNull};
use crate::{assert_unsafe_precondition, cmp, fmt, mem};
use crate::ub_checks::Invariant;

#[cfg(kani)]
use crate::kani;

#[cfg(kani)]
use crate::ub_checks::Invariant;

// While this function is used in one place and its implementation
// could be inlined, the previous attempts to do so made rustc
// slower:
Expand Down
5 changes: 4 additions & 1 deletion library/core/src/ptr/alignment.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
use safety::{ensures, invariant, requires};
use crate::num::NonZero;
use crate::ub_checks::{assert_unsafe_precondition, Invariant};
use crate::ub_checks::assert_unsafe_precondition;
use crate::{cmp, fmt, hash, mem, num};

#[cfg(kani)]
use crate::kani;

#[cfg(kani)]
use crate::ub_checks::Invariant;

/// A type storing a `usize` which is a power of two, and thus
/// represents a possible alignment in the Rust abstract machine.
///
Expand Down

0 comments on commit 20696bf

Please sign in to comment.