File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed
compiler/rustc_session/src Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,21 @@ impl Options {
107107 . mir_opt_level
108108 . unwrap_or_else ( || if self . optimize != OptLevel :: No { 2 } else { 1 } )
109109 }
110+
111+ pub fn instrument_coverage ( & self ) -> bool {
112+ self . debugging_opts . instrument_coverage . unwrap_or ( InstrumentCoverage :: Off )
113+ != InstrumentCoverage :: Off
114+ }
115+
116+ pub fn instrument_coverage_except_unused_generics ( & self ) -> bool {
117+ self . debugging_opts . instrument_coverage . unwrap_or ( InstrumentCoverage :: Off )
118+ == InstrumentCoverage :: ExceptUnusedGenerics
119+ }
120+
121+ pub fn instrument_coverage_except_unused_functions ( & self ) -> bool {
122+ self . debugging_opts . instrument_coverage . unwrap_or ( InstrumentCoverage :: Off )
123+ == InstrumentCoverage :: ExceptUnusedFunctions
124+ }
110125}
111126
112127top_level_options ! (
Original file line number Diff line number Diff line change @@ -1044,18 +1044,15 @@ impl Session {
10441044 }
10451045
10461046 pub fn instrument_coverage ( & self ) -> bool {
1047- self . opts . debugging_opts . instrument_coverage . unwrap_or ( config:: InstrumentCoverage :: Off )
1048- != config:: InstrumentCoverage :: Off
1047+ self . opts . instrument_coverage ( )
10491048 }
10501049
10511050 pub fn instrument_coverage_except_unused_generics ( & self ) -> bool {
1052- self . opts . debugging_opts . instrument_coverage . unwrap_or ( config:: InstrumentCoverage :: Off )
1053- == config:: InstrumentCoverage :: ExceptUnusedGenerics
1051+ self . opts . instrument_coverage_except_unused_generics ( )
10541052 }
10551053
10561054 pub fn instrument_coverage_except_unused_functions ( & self ) -> bool {
1057- self . opts . debugging_opts . instrument_coverage . unwrap_or ( config:: InstrumentCoverage :: Off )
1058- == config:: InstrumentCoverage :: ExceptUnusedFunctions
1055+ self . opts . instrument_coverage_except_unused_functions ( )
10591056 }
10601057
10611058 pub fn is_proc_macro_attr ( & self , attr : & Attribute ) -> bool {
You can’t perform that action at this time.
0 commit comments