this post was submitted on 01 Jun 2024
10 points (91.7% liked)

Rust Programming

8150 readers
6 users here now

founded 5 years ago
MODERATORS
 

The autocompletion works (mostly) but for example Vec::new() doesn't highlight anything at all. I do get errors when not putting a semicolon, but things like passing too many arguments into the println macro doesn't throw an error. Or how shown in this example, it did not autocomplete the clone method, while also just accepting .clo; at the end of a String (it also didn't autocomplete "String"). In the video I show how it also gives me a recommendation for setting vec![] as a type, which doesn't make any sense. It only seems to a very limited selection of methods and some words I already used in the script. Is this how it's supposed to be, or do I have some very old version perhaps?

EDIT: Look in description for the fix

you are viewing a single comment's thread
view the rest of the comments
[–] ssokolow@lemmy.ml 2 points 5 months ago

Ahh, yeah. In the beginning, Rust was built around the idea that individual files and invoking rustc are internal details, only relevant for integration into some other build system like Bazel, and that "normal" Rust projects need to be inside a Cargo project structure.

There is in-development work to have official support for something along the lines of rust-script, but it's still just that... in development. If you want to keep an eye on it, here is the tracking issue.