]> git.lizzy.rs Git - rust.git/commit
std: Handle prints with literally no context
authorAlex Crichton <alex@alexcrichton.com>
Fri, 13 Dec 2013 01:32:35 +0000 (17:32 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 24 Dec 2013 22:42:00 +0000 (14:42 -0800)
commitdd19785f963fd1045e53447add17ab36ca41fc79
tree89018b18de5b1b9afde15db1e61e25fc73770d1c
parent4538369566b8b51fc8371253aa90f9725547a193
std: Handle prints with literally no context

Printing is an incredibly useful debugging utility, and it's not much help if
your debugging prints just trigger an obscure abort when you need them most. In
order to handle this case, forcibly fall back to a libc::write implementation of
printing whenever a local task is not available.

Note that this is *not* a 1:1 fallback. All 1:1 rust tasks will still have a
local Task that it can go through (and stdio will be created through the local
IO factory), this is only a fallback for "no context" rust code (such as that
setting up the context).
src/libstd/io/stdio.rs
src/libstd/rt/util.rs