Skip to content

Commit d4bd7f7

Browse files
committed
remove useless cfg[kani] and delete comment
1 parent 5fe6c11 commit d4bd7f7

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

library/core/src/time.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ use crate::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Sub, SubAssign}
2727
#[cfg(kani)]
2828
use crate::kani;
2929

30-
#[cfg(kani)]
3130
use crate::ub_checks::Invariant;
3231

3332
const NANOS_PER_SEC: u32 = 1_000_000_000;
@@ -51,7 +50,6 @@ const DAYS_PER_WEEK: u64 = 7;
5150
#[rustc_layout_scalar_valid_range_end(999_999_999)]
5251
struct Nanoseconds(u32);
5352

54-
#[cfg(kani)]
5553
impl Invariant for Nanoseconds {
5654
fn is_safe(&self) -> bool {
5755
self.0 < NANOS_PER_SEC
@@ -110,10 +108,9 @@ impl Default for Nanoseconds {
110108
#[stable(feature = "duration", since = "1.3.0")]
111109
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
112110
#[cfg_attr(not(test), rustc_diagnostic_item = "Duration")]
113-
#[cfg_attr(kani, derive(Invariant))]
111+
#[derive(Invariant)]
114112
pub struct Duration {
115113
secs: u64,
116-
// #[safety_constraint(*nanos.0 < NANOS_PER_SEC)]
117114
nanos: Nanoseconds, // Always 0 <= nanos < NANOS_PER_SEC
118115
}
119116

0 commit comments

Comments
 (0)