@@ -249,23 +249,13 @@ fn init_current(current: *mut ()) -> Thread {
249
249
// BUSY exists solely for this check, but as it is in the slow path, the
250
250
// extra TLS write above shouldn't matter. The alternative is nearly always
251
251
// a stack overflow.
252
-
253
- // If you came across this message, contact the author of your
254
- // allocator. If you are said author: A surprising amount of functions
255
- // inside the standard library (e.g. `Mutex`, `File` when using long
256
- // paths, even `panic!` when using unwinding), need memory allocation,
257
- // so you'll get circular dependencies all over the place when using
258
- // them. I (joboet) highly recommend using only APIs from core in your
259
- // allocator and implementing your own system abstractions. Still, if
260
- // you feel that a particular API should be entirely allocation-free,
261
- // feel free to open an issue on the Rust repository, we'll see what we
262
- // can do.
252
+ //
253
+ // If we reach this point it means our initialization routine ended up
254
+ // calling current() either directly, or indirectly through the global
255
+ // allocator, which is a bug either way as we may not call the global
256
+ // allocator in current().
263
257
rtabort ! (
264
- "\n \
265
- Attempted to access thread-local data while allocating said data.\n \
266
- Do not access functions that allocate in the global allocator!\n \
267
- This is a bug in the global allocator.\n \
268
- "
258
+ "init_current() was re-entrant, which indicates a bug in the Rust threading implementation"
269
259
)
270
260
} else {
271
261
debug_assert_eq ! ( current, DESTROYED ) ;
0 commit comments