this post was submitted on 11 Sep 2025
40 points (97.6% liked)

Rust

7419 readers
21 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 2 years ago
MODERATORS
top 4 comments
sorted by: hot top controversial new old
[–] kubica@fedia.io 3 points 1 month ago (2 children)

It's quite annoying at the beginning that the errors you get make you believe that 'closure' is a type in itself, because the errors themselves quote the word as if it was some kind of type, but then you can't specify something like let f: closure = ....

[–] calcopiritus@lemmy.world 9 points 1 month ago* (last edited 1 month ago)

Well, the closure has a type. Just you cannot declare it. That's why you do "impl Fn" instead. Because you know that whatever type the close is, it implements the "Fn" trait.

[–] BatmanAoD@programming.dev 3 points 1 month ago

Do you have a different recommendation for how to display unnameable types in error messages? I'm sure the compiler team would consider any suggestions.

[–] tjunge@twit.social 3 points 1 month ago

@turbohz Very nice summary, thanks!