Skip to content

Commit

Permalink
Explain the _oibit_remover field
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Oct 11, 2017
1 parent 787f9f4 commit dc7de37
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/libcore/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()>,
}

Expand Down

0 comments on commit dc7de37

Please sign in to comment.