Skip to content

Commit 8b7700f

Browse files
committed
---
yaml --- r: 128958 b: refs/heads/try c: 1f1620e h: refs/heads/master v: v3
1 parent e4df134 commit 8b7700f

File tree

27 files changed

+189
-613
lines changed

27 files changed

+189
-613
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: 07d86b46a949a94223da714e35b343243e4ecce4
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a86d9ad15e339ab343a12513f9c90556f677b9ca
5-
refs/heads/try: cb5967e002dc33671f687b957ba8ae46a9de66fb
5+
refs/heads/try: 1f1620eed72f9b9c650576e3f6509c3267f0ab78
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/doc/complement-design-faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% The Rust Design FAQ
22

3-
This document describes decisions were arrived at after lengthy discussion and
3+
This document describes decisions that were arrived at after lengthy discussion and
44
experimenting with alternatives. Please do not propose reversing them unless
55
you have a new, extremely compelling argument. Note that this document
66
specifically talks about the *language* and not any library or implementation.

branches/try/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/try/src/doc/guide-tasks.md

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

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

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

356357
~~~
357358
# use std::rand;
358359
# use std::sync::Arc;
359360
# fn main() {
360361
# let numbers = Vec::from_fn(1000000, |_| rand::random::<f64>());
361-
let numbers_arc = Arc::new(numbers);
362+
let numbers_arc=Arc::new(numbers);
362363
# }
363364
~~~
364365

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ possible in two ways: the `#[start]` attribute, or overriding the
446446
default shim for the C `main` function with your own.
447447

448448
The function marked `#[start]` is passed the command line parameters
449-
in the same format as a C:
449+
in the same format as C:
450450

451451
```
452452
#![no_std]
@@ -593,7 +593,7 @@ standard library itself.
593593
# Interacting with the compiler internals
594594

595595
> **Note**: this section is specific to the `rustc` compiler; these
596-
> parts of the language may never be full specified and so details may
596+
> parts of the language may never be fully specified and so details may
597597
> differ wildly between implementations (and even versions of `rustc`
598598
> itself).
599599
>

branches/try/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/try/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/try/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/try/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/try/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/try/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/try/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/try/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/try/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)