Files
emacsd/elpa/flycheck-rust-20190319.1546/flycheck-rust.elc

85 lines
5.8 KiB
Plaintext
Raw Normal View History

2019-10-27 20:23:01 +01:00
;ELC
;;; Compiled
;;; in Emacs version 26.3
;;; with all optimizations.
;;; This file uses dynamic docstrings, first added in Emacs 19.29.
;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\207" [require dash flycheck seq json] 2)
#@311 Get the Cargo.toml manifest for FILE-NAME.
FILE-NAME is the path of a file in a cargo project given as a
string.
See http://doc.crates.io/guide.html for an introduction to the
Cargo.toml manifest.
Return the path to the Cargo.toml manifest file, or nil if the
manifest could not be located.
(fn FILE-NAME)
(defalias 'flycheck-rust-find-manifest #[257 "\300\301\"\211\205\f\302\301\"\207" [locate-dominating-file "Cargo.toml" expand-file-name] 5 (#$ . 511)])
#@351 Return a list of directories from START (inclusive) to END (exclusive).
E.g., if START is '/a/b/c/d' and END is '/a', return the list
'(/a/b/c/d /a/b/c /a/b) in this order.
START and END are strings representing file paths. END should be
above START in the file hierarchy; if not, the list stops at the
root of the file hierarchy.
(fn START END)
(defalias 'flycheck-rust-dirs-list #[514 "\300\301!\301!@\232\204$\302\"\204$B\262\303\304!!\262\202\237\207" [nil expand-file-name file-equal-p directory-file-name file-name-directory] 8 (#$ . 983)])
#@346 Return the list of available Cargo targets for the given project.
MANIFEST is the path to the Cargo.toml file of the project.
Calls `cargo metadata --no-deps --manifest-path MANIFEST
--format-version 1', parses and collects the targets for the
current workspace, and returns them in a list, or nil if no
targets could be found.
(fn MANIFEST)
(defalias 'flycheck-rust-get-cargo-targets #[257 "\302!\211\204 \303\304!\210\305\306!r\211q\210\307\310\311\312\313!\314\"\315$\216\316\317\320\317\321\322\323\n\324\325&\n\210eb\210\326\327 +\262\330\236A\211\262\262\211\205H\331\332\"\262\207" [flycheck-executable-find json-array-type "cargo" user-error "flycheck-rust cannot find `cargo'. Please make sure that cargo is installed and on your PATH. See http://www.flycheck.org/en/latest/user/troubleshooting.html for more information on setting your PATH with Emacs." generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 call-process nil (t nil) "metadata" "--no-deps" "--manifest-path" "--format-version" "1" list json-read packages seq-map #[257 "\211\300\236A\211\262\207" [targets] 4 "\n\n(fn PKG)"]] 14 (#$ . 1557)])
#@768 Return the Cargo build target associated with FILE-NAME.
FILE-NAME is the path of the file that is matched against the
`src_path' value in the list of `targets' returned by `cargo
read-manifest'.
Return an alist ((KIND . k) (NAME . n) (REQUIRED-FEATURES . rf))
where KIND is the target kind (lib, bin, test, example or bench),
NAME the target name (usually, the crate name), and REQUIRED-FEATURES is the
optional list of features required to build the selected target. If FILE-NAME
exactly matches a target `src-path', this target is returned. Otherwise, return
the closest matching target, or nil if no targets could be found.
See http://doc.crates.io/manifest.html#the-project-layout for a
description of the conventional Cargo project layout.
(fn FILE-NAME)
(defalias 'flycheck-rust-find-cargo-target #[257 "\300!\211\205\f\301!\211\205\n\302\303\"\211\205\304\305\306\307\310\311 !\312\"\313\314%\"\206>\304\315\316\317\320 \321\n!\"#\"@\206>\211@\211\322\236A\211@\262\262\323\230\203\341\324\211\325\326\203\252\203\252@\203g\324\262\202\236\327\324\325\326\203\222\203\222@\203\200\324\262\202\206\f\232\262\210\211T\262A\262\202l\266\211\262!\203\236\211\262\210\211T\262A\262\202S\266\211\262\325\326\203\332\203\332@\203\305\324\262\202\316\232\204\316\211\262\210\211T\262A\262\202\261\266\211\262\262\211\205\211\322\236A\330\236A\331\236A\332\333\322\334!B\330B\331BE\"\266\203\262\262\262\262\207" [flycheck-rust-find-manifest flycheck-rust-get-cargo-targets -flatten-n 1 seq-find make-byte-code 257 "\211\301\236A\300\230\262\207" vconcat vector [src_path] 5 "\n\n(fn TARGET)" #[257 "\211\300\301\211A\262\242\"A\302\303!\"\207" [assoc src_path file-equal-p file-name-directory] 8 "\n\n(fn PAIR)"] -table-flat cons flycheck-rust-dirs-list file-name-directory kind "custom-build" nil t 0 ---truthy\? name required-features seq-filter #[257 "\211A\207" [] 2 "\n\n(fn KV)"] flycheck-rust-normalize-target-kind] 19 (#$ . 2770)])
#@290 Return the normalized target name from KIND.
KIND is a list of target name as returned by `cargo metadata',
which do not necessarily correspond to to target names that can
be passed as argument to `cargo rustc'.
The normalization returns a valid cargo target based on KINDS.
(fn KINDS)
(defalias 'flycheck-rust-normalize-target-kind #[257 "\211@\211\300\232\204 \211\301\232\204 \211\302\232\204 \211\303\232\204 \211\304\232\203$\305\202&@\207" ["dylib" "rlib" "staticlib" "cdylib" "proc-macro" "lib"] 4 (#$ . 4819)])
#@132 Setup Rust in Flycheck.
If the current file is part of a Cargo project, configure
Flycheck according to the Cargo project layout.
(defalias 'flycheck-rust-setup #[0 "\3031;\304 \211\2057\305!\211\2055\211\306\236A\307\236A\310\236A\311\300!\210\311\301!\210\311\302!\210\211\211\266\203\262\262\2620\207\312\313\"\210\314\207" [flycheck-rust-features flycheck-rust-crate-type flycheck-rust-binary-name (debug error) buffer-file-name flycheck-rust-find-cargo-target required-features kind name make-local-variable message "Error in flycheck-rust-setup: %S" nil] 8 (#$ . 5355) nil])
(provide 'flycheck-rust)