@@ -786,30 +786,14 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
786786 opt:: multi ( "" , "extern" , "Specify where an external rust library is \
787787 located",
788788 "NAME=PATH" ) ,
789- opt:: opt ( "" , "opt-level" , "Optimize with possible levels 0-3" , "LEVEL" ) ,
790789 opt:: opt ( "" , "sysroot" , "Override the system root" , "PATH" ) ,
791790 opt:: multi ( "Z" , "" , "Set internal debugging options" , "FLAG" ) ,
792791 opt:: opt ( "" , "color" , "Configure coloring of output:
793792 auto = colorize, if output goes to a tty (default);
794793 always = always colorize output;
795794 never = never colorize output" , "auto|always|never" ) ,
796795
797- // DEPRECATED
798- opt:: flag ( "" , "print-crate-name" , "Output the crate name and exit" ) ,
799- opt:: flag ( "" , "print-file-name" , "Output the file(s) that would be \
800- written if compilation \
801- continued and exit") ,
802- opt:: opt ( "" , "debuginfo" , "Emit DWARF debug info to the objects created:
803- 0 = no debug info,
804- 1 = line-tables only (for stacktraces and breakpoints),
805- 2 = full debug info with variable and type information \
806- (same as -g)", "LEVEL" ) ,
807- opt:: flag ( "" , "no-trans" , "Run all passes except translation; no output" ) ,
808- opt:: flag ( "" , "no-analysis" , "Parse and expand the source, but run no \
809- analysis and produce no output") ,
810- opt:: flag ( "" , "parse-only" , "Parse only; do not compile, assemble, \
811- or link") ,
812- opt:: flagopt ( "" , "pretty" ,
796+ opt:: flagopt_u ( "" , "pretty" ,
813797 "Pretty-print the input instead of compiling;
814798 valid types are: `normal` (un-annotated source),
815799 `expanded` (crates expanded),
@@ -823,9 +807,6 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
823807 `everybody_loops` (all function bodies replaced with `loop {}`)." ,
824808 "TYPE" ) ,
825809 opt:: opt_u ( "" , "show-span" , "Show spans for compiler debugging" , "expr|pat|ty" ) ,
826- opt:: flagopt ( "" , "dep-info" ,
827- "Output dependency info to <filename> after compiling, \
828- in a format suitable for use by Makefiles", "FILENAME" ) ,
829810 ] ) ;
830811 opts
831812}
@@ -861,27 +842,9 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
861842
862843 let debugging_opts = build_debugging_options ( matches) ;
863844
864- let parse_only = if matches. opt_present ( "parse-only" ) {
865- // FIXME(acrichto) remove this eventually
866- early_warn ( "--parse-only is deprecated in favor of -Z parse-only" ) ;
867- true
868- } else {
869- debugging_opts. parse_only
870- } ;
871- let no_trans = if matches. opt_present ( "no-trans" ) {
872- // FIXME(acrichto) remove this eventually
873- early_warn ( "--no-trans is deprecated in favor of -Z no-trans" ) ;
874- true
875- } else {
876- debugging_opts. no_trans
877- } ;
878- let no_analysis = if matches. opt_present ( "no-analysis" ) {
879- // FIXME(acrichto) remove this eventually
880- early_warn ( "--no-analysis is deprecated in favor of -Z no-analysis" ) ;
881- true
882- } else {
883- debugging_opts. no_analysis
884- } ;
845+ let parse_only = debugging_opts. parse_only ;
846+ let no_trans = debugging_opts. no_trans ;
847+ let no_analysis = debugging_opts. no_analysis ;
885848
886849 if debugging_opts. debug_llvm {
887850 unsafe { llvm:: LLVMSetDebug ( 1 ) ; }
@@ -921,28 +884,10 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
921884 host_triple ( ) . to_string ( ) ) ;
922885 let opt_level = {
923886 if matches. opt_present ( "O" ) {
924- if matches. opt_present ( "opt-level" ) {
925- early_error ( "-O and --opt-level both provided" ) ;
926- }
927887 if cg. opt_level . is_some ( ) {
928888 early_error ( "-O and -C opt-level both provided" ) ;
929889 }
930890 Default
931- } else if matches. opt_present ( "opt-level" ) {
932- // FIXME(acrichto) remove this eventually
933- early_warn ( "--opt-level=N is deprecated in favor of -C opt-level=N" ) ;
934- match matches. opt_str ( "opt-level" ) . as_ref ( ) . map ( |s| s. as_slice ( ) ) {
935- None |
936- Some ( "0" ) => No ,
937- Some ( "1" ) => Less ,
938- Some ( "2" ) => Default ,
939- Some ( "3" ) => Aggressive ,
940- Some ( arg) => {
941- early_error ( & format ! ( "optimization level needs to be \
942- between 0-3 (instead was `{}`)",
943- arg) [ ] ) ;
944- }
945- }
946891 } else {
947892 match cg. opt_level {
948893 None => No ,
@@ -960,27 +905,10 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
960905 } ;
961906 let gc = debugging_opts. gc ;
962907 let debuginfo = if matches. opt_present ( "g" ) {
963- if matches. opt_present ( "debuginfo" ) {
964- early_error ( "-g and --debuginfo both provided" ) ;
965- }
966908 if cg. debuginfo . is_some ( ) {
967909 early_error ( "-g and -C debuginfo both provided" ) ;
968910 }
969911 FullDebugInfo
970- } else if matches. opt_present ( "debuginfo" ) {
971- // FIXME(acrichto) remove this eventually
972- early_warn ( "--debuginfo=N is deprecated in favor of -C debuginfo=N" ) ;
973- match matches. opt_str ( "debuginfo" ) . as_ref ( ) . map ( |s| s. as_slice ( ) ) {
974- Some ( "0" ) => NoDebugInfo ,
975- Some ( "1" ) => LimitedDebugInfo ,
976- None |
977- Some ( "2" ) => FullDebugInfo ,
978- Some ( arg) => {
979- early_error ( & format ! ( "debug info level needs to be between \
980- 0-2 (instead was `{}`)",
981- arg) [ ] ) ;
982- }
983- }
984912 } else {
985913 match cg. debuginfo {
986914 None | Some ( 0 ) => NoDebugInfo ,
@@ -1036,15 +964,9 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
1036964
1037965 let cfg = parse_cfgspecs ( matches. opt_strs ( "cfg" ) ) ;
1038966 let test = matches. opt_present ( "test" ) ;
1039- let write_dependency_info = if matches. opt_present ( "dep-info" ) {
1040- // FIXME(acrichto) remove this eventually
1041- early_warn ( "--dep-info has been deprecated in favor of --emit" ) ;
1042- ( true , matches. opt_str ( "dep-info" ) . map ( |p| Path :: new ( p) ) )
1043- } else {
1044- ( output_types. contains ( & OutputTypeDepInfo ) , None )
1045- } ;
967+ let write_dependency_info = ( output_types. contains ( & OutputTypeDepInfo ) , None ) ;
1046968
1047- let mut prints = matches. opt_strs ( "print" ) . into_iter ( ) . map ( |s| {
969+ let prints = matches. opt_strs ( "print" ) . into_iter ( ) . map ( |s| {
1048970 match s. as_slice ( ) {
1049971 "crate-name" => PrintRequest :: CrateName ,
1050972 "file-names" => PrintRequest :: FileNames ,
@@ -1054,18 +976,6 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
1054976 }
1055977 }
1056978 } ) . collect :: < Vec < _ > > ( ) ;
1057- if matches. opt_present ( "print-crate-name" ) {
1058- // FIXME(acrichto) remove this eventually
1059- early_warn ( "--print-crate-name has been deprecated in favor of \
1060- --print crate-name") ;
1061- prints. push ( PrintRequest :: CrateName ) ;
1062- }
1063- if matches. opt_present ( "print-file-name" ) {
1064- // FIXME(acrichto) remove this eventually
1065- early_warn ( "--print-file-name has been deprecated in favor of \
1066- --print file-names") ;
1067- prints. push ( PrintRequest :: FileNames ) ;
1068- }
1069979
1070980 if !cg. remark . is_empty ( ) && debuginfo == NoDebugInfo {
1071981 early_warn ( "-C remark will not show source locations without \
0 commit comments