Skip to content

Commit dc38008

Browse files
authored
Merge pull request #3182 from woppopo/patch-1
Fix typo: `Alloc` -> `Allow`
2 parents 899eef7 + 6521129 commit dc38008

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

text/1440-drop-types-in-const.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ Some of the collection types do not allocate any memory when constructed empty (
1515
is no longer required to be a hard error (as it is safe and accepted that these destructors may never run).
1616

1717
Allowing types with destructors to be directly used in `const` functions and stored in `static`s or `const`s will remove the need to have
18-
runtime-initialisation for global variables.
18+
runtime-initialization for global variables.
1919

2020
# Detailed design
2121
[design]: #detailed-design
2222

2323
- Lift the restriction on types with destructors being used in `static` or `const` items.
24-
- `static`s containing Drop-types will not run the destructor upon program/thread exit.
25-
- `const`s containing Drop-types _will_ run the destructor at the appropriate point in the program.
26-
- (Optionally adding a lint that warn about the possibility of resource leak)
27-
- Alloc instantiating structures with destructors in constant expressions,
24+
- `static`s containing Drop-types will not run the destructor upon program/thread exit.
25+
- `const`s containing Drop-types _will_ run the destructor at the appropriate point in the program.
26+
- (Optionally adding a lint that warn about the possibility of resource leak)
27+
- Allow instantiating structures with destructors in constant expressions.
2828
- Allow `const fn` to return types with destructors.
2929
- Disallow constant expressions that require destructors to run during compile-time constant evaluation (i.e: a `drop(foo)` in a `const fn`).
3030

@@ -62,11 +62,11 @@ A `const` item's destructor _will_ run at each point where the `const` item is u
6262
# Alternatives
6363
[alternatives]: #alternatives
6464

65-
- Runtime initialisation of a raw pointer can be used instead (as the `lazy_static` crate currently does on stable)
65+
- Runtime initialization of a raw pointer can be used instead (as the `lazy_static` crate currently does on stable).
6666
- On nightly, a bug related to `static` and `UnsafeCell<Option<T>>` can be used to remove the dynamic allocation.
67-
- Both of these alternatives require runtime initialisation, and incur a checking overhead on subsequent accesses.
67+
- Both of these alternatives require runtime initialization, and incur a checking overhead on subsequent accesses.
6868
- Leaking of objects could be addressed by using C++-style `.dtors` support
69-
- This is undesirable, as it introduces confusion around destructor execution order.
69+
- This is undesirable, as it introduces confusion around destructor execution order.
7070

7171
# Unresolved questions
7272
[unresolved]: #unresolved-questions

0 commit comments

Comments
 (0)