Skip to content
/ rust Public
forked from rust-lang/rust

Commit 0c474ac

Browse files
committed
Use generic NonZero everywhere else.
1 parent 36d194f commit 0c474ac

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

Diff for: library/proc_macro/src/bridge/symbol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ thread_local! {
136136
arena: arena::Arena::new(),
137137
names: fxhash::FxHashMap::default(),
138138
strings: Vec::new(),
139-
// Start with a base of 1 to make sure that `NonZeroU32` works.
139+
// Start with a base of 1 to make sure that `NonZero<u32>` works.
140140
sym_base: NonZero::new(1).unwrap(),
141141
});
142142
}

Diff for: library/test/src/helpers/concurrency.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
//! Helper module which helps to determine amount of threads to be used
22
//! during tests execution.
3-
use std::{env, num::NonZeroUsize, thread};
3+
use std::{env, num::NonZero, thread};
44

55
pub fn get_concurrency() -> usize {
66
if let Ok(value) = env::var("RUST_TEST_THREADS") {
7-
match value.parse::<NonZeroUsize>().ok() {
7+
match value.parse::<NonZero<usize>>().ok() {
88
Some(n) => n.get(),
99
_ => panic!("RUST_TEST_THREADS is `{value}`, should be a positive integer."),
1010
}

Diff for: library/test/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#![unstable(feature = "test", issue = "50297")]
1818
#![doc(test(attr(deny(warnings))))]
1919
#![doc(rust_logo)]
20+
#![feature(generic_nonzero)]
2021
#![feature(rustdoc_internals)]
2122
#![feature(internal_output_capture)]
2223
#![feature(staged_api)]

0 commit comments

Comments
 (0)