@jarkko The compilation unit in Rust is the crate. So you generally can't compile a single file.
Also, as a tip, don't invoke rustc directly unless you really really have to for something specific. Use cargo for everything.
Rustc doesn't know about project structure or dependencies.
I've been using Rust full time since 2019 and I think I've called rustc directly less than 10 times
@jarkko As for how not to get DOS'ed, depends on the situation. Typically I just look at the bottom error, fix it, and compile it again.
But there are ways to decrease the amount of errors using e.g. the `todo!` macro (which returns the !/never type which can be coerced to any type and thus won't emit a type error)
@jarkko don't know if this covers what you are looking for, but looks like the most likely candidate.
https://www.reddit.com/r/rust/comments/tiaor0/comment/i1ft83t
@jarkko It doesn't directly address your question, but to combat terminal DOS I use "bacon check", which is a bit like "watch cargo" except it re-runs Cargo if it sees files change, so you can pick away at the errors one by one https://github.com/Canop/bacon
@diondokter @jarkko additionally, if the number of unnecessary errors is too high because they are implied by earlier ones, that's considered a bug: rustc is meant to silence the latter ones so only relevant ones are displayed. If it's not doing that, having a ticket with a repro would be helpful.
@jarkko @diondokter the closest to that that the compiler has is the nightly only -Ztreat-err-as-bug. The compiler used to stop after encountering errors in a given stage, and the user feedback on doing that was quite negative.
Is piping to a pager like less not a possibility for you?
@jarkko oh that is some fiddly code. Rust is weird, I thought it was just updated objectiveC, apparently it was written on OCaml. That explains some of the weird.
Let instead of assignment with = just seems like some user hostility built into the language. I expect it's for things that are managed instead of just raw first order data types.
Definitely can see why the LSP route wasn't a viable choice.