Files
rust/compiler/rustc_thread_pool/tests/double_init_fail.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
498 B
Rust
Raw Normal View History

2025-06-11 12:32:09 -07:00
#![allow(unused_crate_dependencies)]
use std::error::Error;
2025-06-11 12:32:09 -07:00
use rustc_thread_pool::ThreadPoolBuilder;
#[test]
#[cfg_attr(any(target_os = "emscripten", target_family = "wasm"), ignore)]
fn double_init_fail() {
let result1 = ThreadPoolBuilder::new().build_global();
assert!(result1.is_ok());
let err = ThreadPoolBuilder::new().build_global().unwrap_err();
assert!(err.source().is_none());
assert_eq!(err.to_string(), "The global thread pool has already been initialized.",);
}