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