36
submitted 4 days ago by jwr1@kbin.earth to c/rust@programming.dev
you are viewing a single comment's thread
view the rest of the comments
[-] thingsiplay@beehaw.org 1 points 4 days ago

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 9 points 4 days ago

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 4 days ago

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

[-] 0xDEADBEEFCAFE@programming.dev 11 points 4 days ago

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

load more comments (8 replies)
this post was submitted on 11 Dec 2025
36 points (100.0% liked)

Rust

7572 readers
3 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