Upgrade Rust to 1.52.0 (#17096)

* Upgrade Rust to 1.52.0
update nightly_version to newly pushed docker image
fix clippy lint errors
1.52 comes with grcov 0.8.0, include this version to script

* upgrade to Rust 1.52.1

* disabling Serum from downstream projects until it is upgraded to Rust 1.52.1
This commit is contained in:
Tao Zhu
2021-05-19 09:31:47 -05:00
committed by GitHub
parent 4788976517
commit 0781fe1b4f
54 changed files with 345 additions and 423 deletions

View File

@ -1,4 +1,4 @@
#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(specialization))]
#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))]
#![allow(clippy::integer_arithmetic)]
use solana_sdk::genesis_config::GenesisConfig;

View File

@ -1881,22 +1881,16 @@ mod tests {
#[test]
fn test_stake_is_bootstrap() {
assert_eq!(
Delegation {
activation_epoch: std::u64::MAX,
..Delegation::default()
}
.is_bootstrap(),
true
);
assert_eq!(
Delegation {
activation_epoch: 0,
..Delegation::default()
}
.is_bootstrap(),
false
);
assert!(Delegation {
activation_epoch: std::u64::MAX,
..Delegation::default()
}
.is_bootstrap());
assert!(!Delegation {
activation_epoch: 0,
..Delegation::default()
}
.is_bootstrap());
}
#[test]
@ -5719,65 +5713,50 @@ mod tests {
custodian,
};
// neither time
assert_eq!(
lockup.is_in_force(
&Clock {
epoch: 0,
unix_timestamp: 0,
..Clock::default()
},
None
),
true
);
assert!(lockup.is_in_force(
&Clock {
epoch: 0,
unix_timestamp: 0,
..Clock::default()
},
None
));
// not timestamp
assert_eq!(
lockup.is_in_force(
&Clock {
epoch: 2,
unix_timestamp: 0,
..Clock::default()
},
None
),
true
);
assert!(lockup.is_in_force(
&Clock {
epoch: 2,
unix_timestamp: 0,
..Clock::default()
},
None
));
// not epoch
assert_eq!(
lockup.is_in_force(
&Clock {
epoch: 0,
unix_timestamp: 2,
..Clock::default()
},
None
),
true
);
assert!(lockup.is_in_force(
&Clock {
epoch: 0,
unix_timestamp: 2,
..Clock::default()
},
None
));
// both, no custodian
assert_eq!(
lockup.is_in_force(
&Clock {
epoch: 1,
unix_timestamp: 1,
..Clock::default()
},
None
),
false
);
assert!(!lockup.is_in_force(
&Clock {
epoch: 1,
unix_timestamp: 1,
..Clock::default()
},
None
));
// neither, but custodian
assert_eq!(
lockup.is_in_force(
&Clock {
epoch: 0,
unix_timestamp: 0,
..Clock::default()
},
Some(&custodian),
),
false,
);
assert!(!lockup.is_in_force(
&Clock {
epoch: 0,
unix_timestamp: 0,
..Clock::default()
},
Some(&custodian),
));
}
#[test]