Skip to content

Commit 824b518

Browse files
committed
fix: removed deprecated rustc arguments
The `--pretty` and `--xpretty` arguments have been deprecated [0] and removed [1]. They have been renamed to '-Zunpretty' and moved to nightly [2]. This means that currently, with the default stable compiler this won't work. You will have to use nightly or wait until it is stabilized (which is an ongoing effort [3]). [0]: rust-lang/rust#21441 [1]: rust-lang/rust#83491 [2]: rust-lang/rust#27392 [3]: rust-lang/rust#43364 Signed-off-by: Gabriel Goller <[email protected]>
1 parent 889b9a7 commit 824b518

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

autoload/rust.vim

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,8 @@ endfunction
144144
function! s:Expand(dict, pretty, args)
145145
try
146146
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
147-
148-
if a:pretty =~? '^\%(everybody_loops$\|flowgraph=\)'
149-
let flag = '--xpretty'
150-
else
151-
let flag = '--pretty'
152-
endif
153147
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
154-
let args = [relpath, '-Z', 'unstable-options', l:flag, a:pretty] + a:args
148+
let args = [relpath, $"-Zunpretty={a:pretty}"] + a:args
155149
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
156150
let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)')))
157151
if v:shell_error

doc/rust.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ functionality from other plugins.
394394

395395
:RustExpand [args] *:RustExpand*
396396
:RustExpand! [TYPE] [args]
397-
Expands the current file using --pretty and displays the
397+
Expands the current file using --Zunpretty and displays the
398398
results in a new split. If the current file has unsaved
399399
changes, it will be saved first using |:update|. If the
400400
current file is an unnamed buffer, it will be written to a
@@ -405,7 +405,7 @@ functionality from other plugins.
405405
configurations.
406406

407407
If ! is specified, the first argument is the expansion type to
408-
pass to rustc --pretty. Otherwise it will default to
408+
pass to rustc --Zunpretty. Otherwise it will default to
409409
"expanded".
410410

411411
If |g:rustc_path| is defined, it is used as the path to rustc.

0 commit comments

Comments
 (0)