Skip to content

Commit b035195

Browse files
committed
---
yaml --- r: 128506 b: refs/heads/auto c: 17c630a h: refs/heads/master v: v3
1 parent 32ab1c0 commit b035195

File tree

25 files changed

+184
-610
lines changed

25 files changed

+184
-610
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: b22e840d43ec8d0de0b95f26a76046cfcca93c22
16+
refs/heads/auto: 17c630a8dd4d8fbbf7e2fd454593c6529dcc93ab
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/doc/guide-pointers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ let z = &x;
332332
Mutable ones, however, are not:
333333

334334
```{rust,ignore}
335-
let mut x = 5i;
335+
let x = 5i;
336336
let y = &mut x;
337337
let z = &mut x; // error: cannot borrow `x` as mutable more than once at a time
338338
```

branches/auto/src/doc/guide-tasks.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,9 @@ closure in the new task.
8989
fn print_message() { println!("I am running in a different task!"); }
9090
spawn(print_message);
9191
92-
// Print something profound in a different task using a `proc` expression
92+
// Alternatively, use a `proc` expression instead of a named function.
9393
// The `proc` expression evaluates to an (unnamed) owned closure.
9494
// That closure will call `println!(...)` when the spawned task runs.
95-
9695
spawn(proc() println!("I am also running in a different task!") );
9796
~~~~
9897

@@ -352,14 +351,14 @@ fn main() {
352351

353352
The function `pnorm` performs a simple computation on the vector (it computes the sum of its items
354353
at the power given as argument and takes the inverse power of this value). The Arc on the vector is
355-
created by the line
354+
created by the line:
356355

357356
~~~
358357
# use std::rand;
359358
# use std::sync::Arc;
360359
# fn main() {
361360
# let numbers = Vec::from_fn(1000000, |_| rand::random::<f64>());
362-
let numbers_arc=Arc::new(numbers);
361+
let numbers_arc = Arc::new(numbers);
363362
# }
364363
~~~
365364

branches/auto/src/libcore/str.rs

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,25 +1094,13 @@ pub trait StrSlice<'a> {
10941094
/// # Arguments
10951095
///
10961096
/// - needle - The string to look for
1097-
///
1098-
/// # Example
1099-
///
1100-
/// ```rust
1101-
/// assert!("bananas".contains("nana"));
1102-
/// ```
11031097
fn contains<'a>(&self, needle: &'a str) -> bool;
11041098

11051099
/// Returns true if a string contains a char.
11061100
///
11071101
/// # Arguments
11081102
///
11091103
/// - needle - The char to look for
1110-
///
1111-
/// # Example
1112-
///
1113-
/// ```rust
1114-
/// assert!("hello".contains_char('e'));
1115-
/// ```
11161104
fn contains_char(&self, needle: char) -> bool;
11171105

11181106
/// An iterator over the characters of `self`. Note, this iterates
@@ -1127,13 +1115,6 @@ pub trait StrSlice<'a> {
11271115
fn chars(&self) -> Chars<'a>;
11281116

11291117
/// An iterator over the bytes of `self`
1130-
///
1131-
/// # Example
1132-
///
1133-
/// ```rust
1134-
/// let v: Vec<u8> = "bors".bytes().collect();
1135-
/// assert_eq!(v, b"bors".to_vec());
1136-
/// ```
11371118
fn bytes(&self) -> Bytes<'a>;
11381119

11391120
/// An iterator over the characters of `self` and their byte offsets.
@@ -1400,21 +1381,9 @@ pub trait StrSlice<'a> {
14001381
fn slice_chars(&self, begin: uint, end: uint) -> &'a str;
14011382

14021383
/// Returns true if `needle` is a prefix of the string.
1403-
///
1404-
/// # Example
1405-
///
1406-
/// ```rust
1407-
/// assert!("banana".starts_with("ba"));
1408-
/// ```
14091384
fn starts_with(&self, needle: &str) -> bool;
14101385

14111386
/// Returns true if `needle` is a suffix of the string.
1412-
///
1413-
/// # Example
1414-
///
1415-
/// ```rust
1416-
/// assert!("banana".ends_with("nana"));
1417-
/// ```
14181387
fn ends_with(&self, needle: &str) -> bool;
14191388

14201389
/// Returns a string with characters that match `to_trim` removed.
@@ -1556,15 +1525,6 @@ pub trait StrSlice<'a> {
15561525

15571526
/// Plucks the character starting at the `i`th byte of a string.
15581527
///
1559-
/// # Example
1560-
///
1561-
/// ```rust
1562-
/// let s = "abπc";
1563-
/// assert_eq!(s.char_at(1), 'b');
1564-
/// assert_eq!(s.char_at(2), 'π');
1565-
/// assert_eq!(s.char_at(4), 'c');
1566-
/// ```
1567-
///
15681528
/// # Failure
15691529
///
15701530
/// If `i` is greater than or equal to the length of the string.
@@ -1580,12 +1540,6 @@ pub trait StrSlice<'a> {
15801540
fn char_at_reverse(&self, i: uint) -> char;
15811541

15821542
/// Work with the byte buffer of a string as a byte slice.
1583-
///
1584-
/// # Example
1585-
///
1586-
/// ```rust
1587-
/// assert_eq!("bors".as_bytes(), b"bors");
1588-
/// ```
15891543
fn as_bytes(&self) -> &'a [u8];
15901544

15911545
/// Returns the byte index of the first character of `self` that

branches/auto/src/liblibc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ extern {}
304304
// If/when libprim happens, this can be removed in favor of that
305305
pub enum Nullable<T> {
306306
Null,
307-
NotNull(T)
307+
Some(T)
308308
}
309309

310310
pub mod types {

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,15 +473,14 @@ impl<'a> CFGBuilder<'a> {
473473
ast::ExprInlineAsm(ref inline_asm) => {
474474
let inputs = inline_asm.inputs.iter();
475475
let outputs = inline_asm.outputs.iter();
476+
fn extract_expr<A>(&(_, expr): &(A, Gc<ast::Expr>)) -> Gc<ast::Expr> { expr }
476477
let post_inputs = self.exprs(inputs.map(|a| {
477478
debug!("cfg::construct InlineAsm id:{} input:{:?}", expr.id, a);
478-
let &(_, expr) = a;
479-
expr
479+
extract_expr(a)
480480
}), pred);
481481
let post_outputs = self.exprs(outputs.map(|a| {
482482
debug!("cfg::construct InlineAsm id:{} output:{:?}", expr.id, a);
483-
let &(_, expr, _) = a;
484-
expr
483+
extract_expr(a)
485484
}), post_inputs);
486485
self.add_node(expr.id, [post_outputs])
487486
}

branches/auto/src/librustc/middle/expr_use_visitor.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,8 @@ impl<'d,'t,TYPER:mc::Typer> ExprUseVisitor<'d,'t,TYPER> {
380380
self.consume_expr(&**input);
381381
}
382382

383-
for &(_, ref output, is_rw) in ia.outputs.iter() {
384-
self.mutate_expr(expr, &**output,
385-
if is_rw { WriteAndRead } else { JustWrite });
383+
for &(_, ref output) in ia.outputs.iter() {
384+
self.mutate_expr(expr, &**output, JustWrite);
386385
}
387386
}
388387

branches/auto/src/librustc/middle/liveness.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,10 +1192,9 @@ impl<'a> Liveness<'a> {
11921192
}
11931193

11941194
ExprInlineAsm(ref ia) => {
1195-
1196-
let succ = ia.outputs.iter().rev().fold(succ, |succ, &(_, ref expr, _)| {
1197-
// see comment on lvalues
1198-
// in propagate_through_lvalue_components()
1195+
let succ = ia.outputs.iter().rev().fold(succ, |succ, &(_, ref expr)| {
1196+
// see comment on lvalues in
1197+
// propagate_through_lvalue_components()
11991198
let succ = self.write_lvalue(&**expr, succ, ACC_WRITE);
12001199
self.propagate_through_lvalue_components(&**expr, succ)
12011200
});
@@ -1438,7 +1437,7 @@ fn check_expr(this: &mut Liveness, expr: &Expr) {
14381437
}
14391438

14401439
// Output operands must be lvalues
1441-
for &(_, ref out, _) in ia.outputs.iter() {
1440+
for &(_, ref out) in ia.outputs.iter() {
14421441
this.check_lvalue(&**out);
14431442
this.visit_expr(&**out, ());
14441443
}

branches/auto/src/librustc/middle/trans/asm.rs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,13 @@ pub fn trans_inline_asm<'a>(bcx: &'a Block<'a>, ia: &ast::InlineAsm)
3636

3737
let temp_scope = fcx.push_custom_cleanup_scope();
3838

39-
let mut ext_inputs = Vec::new();
40-
let mut ext_constraints = Vec::new();
41-
4239
// Prepare the output operands
43-
let outputs = ia.outputs.iter().enumerate().map(|(i, &(ref c, ref out, is_rw))| {
40+
let outputs = ia.outputs.iter().map(|&(ref c, ref out)| {
4441
constraints.push((*c).clone());
4542

4643
let out_datum = unpack_datum!(bcx, expr::trans(bcx, &**out));
4744
output_types.push(type_of::type_of(bcx.ccx(), out_datum.ty));
48-
let val = out_datum.val;
49-
if is_rw {
50-
ext_inputs.push(unpack_result!(bcx, {
51-
callee::trans_arg_datum(bcx,
52-
expr_ty(bcx, &**out),
53-
out_datum,
54-
cleanup::CustomScope(temp_scope),
55-
callee::DontAutorefArg)
56-
}));
57-
ext_constraints.push(i.to_string());
58-
}
59-
val
45+
out_datum.val
6046

6147
}).collect::<Vec<_>>();
6248

@@ -72,15 +58,14 @@ pub fn trans_inline_asm<'a>(bcx: &'a Block<'a>, ia: &ast::InlineAsm)
7258
cleanup::CustomScope(temp_scope),
7359
callee::DontAutorefArg)
7460
})
75-
}).collect::<Vec<_>>().append(ext_inputs.as_slice());
61+
}).collect::<Vec<_>>();
7662

7763
// no failure occurred preparing operands, no need to cleanup
7864
fcx.pop_custom_cleanup_scope(temp_scope);
7965

8066
let mut constraints =
8167
String::from_str(constraints.iter()
8268
.map(|s| s.get().to_string())
83-
.chain(ext_constraints.move_iter())
8469
.collect::<Vec<String>>()
8570
.connect(",")
8671
.as_slice());

branches/auto/src/librustc/middle/trans/cabi_x86_64.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,11 @@ fn classify_ty(ty: Type) -> Vec<RegClass> {
176176
}
177177

178178
fn classify_struct(tys: &[Type],
179-
cls: &mut [RegClass],
180-
i: uint,
181-
off: uint,
182-
packed: bool) {
179+
cls: &mut [RegClass], i: uint,
180+
off: uint) {
183181
let mut field_off = off;
184182
for ty in tys.iter() {
185-
if !packed {
186-
field_off = align(field_off, *ty);
187-
}
183+
field_off = align(field_off, *ty);
188184
classify(*ty, cls, i, field_off);
189185
field_off += ty_size(*ty);
190186
}
@@ -223,7 +219,7 @@ fn classify_ty(ty: Type) -> Vec<RegClass> {
223219
unify(cls, ix + off / 8u, SSEDs);
224220
}
225221
Struct => {
226-
classify_struct(ty.field_types().as_slice(), cls, ix, off, ty.is_packed());
222+
classify_struct(ty.field_types().as_slice(), cls, ix, off);
227223
}
228224
Array => {
229225
let len = ty.array_length();

branches/auto/src/librustc/middle/trans/debuginfo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3729,7 +3729,7 @@ fn populate_scope_map(cx: &CrateContext,
37293729
walk_expr(cx, &**exp, scope_stack, scope_map);
37303730
}
37313731

3732-
for &(_, ref exp, _) in outputs.iter() {
3732+
for &(_, ref exp) in outputs.iter() {
37333733
walk_expr(cx, &**exp, scope_stack, scope_map);
37343734
}
37353735
}

branches/auto/src/librustc/middle/typeck/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3332,7 +3332,7 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
33323332
for &(_, ref input) in ia.inputs.iter() {
33333333
check_expr(fcx, &**input);
33343334
}
3335-
for &(_, ref out, _) in ia.outputs.iter() {
3335+
for &(_, ref out) in ia.outputs.iter() {
33363336
check_expr(fcx, &**out);
33373337
}
33383338
fcx.write_nil(id);

0 commit comments

Comments
 (0)