News for hackers. Stuff that matters.
Re:Was Rust Worth It? by CGamesPlay on Wednesday October 25, 2023 @10:22PM (#38020949)
> The compiler is trying to help out as much as possible, especially since rustc has the best error messages in the world.

Generally good, but man do I hate how any error in my async function causes every recursive call site to generate an error about how the Future is no longer Send and Sync. Literally an entire console scrollback of errors with the actual syntax error buried somewhere in the middle.

Re:Was Rust Worth It? by estebank on Wednesday October 25, 2023 @11:16PM (#38021255)
I believe this is in our radar and waiting on the new trait solver, but just in case if you have a repro I would appreciate a ticket to improve the diagnostic.
Re:Was Rust Worth It? by CGamesPlay on Thursday October 26, 2023 @04:12AM (#38023049)
https://play.rust-lang.org/?version=stable&mode=debug&editio...

In this case, the first two errors are clear. The next 3 provide multiple, redundant context blocks. The upshot is that this simple example results in rustc printing 11 lines of useful error messages and 86 lines of useless messages. Add to that the fact that the useful error messages need not be at the top or bottom of the error list, they can be anywhere inside of it, depending on the declaration order.

Re:Was Rust Worth It? by estebank on Thursday October 26, 2023 @12:12PM (#38027664)
That is a different problem than the one I thought you were seeing.

We do spend a lot of time trying to silence errors that are irrelevant. We also get a lot of complaints when fixing a single error produces a wave of new errors that were hidden due to failures in earlier stages. It's a balancing act.

Also, specific errors are verbose in order to give people a fighting chance to fix their issue. An error that is too verbose is annoying. An error that is too terse will leave users in the cold as to what the problem was. It's yet another balancing act.

I filed https://github.com/rust-lang/rust/issues/117233 for you. Could I ask you why you didn't consider doing so when you first encountered this problem?

Re:Was Rust Worth It? by CGamesPlay on Thursday October 26, 2023 @07:02PM (#38032758)
> Could I ask you why you didn't consider doing so when you first encountered this problem?

Thanks for looking into it. I have a filed a bug against Rust before, but that was a clear bug, not a poor error message. Remember, the only time a user sees something like this is when they are trying to do something else. The only reason I looked into it just now is because you explicitly asked.

Re:Was Rust Worth It? by estebank on Friday October 27, 2023 @11:10AM (#38039504)
We consider poor error messages to be bugs. I know most people don't, so I've made it one of my missions to yell it from the mountain tops to encourage people to report more often. We can't fix what we don't know about. The majority of the current good errors were a reaction to things people filed in the past.