@@ -5,80 +5,110 @@ 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.]'
8
10
--bin'[Compile an executable crate (default)]'
9
11
-c'[Compile and assemble, but do not link]'
10
12
--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]'
11
18
--emit-llvm'[Produce an LLVM bitcode file]'
12
19
{-h,--help}'[Display this message]'
13
20
-L'[Add a directory to the library search path]'
14
21
--lib'[Compile a library crate]'
15
22
--linker'[Program to use for linking instead of the default.]'
16
23
--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]'
17
25
--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]'
18
28
--no-trans'[Run all passes except translation; no output]'
19
29
-O'[Equivalent to --opt-level=2]'
20
30
-o'[Write output to <filename>]'
21
31
--opt-level'[Optimize with possible levels 0-3]'
22
32
--out-dir'[Write output to compiler-chosen filename in <dir>]'
23
33
--parse-only'[Parse only; do not compile, assemble, or link]'
34
+ --passes'[Comma or space separated list of pass names to use]'
24
35
--pretty'[Pretty-print the input instead of compiling]'
36
+ --rlib'[Compile a rust library crate as an rlib file]'
25
37
-S'[Compile only; do not assemble or link]'
26
38
--save-temps'[Write intermediate files (.bc, .opt.bc, .o) in addition to normal output]'
39
+ --staticlib'[Compile a static library crate]'
27
40
--sysroot'[Override the system root]'
28
41
--test'[Build a test harness]'
29
42
--target'[Target triple cpu-manufacturer-kernel\[-os\] to compile]'
30
43
--target-cpu'[Select target processor (llc -mcpu=help for details)]'
31
44
--target-feature'[Target specific attributes (llc -mattr=help for details)]'
32
- --android-cross-path'[The path to the Android NDK]'
33
45
{-v,--version}'[Print version info and exit]'
34
46
)
35
47
_rustc_opts_lint=(
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]'
48
+ 'attribute-usage[detects bad use of attributes]'
39
49
'ctypes[proper use of std::libc types in foreign modules]'
40
- "unused-mut[detect mut variables which don't need to be mutable]"
41
- 'unused-imports[imports that are never used]'
42
- 'heap-memory[use of any (~ type or @ type) heap memory]'
43
- 'default-methods[allow default methods]'
44
- 'unused-variable[detect variables which are not used in any way]'
45
50
'dead-assignment[detect assignments that will never be read]'
46
- 'unrecognized-lint[unrecognized lint attribute ]'
47
- 'type-limits[comparisons made useless by limits of the types involved ]'
48
- 'unused-unsafe[unnecessary use of an `unsafe` block ]'
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
+ '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 ]'
55
+ 'heap-memory[use of any (~ type or @ type) heap memory ]'
51
56
'managed-heap-memory[use of managed (@ type) heap memory]'
52
- 'unnecessary-allocation[detects unnecessary allocations that can be eliminated]'
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]'
53
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]'
72
+ '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]'
79
+ '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 { }`]'
54
83
)
55
84
56
85
_rustc_opts_debug=(
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'
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]'
82
112
)
83
113
84
114
_rustc_opts_fun_lint(){
0 commit comments