Skip to content

Commit b3e2076

Browse files
committed
editorial
1 parent 8cf7bbe commit b3e2076

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

active/0000-statically-sized-literals.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,26 +62,26 @@ In the future, after gaining the ability to parameterize on integers, strings of
6262
```
6363
struct __StrImpl<Sized? T>(T); // private
6464
65-
pub type str = StrImpl<[u8]>; // unsized referent of string slice `&str`, public
65+
pub type str = __StrImpl<[u8]>; // unsized referent of string slice `&str`, public
6666
pub type FixedString<const N: uint> = __StrImpl<[u8, ..N]>; // string of fixed size, public
6767
6868
// &FixedString<N> -> &str : OK, including &'static FixedString<N> -> &'static str for string literals
6969
```
70-
So, we don't propose to make these changes today and sugget to wait until parameterizing on integers is added to the language.
70+
So, we don't propose to make these changes today and suggest to wait until generic parameterization on integers is added to the language.
7171

7272
### Precedents
7373

74-
C and C++ string literals are lvalue `char` arrays of fixed size with static duration.
74+
C and C++ string literals are lvalue `char` arrays of fixed size with static duration.
7575
C++ library proposal for strings of fixed size ([link][1]), the paper also contains some discussion and motivation.
7676

7777
# Rejected alternatives and discussion
7878

7979
## Array literals
8080

81-
The types of array literals potentially can be changed from `[T, ..N]` to `&'a [T, ..N]` for consistency with the other literals and ergonomics.
81+
The types of array literals potentially can be changed from `[T, ..N]` to `&'a [T, ..N]` for consistency with the other literals and ergonomics.
8282
The major blocker for this change is the inability to move out from a dereferenced array literal if `T` is not `Copy`.
8383
```
84-
let mut a = *[box 1i, box 2, box 3]; // Wouldn't work without special-casing of string literal with regard to moving out from dereferenced borrowed pointer
84+
let mut a = *[box 1i, box 2, box 3]; // Wouldn't work without special-casing of array literals with regard to moving out from dereferenced borrowed pointer
8585
```
8686
Despite that array literals as references have better usability, possible `static`ness and consistency with other literals.
8787

0 commit comments

Comments
 (0)