Skip to content

Commit 74d8a06

Browse files
committed
---
yaml --- r: 50994 b: refs/heads/try c: 969e8b7 h: refs/heads/master v: v3
1 parent 17d5d1e commit 74d8a06

Some content is hidden

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

42 files changed

+258
-600
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: 5f13e9ccc2e3328d4cd8ca49f84e6840dd998346
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: f7a2371c176663d59062ec5158f39faecba45768
5-
refs/heads/try: 3f7c74d0225354b93bf7649fed8cdd2774480106
5+
refs/heads/try: 969e8b76a184ce3083c7854a986baf3f279b5c81
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/RELEASES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ Version 0.6 (March 2013)
6262
* Pattern matching over vectors improved and expanded
6363
* Typechecking of closure types has been overhauled to
6464
improve inference and eliminate unsoundness
65+
* Macros leave scope at the end of modules, unless that module is
66+
tagged with #[macro_escape]
6567

6668
* Libraries
6769
* Added big integers to `std::bigint`

branches/try/doc/rust.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,4 @@ td {
101101
#TOC ul {
102102
list-style: none;
103103
padding-left: 0px;
104-
}
105-
106-
/* Adjust list alignment so rustdoc indexes don't align with blockquotes */
107-
div.index ul {
108-
padding-left: 1em;
109104
}

branches/try/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/try/src/libcore/cast.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Unsafe casting functions
12-
1311
pub mod rusti {
1412
#[abi = "rust-intrinsic"]
1513
#[link_name = "rusti"]

branches/try/src/libcore/cell.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,13 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! A mutable, nullable memory location
12-
1311
use cast::transmute;
1412
use option;
1513
use prelude::*;
1614

17-
/*
18-
A dynamic, mutable location.
19-
20-
Similar to a mutable option type, but friendlier.
21-
*/
15+
/// A dynamic, mutable location.
16+
///
17+
/// Similar to a mutable option type, but friendlier.
2218
2319
pub struct Cell<T> {
2420
mut value: Option<T>

branches/try/src/libcore/clone.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
/*! The Clone trait for types that cannot be "implicitly copied"
12-
13-
In Rust, some simple types are "implicitly copyable" and when you
14-
assign them or pass them as arguments, the receiver will get a copy,
15-
leaving the original value in place. These types do not require
16-
allocation to copy and do not have finalizers (i.e. they do not
17-
contain owned pointers or implement `Drop`), so the compiler considers
18-
them cheap and safe to copy and automatically implements the `Copy`
19-
trait for them. For other types copies must be made explicitly,
20-
by convention implementing the `Clone` trait and calling the
21-
`clone` method.
22-
11+
/**
12+
Clonable types are copied with the clone method
2313
*/
24-
2514
pub trait Clone {
2615
fn clone(&self) -> Self;
2716
}

branches/try/src/libcore/comm.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
/*!
12-
Message passing
13-
*/
14-
1511
use cast;
1612
use either::{Either, Left, Right};
1713
use kinds::Owned;

branches/try/src/libcore/condition.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
/*! Condition handling */
12-
1311
use prelude::*;
1412
use task;
1513
use task::local_data::{local_data_pop, local_data_set};

branches/try/src/libcore/core.rc

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,39 +10,27 @@
1010

1111
/*!
1212

13-
# The Rust core library
13+
The Rust core library
1414

1515
The Rust core library provides runtime features required by the language,
1616
including the task scheduler and memory allocators, as well as library
1717
support for Rust built-in types, platform abstractions, and other commonly
1818
used features.
1919

2020
`core` includes modules corresponding to each of the integer types, each of
21-
the floating point types, the `bool` type, tuples, characters, strings
22-
(`str`), vectors (`vec`), managed boxes (`managed`), owned boxes (`owned`),
23-
and unsafe and borrowed pointers (`ptr`). Additionally, `core` provides
24-
pervasive types (`option` and `result`), task creation and communication
25-
primitives (`task`, `comm`), platform abstractions (`os` and `path`), basic
26-
I/O abstractions (`io`), common traits (`kinds`, `ops`, `cmp`, `num`,
27-
`to_str`), and complete bindings to the C standard library (`libc`).
21+
the floating point types, the `bool` type, tuples, characters, strings,
22+
vectors (`vec`), managed boxes (`managed`), owned boxes (`owned`), and unsafe
23+
and borrowed pointers (`ptr`). Additionally, `core` provides task management
24+
and creation (`task`), communication primitives (`comm` and `pipes`), platform
25+
abstractions (`os` and `path`), basic I/O abstractions (`io`), common traits
26+
(`cmp`, `num`, `to_str`), and complete bindings to the C standard library
27+
(`libc`).
2828

29-
# Core injection and the Rust prelude
30-
31-
`core` is imported at the topmost level of every crate by default, as
32-
if the first line of each crate was
29+
`core` is linked to all crates by default and its contents imported.
30+
Implicitly, all crates behave as if they included the following prologue:
3331

3432
extern mod core;
35-
36-
This means that the contents of core can be accessed from from any context
37-
with the `core::` path prefix, as in `use core::vec`, `use core::task::spawn`,
38-
etc.
39-
40-
Additionally, `core` contains a `prelude` module that reexports many of the
41-
most common core modules, types and traits. The contents of the prelude are
42-
imported inte every *module* by default. Implicitly, all modules behave as if
43-
they contained the following prologue:
44-
45-
use core::prelude::*;
33+
use core::*;
4634

4735
*/
4836

branches/try/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/try/src/libcore/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! The Rust prelude. Imported into every module by default.
11+
// This file is imported into every module by default.
1212

1313
/* Reexported core operators */
1414

branches/try/src/libcore/rt/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[doc(hidden)];
12-
1311
use libc::c_char;
1412

1513
// Some basic logging

branches/try/src/libcore/unstable/lang.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,8 @@ pub unsafe fn borrow_as_imm(a: *u8) {
9999
#[lang="return_to_mut"]
100100
#[inline(always)]
101101
pub unsafe fn return_to_mut(a: *u8) {
102-
// Sometimes the box is null, if it is conditionally frozen.
103-
// See e.g. #4904.
104-
if !a.is_null() {
105-
let a: *mut BoxRepr = transmute(a);
106-
(*a).header.ref_count &= !FROZEN_BIT;
107-
}
102+
let a: *mut BoxRepr = transmute(a);
103+
(*a).header.ref_count &= !FROZEN_BIT;
108104
}
109105

110106
#[lang="check_not_borrowed"]

branches/try/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/try/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/try/src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,17 +1579,7 @@ pub fn new_fn_ctxt_w_id(ccx: @CrateContext,
15791579
id: ast::node_id,
15801580
impl_id: Option<ast::def_id>,
15811581
param_substs: Option<@param_substs>,
1582-
sp: Option<span>) -> fn_ctxt
1583-
{
1584-
for param_substs.each |p| { p.validate(); }
1585-
1586-
debug!("new_fn_ctxt_w_id(path=%s, id=%?, impl_id=%?, \
1587-
param_substs=%s",
1588-
path_str(ccx.sess, path),
1589-
id,
1590-
impl_id,
1591-
opt_param_substs_to_str(ccx.tcx, &param_substs));
1592-
1582+
sp: Option<span>) -> fn_ctxt {
15931583
let llbbs = mk_standard_basic_blocks(llfndecl);
15941584
return @mut fn_ctxt_ {
15951585
llfn: llfndecl,

branches/try/src/librustc/middle/trans/callee.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ pub fn trans_fn_ref_with_vtables(
217217
// - `type_params`: values for each of the fn/method's type parameters
218218
// - `vtables`: values for each bound on each of the type parameters
219219

220-
let _icx = bcx.insn_ctxt("trans_fn_ref_with_vtables");
220+
let _icx = bcx.insn_ctxt("trans_fn_with_vtables");
221221
let ccx = bcx.ccx();
222222
let tcx = ccx.tcx;
223223

@@ -228,8 +228,6 @@ pub fn trans_fn_ref_with_vtables(
228228
vtables);
229229
let _indenter = indenter();
230230

231-
fail_unless!(type_params.all(|t| !ty::type_needs_infer(*t)));
232-
233231
// Polytype of the function item (may have type params)
234232
let fn_tpt = ty::lookup_item_type(tcx, def_id);
235233

branches/try/src/librustc/middle/trans/common.rs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -250,25 +250,13 @@ pub struct param_substs {
250250
self_ty: Option<ty::t>
251251
}
252252

253-
pub impl param_substs {
254-
fn validate(&self) {
255-
for self.tys.each |t| { fail_unless!(!ty::type_needs_infer(*t)); }
256-
for self.self_ty.each |t| { fail_unless!(!ty::type_needs_infer(*t)); }
257-
}
258-
}
259-
260253
pub fn param_substs_to_str(tcx: ty::ctxt, substs: &param_substs) -> ~str {
261254
fmt!("param_substs {tys:%?, vtables:%?, bounds:%?}",
262255
substs.tys.map(|t| ty_to_str(tcx, *t)),
263256
substs.vtables.map(|vs| vs.map(|v| v.to_str(tcx))),
264257
substs.bounds.map(|b| ty::param_bounds_to_str(tcx, *b)))
265258
}
266259

267-
pub fn opt_param_substs_to_str(tcx: ty::ctxt,
268-
substs: &Option<@param_substs>) -> ~str {
269-
substs.map_default(~"None", |&ps| param_substs_to_str(tcx, ps))
270-
}
271-
272260
// Function context. Every LLVM function we create will have one of
273261
// these.
274262
pub struct fn_ctxt_ {
@@ -1379,13 +1367,6 @@ pub fn expr_ty_adjusted(bcx: block, ex: @ast::expr) -> ty::t {
13791367
pub fn node_id_type_params(bcx: block, id: ast::node_id) -> ~[ty::t] {
13801368
let tcx = bcx.tcx();
13811369
let params = ty::node_id_to_type_params(tcx, id);
1382-
1383-
if !params.all(|t| !ty::type_needs_infer(*t)) {
1384-
bcx.sess().bug(
1385-
fmt!("Type parameters for node %d include inference types: %s",
1386-
id, str::connect(params.map(|t| bcx.ty_to_str(*t)), ",")));
1387-
}
1388-
13891370
match bcx.fcx.param_substs {
13901371
Some(substs) => {
13911372
do vec::map(params) |t| {
@@ -1442,7 +1423,7 @@ pub fn resolve_vtable_in_fn_ctxt(fcx: fn_ctxt, +vt: typeck::vtable_origin)
14421423
}
14431424
14441425
pub fn find_vtable(tcx: ty::ctxt, ps: &param_substs,
1445-
n_param: uint, n_bound: uint)
1426+
n_param: uint, n_bound: uint)
14461427
-> typeck::vtable_origin {
14471428
debug!("find_vtable_in_fn_ctxt(n_param=%u, n_bound=%u, ps=%?)",
14481429
n_param, n_bound, param_substs_to_str(tcx, ps));

0 commit comments

Comments
 (0)