Home Explore Blog CI



neovim

6th chunk of `runtime/doc/ft_rust.txt`
81327b6aa381367d5f8af6df227eb847503deb2583e86666000000010000094f
 for the shorterner, by
		default "https://is.gd/"

		|g:rust_clip_command| is the command to run to copy the
		playpen url to the clipboard of your system.


Evaluation of a single Rust file ~

NOTE: These commands are useful only when working with standalone Rust files,
which is usually not the case for common Rust development. If you wish to
building Rust crates from with Vim can should use Vim's make, Syntastic, or
functionality from other plugins.


:RustRun  [args]                                                    *:RustRun*
:RustRun! [rustc-args] [--] [args]
		Compiles and runs the current file. If it has unsaved changes,
		it will be saved first using |:update|. If the current file is
		an unnamed buffer, it will be written to a temporary file
		first. The compiled binary is always placed in a temporary
		directory, but is run from the current directory.

		The arguments given to |:RustRun| will be passed to the
		compiled binary.

		If ! is specified, the arguments are passed to rustc instead.
		A "--" argument will separate the rustc arguments from the
		arguments passed to the binary.

		If |g:rustc_path| is defined, it is used as the path to rustc.
		Otherwise it is assumed rustc can be found in $PATH.

:RustExpand  [args]                                              *:RustExpand*
:RustExpand! [TYPE] [args]
		Expands the current file using `--pretty` and displays the
		results in a new split. If the current file has unsaved
		changes, it will be saved first using |:update|. If the
		current file is an unnamed buffer, it will be written to a
		temporary file first.

		The arguments given to |:RustExpand| will be passed to rustc.
		This is largely intended for specifying various `--cfg`
		configurations.

		If ! is specified, the first argument is the expansion type to
		pass to `rustc --pretty` . Otherwise it will default to
		"expanded".

		If |g:rustc_path| is defined, it is used as the path to rustc.
		Otherwise it is assumed rustc can be found in $PATH.

:RustEmitIr [args]                                               *:RustEmitIr*
		Compiles the current file to LLVM IR and displays the results
		in a new split. If the current file has unsaved changes, it
		will be saved first using |:update|. If the current file is an
		unnamed buffer, it will be written to a temporary file first.

		The arguments given to |:RustEmitIr| will

Title: Rust Vim Plugin: Single File Evaluation - :RustRun, :RustExpand, :RustEmitIr
Summary
This section describes Vim commands for evaluating single Rust files, which are useful for standalone Rust development. The `:RustRun` command compiles and runs the current file, saving unsaved changes first. The `:RustExpand` command expands the current file using `--pretty` and displays the results in a new split, allowing for inspection of macro expansions and conditional compilation. The `:RustEmitIr` command compiles the current file to LLVM IR and displays the results in a new split.