Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upChange ManuallyDrop<T> to a lang item. #52711
Conversation
rust-highfive
assigned
nikomatsakis
Jul 25, 2018
rust-highfive
added
the
S-waiting-on-review
label
Jul 25, 2018
nagisa
added
the
relnotes
label
Jul 25, 2018
This comment was marked as resolved.
This comment was marked as resolved.
;) Should be |
This comment has been minimized.
This comment has been minimized.
|
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Centril
added
the
T-lang
label
Jul 25, 2018
scottmcm
reviewed
Jul 25, 2018
| #[derive(Copy)] | ||
| pub union ManuallyDrop<T>{ value: T } | ||
| #[lang = "manually_drop"] | ||
| #[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] |
This comment has been minimized.
This comment has been minimized.
eddyb
changed the title
Change ManuallySized<T> to a lang item and relax it to allow T: ?Sized.
Change ManuallyDrop<T> to a lang item and relax it to allow T: ?Sized.
Jul 25, 2018
This comment has been minimized.
This comment has been minimized.
r=me once travis is happy |
RalfJung
reviewed
Jul 27, 2018
| @@ -243,7 +243,10 @@ pub fn trivial_dropck_outlives<'tcx>(tcx: TyCtxt<'_, '_, 'tcx>, ty: Ty<'tcx>) -> | |||
|
|
|||
| ty::TyAdt(def, _) => { | |||
| if def.is_union() { | |||
| // Unions never run have a dtor. | |||
| // Unions never have a dtor. | |||
| true | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
RalfJung
Jul 27, 2018
•
Member
Actually, yes, I think it is a concern. :D #52786
(but the bug is already on nightly, so it's not introduced by this PR)
This comment has been minimized.
This comment has been minimized.
|
This makes @eddyb said he doesn't have much time to follow up on this, but I think I can take over. I should probably also add at least one test because it seems there are none? |
This comment has been minimized.
This comment has been minimized.
|
FWIW we would only need an FCP for the second commit, the first one can be landed independently and then union-related changes can be made in parallel with generalized to |
This comment has been minimized.
This comment has been minimized.
|
So shall we split the PR? |
eddyb
force-pushed the
eddyb:unsized-manuallydrop
branch
from
f1bf3af
to
591eeff
Jul 27, 2018
eddyb
changed the title
Change ManuallyDrop<T> to a lang item and relax it to allow T: ?Sized.
Change ManuallyDrop<T> to a lang item.
Jul 27, 2018
This comment has been minimized.
This comment has been minimized.
|
PR submitted to fix link in reference: rust-lang-nursery/reference#373 |
This comment has been minimized.
This comment has been minimized.
|
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
This comment has been minimized.
This comment has been minimized.
|
@TimNN Bot shows empty log. |
This comment has been minimized.
This comment has been minimized.
|
Updated reference submodule so the links should be fixed. |
This comment has been minimized.
This comment has been minimized.
|
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
This comment has been minimized.
This comment has been minimized.
|
Dang, unrelated updates in the reference contain broken links. Reported as rust-lang-nursery/reference#374 EDIT: Fix submitted: rust-lang-nursery/reference#375 |
This comment has been minimized.
This comment has been minimized.
@bors r=nikomatsakis |
This comment has been minimized.
This comment has been minimized.
|
|
bors
added
S-waiting-on-bors
and removed
S-waiting-on-review
labels
Jul 27, 2018
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Jul 28, 2018
This comment has been minimized.
This comment has been minimized.
|
|
eddyb commentedJul 25, 2018
•
edited
This PR implements the approach @RalfJung proposes in https://internals.rust-lang.org/t/pre-rfc-unions-drop-types-and-manuallydrop/8025 (lang item
structinstead ofunion).A followup PR can easily solve #47034 as well, by just adding a few
?Sizedtolibcore/mem.rs.r? @nikomatsakis