Skip to content

Commit 0809b41

Browse files
committed
Move supports_parallel from CodegenBackend to ExtraBackendMethods
It is only relevant when using cg_ssa for driving compilation.
1 parent 0fd257d commit 0809b41

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

compiler/rustc_codegen_ssa/src/back/write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ pub struct CodegenContext<B: WriteBackendMethods> {
383383
pub coordinator_send: Sender<Box<dyn Any + Send>>,
384384
/// `true` if the codegen should be run in parallel.
385385
///
386-
/// Depends on [`CodegenBackend::supports_parallel()`] and `-Zno_parallel_backend`.
386+
/// Depends on [`ExtraBackendMethods::supports_parallel()`] and `-Zno_parallel_backend`.
387387
pub parallel: bool,
388388
}
389389

compiler/rustc_codegen_ssa/src/traits/backend.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,6 @@ pub trait CodegenBackend {
9797
fn link(&self, sess: &Session, codegen_results: CodegenResults, outputs: &OutputFilenames) {
9898
link_binary(sess, &ArArchiveBuilderBuilder, codegen_results, outputs);
9999
}
100-
101-
/// Returns `true` if this backend can be safely called from multiple threads.
102-
///
103-
/// Defaults to `true`.
104-
fn supports_parallel(&self) -> bool {
105-
true
106-
}
107100
}
108101

109102
pub trait ExtraBackendMethods:
@@ -144,4 +137,11 @@ pub trait ExtraBackendMethods:
144137
{
145138
std::thread::Builder::new().name(name).spawn(f)
146139
}
140+
141+
/// Returns `true` if this backend can be safely called from multiple threads.
142+
///
143+
/// Defaults to `true`.
144+
fn supports_parallel(&self) -> bool {
145+
true
146+
}
147147
}

0 commit comments

Comments
 (0)