Uh oh!
There was an error while loading. Please reload this page.
Add Gankro's table to nomicon/src/phantom-data.md - #40069
Conversation
rust-highfive
commented
Feb 24, 2017
(rust_highfive has picked a reviewer for you, use r? to override) |
steveklabnik
commented
Feb 24, 2017
@bors: r+ neat, thank you! ❤️ |
bors
commented
Feb 24, 2017
📌 Commit 49fa66c has been approved by |
bluss
commented
Feb 24, 2017
@pnkfelix Does |
Rufflewind
commented
Feb 24, 2017
This is what I used to test whether the drop checker is active: use std::marker::PhantomData;structInspector<'a>(&'a());impl<'a>DropforInspector<'a>{fndrop(&mutself){}}fnwrap<T>(_:T) -> PhantomData<T>{PhantomData}fnmain(){let(i, inspector);
i = ();
inspector = wrap(Inspector(&i));}Right now this fails to compile. But if I use |
bluss
commented
Feb 25, 2017
Nice! You said:
The code doesn't demonstrate this, did you mean the opposite? |
Rufflewind
commented
Feb 25, 2017
Yeah, I meant the opposite. The documentation is correct, but I messed up the commit message / pull request -.- Rebasing… |
Original: rust-lang#30069 (comment) Testing confirms that: - PhantomData<fn() -> T> does not actually enable drop checking. - PhantomData<fn(T) -> T> is neither variant nor contravariant.
steveklabnik
commented
Feb 25, 2017
@bors: r+ rollup nice catch all, sorry I missed it! 😓 |
bors
commented
Feb 25, 2017
📌 Commit 1f75085 has been approved by |
Add Gankro's table to nomicon/src/phantom-data.md Original: rust-lang#30069 (comment) Testing confirms that: - `PhantomData<fn() -> T>` does not actually enable drop checking. - `PhantomData<fn(T) -> T>` is neither variant nor contravariant.
bluss
commented
Feb 25, 2017
Thanks for the clarification and the new and better docs! |
Add Gankro's table to nomicon/src/phantom-data.md Original: rust-lang#30069 (comment) Testing confirms that: - `PhantomData<fn() -> T>` does not actually enable drop checking. - `PhantomData<fn(T) -> T>` is neither variant nor contravariant.
Rollup of 28 pull requests - Successful merges: #39859, #39864, #39888, #39903, #39905, #39914, #39945, #39950, #39953, #39961, #39980, #39988, #39993, #39995, #40019, #40020, #40022, #40024, #40025, #40026, #40027, #40031, #40035, #40037, #40038, #40064, #40069, #40086 - Failed merges: #39927, #40008, #40047
Original: #30069 (comment)
Testing confirms that:
PhantomData<fn() -> T>does not actually enable drop checking.PhantomData<fn(T) -> T>is neither variant nor contravariant.