@@ -269,23 +269,13 @@ fn init_current(current: *mut ()) -> Thread {
269269 // BUSY exists solely for this check, but as it is in the slow path, the
270270 // extra TLS write above shouldn't matter. The alternative is nearly always
271271 // a stack overflow.
272-
273- // If you came across this message, contact the author of your
274- // allocator. If you are said author: A surprising amount of functions
275- // inside the standard library (e.g. `Mutex`, `File` when using long
276- // paths, even `panic!` when using unwinding), need memory allocation,
277- // so you'll get circular dependencies all over the place when using
278- // them. I (joboet) highly recommend using only APIs from core in your
279- // allocator and implementing your own system abstractions. Still, if
280- // you feel that a particular API should be entirely allocation-free,
281- // feel free to open an issue on the Rust repository, we'll see what we
282- // can do.
272+ //
273+ // If we reach this point it means our initialization routine ended up
274+ // calling current() either directly, or indirectly through the global
275+ // allocator, which is a bug either way as we may not call the global
276+ // allocator in current().
283277 rtabort ! (
284- "\n \
285- Attempted to access thread-local data while allocating said data.\n \
286- Do not access functions that allocate in the global allocator!\n \
287- This is a bug in the global allocator.\n \
288- "
278+ "init_current() was re-entrant, which indicates a bug in the Rust threading implementation"
289279 )
290280 } else {
291281 debug_assert_eq ! ( current, DESTROYED ) ;
0 commit comments