this post was submitted on 11 Dec 2025
37 points (100.0% liked)

Rust

7827 readers
26 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
you are viewing a single comment's thread
view the rest of the comments
[–] thingsiplay@beehaw.org 0 points 2 months ago (11 children)

I don't understand why this never type was introduced at all. Instead functions not returning, shouldn't Rust enforce returning from function and instead use a None in place of never type? Otherwise how will the "Unwinding" of program flow implemented?

[–] 0xDEADBEEFCAFE@programming.dev 11 points 2 months ago (2 children)

shouldn’t Rust enforce returning from function

How do you enforce returning from exit or a function with a loop that never terminates?

[–] thingsiplay@beehaw.org 1 points 2 months ago (1 children)

If it never terminates, then it means it runs forever.

[–] 0xDEADBEEFCAFE@programming.dev 14 points 2 months ago

Right, so you can't "enforce" a return from the function.

load more comments (8 replies)