Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustc compiler config for Vim #7747

Closed

Conversation

chris-morgan
Copy link
Member

Note that this is not actually used by default; it is a matter of
configuration still, because you might want to:

  • Compile all .rs files with rustc % (where each can be built itself)
  • Compile all .rs files with rustc some-file.rs (where you are editing
    part of a crate)
  • Compile with a different tool, such as make. (In this case you might
    put a ~/.vim/after/compiler/rustc.vim to match such cases, set
    makeprg and extend errorformat as appropriate. That should probably go
    in a different compiler mode, e.g. make-rustc.)

To try using it, :compiler rustc. Then, :make on a file you would
run rustc on will work its magic, invoking rustc. To automate this,
you could have something like autocmd FileType rust compiler rustc in
your Vim config.

Note that this is not actually *used* by default; it is a matter of
configuration still, because you might want to:

- Compile all .rs files with `rustc %` (where each can be built itself)

- Compile all .rs files with `rustc some-file.rs` (where you are editing
  part of a crate)

- Compile with a different tool, such as `make`. (In this case you might
  put a `~/.vim/after/compiler/rustc.vim` to match such cases, set
  makeprg and extend errorformat as appropriate. That should probably go
  in a different compiler mode, e.g. make-rustc.)

To try using it, `:compiler rustc`. Then, `:make` on a file you would
run `rustc` on will work its magic, invoking rustc. To automate this,
you could have something like `autocmd FileType rust compiler rustc` in
your Vim config.
@lilyball
Copy link
Contributor

Suggestion: Add a :compiler rustrun that uses rust run instead.

@chris-morgan
Copy link
Member Author

@kballard Hmm, not sure about that. That's not the idea of a compiler plug-in. Then also: if it runs for a long time, it blocks Vim, and if it writes to stdout/stderr, you'll get lines that are unlikely to match 'errorformat', but some may, and things will get tangled, though probably not severely.

@lilyball
Copy link
Contributor

@chris-morgan Fair enough. Would be nice to add a :Rustrun command though that does this.

@chris-morgan
Copy link
Member Author

@kballard I could do that, but it's be equivalent to :!rust run <args> (or with no arguments, :!rust run %), wouldn't it? Hardly seems worth it at present.

@lilyball
Copy link
Contributor

@chris-morgan: :!rust run % requires you to be operating on a saved file. My ideal :Rustrun would let me do this even with buffers that don't have an associated file on-disk.

dotdash added a commit to dotdash/rust that referenced this pull request Jul 14, 2013
This allows to run the contents of a buffer through "rust run" and show
the results in a scratch buffer. Handy for things that are just a bit
too big to be done comfortably in rusti.

Refs rust-lang#7747
bors added a commit that referenced this pull request Jul 18, 2013
Note that this is not actually *used* by default; it is a matter of
configuration still, because you might want to:

- Compile all .rs files with `rustc %` (where each can be built itself)

- Compile all .rs files with `rustc some-file.rs` (where you are editing
  part of a crate)

- Compile with a different tool, such as `make`. (In this case you might
  put a `~/.vim/after/compiler/rustc.vim` to match such cases, set
  makeprg and extend errorformat as appropriate. That should probably go
  in a different compiler mode, e.g. make-rustc.)

To try using it, `:compiler rustc`. Then, `:make` on a file you would
run `rustc` on will work its magic, invoking rustc. To automate this,
you could have something like `autocmd FileType rust compiler rustc` in
your Vim config.
@bors bors closed this Jul 18, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 7, 2021
…ednet

Correctly handle signs in exponents in numeric_literal::format()

Fixes rust-lang#7744

changelog: Correctly handle signs in exponents in `numeric_literal::format()`
arcnmx pushed a commit to arcnmx/rust that referenced this pull request Jan 9, 2023
feat: Package Windows release artifacts as ZIP and add symbols file

Closes rust-lang#13872
Closes rust-lang#7747
CC rust-lang#10371

This allows us to ship a format that's easier to handle on Windows. As a bonus, we can also include the PDB, to get useful stack traces. Unfortunately, it adds a couple of dependencies to `xtask`, increasing the debug build times from 1.28 to 1.58 s (release from 1.60s to 2.20s) on my system.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants