Skip to content

Commit 2b0cdd2

Browse files
committed
---
yaml --- r: 89695 b: refs/heads/master c: 9d8dc00 h: refs/heads/master i: 89693: 3155e31 89691: 7d8bb33 89687: 416a0d4 89679: 0f7d408 89663: 718a43f v: v3
1 parent 5b86a97 commit 2b0cdd2

File tree

28 files changed

+700
-108
lines changed

28 files changed

+700
-108
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: eca52e682b9f253651606ce375495330d70a21d0
2+
refs/heads/master: 9d8dc004a021af5807120ae9ef2854ab99350cbf
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8

trunk/doc/po/ja/rust.md.po

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,13 @@ msgid ""
678678
"and continues as any mixture hex digits and underscores."
679679
msgstr ""
680680

681+
#. type: Bullet: ' * '
682+
#: doc/rust.md:326
683+
msgid ""
684+
"An _octal literal_ starts with the character sequence `U+0030` `U+006F` (`0o`) "
685+
"and continues as any mixture octal digits and underscores."
686+
msgstr ""
687+
681688
#. type: Bullet: ' * '
682689
#: doc/rust.md:326
683690
msgid ""
@@ -740,6 +747,7 @@ msgid ""
740747
"123u; // type uint\n"
741748
"123_u; // type uint\n"
742749
"0xff_u8; // type u8\n"
750+
"0o70_i16; // type i16\n"
743751
"0b1111_1111_1001_0000_i32; // type i32\n"
744752
"~~~~\n"
745753
msgstr ""

trunk/doc/po/ja/tutorial.md.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ msgstr "## プリミティブ型とリテラル"
849849
msgid ""
850850
"There are general signed and unsigned integer types, `int` and `uint`, as "
851851
"well as 8-, 16-, 32-, and 64-bit variants, `i8`, `u16`, etc. Integers can "
852-
"be written in decimal (`144`), hexadecimal (`0x90`), or binary "
852+
"be written in decimal (`144`), hexadecimal (`0x90`), octal (`0o70`), or binary "
853853
"(`0b10010000`) base. Each integral type has a corresponding literal suffix "
854854
"that can be used to indicate the type of a literal: `i` for `int`, `u` for "
855855
"`uint`, `i8` for the `i8` type."

trunk/doc/po/rust.md.pot

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ msgstr ""
661661

662662
#. type: Plain text
663663
#: doc/rust.md:319
664-
msgid "An _integer literal_ has one of three forms:"
664+
msgid "An _integer literal_ has one of four forms:"
665665
msgstr ""
666666

667667
#. type: Bullet: ' * '
@@ -678,6 +678,13 @@ msgid ""
678678
"and continues as any mixture hex digits and underscores."
679679
msgstr ""
680680

681+
#. type: Bullet: ' * '
682+
#: doc/rust.md:326
683+
msgid ""
684+
"An _octal literal_ starts with the character sequence `U+0030` `U+006F` (`0o`) "
685+
"and continues as any mixture octal digits and underscores."
686+
msgstr ""
687+
681688
#. type: Bullet: ' * '
682689
#: doc/rust.md:326
683690
msgid ""
@@ -740,6 +747,7 @@ msgid ""
740747
"123u; // type uint\n"
741748
"123_u; // type uint\n"
742749
"0xff_u8; // type u8\n"
750+
"0o70_i16; // type i16\n"
743751
"0b1111_1111_1001_0000_i32; // type i32\n"
744752
"~~~~\n"
745753
msgstr ""

trunk/doc/po/tutorial.md.pot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ msgstr ""
646646
msgid ""
647647
"There are general signed and unsigned integer types, `int` and `uint`, as "
648648
"well as 8-, 16-, 32-, and 64-bit variants, `i8`, `u16`, etc. Integers can "
649-
"be written in decimal (`144`), hexadecimal (`0x90`), or binary "
649+
"be written in decimal (`144`), hexadecimal (`0x90`), octal (`0o70`), or binary "
650650
"(`0b10010000`) base. Each integral type has a corresponding literal suffix "
651651
"that can be used to indicate the type of a literal: `i` for `int`, `u` for "
652652
"`uint`, `i8` for the `i8` type."

trunk/doc/rust.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,12 +340,14 @@ as they are differentiated by suffixes.
340340

341341
##### Integer literals
342342

343-
An _integer literal_ has one of three forms:
343+
An _integer literal_ has one of four forms:
344344

345345
* A _decimal literal_ starts with a *decimal digit* and continues with any
346346
mixture of *decimal digits* and _underscores_.
347347
* A _hex literal_ starts with the character sequence `U+0030` `U+0078`
348348
(`0x`) and continues as any mixture hex digits and underscores.
349+
* An _octal literal_ starts with the character sequence `U+0030` `U+006F`
350+
(`0o`) and continues as any mixture octal digits and underscores.
349351
* A _binary literal_ starts with the character sequence `U+0030` `U+0062`
350352
(`0b`) and continues as any mixture binary digits and underscores.
351353

@@ -376,6 +378,7 @@ Examples of integer literals of various forms:
376378
123u; // type uint
377379
123_u; // type uint
378380
0xff_u8; // type u8
381+
0o70_i16; // type i16
379382
0b1111_1111_1001_0000_i32; // type i32
380383
~~~~
381384

trunk/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ fn is_four(x: int) -> bool {
305305

306306
There are general signed and unsigned integer types, `int` and `uint`,
307307
as well as 8-, 16-, 32-, and 64-bit variants, `i8`, `u16`, etc.
308-
Integers can be written in decimal (`144`), hexadecimal (`0x90`), or
308+
Integers can be written in decimal (`144`), hexadecimal (`0x90`), octal (`0o70`), or
309309
binary (`0b10010000`) base. Each integral type has a corresponding literal
310310
suffix that can be used to indicate the type of a literal: `i` for `int`,
311311
`u` for `uint`, `i8` for the `i8` type.

trunk/src/compiletest/errors.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ fn parse_expected(line_num: uint, line: ~str) -> ~[ExpectedError] {
5252
let start_kind = idx;
5353
while idx < len && line[idx] != (' ' as u8) { idx += 1u; }
5454

55-
// FIXME: #4318 Instead of to_ascii and to_str_ascii, could use
56-
// to_ascii_consume and to_str_consume to not do a unnecessary copy.
5755
let kind = line.slice(start_kind, idx);
58-
let kind = kind.to_ascii().to_lower().to_str_ascii();
56+
let kind = kind.to_ascii().to_lower().into_str();
5957

6058
// Extract msg:
6159
while idx < len && line[idx] == (' ' as u8) { idx += 1u; }

trunk/src/etc/gedit/share/gtksourceview-3.0/language-specs/rust.lang

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,18 @@
224224
[0-9a-fA-F]
225225
</define-regex>
226226

227+
<define-regex id="oct_digit" extended="true">
228+
[0-7]
229+
</define-regex>
230+
227231
<context id="number" style-ref="number">
228232
<match extended="true">
229233
((?&lt;=\.\.)|(?&lt;![\w\.]))
230234
(
231235
[1-9][0-9_]*\%{num_suffix}?|
232236
0[0-9_]*\%{num_suffix}?|
233237
0b[01_]+\%{int_suffix}?|
238+
0o(\%{oct_digit}|_)+\%{int_suffix}?|
234239
0x(\%{hex_digit}|_)+\%{int_suffix}?
235240
)
236241
((?![\w\.].)|(?=\.\.))

trunk/src/etc/kate/rust.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@
199199
<Detect2Chars char="/" char1="/" attribute="Comment" context="Commentar 1"/>
200200
<Detect2Chars char="/" char1="*" attribute="Comment" context="Commentar 2" beginRegion="Comment"/>
201201
<RegExpr String="0x[0-9a-fA-F_]+&rustIntSuf;" attribute="Number" context="#stay"/>
202+
<RegExpr String="0o[0-7_]+&rustIntSuf;" attribute="Number" context="#stay"/>
202203
<RegExpr String="0b[0-1_]+&rustIntSuf;" attribute="Number" context="#stay"/>
203204
<RegExpr String="[0-9][0-9_]*\.[0-9_]*([eE][+-]?[0-9_]+)?(f32|f64|f)?" attribute="Number" context="#stay"/>
204205
<RegExpr String="[0-9][0-9_]*&rustIntSuf;" attribute="Number" context="#stay"/>

trunk/src/etc/mingw-fix-include/winsock2.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33

44
#include_next <winsock2.h>
55

6+
// mingw 4.0.x has broken headers (#9246) but mingw-w64 does not.
7+
#if defined(__MINGW_MAJOR_VERSION) && __MINGW_MAJOR_VERSION == 4
8+
69
typedef struct pollfd {
710
SOCKET fd;
811
short events;
912
short revents;
1013
} WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;
1114

1215
#endif
16+
17+
#endif // _FIX_WINSOCK2_H

trunk/src/etc/vim/syntax/rust.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ syn match rustNumber display "\<[0-9][0-9_]*\(i\|i8\|i16\|i32\|i64\)\>"
161161
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\>"
162162
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\(u\|u8\|u16\|u32\|u64\)\>"
163163
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\(i8\|i16\|i32\|i64\)\>"
164+
syn match rustOctNumber display "\<0o[0-7_]\+\>"
165+
syn match rustOctNumber display "\<0o[0-7_]\+\(u\|u8\|u16\|u32\|u64\)\>"
166+
syn match rustOctNumber display "\<0o[0-7_]\+\(i8\|i16\|i32\|i64\)\>"
164167
syn match rustBinNumber display "\<0b[01_]\+\>"
165168
syn match rustBinNumber display "\<0b[01_]\+\(u\|u8\|u16\|u32\|u64\)\>"
166169
syn match rustBinNumber display "\<0b[01_]\+\(i8\|i16\|i32\|i64\)\>"
@@ -198,6 +201,7 @@ syn region rustFoldBraces start="{" end="}" transparent fold
198201

199202
" Default highlighting {{{1
200203
hi def link rustHexNumber rustNumber
204+
hi def link rustOctNumber rustNumber
201205
hi def link rustBinNumber rustNumber
202206
hi def link rustIdentifierPrime rustIdentifier
203207
hi def link rustTrait rustType

0 commit comments

Comments
 (0)