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