mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-24 05:33:41 +00:00
tutorial: only Owned types can have a Drop impl
This commit is contained in:
parent
467502216e
commit
d4509f270b
@ -982,7 +982,9 @@ when it is collected.
|
|||||||
|
|
||||||
If an object doesn't contain garbage-collected boxes, it consists of a single
|
If an object doesn't contain garbage-collected boxes, it consists of a single
|
||||||
ownership tree and is given the `Owned` trait which allows it to be sent
|
ownership tree and is given the `Owned` trait which allows it to be sent
|
||||||
between tasks.
|
between tasks. Custom destructors can only be implemented directly on types
|
||||||
|
that are `Owned`, but garbage-collected boxes can still *contain* types with
|
||||||
|
custom destructors.
|
||||||
|
|
||||||
# Boxes
|
# Boxes
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user