Skip to content

Commit 28e19f1

Browse files
committed
Add little is_test_crate function
1 parent 709a97f commit 28e19f1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_session/src/session.rs

+5
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,11 @@ impl Session {
294294
self.crate_types.get().unwrap().as_slice()
295295
}
296296

297+
/// Returns true if the crate is a testing one.
298+
pub fn is_test_crate(&self) -> bool {
299+
self.opts.test
300+
}
301+
297302
pub fn needs_crate_hash(&self) -> bool {
298303
// Why is the crate hash needed for these configurations?
299304
// - debug_assertions: for the "fingerprint the result" check in

0 commit comments

Comments
 (0)