diff options
| author | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2017-10-11 14:33:06 +0200 |
|---|---|---|
| committer | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2017-10-11 14:33:06 +0200 |
| commit | dc7de37d995e5922ce3b016c5cc01f5fcd326570 (patch) | |
| tree | 5b5529a477022559f8d3a587e8d2c0b7f929fd91 /src/libcore | |
| parent | 787f9f4ab762c54ce7125451460b01000a26cfd7 (diff) | |
| download | rust-dc7de37d995e5922ce3b016c5cc01f5fcd326570.tar.gz rust-dc7de37d995e5922ce3b016c5cc01f5fcd326570.zip | |
Explain the `_oibit_remover` field
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/fmt/mod.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index 4b263596ac1..c2ebb419e9e 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -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()>, } |
