Skip to content

Commit 0d6bc31

Browse files
committed
fix tests
1 parent f27d156 commit 0d6bc31

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

Cargo.lock.msrv

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "1.21.0"
44
authors = ["Aleksey Kladov <[email protected]>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.60"
7+
rust-version = "1.70"
88

99
description = "Single assignment cells and lazy values."
1010
readme = "README.md"

tests/it/race.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ fn once_bool_set() {
130130
#[test]
131131
fn get_unchecked() {
132132
let cell = OnceNonZeroUsize::new();
133-
cell.set(NonZeroUsize::new(92).unwrap());
133+
cell.set(NonZeroUsize::new(92).unwrap()).unwrap();
134134
let value = unsafe { cell.get_unchecked() };
135135
assert_eq!(value, NonZeroUsize::new(92).unwrap());
136136
}

tests/it/race_once_box.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ fn onece_box_with_value() {
154154
fn onece_box_clone() {
155155
let cell1 = OnceBox::new();
156156
let cell2 = cell1.clone();
157-
cell1.set(Box::new(92));
157+
cell1.set(Box::new(92)).unwrap();
158158
let cell3 = cell1.clone();
159159
assert_eq!(cell1.get(), Some(&92));
160160
assert_eq!(cell2.get(), None);

xtask/src/main.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ use std::time::Instant;
55

66
use xshell::{cmd, Shell};
77

8-
const MSRV: &str = "1.60.0";
9-
108
fn main() -> xshell::Result<()> {
119
let sh = Shell::new()?;
1210

@@ -53,14 +51,21 @@ fn main() -> xshell::Result<()> {
5351

5452
{
5553
let _s = section("TEST_MSRV");
56-
let _e = push_toolchain(&sh, MSRV)?;
54+
let msrv = {
55+
let manifest = sh.read_file("Cargo.toml")?;
56+
let (_, suffix) = manifest.split_once("rust-version = \"").unwrap();
57+
let (version, _) = suffix.split_once("\"").unwrap();
58+
version.to_string()
59+
};
60+
61+
let _e = push_toolchain(&sh, &msrv)?;
5762
sh.copy_file("Cargo.lock.msrv", "Cargo.lock")?;
5863
if let err @ Err(_) = cmd!(sh, "cargo update -w -v --locked").run() {
5964
// `Cargo.lock.msrv` is out of date! Probably from having bumped our own version number.
6065
println! {"\
6166
Error: `Cargo.lock.msrv` is out of date. \
6267
Please run:\n \
63-
(cp Cargo.lock{{.msrv,}} && cargo +{MSRV} update -w -v && cp Cargo.lock{{.msrv,}})\n\
68+
(cp Cargo.lock{{.msrv,}} && cargo +{msrv} update -w -v && cp Cargo.lock{{.msrv,}})\n\
6469
\n\
6570
Alternatively, `git apply` the `.patch` below:\
6671
"}

0 commit comments

Comments
 (0)