|
|
Log in / Subscribe / Register

Never traits

Never traits

Posted Sep 11, 2026 6:57 UTC (Fri) by taladar (subscriber, #68407)
In reply to: Never traits by tsavola
Parent article: Stabilizing Rust's never type

But that is not how traits work in Rust. What you suggest would be true if all traits just had their types appear in parameter position in the methods they implement but traits like Default have them appear only in return type position where you absolutely have to come up with a value if someone calls <! as Default>::default()


to post comments

Never traits

Posted Sep 11, 2026 7:17 UTC (Fri) by tsavola (subscriber, #37605) [Link]

Okay, I see.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds