Explain the _oibit_remover field

This commit is contained in:
Oliver Schneider 2017-10-11 14:33:06 +02:00
parent 787f9f4ab7
commit dc7de37d99

View file

@ -261,6 +261,13 @@ pub struct Formatter<'a> {
struct Void {
_priv: (),
/// Erases all oibits, because `Void` erases the type of the object that
/// will be used to produce formatted output. Since we do not know what
/// oibits the real types have (and they can have any or none), we need to
/// take the most conservative approach and forbid all oibits.
///
/// It was added after #45197 showed that one could share a `!Sync`
/// object across threads by passing it into `format_args!`.
_oibit_remover: PhantomData<*mut Fn()>,
}