News for hackers. Stuff that matters.
Re:I stopped everything and started writing C again by sestep on Wednesday March 12, 2025 @02:50PM (#43346456)
If you're using VS Code then you can add `"rust-analyzer.check.command": "clippy"` to your `settings.json`. I assume there's a similar setting for rust-analyzer in other editors.
Re:I stopped everything and started writing C again by maleldil on Wednesday March 12, 2025 @09:42PM (#43349585)
Neovim:

    require("lspconfig").rust_analyzer.setup({
        settings = {
            ["rust-analyzer"] = {
                checkOnSave = {
                    command = "clippy",
                    allFeatures = true,
                },
            },
        },
    })
Re:I stopped everything and started writing C again by pabs3 on Wednesday March 12, 2025 @11:18PM (#43350089)
You might want to reconsider use of rust-analyzer, it isn't safe to use on code you haven't written yourself.

https://rust-analyzer.github.io/book/security.html

Re:I stopped everything and started writing C again by swiftcoder on Thursday March 13, 2025 @04:39AM (#43351342)
> it isn't safe to use on code you haven't written yourself

Neither is cargo (nor npm, nor any other package manager, for that matter).

I'm not sure what value being that paranoid is buying you in the long run.

Re:I stopped everything and started writing C again by pabs3 on Thursday March 13, 2025 @09:54AM (#43353380)
Package managers are for running other people's code, I would not expect the same of static analysis tools, especially since they are of use while auditing other people's code before building/running it.
Re:I stopped everything and started writing C again by swiftcoder on Friday March 14, 2025 @06:57AM (#43361374)
Cargo's threat model here is identical to that of rust analyser. If you trust your dependency tree sufficiently to run `cargo build`, then you trust it sufficiently to run rust analyser.
Re:I stopped everything and started writing C again by pabs3 on Saturday March 15, 2025 @02:39AM (#43370508)
Considering Cargo has build scripts, which are designed to run arbitrary code, that doesn't appear to be correct.

https://doc.rust-lang.org/cargo/reference/build-scripts.html

Re:I stopped everything and started writing C again by swiftcoder on Sunday March 16, 2025 @05:33AM (#43377813)
Rust analyser executes those exact same build scripts. This is the primary avenue for exploits in both pieces of software, and is called out explicitly in the page you originally linked.
Re:I stopped everything and started writing C again by pabs3 on Monday March 24, 2025 @06:36PM (#43466108)
Yes, and that is my complaint.