MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/transprogrammer/comments/sbprkt/panic/hu53xjv/?context=3
r/transprogrammer • u/olsonexi • Jan 24 '22
15 comments sorted by
View all comments
Show parent comment
2
The solution is to simply never return one, statically we can optimize out any annoying queries about gender since we know they diverge.
#![feature(never_type)] fn get_gender(&self) -> ! { loop {} }
Although leaving the local type of get_gender up to the caller could be problematic.
get_gender
View all comments
Show parent comment
2
u/RecDep Jan 25 '22
The solution is to simply never return one, statically we can optimize out any annoying queries about gender since we know they diverge.
Although leaving the local type of
get_genderup to the caller could be problematic.