|
12 | 12 | //! command line options.
|
13 | 13 |
|
14 | 14 | pub use self::EntryFnType::*;
|
15 |
| -pub use self::Passes::*; |
16 | 15 | pub use self::DebugInfoLevel::*;
|
17 | 16 |
|
18 | 17 | use std::str::FromStr;
|
@@ -679,15 +678,15 @@ pub enum CrateType {
|
679 | 678 |
|
680 | 679 | #[derive(Clone, Hash)]
|
681 | 680 | pub enum Passes {
|
682 |
| - SomePasses(Vec<String>), |
683 |
| - AllPasses, |
| 681 | + Some(Vec<String>), |
| 682 | + All, |
684 | 683 | }
|
685 | 684 |
|
686 | 685 | impl Passes {
|
687 | 686 | pub fn is_empty(&self) -> bool {
|
688 | 687 | match *self {
|
689 |
| - SomePasses(ref v) => v.is_empty(), |
690 |
| - AllPasses => false, |
| 688 | + Passes::Some(ref v) => v.is_empty(), |
| 689 | + Passes::All => false, |
691 | 690 | }
|
692 | 691 | }
|
693 | 692 | }
|
@@ -822,8 +821,7 @@ macro_rules! options {
|
822 | 821 |
|
823 | 822 | #[allow(dead_code)]
|
824 | 823 | mod $mod_set {
|
825 |
| - use super::{$struct_name, Passes, SomePasses, AllPasses, Sanitizer, Lto, |
826 |
| - CrossLangLto}; |
| 824 | + use super::{$struct_name, Passes, Sanitizer, Lto, CrossLangLto}; |
827 | 825 | use rustc_target::spec::{LinkerFlavor, PanicStrategy, RelroLevel};
|
828 | 826 | use std::path::PathBuf;
|
829 | 827 |
|
@@ -934,13 +932,13 @@ macro_rules! options {
|
934 | 932 | fn parse_passes(slot: &mut Passes, v: Option<&str>) -> bool {
|
935 | 933 | match v {
|
936 | 934 | Some("all") => {
|
937 |
| - *slot = AllPasses; |
| 935 | + *slot = Passes::All; |
938 | 936 | true
|
939 | 937 | }
|
940 | 938 | v => {
|
941 | 939 | let mut passes = vec![];
|
942 | 940 | if parse_list(&mut passes, v) {
|
943 |
| - *slot = SomePasses(passes); |
| 941 | + *slot = Passes::Some(passes); |
944 | 942 | true
|
945 | 943 | } else {
|
946 | 944 | false
|
@@ -1103,7 +1101,7 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
|
1103 | 1101 | "extra data to put in each output filename"),
|
1104 | 1102 | codegen_units: Option<usize> = (None, parse_opt_uint, [UNTRACKED],
|
1105 | 1103 | "divide crate into N units to optimize in parallel"),
|
1106 |
| - remark: Passes = (SomePasses(Vec::new()), parse_passes, [UNTRACKED], |
| 1104 | + remark: Passes = (Passes::Some(Vec::new()), parse_passes, [UNTRACKED], |
1107 | 1105 | "print remarks for these optimization passes (space separated, or \"all\")"),
|
1108 | 1106 | no_stack_check: bool = (false, parse_bool, [UNTRACKED],
|
1109 | 1107 | "the --no-stack-check flag is deprecated and does nothing"),
|
@@ -2946,7 +2944,7 @@ mod tests {
|
2946 | 2944 | opts.cg.codegen_units = Some(42);
|
2947 | 2945 | assert_eq!(reference.dep_tracking_hash(), opts.dep_tracking_hash());
|
2948 | 2946 |
|
2949 |
| - opts.cg.remark = super::SomePasses(vec![String::from("pass1"), String::from("pass2")]); |
| 2947 | + opts.cg.remark = super::Passes::Some(vec![String::from("pass1"), String::from("pass2")]); |
2950 | 2948 | assert_eq!(reference.dep_tracking_hash(), opts.dep_tracking_hash());
|
2951 | 2949 |
|
2952 | 2950 | opts.cg.save_temps = true;
|
|
0 commit comments