Skip to content

Commit d563fe9

Browse files
committed
---
yaml --- r: 54141 b: refs/heads/dist-snap c: 74fb263 h: refs/heads/master i: 54139: 07be3dd v: v3
1 parent 2090d1c commit d563fe9

File tree

9 files changed

+29
-50
lines changed

9 files changed

+29
-50
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: 44d4d6de762f3f9aae1fedcf454c66b79b3ad58d
10-
refs/heads/dist-snap: e1dccf9a7362d0537b92f6c642a00e3c716c7b60
10+
refs/heads/dist-snap: 74fb263f7a8d385635e0861593ce6d72d0e5ec10
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/RELEASES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ Version 0.6 (March 2013)
4141
* Pattern matching over vectors improved and expanded
4242
* `const` renamed to `static` to correspond to lifetime name,
4343
and make room for future `static mut` unsafe mutable globals.
44+
* Replaced `#[deriving_eq]` with `#[deriving(Eq)]`
45+
* `Clone` implementations can be automatically generated with
46+
`#[deriving(Clone)]`
4447

4548
* Semantic changes
4649
* Types with owned pointers or custom destructors move by default,

branches/dist-snap/doc/rust.md

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,10 +1671,6 @@ vec_elems : [expr [',' expr]*] | [expr ',' ".." expr]
16711671
A [_vector_](#vector-types) _expression_ is written by enclosing zero or
16721672
more comma-separated expressions of uniform type in square brackets.
16731673

1674-
In the `[expr ',' ".." expr]` form, the expression after the `".."`
1675-
must be a constant expression that can be evaluated at compile time, such
1676-
as a [literal](#literals) or a [static item](#static-items).
1677-
16781674
~~~~
16791675
[1, 2, 3, 4];
16801676
["a", "b", "c", "d"];
@@ -2160,19 +2156,6 @@ do f |j| {
21602156
}
21612157
~~~~
21622158

2163-
In this example, both calls to the (binary) function `k` are equivalent:
2164-
2165-
~~~~
2166-
# fn k(x:int, f: &fn(int)) { }
2167-
# fn l(i: int) { }
2168-
2169-
k(3, |j| l(j));
2170-
2171-
do k(3) |j| {
2172-
l(j);
2173-
}
2174-
~~~~
2175-
21762159

21772160
### For expressions
21782161

@@ -2201,7 +2184,7 @@ and early boolean-valued returns from the `block` function,
22012184
such that the meaning of `break` and `loop` is preserved in a primitive loop
22022185
when rewritten as a `for` loop controlled by a higher order function.
22032186

2204-
An example of a for loop over the contents of a vector:
2187+
An example a for loop:
22052188

22062189
~~~~
22072190
# type foo = int;
@@ -2215,14 +2198,6 @@ for v.each |e| {
22152198
}
22162199
~~~~
22172200

2218-
An example of a for loop over a series of integers:
2219-
2220-
~~~~
2221-
# fn bar(b:uint) { }
2222-
for uint::range(0, 256) |i| {
2223-
bar(i);
2224-
}
2225-
~~~~
22262201

22272202
### If expressions
22282203

@@ -2499,7 +2474,6 @@ fail_unless!(b != "world");
24992474

25002475
The vector type constructor represents a homogeneous array of values of a given type.
25012476
A vector has a fixed size.
2502-
(Operations like `vec::push` operate solely on owned vectors.)
25032477
A vector type can be annotated with a _definite_ size,
25042478
written with a trailing asterisk and integer literal, such as `[int * 10]`.
25052479
Such a definite-sized vector type is a first-class type, since its size is known statically.
@@ -2510,10 +2484,6 @@ such as `&[T]`, `@[T]` or `~[T]`.
25102484
The kind of a vector type depends on the kind of its element type,
25112485
as with other simple structural types.
25122486

2513-
Expressions producing vectors of definite size cannot be evaluated in a
2514-
context expecting a vector of indefinite size; one must copy the
2515-
definite-sized vector contents into a distinct vector of indefinite size.
2516-
25172487
An example of a vector type and its use:
25182488

25192489
~~~~

branches/dist-snap/src/libcore/iter.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,7 @@ pub fn build_sized_opt<A,B: Buildable<A>>(size: Option<uint>,
284284

285285
// Functions that combine iteration and building
286286

287-
/// Applies a function to each element of an iterable and returns the results
288-
/// in a sequence built via `BU`. See also `map_to_vec`.
287+
/// Applies a function to each element of an iterable and returns the results.
289288
#[inline(always)]
290289
pub fn map<T,IT: BaseIter<T>,U,BU: Buildable<U>>(v: &IT, f: &fn(&T) -> U)
291290
-> BU {

branches/dist-snap/src/libcore/vec.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,12 @@ pub fn with_capacity<T>(capacity: uint) -> ~[T] {
172172
/**
173173
* Builds a vector by calling a provided function with an argument
174174
* function that pushes an element to the back of a vector.
175-
* This version takes an initial capacity for the vector.
175+
* This version takes an initial size for the vector.
176176
*
177177
* # Arguments
178178
*
179179
* * size - An initial size of the vector to reserve
180-
* * builder - A function that will construct the vector. It receives
180+
* * builder - A function that will construct the vector. It recieves
181181
* as an argument a function that will push an element
182182
* onto the vector being constructed.
183183
*/
@@ -194,7 +194,7 @@ pub fn build_sized<A>(size: uint, builder: &fn(push: &fn(v: A))) -> ~[A] {
194194
*
195195
* # Arguments
196196
*
197-
* * builder - A function that will construct the vector. It receives
197+
* * builder - A function that will construct the vector. It recieves
198198
* as an argument a function that will push an element
199199
* onto the vector being constructed.
200200
*/

branches/dist-snap/src/librustc/README.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ lib/ - bindings to LLVM
3232
The files concerned purely with syntax -- that is, the AST, parser,
3333
pretty-printer, lexer, macro expander, and utilities for traversing
3434
ASTs -- are in a separate crate called "syntax", whose files are in
35-
./../libsyntax, where . is the current directory (that is, the parent
36-
directory of front/, middle/, back/, and so on).
35+
./../libsyntax if the parent directory of front/, middle/, back/, and
36+
so on is . .
3737

3838
The entry-point for the compiler is main() in driver/rustc.rs, and
3939
this file sequences the various parts together.

branches/dist-snap/src/librustc/middle/borrowck/gather_loans.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ fn req_loans_in_expr(ex: @ast::expr,
145145

146146
// make sure that the thing we are pointing out stays valid
147147
// for the lifetime `scope_r` of the resulting ptr:
148-
let scope_r = ty_region(tcx.ty(ex));
148+
let scope_r = ty_region(tcx, ex.span, tcx.ty(ex));
149149
self.guarantee_valid(base_cmt, mutbl, scope_r);
150150
visit::visit_expr(ex, self, vt);
151151
}
@@ -599,7 +599,8 @@ pub impl GatherLoanCtxt {
599599
// find the region of the resulting pointer (note that
600600
// the type of such a pattern will *always* be a
601601
// region pointer)
602-
let scope_r = ty_region(self.tcx().ty(pat));
602+
let scope_r = ty_region(self.tcx(), pat.span,
603+
self.tcx().ty(pat));
603604

604605
// if the scope of the region ptr turns out to be
605606
// specific to this arm, wrap the categorization with

branches/dist-snap/src/librustc/middle/ty.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2794,13 +2794,18 @@ pub fn ty_vstore(ty: t) -> vstore {
27942794
}
27952795
}
27962796

2797-
pub fn ty_region(ty: t) -> Region {
2797+
pub fn ty_region(tcx: ctxt,
2798+
span: span,
2799+
ty: t) -> Region {
27982800
match get(ty).sty {
2799-
ty_rptr(r, _) => r,
2800-
ty_evec(_, vstore_slice(r)) => r,
2801-
ty_estr(vstore_slice(r)) => r,
2802-
ref s => fail!(fmt!("ty_region() invoked on in appropriate ty: %?",
2803-
(*s)))
2801+
ty_rptr(r, _) => r,
2802+
ty_evec(_, vstore_slice(r)) => r,
2803+
ty_estr(vstore_slice(r)) => r,
2804+
ref s => {
2805+
tcx.sess.span_bug(
2806+
span,
2807+
fmt!("ty_region() invoked on in appropriate ty: %?", s));
2808+
}
28042809
}
28052810
}
28062811

branches/dist-snap/src/librustc/middle/typeck/check/regionck.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -616,8 +616,9 @@ pub mod guarantor {
616616
// mk_subr should never fail.
617617
let rptr_ty = rcx.resolve_node_type(id);
618618
if !ty::type_is_error(rptr_ty) {
619-
debug!("rptr_ty=%s", ty_to_str(rcx.fcx.ccx.tcx, rptr_ty));
620-
let r = ty::ty_region(rptr_ty);
619+
let tcx = rcx.fcx.ccx.tcx;
620+
debug!("rptr_ty=%s", ty_to_str(tcx, rptr_ty));
621+
let r = ty::ty_region(tcx, span, rptr_ty);
621622
infallibly_mk_subr(rcx, true, span, r, bound);
622623
}
623624
}
@@ -890,7 +891,7 @@ pub mod guarantor {
890891
ast::pat_region(p) => {
891892
let rptr_ty = rcx.resolve_node_type(pat.id);
892893
if !ty::type_is_error(rptr_ty) {
893-
let r = ty::ty_region(rptr_ty);
894+
let r = ty::ty_region(rcx.fcx.tcx(), pat.span, rptr_ty);
894895
link_ref_bindings_in_pat(rcx, p, Some(r));
895896
}
896897
}

0 commit comments

Comments
 (0)