Feddit.dk
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
snaggen@programming.dev to Rust@programming.dev · 11 months ago

Announcing Rust 1.79.0

blog.rust-lang.org

external-link
message-square
3
link
fedilink
  • cross-posted to:
  • rust@lemmy.ml
79
external-link

Announcing Rust 1.79.0

blog.rust-lang.org

snaggen@programming.dev to Rust@programming.dev · 11 months ago
message-square
3
link
fedilink
  • cross-posted to:
  • rust@lemmy.ml
Announcing Rust 1.79.0 | Rust Blog
blog.rust-lang.org
external-link
Empowering everyone to build reliable and efficient software.
alert-triangle
You must log in or register to comment.
  • BatmanAoD@programming.dev
    link
    fedilink
    arrow-up
    10
    ·
    edit-2
    11 months ago

    How does the const { None } example type-inference work? The size of the option type can’t be known without knowing the type of the Somevariant.

    Edit: aha, it doesn’t work as-is. It needs to infer the type of elements of foo from usage. https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=05a95c592626b6935ae812527aa6bbc6

  • calcopiritus@lemmy.world
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    11 months ago

    I don’t understand what the advantages of const expressions are.

    Isn’t const { None } the same as just None?

    • taladar@sh.itjust.works
      link
      fedilink
      arrow-up
      7
      ·
      11 months ago

      const expressions are evaluated at compile time and can be used in locations where you would have to otherwise specify a literal (or something that amounts to a named literal like a const value).

Rust@programming.dev

rust@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !rust@programming.dev

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)
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 43 users / day
  • 192 users / week
  • 399 users / month
  • 2.84K users / 6 months
  • 11 local subscribers
  • 6.89K subscribers
  • 991 Posts
  • 4.51K Comments
  • Modlog
  • mods:
  • snowe@programming.dev
  • Ategon@programming.dev
  • EdTheLegendary@programming.dev
  • kahnclusions@programming.dev
  • torcherist@programming.dev
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org