mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
Add len() method to OutputTypes
This commit is contained in:
parent
f15e5c133e
commit
8414520436
@ -246,6 +246,10 @@ impl OutputTypes {
|
||||
self.0.values()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.0.len()
|
||||
}
|
||||
|
||||
// True if any of the output types require codegen or linking.
|
||||
pub fn should_trans(&self) -> bool {
|
||||
self.0.keys().any(|k| match *k {
|
||||
|
@ -168,7 +168,7 @@ pub fn compile_input(trans: Box<TransCrate>,
|
||||
|
||||
write_out_deps(sess, &outputs, &output_paths);
|
||||
if sess.opts.output_types.contains_key(&OutputType::DepInfo) &&
|
||||
sess.opts.output_types.keys().count() == 1 {
|
||||
sess.opts.output_types.len() == 1 {
|
||||
return Ok(())
|
||||
}
|
||||
|
||||
|
@ -835,7 +835,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> {
|
||||
|
||||
fn metadata_output_only(&self) -> bool {
|
||||
// MIR optimisation can be skipped when we're just interested in the metadata.
|
||||
self.tcx.sess.opts.output_types.keys().count() == 1 &&
|
||||
self.tcx.sess.opts.output_types.len() == 1 &&
|
||||
self.tcx.sess.opts.output_types.contains_key(&OutputType::Metadata)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user