Does borrowing a #[thread_local] return 'static references or some local lifetime for each use?
Either way, it seems fixable by banning borrows from thread_locals across yields?
eddyb
Zoxc: it's local
and yeah I think there's a straightforward solution
Zoxc: I only came across it because someone mentioned stackful coroutines and TLS elsewhere :P
and I thought that the generator state transform would prevent misuse because it can see the reference, but specifically self-borrowing generators assume it's just another stack local :P
chill joined the channel
cp has quit
aismallard has quit
aismallard joined the channel
aismallard has quit
varkor joined the channel
Diggsey joined the channel
nagisa joined the channel
nagisa has quit
nagisa joined the channel
varkor has quit
niconii has quit
netrino joined the channel
Aaronepowerr has quit
Aaronepower joined the channel
Aaronepower has quit
japaric joined the channel
Aaronepower joined the channel
pickfire_ joined the channel
pickfire_ has quit
pickfire joined the channel
Guest49 joined the channel
est31 joined the channel
woboats
eddyb: how serious is the thread local problem
sounds like you think its easy to fix?
eddyb
woboats: the conceptual fix is easy, idk what the code looks like
woboats: the problem is not *too* serious because #[thread_local] will likely not be stabilized any time soon
and we can just literally block its stabilization on fixing this etc.
woboats
eddyb: what about the reply about an external library providing some thread local mechanism?
does it not apply to that crate because its API doesnt work like #[thread_local]?
Zoxc
#[thread_local] has borrowck magic
woboats
Zoxc: I assume by implication the third party crate does not?
Zoxc
I'll be impressed if stable crates alter borrowck =P
woboats
well as long as the unsoundness doesnt apply to stable it is not a huge priority :)
Zoxc
I don't think the addition of immovable generators makes already sound stable crates unsound, you can still have unsound stable code using unsafe though
Jesin joined the channel
Jesin has quit
Jesin joined the channel
eddyb
woboats: they don't have access to the hack #[thread_local] has, so they're either unsound already or they're fine