3 ms·
It's not a disaster, it's quite inconvenient though and the effect would be the same as the lint that the article discusses.
by bonzini 4y ago
It's not a disaster, it's quite inconvenient though and the effect would be the same as the lint that the article discusses.
- tialaramex 4y agoCan the inconvenience be mostly dissolved by a proc macro though? Leveraging the type system scales better than ad hoc lints. Maybe later we need to keep track of several tokens, Rust has no problem making a Vec<CanSleep> and will optimise that exactly the way you expect (it's just a counter, the CanSleeps don't need storing anywhere) likewise a [Option<CanSleep>; 4] is just four bytes to track whether each element is None or Some(CanSleep).