File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1329,10 +1329,11 @@ resource file_desc(fd: int) {
1329
1329
~~~~
1330
1330
1331
1331
This defines a type ` file_desc ` and a constructor of the same name,
1332
- which takes an integer. Values of such a type can not be copied, and
1333
- when they are destroyed (by going out of scope, or, when boxed, when
1334
- their box is cleaned up), their body runs. In the example above, this
1335
- would cause the given file descriptor to be closed.
1332
+ which takes an integer. The type has an associated destructor procedure,
1333
+ whose contents are specified by the block. Values of such a type can not
1334
+ be copied, and when they are destroyed (by going out of scope, or, when
1335
+ boxed, when their box is cleaned up), their body runs. In the example
1336
+ above, this would cause the given file descriptor to be closed.
1336
1337
1337
1338
NOTE: We're considering alternative approaches for data types with
1338
1339
destructors. Resources might go away in the future.
You can’t perform that action at this time.
0 commit comments