Skip to content

Commit 7184260

Browse files
committed
---
yaml --- r: 152631 b: refs/heads/try2 c: 78cb2f5 h: refs/heads/master i: 152629: c5ad640 152627: 9f0e07f 152623: 1353ae3 v: v3
1 parent 10a4d24 commit 7184260

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1504
-862
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: bb0a42745f7a951c298b7bc2e07f7ba1fee14100
8+
refs/heads/try2: 78cb2f5bc0244edeb0f7f042c81f16931c437d27
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/doc/rust.md

Lines changed: 76 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ rule. A literal is a form of constant expression, so is evaluated (primarily)
234234
at compile time.
235235

236236
~~~~ {.ebnf .gram}
237-
literal : string_lit | char_lit | num_lit ;
237+
literal : string_lit | char_lit | byte_string_lit | byte_lit | num_lit ;
238238
~~~~
239239

240240
#### Character and string literals
@@ -244,17 +244,17 @@ char_lit : '\x27' char_body '\x27' ;
244244
string_lit : '"' string_body * '"' | 'r' raw_string ;
245245
246246
char_body : non_single_quote
247-
| '\x5c' [ '\x27' | common_escape ] ;
247+
| '\x5c' [ '\x27' | common_escape | unicode_escape ] ;
248248
249249
string_body : non_double_quote
250-
| '\x5c' [ '\x22' | common_escape ] ;
250+
| '\x5c' [ '\x22' | common_escape | unicode_escape ] ;
251251
raw_string : '"' raw_string_body '"' | '#' raw_string '#' ;
252252
253253
common_escape : '\x5c'
254254
| 'n' | 'r' | 't' | '0'
255255
| 'x' hex_digit 2
256-
| 'u' hex_digit 4
257-
| 'U' hex_digit 8 ;
256+
unicode_escape : 'u' hex_digit 4
257+
| 'U' hex_digit 8 ;
258258
259259
hex_digit : 'a' | 'b' | 'c' | 'd' | 'e' | 'f'
260260
| 'A' | 'B' | 'C' | 'D' | 'E' | 'F'
@@ -294,7 +294,7 @@ the following forms:
294294
escaped in order to denote *itself*.
295295

296296
Raw string literals do not process any escapes. They start with the character
297-
`U+0072` (`r`), followed zero or more of the character `U+0023` (`#`) and a
297+
`U+0072` (`r`), followed by zero or more of the character `U+0023` (`#`) and a
298298
`U+0022` (double-quote) character. The _raw string body_ is not defined in the
299299
EBNF grammar above: it can contain any sequence of Unicode characters and is
300300
terminated only by another `U+0022` (double-quote) character, followed by the
@@ -319,6 +319,65 @@ r##"foo #"# bar"##; // foo #"# bar
319319
"\\x52"; r"\x52"; // \x52
320320
~~~~
321321

322+
#### Byte and byte string literals
323+
324+
~~~~ {.ebnf .gram}
325+
byte_lit : 'b' '\x27' byte_body '\x27' ;
326+
byte_string_lit : 'b' '"' string_body * '"' | 'b' 'r' raw_byte_string ;
327+
328+
byte_body : ascii_non_single_quote
329+
| '\x5c' [ '\x27' | common_escape ] ;
330+
331+
byte_string_body : ascii_non_double_quote
332+
| '\x5c' [ '\x22' | common_escape ] ;
333+
raw_byte_string : '"' raw_byte_string_body '"' | '#' raw_byte_string '#' ;
334+
335+
~~~~
336+
337+
A _byte literal_ is a single ASCII character (in the `U+0000` to `U+007F` range)
338+
enclosed within two `U+0027` (single-quote) characters,
339+
with the exception of `U+0027` itself,
340+
which must be _escaped_ by a preceding U+005C character (`\`),
341+
or a single _escape_.
342+
It is equivalent to a `u8` unsigned 8-bit integer _number literal_.
343+
344+
A _byte string literal_ is a sequence of ASCII characters and _escapes_
345+
enclosed within two `U+0022` (double-quote) characters,
346+
with the exception of `U+0022` itself,
347+
which must be _escaped_ by a preceding `U+005C` character (`\`),
348+
or a _raw byte string literal_.
349+
It is equivalent to a `&'static [u8]` borrowed vectior unsigned 8-bit integers.
350+
351+
Some additional _escapes_ are available in either byte or non-raw byte string
352+
literals. An escape starts with a `U+005C` (`\`) and continues with one of
353+
the following forms:
354+
355+
* An _byte escape_ escape starts with `U+0078` (`x`) and is
356+
followed by exactly two _hex digits_. It denotes the byte
357+
equal to the provided hex value.
358+
* A _whitespace escape_ is one of the characters `U+006E` (`n`), `U+0072`
359+
(`r`), or `U+0074` (`t`), denoting the bytes values `0x0A` (ASCII LF),
360+
`0x0D` (ASCII CR) or `0x09` (ASCII HT) respectively.
361+
* The _backslash escape_ is the character `U+005C` (`\`) which must be
362+
escaped in order to denote its ASCII encoding `0x5C`.
363+
364+
Raw byte string literals do not process any escapes.
365+
They start with the character `U+0072` (`r`),
366+
followed by `U+0062` (`b`),
367+
followed by zero or more of the character `U+0023` (`#`),
368+
and a `U+0022` (double-quote) character.
369+
The _raw string body_ is not defined in the EBNF grammar above:
370+
it can contain any sequence of ASCII characters and is
371+
terminated only by another `U+0022` (double-quote) character, followed by the
372+
same number of `U+0023` (`#`) characters that preceded the opening `U+0022`
373+
(double-quote) character.
374+
A raw byte string literal can not contain any non-ASCII byte.
375+
376+
All characters contained in the raw string body represent their ASCII encoding,
377+
the characters `U+0022` (double-quote) (except when followed by at least as
378+
many `U+0023` (`#`) characters as were used to start the raw string literal) or
379+
`U+005C` (`\`) do not have any special meaning.
380+
322381
#### Number literals
323382

324383
~~~~ {.ebnf .gram}
@@ -1829,8 +1888,6 @@ type int8_t = i8;
18291888

18301889
### Static-only attributes
18311890

1832-
- `address_insignificant` - references to this static may alias with
1833-
references to other statics, potentially of unrelated type.
18341891
- `thread_local` - on a `static mut`, this signals that the value of this
18351892
static may change depending on the current thread. The exact consequences of
18361893
this are implementation-defined.
@@ -2141,13 +2198,22 @@ These types help drive the compiler's analysis
21412198
### Inline attributes
21422199

21432200
The inline attribute is used to suggest to the compiler to perform an inline
2144-
expansion and place a copy of the function in the caller rather than generating
2145-
code to call the function where it is defined.
2201+
expansion and place a copy of the function or static in the caller rather than
2202+
generating code to call the function or access the static where it is defined.
21462203

21472204
The compiler automatically inlines functions based on internal heuristics.
21482205
Incorrectly inlining functions can actually making the program slower, so it
21492206
should be used with care.
21502207

2208+
Immutable statics are always considered inlineable
2209+
unless marked with `#[inline(never)]`.
2210+
It is undefined
2211+
whether two different inlineable statics
2212+
have the same memory address.
2213+
In other words,
2214+
the compiler is free
2215+
to collapse duplicate inlineable statics together.
2216+
21512217
`#[inline]` and `#[inline(always)]` always causes the function to be serialized
21522218
into crate metadata to allow cross-crate inlining.
21532219

branches/try2/src/etc/emacs/run_rust_emacs_tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
23
# file at the top-level directory of this distribution and at
34
# http://rust-lang.org/COPYRIGHT.

0 commit comments

Comments
 (0)