SDF Chatter
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
snaggen@programming.dev to Rust@programming.dev · 1 year ago

Announcing Rust 1.79.0

blog.rust-lang.org

external-link
message-square
3
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 · 1 year ago
message-square
3
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
    1 year 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
    ·
    1 year 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
      ·
      1 year 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.

  • 3 users / day
  • 35 users / week
  • 478 users / month
  • 2.87K users / 6 months
  • 74 local subscribers
  • 6.98K subscribers
  • 1.02K Posts
  • 4.8K Comments
  • Modlog
  • mods:
  • snowe@programming.dev
  • Ategon@programming.dev
  • EdTheLegendary@programming.dev
  • kahnclusions@programming.dev
  • torcherist@programming.dev
  • BE: 0.19.8
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org