You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: text/0000-drop-types-in-const.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,13 @@
6
6
# Summary
7
7
[summary]: #summary
8
8
9
-
Allow types with destructors to be used in `static` items and in `cosnt` functions, as long as the destructor never needs to run in const context.
9
+
Allow types with destructors to be used in `static` items and in `const` functions, as long as the destructor never needs to run in const context.
10
10
11
11
# Motivation
12
12
[motivation]: #motivation
13
13
14
14
Most collection types do not allocate any memory when constructed empty. With the change to make leaking safe, the restriction on `static` items with destructors
15
-
is no longer trequired to be a hard error.
15
+
is no longer required to be a hard error.
16
16
17
17
Allowing types with destructors to be directly used in `const` functions and stored in `static`s will remove the need to have
18
18
runtime-initialisation for global variables.
@@ -24,7 +24,7 @@ runtime-initialisation for global variables.
24
24
- (Optionally adding a lint that warn about the possibility of resource leak)
25
25
- Alloc instantiating structures with destructors in constant expressions,
26
26
- Continue to prevent `const` items from holding types with destructors.
27
-
- Allow `const fn` to return types wth destructors.
27
+
- Allow `const fn` to return types with destructors.
28
28
- Disallow constant expressions which would result in the destructor being called (if the code were run at runtime).
0 commit comments