| ▲ | n_u a day ago |
| > Cargo now reports unused dependencies to users, e.g. > warning: unused dependency `tracing-subscriber`
--> Cargo.toml:23:1
|
23 | tracing-subscriber.workspace = true
| ^^^^^^^^^^^^^^^^^^
|
= note: `cargo::unused_dependencies` is set to `warn` by default
help: consider removing the dependency on `tracing-subscriber` Heck yes |
|
| ▲ | minimaxir a day ago | parent | next [-] |
| I updated to 1.100 during a Claude session and it complained about new warnings, so I told it to fix them. It removed a large number of unused dependencies without issue. |
| |
| ▲ | saghm a day ago | parent | next [-] | | My semi-controversial take is that the best way to use agents for Rust is to literally turn every possible lint and warning on in clippy and require that they're treated as blocking for the agent to fix before ever saying things are done. While a few of them might be overzealous and feel tedious to work around manually, there's no need to care about it being tedious for an agent! | | |
| ▲ | skavi a day ago | parent [-] | | clippy lints are not universally good advice. just off the dome, there are a few reasons you’d want to avoid boxing large variants. and with the pedantic set enabled, you quickly have bad clippy advice forcing a bunch of ugly expects in your code. the default set plus a selection of whatever you like from the rest works better. | | |
| ▲ | saghm 12 hours ago | parent [-] | | I was pretty explicitly talking about LLM-generated code. At the end of the day, you're either reviewing the code it outputs or you're not. If you are, I'd argue that you're going to be getting a bunch of ugly things in your code that you're going to want to clean up anyhow, and the tradeoff of having everything enabled is well worth it compared to what an LLM will generate with more relaxed lints. If you're not, I don't think you particularly need to care about "ugly" code. |
|
| |
| ▲ | minimaxir a day ago | parent | prev [-] | | I am legitimately confused why my parent comment is being mass downvoted: the point I was making is that this is change is more a perk for agent use with Rust since agents typically will resolve warnings by solving the issue (and therefore proactively remove redundant dependencies) | | |
| ▲ | nightpool a day ago | parent | next [-] | | I think most people (rightly or not) feel pretty negatively about the concept of a project having hundreds of unused dependencies. If you've lost track of your codebase to such an extent as that, you should probably expect a little bit of social pushback from people who pride themselves on understanding their code and being responsible for it. It's just a fundamentally different and in some ways upsetting mindset to the average programmer. | |
| ▲ | psnehanshu a day ago | parent | prev | next [-] | | How do you guys know when your comment is downvoted? I seem to be missing something in Hacker News. | | |
| ▲ | dns_snek 21 hours ago | parent | next [-] | | You can see the number of points for your own comment right next to it. They start out at 1. | |
| ▲ | steveklabnik 14 hours ago | parent | prev | next [-] | | Comments that go below one karma are made an increasingly light shade of grey. | |
| ▲ | nexawave-ai a day ago | parent | prev [-] | | You must have a certain amount of Karma, then you'll be able to downvote comments. I dont know what that amount is though, I'm on 50 karma points and I dont have that feature enabled | | |
| ▲ | latexr 19 hours ago | parent [-] | | > You must have a certain amount of Karma, then you'll be able to downvote comments That’s not what they’re asking, they want to know how people know their own comments were downvoted. The answer is that you can look at your own points in your own comments. > I dont know what that amount is though 501. | | |
|
| |
| ▲ | MindSpunk a day ago | parent | prev | next [-] | | Confuses me too. Maybe they just stopped reading after the first sentence and assumed you were complaining about new warnings? | |
| ▲ | yuriks a day ago | parent | prev [-] | | fwiw my immediate reaction (I didn't downvote) to your comment was "no one asked". | | |
| ▲ | minimaxir a day ago | parent [-] | | My intent was to share a fun anecdote of an practical, unexpected impact of the change but I now see that agents + fun is still a tough sell on HN. | | |
| ▲ | epage a day ago | parent | next [-] | | I shared your anecdote with another Cargo team member who helped work on this feature. We appreciate seeing how what we made helped people! | |
| ▲ | a day ago | parent | prev [-] | | [deleted] |
|
|
|
|
|
| ▲ | jtwaleson a day ago | parent | prev [-] |
| Does this remove the need for machete or shear? |
| |
| ▲ | epage a day ago | parent [-] | | I believe so. The maintaner of cargo-udeps did most of the work as an effort to upstream it. The main limitation is in dev-dep detection since there isn't a way to exhaustively run everything that uses dev-deps yet. You can look at logging statements to get an approximation though. |
|