@@ -5,110 +5,80 @@ local -a _rustc_opts_switches _rustc_opts_lint _rustc_opts_debug
5
5
typeset -A opt_args
6
6
7
7
_rustc_opts_switches=(
8
- --android-cross-path'[The path to the Android NDK]'
9
- --ar'[Program to use for managing archives instead of the default.]'
10
8
--bin'[Compile an executable crate (default)]'
11
9
-c'[Compile and assemble, but do not link]'
12
10
--cfg'[Configure the compilation environment]'
13
- --crate-id'[Output the crate id and exit]'
14
- --crate-file-name'[Output the file(s) that would be written if compilation continued and exit]'
15
- --crate-name'[Output the crate name and exit]'
16
- --dep-info'[Output dependency info to <filename> after compiling]'
17
- --dylib'[Compile a dynamic library crate]'
18
11
--emit-llvm'[Produce an LLVM bitcode file]'
19
12
{-h,--help}'[Display this message]'
20
13
-L'[Add a directory to the library search path]'
21
14
--lib'[Compile a library crate]'
22
15
--linker'[Program to use for linking instead of the default.]'
23
16
--link-args'[FLAGS is a space-separated list of flags passed to the linker]'
24
- --llvm-args'[A list of arguments to pass to llvm, comma separated]'
25
17
--ls'[List the symbols defined by a library crate]'
26
- --no-analysis'[Parse and expand the output, but run no analysis or produce output]'
27
- --no-rpath'[Disables setting the rpath in libs/exes]'
28
18
--no-trans'[Run all passes except translation; no output]'
29
19
-O'[Equivalent to --opt-level=2]'
30
20
-o'[Write output to <filename>]'
31
21
--opt-level'[Optimize with possible levels 0-3]'
32
22
--out-dir'[Write output to compiler-chosen filename in <dir>]'
33
23
--parse-only'[Parse only; do not compile, assemble, or link]'
34
- --passes'[Comma or space separated list of pass names to use]'
35
24
--pretty'[Pretty-print the input instead of compiling]'
36
- --rlib'[Compile a rust library crate as an rlib file]'
37
25
-S'[Compile only; do not assemble or link]'
38
26
--save-temps'[Write intermediate files (.bc, .opt.bc, .o) in addition to normal output]'
39
- --staticlib'[Compile a static library crate]'
40
27
--sysroot'[Override the system root]'
41
28
--test'[Build a test harness]'
42
29
--target'[Target triple cpu-manufacturer-kernel\[-os\] to compile]'
43
30
--target-cpu'[Select target processor (llc -mcpu=help for details)]'
44
31
--target-feature'[Target specific attributes (llc -mattr=help for details)]'
32
+ --android-cross-path'[The path to the Android NDK]'
45
33
{-v,--version}'[Print version info and exit]'
46
34
)
47
35
_rustc_opts_lint=(
48
- 'attribute-usage[detects bad use of attributes]'
36
+ 'path-statement[path statements with no effect]'
37
+ 'missing-trait-doc[detects missing documentation for traits]'
38
+ 'missing-struct-doc[detects missing documentation for structs]'
49
39
'ctypes[proper use of std::libc types in foreign modules]'
50
- 'dead-assignment[detect assignments that will never be read]'
51
- 'dead-code[detect piece of code that will never be used]'
52
- 'default-type-param-usage[prevents explicitly setting a type parameter with a default]'
53
- 'deprecated[detects use of #\[deprecated\] items]'
54
- 'experimental[detects use of #\[experimental\] items]'
40
+ "unused-mut[detect mut variables which don't need to be mutable]"
41
+ 'unused-imports[imports that are never used]'
55
42
'heap-memory[use of any (~ type or @ type) heap memory]'
56
- 'managed-heap-memory[use of managed (@ type) heap memory]'
57
- 'missing-doc[detects missing documentation for public members]'
58
- 'non-camel-case-types[types, variants and traits should have camel case names]'
59
- 'non-uppercase-pattern-statics[static constants in match patterns should be all caps]'
60
- 'non-uppercase-statics[static constants should have uppercase identifiers]'
61
- 'owned-heap-memory[use of owned (~ type) heap memory]'
62
- 'path-statement[path statements with no effect]'
63
- 'type-limits[comparisons made useless by limits of the types involved]'
64
- 'type-overflow[literal out of range for its type]'
65
- 'unknown-crate-type[unknown crate type found in #\[crate_type\] directive]'
66
- 'unknown-features[unknown features found in crate-level #\[feature\] directives]'
67
- 'unnecessary-allocation[detects unnecessary allocations that can be eliminated]'
68
- 'unnecessary-parens[`if`, `match`, `while` and `return` do not need parentheses]'
69
- 'unnecessary-qualification[detects unnecessarily qualified names]'
70
- 'unnecessary-typecast[detects unnecessary type casts, that can be removed]'
71
- 'unreachable-code[detects unreachable code]'
43
+ 'default-methods[allow default methods]'
44
+ 'unused-variable[detect variables which are not used in any way]'
45
+ 'dead-assignment[detect assignments that will never be read]'
72
46
'unrecognized-lint[unrecognized lint attribute]'
73
- 'unsafe-block[usage of an `unsafe` block]'
74
- 'unstable[detects use of #\[unstable\] items (incl. items with no stability attribute)]'
75
- 'unused-imports[imports that are never used]'
76
- 'unused-must-use[unused result of an type flagged as #\[must_use\]]'
77
- "unused-mut[detect mut variables which don't need to be mutable]"
78
- 'unused-result[unused result of an expression in a statement]'
47
+ 'type-limits[comparisons made useless by limits of the types involved]'
79
48
'unused-unsafe[unnecessary use of an `unsafe` block]'
80
- 'unused-variable[detect variables which are not used in any way]'
81
- 'warnings[mass-change the level for lints which produce warnings]'
82
- 'while-true[suggest using `loop { }` instead of `while true { }`]'
49
+ 'while-true[suggest using loop { } instead of while(true) { }]'
50
+ 'non-camel-case-types[types, variants and traits should have camel case names]'
51
+ 'managed-heap-memory[use of managed (@ type) heap memory]'
52
+ 'unnecessary-allocation[detects unnecessary allocations that can be eliminated]'
53
+ 'owned-heap-memory[use of owned (~ type) heap memory]'
83
54
)
84
55
85
56
_rustc_opts_debug=(
86
- 'asm-comments[generate comments into the assembly (may change behavior)]'
87
- 'borrowck-stats[gather borrowck statistics]'
88
- 'count-llvm-insns[count where LLVM instrs originate]'
89
- 'count-type-sizes[count the sizes of aggregate types]'
90
- 'debug-info[Produce debug info (experimental)]'
91
- 'debug-llvm[enable debug output from LLVM]'
92
- 'extra-debug-info[Extra debugging info (experimental)]'
93
- 'gc[Garbage collect shared data (experimental)]'
94
- 'gen-crate-map[Force generation of a toplevel crate map]'
95
- 'lto[Perform LLVM link-time optimizations]'
96
- 'meta-stats[gather metadata statistics]'
97
- "no-integrated-as[Use external assembler rather than LLVM's integrated one]"
98
- 'no-landing-pads[omit landing pads for unwinding]'
99
- 'no-opt[do not optimize, even if -O is passed]'
100
- "no-prepopulate-passes[Don't pre-populate the pass managers with a list of passes, only use the passes from --passes]"
101
- "no-vectorize-loops[Don't run the loop vectorization optimization passes]"
102
- "no-vectorize-slp[Don't run LLVM's SLP vectorization passes]"
103
- 'no-verify[skip LLVM verification]'
104
- 'prefer-dynamic[Prefer dynamic linking to static linking]'
105
- 'print-link-args[Print the arguments passed to the linker]'
106
- 'print-llvm-passes[Prints the llvm optimization passes being run]'
107
- 'soft-float[Generate software floating point library calls]'
108
- 'time-llvm-passes[measure time of each LLVM pass]'
109
- 'time-passes[measure time of each rustc pass]'
110
- 'trans-stats[gather trans statistics]'
111
- 'verbose[in general, enable more debug printouts]'
57
+ 'verbose:in general, enable more debug printouts'
58
+ 'time-passes:measure time of each rustc pass'
59
+ 'count-llvm-insns:count where LLVM instrs originate'
60
+ 'time-llvm-passes:measure time of each LLVM pass'
61
+ 'trans-stats:gather trans statistics'
62
+ 'asm-comments:generate comments into the assembly (may change behavior)'
63
+ 'no-verify:skip LLVM verification'
64
+ 'trace:emit trace logs'
65
+ 'coherence:perform coherence checking'
66
+ 'borrowck-stats:gather borrowck statistics'
67
+ "borrowck-note-pure:note where purity is req'd"
68
+ "borrowck-note-loan:note where loans are req'd"
69
+ 'no-landing-pads:omit landing pads for unwinding'
70
+ 'debug-llvm:enable debug output from LLVM'
71
+ 'count-type-sizes:count the sizes of aggregate types'
72
+ 'meta-stats:gather metadata statistics'
73
+ 'no-opt:do not optimize, even if -O is passed'
74
+ 'print-link-args:Print the arguments passed to the linker'
75
+ 'gc:Garbage collect shared data (experimental)'
76
+ 'jit:Execute using JIT (experimental)'
77
+ 'extra-debug-info:Extra debugging info (experimental)'
78
+ 'debug-info:Produce debug info (experimental)'
79
+ 'static:Use or produce static libraries or binaries (experimental)'
80
+ 'no-debug-borrows:do not show where borrow checks fail'
81
+ 'lint-llvm:Run the LLVM lint pass on the pre-optimization IR'
112
82
)
113
83
114
84
_rustc_opts_fun_lint(){
0 commit comments