News for hackers. Stuff that matters.
Re:Klint: Compile-Time Detection of Atomic Context Violation... by bonzini on Saturday March 18, 2023 @05:25PM (#35213253)
It's not a disaster, it's quite inconvenient though and the effect would be the same as the lint that the article discusses.
Re:Klint: Compile-Time Detection of Atomic Context Violation... by tialaramex on Saturday March 18, 2023 @10:35PM (#35215430)
Can 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).