xref: /vim-8.2.3635/runtime/compiler/rustc.vim (revision 01a6c216)
1" Vim compiler file
2" Compiler:         Rust Compiler
3" Maintainer:       Chris Morgan <[email protected]>
4" Latest Revision:  2013 Jul 12
5" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
6
7if exists("current_compiler")
8	finish
9endif
10let current_compiler = "rustc"
11
12let s:cpo_save = &cpo
13set cpo&vim
14
15if exists(":CompilerSet") != 2
16	command -nargs=* CompilerSet setlocal <args>
17endif
18
19if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent != 0
20	CompilerSet makeprg=rustc
21else
22	CompilerSet makeprg=rustc\ \%
23endif
24
25" Old errorformat (before nightly 2016/08/10)
26CompilerSet errorformat=
27			\%f:%l:%c:\ %t%*[^:]:\ %m,
28			\%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m,
29			\%-G%f:%l\ %s,
30			\%-G%*[\ ]^,
31			\%-G%*[\ ]^%*[~],
32			\%-G%*[\ ]...
33
34" New errorformat (after nightly 2016/08/10)
35CompilerSet errorformat+=
36			\%-G,
37			\%-Gerror:\ aborting\ %.%#,
38			\%-Gerror:\ Could\ not\ compile\ %.%#,
39			\%Eerror:\ %m,
40			\%Eerror[E%n]:\ %m,
41			\%Wwarning:\ %m,
42			\%Inote:\ %m,
43			\%C\ %#-->\ %f:%l:%c
44
45let &cpo = s:cpo_save
46unlet s:cpo_save
47