blob: efcf24ed80096630d7aa3c6e61c63b776bdeaf48 [file] [log] [blame]
Bram Moolenaar3c2881d2017-03-21 19:18:29 +01001" Vim compiler file
2" Compiler: Rust Compiler
3" Maintainer: Chris Morgan <me@chrismorgan.info>
Gregory Andersfc935942023-09-12 13:23:38 -05004" Latest Revision: 2023-09-11
Bram Moolenaar3c2881d2017-03-21 19:18:29 +01005" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
6
7if exists("current_compiler")
Gregory Andersfc935942023-09-12 13:23:38 -05008 finish
Bram Moolenaar3c2881d2017-03-21 19:18:29 +01009endif
10let current_compiler = "rustc"
11
Gregory Andersfc935942023-09-12 13:23:38 -050012" vint: -ProhibitAbbreviationOption
13let s:save_cpo = &cpo
Bram Moolenaar3c2881d2017-03-21 19:18:29 +010014set cpo&vim
Gregory Andersfc935942023-09-12 13:23:38 -050015" vint: +ProhibitAbbreviationOption
Bram Moolenaar3c2881d2017-03-21 19:18:29 +010016
17if exists(":CompilerSet") != 2
Gregory Andersfc935942023-09-12 13:23:38 -050018 command -nargs=* CompilerSet setlocal <args>
Bram Moolenaar3c2881d2017-03-21 19:18:29 +010019endif
20
Gregory Andersfc935942023-09-12 13:23:38 -050021if get(g:, 'rustc_makeprg_no_percent', 0)
22 CompilerSet makeprg=rustc
Bram Moolenaar3c2881d2017-03-21 19:18:29 +010023else
Gregory Andersfc935942023-09-12 13:23:38 -050024 if has('patch-7.4.191')
25 CompilerSet makeprg=rustc\ \%:S
26 else
27 CompilerSet makeprg=rustc\ \"%\"
28 endif
Bram Moolenaar3c2881d2017-03-21 19:18:29 +010029endif
30
Bram Moolenaar3c2881d2017-03-21 19:18:29 +010031" New errorformat (after nightly 2016/08/10)
Gregory Andersfc935942023-09-12 13:23:38 -050032CompilerSet errorformat=
33 \%-G,
34 \%-Gerror:\ aborting\ %.%#,
35 \%-Gerror:\ Could\ not\ compile\ %.%#,
36 \%Eerror:\ %m,
37 \%Eerror[E%n]:\ %m,
38 \%Wwarning:\ %m,
39 \%Inote:\ %m,
40 \%C\ %#-->\ %f:%l:%c,
41 \%E\ \ left:%m,%C\ right:%m\ %f:%l:%c,%Z
Bram Moolenaar3c2881d2017-03-21 19:18:29 +010042
Gregory Andersfc935942023-09-12 13:23:38 -050043" Old errorformat (before nightly 2016/08/10)
44CompilerSet errorformat+=
45 \%f:%l:%c:\ %t%*[^:]:\ %m,
46 \%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m,
47 \%-G%f:%l\ %s,
48 \%-G%*[\ ]^,
49 \%-G%*[\ ]^%*[~],
50 \%-G%*[\ ]...
51
52" vint: -ProhibitAbbreviationOption
53let &cpo = s:save_cpo
54unlet s:save_cpo
55" vint: +ProhibitAbbreviationOption
56
57" vim: set et sw=4 sts=4 ts=8: