Skip to content

Commit 2aac80c

Browse files
committed
---
yaml --- r: 138103 b: refs/heads/try c: b2949ae h: refs/heads/master i: 138101: c4eb886 138099: 343a2de 138095: cc9eb74 v: v3
1 parent 302251e commit 2aac80c

Some content is hidden

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

76 files changed

+1063
-831
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: b6e0d3a5bf4c88650a22f605f822e02c6b163580
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
5-
refs/heads/try: 412f4d1fc7ec8858ee4c91abd78097ac48cb15ef
5+
refs/heads/try: b2949ae543e5a7a1e2b5543aff8e4252f1aab41c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fetch snapshots, and an OS that can execute the available snapshot binaries.
8787

8888
Snapshot binaries are currently built and tested on several platforms:
8989

90-
* Windows (7, 8, Server 2008 R2), x86 and x86-64 (64-bit support added in Rust 0.12.0)
90+
* Windows (7, 8, Server 2008 R2), x86 only
9191
* Linux (2.6.18 or later, various distributions), x86 and x86-64
9292
* OSX 10.7 (Lion) or greater, x86 and x86-64
9393

branches/try/src/doc/guide-ffi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ conventions. Rust provides a way to tell the compiler which convention to use:
475475
~~~~
476476
extern crate libc;
477477

478-
#[cfg(all(target_os = "win32", target_arch = "x86"))]
478+
#[cfg(target_os = "win32", target_arch = "x86")]
479479
#[link(name = "kernel32")]
480480
#[allow(non_snake_case)]
481481
extern "stdcall" {

branches/try/src/doc/guide-unsafe.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -313,15 +313,17 @@ literal string (i.e `""`)
313313
```
314314
#![feature(asm)]
315315
316-
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
316+
#[cfg(target_arch = "x86")]
317+
#[cfg(target_arch = "x86_64")]
317318
fn foo() {
318319
unsafe {
319320
asm!("NOP");
320321
}
321322
}
322323
323324
// other platforms
324-
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
325+
#[cfg(not(target_arch = "x86"),
326+
not(target_arch = "x86_64"))]
325327
fn foo() { /* ... */ }
326328
327329
fn main() {
@@ -338,7 +340,7 @@ but you must add the right number of `:` if you skip them:
338340

339341
```
340342
# #![feature(asm)]
341-
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
343+
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
342344
# fn main() { unsafe {
343345
asm!("xor %eax, %eax"
344346
:
@@ -352,7 +354,7 @@ Whitespace also doesn't matter:
352354

353355
```
354356
# #![feature(asm)]
355-
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
357+
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
356358
# fn main() { unsafe {
357359
asm!("xor %eax, %eax" ::: "eax");
358360
# } }
@@ -366,7 +368,7 @@ expressions must be mutable lvalues:
366368

367369
```
368370
# #![feature(asm)]
369-
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
371+
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
370372
fn add(a: int, b: int) -> int {
371373
let mut c = 0;
372374
unsafe {
@@ -377,7 +379,7 @@ fn add(a: int, b: int) -> int {
377379
}
378380
c
379381
}
380-
# #[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
382+
# #[cfg(not(target_arch = "x86"), not(target_arch = "x86_64"))]
381383
# fn add(a: int, b: int) -> int { a + b }
382384
383385
fn main() {
@@ -394,7 +396,7 @@ stay valid.
394396

395397
```
396398
# #![feature(asm)]
397-
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
399+
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
398400
# fn main() { unsafe {
399401
// Put the value 0x200 in eax
400402
asm!("mov $$0x200, %eax" : /* no outputs */ : /* no inputs */ : "eax");

branches/try/src/doc/reference.md

Lines changed: 26 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -185,40 +185,24 @@ grammar as double-quoted strings. Other tokens have exact rules given.
185185

186186
### Keywords
187187

188-
The keywords are the following strings, organized by first letter:
188+
<p id="keyword-table-marker">The keywords are the following strings, organized by first letter:</p>
189189

190-
<div id="keywords">
191190
| | | | |
192191
|----------|--------|--------|-------|
193192
| as | | | |
194-
|----------|--------|--------|-------|
195193
| box | break | | |
196-
|----------|--------|--------|-------|
197194
| continue | crate | | |
198-
|----------|--------|--------|-------|
199195
| else | enum | extern | |
200-
|----------|--------|--------|-------|
201196
| false | fn | for | |
202-
|----------|--------|--------|-------|
203197
| if | impl | in | |
204-
|----------|--------|--------|-------|
205198
| let | loop | | |
206-
|----------|--------|--------|-------|
207199
| match | mod | mut | |
208-
|----------|--------|--------|-------|
209200
| priv | proc | pub | |
210-
|----------|--------|--------|-------|
211201
| ref | return | | |
212-
|----------|--------|--------|-------|
213202
| self | static | struct | super |
214-
|----------|--------|--------|-------|
215203
| trait | true | type | |
216-
|----------|--------|--------|-------|
217204
| unsafe | use | | |
218-
|----------|--------|--------|-------|
219205
| while | | | |
220-
|----------|--------|--------|-------|
221-
</div>
222206

223207
Each of these keywords has special meaning in its grammar, and all of them are
224208
excluded from the `ident` rule.
@@ -1328,6 +1312,23 @@ let c = [Cookie, Cookie, Cookie, Cookie];
13281312
The precise memory layout of a structure is not specified. One can specify a
13291313
particular layout using the [`repr` attribute](#ffi-attributes).
13301314

1315+
By using the `struct_inherit` feature gate, structures may use single
1316+
inheritance. A Structure may only inherit from a single other structure, called
1317+
the _super-struct_. The inheriting structure (sub-struct) acts as if all fields
1318+
in the super-struct were present in the sub-struct. Fields declared in a
1319+
sub-struct must not have the same name as any field in any (transitive)
1320+
super-struct. All fields (both declared and inherited) must be specified in any
1321+
initializers. Inheritance between structures does not give subtyping or
1322+
coercion. The super-struct and sub-struct must be defined in the same crate.
1323+
The super-struct must be declared using the `virtual` keyword. For example:
1324+
1325+
```{.ignore}
1326+
virtual struct Sup { x: int }
1327+
struct Sub : Sup { y: int }
1328+
let s = Sub {x: 10, y: 11};
1329+
let sx = s.x;
1330+
```
1331+
13311332
### Enumerations
13321333

13331334
An _enumeration_ is a simultaneous definition of a nominal [enumerated
@@ -2049,28 +2050,26 @@ fn macos_only() {
20492050
}
20502051
20512052
// This function is only included when either foo or bar is defined
2052-
#[cfg(any(foo, bar))]
2053+
#[cfg(foo)]
2054+
#[cfg(bar)]
20532055
fn needs_foo_or_bar() {
20542056
// ...
20552057
}
20562058
20572059
// This function is only included when compiling for a unixish OS with a 32-bit
20582060
// architecture
2059-
#[cfg(all(unix, target_word_size = "32"))]
2061+
#[cfg(unix, target_word_size = "32")]
20602062
fn on_32bit_unix() {
20612063
// ...
20622064
}
2063-
2064-
// This function is only included when foo is not defined
2065-
#[cfg(not(foo))]
2066-
fn needs_not_foo() {
2067-
// ...
2068-
}
20692065
```
20702066

20712067
This illustrates some conditional compilation can be achieved using the
2072-
`#[cfg(...)]` attribute. `any`, `all` and `not` can be used to assemble
2073-
arbitrarily complex configurations through nesting.
2068+
`#[cfg(...)]` attribute. Note that `#[cfg(foo, bar)]` is a condition that needs
2069+
both `foo` and `bar` to be defined while `#[cfg(foo)] #[cfg(bar)]` only needs
2070+
one of `foo` and `bar` to be defined (this resembles in the disjunctive normal
2071+
form). Additionally, one can reverse a condition by enclosing it in a
2072+
`not(...)`, like e. g. `#[cfg(not(target_os = "win32"))]`.
20742073

20752074
The following configurations must be defined by the implementation:
20762075

@@ -2488,8 +2487,6 @@ The currently implemented features of the reference compiler are:
24882487

24892488
* `if_let` - Allows use of the `if let` syntax.
24902489

2491-
* `while_let` - Allows use of the `while let` syntax.
2492-
24932490
* `intrinsics` - Allows use of the "rust-intrinsics" ABI. Compiler intrinsics
24942491
are inherently unstable and no promise about them is made.
24952492

@@ -3496,18 +3493,6 @@ of a condition expression it expects a refutable let statement. If the value of
34963493
expression on the right hand side of the let statement matches the pattern, the corresponding
34973494
block will execute, otherwise flow proceeds to the first `else` block that follows.
34983495

3499-
### While let loops
3500-
3501-
```{.ebnf .gram}
3502-
while_let_expr : "while" "let" pat '=' expr '{' block '}' ;
3503-
```
3504-
3505-
A `while let` loop is semantically identical to a `while` loop but in place of a
3506-
condition expression it expects a refutable let statement. If the value of the
3507-
expression on the right hand side of the let statement matches the pattern, the
3508-
loop body block executes and control returns to the pattern matching statement.
3509-
Otherwise, the while expression completes.
3510-
35113496
### Return expressions
35123497

35133498
```{.ebnf .gram}

branches/try/src/doc/rust.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,4 +393,9 @@ pre.rust { position: relative; }
393393
}
394394
}
395395

396-
#keywords table td { border: none; }
396+
#keyword-table-marker + table thead { display: none; }
397+
#keyword-table-marker + table td { border: none; }
398+
#keyword-table-marker + table {
399+
margin-left: 2em;
400+
margin-bottom: 1em;
401+
}

branches/try/src/libcollections/bitv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
//! bv.set(0, false);
3434
//! bv.set(1, false);
3535
//!
36-
//! for i in iter::range_inclusive(2, (max_prime as f64).sqrt() as uint) {
36+
//! for i in range(2, max_prime) {
3737
//! // if i is a prime
3838
//! if bv[i] {
3939
//! // Mark all multiples of i as non-prime (any multiples below i * i

branches/try/src/librustc/back/write.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ use std::sync::{Arc, Mutex};
3434
use std::task::TaskBuilder;
3535
use libc::{c_uint, c_int, c_void};
3636

37+
3738
#[deriving(Clone, PartialEq, PartialOrd, Ord, Eq)]
3839
pub enum OutputType {
3940
OutputTypeBitcode,
@@ -43,6 +44,7 @@ pub enum OutputType {
4344
OutputTypeExe,
4445
}
4546

47+
4648
pub fn llvm_err(handler: &diagnostic::Handler, msg: String) -> ! {
4749
unsafe {
4850
let cstr = llvm::LLVMRustGetLastError();
@@ -200,10 +202,6 @@ fn create_target_machine(sess: &Session) -> TargetMachineRef {
200202
(sess.targ_cfg.os == abi::OsMacos &&
201203
sess.targ_cfg.arch == abi::X86_64);
202204

203-
let any_library = sess.crate_types.borrow().iter().any(|ty| {
204-
*ty != config::CrateTypeExecutable
205-
});
206-
207205
// OSX has -dead_strip, which doesn't rely on ffunction_sections
208206
// FIXME(#13846) this should be enabled for windows
209207
let ffunction_sections = sess.targ_cfg.os != abi::OsMacos &&
@@ -242,7 +240,6 @@ fn create_target_machine(sess: &Session) -> TargetMachineRef {
242240
true /* EnableSegstk */,
243241
use_softfp,
244242
no_fp_elim,
245-
!any_library && reloc_model == llvm::RelocPIC,
246243
ffunction_sections,
247244
fdata_sections,
248245
)

branches/try/src/librustc/diagnostics.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ register_diagnostics!(
5656
E0038,
5757
E0039,
5858
E0040,
59+
E0041,
5960
E0044,
6061
E0045,
6162
E0046,
@@ -122,6 +123,7 @@ register_diagnostics!(
122123
E0121,
123124
E0122,
124125
E0124,
126+
E0126,
125127
E0127,
126128
E0128,
127129
E0129,
@@ -139,12 +141,14 @@ register_diagnostics!(
139141
E0141,
140142
E0152,
141143
E0153,
144+
E0154,
145+
E0155,
146+
E0156,
142147
E0157,
143148
E0158,
144149
E0159,
145150
E0161,
146151
E0162,
147152
E0163,
148-
E0164,
149-
E0165
153+
E0164
150154
)

branches/try/src/librustc/lint/builtin.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,8 +1082,7 @@ impl LintPass for UnnecessaryParens {
10821082
ast::ExprWhile(ref cond, _, _) => (cond, "`while` condition", true),
10831083
ast::ExprMatch(ref head, _, source) => match source {
10841084
ast::MatchNormal => (head, "`match` head expression", true),
1085-
ast::MatchIfLetDesugar => (head, "`if let` head expression", true),
1086-
ast::MatchWhileLetDesugar => (head, "`while let` head expression", true),
1085+
ast::MatchIfLetDesugar => (head, "`if let` head expression", true)
10871086
},
10881087
ast::ExprRet(Some(ref value)) => (value, "`return` value", false),
10891088
ast::ExprAssign(_, ref value) => (value, "assigned value", false),

branches/try/src/librustc/middle/cfg/construct.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,6 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
259259
expr_exit
260260
}
261261

262-
ast::ExprWhileLet(..) => {
263-
self.tcx.sess.span_bug(expr.span, "non-desugared ExprWhileLet");
264-
}
265-
266262
ast::ExprForLoop(ref pat, ref head, ref body, _) => {
267263
//
268264
// [pred]

0 commit comments

Comments
 (0)