Skip to content

Commit 58dbdbf

Browse files
committed
---
yaml --- r: 139307 b: refs/heads/try2 c: 624a685 h: refs/heads/master i: 139305: 15138ff 139303: 790bc0e v: v3
1 parent 978c1a0 commit 58dbdbf

Some content is hidden

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

45 files changed

+277
-629
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 3f7c74d0225354b93bf7649fed8cdd2774480106
8+
refs/heads/try2: 624a685283f66afcb40ee3c235624aedebc2f08f
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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/try2/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/try2/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/try2/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/try2/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/try2/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/try2/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/try2/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/try2/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/try2/src/libcore/num/strconv.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ impl_NumStrConv_Integer!(u16)
130130
impl_NumStrConv_Integer!(u32)
131131
impl_NumStrConv_Integer!(u64)
132132

133+
134+
// Special value strings as [u8] consts.
135+
const inf_buf: [u8*3] = ['i' as u8, 'n' as u8, 'f' as u8];
136+
const positive_inf_buf: [u8*4] = ['+' as u8, 'i' as u8, 'n' as u8, 'f' as u8];
137+
const negative_inf_buf: [u8*4] = ['-' as u8, 'i' as u8, 'n' as u8, 'f' as u8];
138+
const nan_buf: [u8*3] = ['N' as u8, 'a' as u8, 'N' as u8];
139+
133140
/**
134141
* Converts a number to its string representation as a byte vector.
135142
* This is meant to be a common base implementation for all numeric string
@@ -479,15 +486,15 @@ pub fn from_str_bytes_common<T:NumCast+Zero+One+Ord+Copy+Div<T,T>+
479486
}
480487

481488
if special {
482-
if buf == str::inf_buf || buf == str::positive_inf_buf {
489+
if buf == inf_buf || buf == positive_inf_buf {
483490
return NumStrConv::inf();
484-
} else if buf == str::negative_inf_buf {
491+
} else if buf == negative_inf_buf {
485492
if negative {
486493
return NumStrConv::neg_inf();
487494
} else {
488495
return None;
489496
}
490-
} else if buf == str::nan_buf {
497+
} else if buf == nan_buf {
491498
return NumStrConv::NaN();
492499
}
493500
}

branches/try2/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/try2/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/try2/src/libcore/str.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1919,14 +1919,6 @@ static tag_five_b: uint = 248u;
19191919
static max_five_b: uint = 67108864u;
19201920
static tag_six_b: uint = 252u;
19211921

1922-
// Constants used for converting strs to floats
1923-
pub static inf_buf: [u8*3] = ['i' as u8, 'n' as u8, 'f' as u8];
1924-
pub static positive_inf_buf: [u8*4] = ['+' as u8, 'i' as u8,
1925-
'n' as u8, 'f' as u8];
1926-
pub static negative_inf_buf: [u8*4] = ['-' as u8, 'i' as u8,
1927-
'n' as u8, 'f' as u8];
1928-
pub static nan_buf: [u8*3] = ['N' as u8, 'a' as u8, 'N' as u8];
1929-
19301922
/**
19311923
* Work with the byte buffer of a string.
19321924
*

branches/try2/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/try2/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/try2/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/try2/src/librustc/middle/borrowck/gather_loans.rs

Lines changed: 2 additions & 3 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, ex.span, tcx.ty(ex));
148+
let scope_r = ty_region(tcx.ty(ex));
149149
self.guarantee_valid(base_cmt, mutbl, scope_r);
150150
visit::visit_expr(ex, self, vt);
151151
}
@@ -599,8 +599,7 @@ 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(), pat.span,
603-
self.tcx().ty(pat));
602+
let scope_r = ty_region(self.tcx().ty(pat));
604603

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

branches/try2/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/try2/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

0 commit comments

Comments
 (0)