Move instrument coverage config getters to Options
This commit is contained in:
parent
386b1c5f57
commit
a0de6346de
2 changed files with 18 additions and 6 deletions
|
@ -107,6 +107,21 @@ impl Options {
|
|||
.mir_opt_level
|
||||
.unwrap_or_else(|| if self.optimize != OptLevel::No { 2 } else { 1 })
|
||||
}
|
||||
|
||||
pub fn instrument_coverage(&self) -> bool {
|
||||
self.debugging_opts.instrument_coverage.unwrap_or(InstrumentCoverage::Off)
|
||||
!= InstrumentCoverage::Off
|
||||
}
|
||||
|
||||
pub fn instrument_coverage_except_unused_generics(&self) -> bool {
|
||||
self.debugging_opts.instrument_coverage.unwrap_or(InstrumentCoverage::Off)
|
||||
== InstrumentCoverage::ExceptUnusedGenerics
|
||||
}
|
||||
|
||||
pub fn instrument_coverage_except_unused_functions(&self) -> bool {
|
||||
self.debugging_opts.instrument_coverage.unwrap_or(InstrumentCoverage::Off)
|
||||
== InstrumentCoverage::ExceptUnusedFunctions
|
||||
}
|
||||
}
|
||||
|
||||
top_level_options!(
|
||||
|
|
|
@ -1044,18 +1044,15 @@ impl Session {
|
|||
}
|
||||
|
||||
pub fn instrument_coverage(&self) -> bool {
|
||||
self.opts.debugging_opts.instrument_coverage.unwrap_or(config::InstrumentCoverage::Off)
|
||||
!= config::InstrumentCoverage::Off
|
||||
self.opts.instrument_coverage()
|
||||
}
|
||||
|
||||
pub fn instrument_coverage_except_unused_generics(&self) -> bool {
|
||||
self.opts.debugging_opts.instrument_coverage.unwrap_or(config::InstrumentCoverage::Off)
|
||||
== config::InstrumentCoverage::ExceptUnusedGenerics
|
||||
self.opts.instrument_coverage_except_unused_generics()
|
||||
}
|
||||
|
||||
pub fn instrument_coverage_except_unused_functions(&self) -> bool {
|
||||
self.opts.debugging_opts.instrument_coverage.unwrap_or(config::InstrumentCoverage::Off)
|
||||
== config::InstrumentCoverage::ExceptUnusedFunctions
|
||||
self.opts.instrument_coverage_except_unused_functions()
|
||||
}
|
||||
|
||||
pub fn is_proc_macro_attr(&self, attr: &Attribute) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue