@@ -786,30 +786,14 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
786
786
opt:: multi ( "" , "extern" , "Specify where an external rust library is \
787
787
located",
788
788
"NAME=PATH" ) ,
789
- opt:: opt ( "" , "opt-level" , "Optimize with possible levels 0-3" , "LEVEL" ) ,
790
789
opt:: opt ( "" , "sysroot" , "Override the system root" , "PATH" ) ,
791
790
opt:: multi ( "Z" , "" , "Set internal debugging options" , "FLAG" ) ,
792
791
opt:: opt ( "" , "color" , "Configure coloring of output:
793
792
auto = colorize, if output goes to a tty (default);
794
793
always = always colorize output;
795
794
never = never colorize output" , "auto|always|never" ) ,
796
795
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" ,
813
797
"Pretty-print the input instead of compiling;
814
798
valid types are: `normal` (un-annotated source),
815
799
`expanded` (crates expanded),
@@ -823,9 +807,6 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
823
807
`everybody_loops` (all function bodies replaced with `loop {}`)." ,
824
808
"TYPE" ) ,
825
809
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" ) ,
829
810
] ) ;
830
811
opts
831
812
}
@@ -861,27 +842,9 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
861
842
862
843
let debugging_opts = build_debugging_options ( matches) ;
863
844
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 ;
885
848
886
849
if debugging_opts. debug_llvm {
887
850
unsafe { llvm:: LLVMSetDebug ( 1 ) ; }
@@ -921,28 +884,10 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
921
884
host_triple ( ) . to_string ( ) ) ;
922
885
let opt_level = {
923
886
if matches. opt_present ( "O" ) {
924
- if matches. opt_present ( "opt-level" ) {
925
- early_error ( "-O and --opt-level both provided" ) ;
926
- }
927
887
if cg. opt_level . is_some ( ) {
928
888
early_error ( "-O and -C opt-level both provided" ) ;
929
889
}
930
890
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
- }
946
891
} else {
947
892
match cg. opt_level {
948
893
None => No ,
@@ -960,27 +905,10 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
960
905
} ;
961
906
let gc = debugging_opts. gc ;
962
907
let debuginfo = if matches. opt_present ( "g" ) {
963
- if matches. opt_present ( "debuginfo" ) {
964
- early_error ( "-g and --debuginfo both provided" ) ;
965
- }
966
908
if cg. debuginfo . is_some ( ) {
967
909
early_error ( "-g and -C debuginfo both provided" ) ;
968
910
}
969
911
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
- }
984
912
} else {
985
913
match cg. debuginfo {
986
914
None | Some ( 0 ) => NoDebugInfo ,
@@ -1036,15 +964,9 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
1036
964
1037
965
let cfg = parse_cfgspecs ( matches. opt_strs ( "cfg" ) ) ;
1038
966
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 ) ;
1046
968
1047
- let mut prints = matches. opt_strs ( "print" ) . into_iter ( ) . map ( |s| {
969
+ let prints = matches. opt_strs ( "print" ) . into_iter ( ) . map ( |s| {
1048
970
match s. as_slice ( ) {
1049
971
"crate-name" => PrintRequest :: CrateName ,
1050
972
"file-names" => PrintRequest :: FileNames ,
@@ -1054,18 +976,6 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
1054
976
}
1055
977
}
1056
978
} ) . 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
- }
1069
979
1070
980
if !cg. remark . is_empty ( ) && debuginfo == NoDebugInfo {
1071
981
early_warn ( "-C remark will not show source locations without \
0 commit comments