@@ -1377,26 +1377,7 @@ Like vectors, strings are always unique. You can wrap them in a shared
1377
1377
box to share them. Unlike vectors, there is no mutable variant of
1378
1378
strings. They are always immutable.
1379
1379
1380
- ## Resources
1381
-
1382
- Resources are data types that have a destructor associated with them.
1383
-
1384
- ~~~~
1385
- # fn close_file_desc(x: int) {}
1386
- resource file_desc(fd: int) {
1387
- close_file_desc(fd);
1388
- }
1389
- ~~~~
1390
-
1391
- This defines a type `file_desc` and a constructor of the same name,
1392
- which takes an integer. The type has an associated destructor procedure,
1393
- whose contents are specified by the block. Values of such a type can not
1394
- be copied, and when they are destroyed (by going out of scope, or, when
1395
- boxed, when their box is cleaned up), their body runs. In the example
1396
- above, this would cause the given file descriptor to be closed.
1397
-
1398
- NOTE: We're considering alternative approaches for data types with
1399
- destructors. Resources might go away in the future.
1380
+ NOTE: Section on resources removed. ToDo: document classes and destructors
1400
1381
1401
1382
# Argument passing
1402
1383
@@ -1581,7 +1562,7 @@ without any sophistication).
1581
1562
## Kinds
1582
1563
1583
1564
Perhaps surprisingly, the 'copy' (duplicate) operation is not defined
1584
- for all Rust types. Resource types (types with destructors) can not be
1565
+ for all Rust types. Resource types (classes with destructors) cannot be
1585
1566
copied, and neither can any type whose copying would require copying a
1586
1567
resource (such as records or unique boxes containing a resource).
1587
1568
0 commit comments