Skip to content

Commit 8cf6388

Browse files
committed
---
yaml --- r: 41919 b: refs/heads/master c: d77f8d5 h: refs/heads/master i: 41917: 6359266 41915: 7b836aa 41911: acad4f9 41903: 55cc6aa 41887: 214eefd 41855: db144bf v: v3
1 parent 2e014aa commit 8cf6388

Some content is hidden

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

62 files changed

+547
-274
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 8bf9bae30389b69bebeed4b1da60166fe0458a3f
2+
refs/heads/master: d77f8d55542bd0649031b8ccc45f5a7a3a4fbd07
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
55
refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650

trunk/AUTHORS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Benjamin Jackman <[email protected]>
2626
Benjamin Kircher <[email protected]>
2727
Benjamin Peterson <[email protected]>
2828
Bilal Husain <[email protected]>
29+
Bill Fallon <[email protected]>
2930
Brendan Eich <[email protected]>
3031
Brian Anderson <[email protected]>
3132
Brian J. Burg <[email protected]>

trunk/doc/rust.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3018,6 +3018,11 @@ Local variables are immutable unless declared with `let mut`. The
30183018
declaration (so `let mut x, y` declares two mutable variables, `x` and
30193019
`y`).
30203020

3021+
Function parameters are immutable unless declared with `mut`. The
3022+
`mut` keyword applies only to the following parameter (so `|mut x, y|`
3023+
and `fn f(mut x: ~int, y: ~int)` declare one mutable variable `x` and
3024+
one immutable variable `y`).
3025+
30213026
Local variables are not initialized when allocated; the entire frame worth of
30223027
local variables are allocated at once, on frame-entry, in an uninitialized
30233028
state. Subsequent statements within a function may or may not initialize the

trunk/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ fn check_expected_errors(expected_errors: ~[errors::expected_error],
273273
procres: procres) {
274274

275275
// true if we found the error in question
276-
let found_flags = vec::to_mut(vec::from_elem(
276+
let found_flags = vec::cast_to_mut(vec::from_elem(
277277
vec::len(expected_errors), false));
278278

279279
if procres.status == 0 {

trunk/src/libcargo/cargo.rc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use core::*;
5252
use core::dvec::DVec;
5353
use core::io::WriterUtil;
5454
use core::result::{Ok, Err};
55-
use core::hashmap::linear::LinearMap;
55+
use core::send_map::linear::LinearMap;
5656
use std::getopts::{optflag, optopt, opt_present};
5757
use std::map::HashMap;
5858
use std::{map, json, tempfile, term, sort, getopts};
@@ -465,19 +465,19 @@ fn parse_source(name: ~str, j: &json::Json) -> @Source {
465465

466466
match *j {
467467
json::Object(j) => {
468-
let mut url = match j.find_copy(&~"url") {
468+
let mut url = match j.find(&~"url") {
469469
Some(json::String(u)) => u,
470470
_ => fail ~"needed 'url' field in source"
471471
};
472-
let method = match j.find_copy(&~"method") {
472+
let method = match j.find(&~"method") {
473473
Some(json::String(u)) => u,
474474
_ => assume_source_method(url)
475475
};
476-
let key = match j.find_copy(&~"key") {
476+
let key = match j.find(&~"key") {
477477
Some(json::String(u)) => Some(u),
478478
_ => None
479479
};
480-
let keyfp = match j.find_copy(&~"keyfp") {
480+
let keyfp = match j.find(&~"keyfp") {
481481
Some(json::String(u)) => Some(u),
482482
_ => None
483483
};
@@ -512,7 +512,7 @@ fn try_parse_sources(filename: &Path, sources: map::HashMap<~str, @Source>) {
512512
}
513513

514514
fn load_one_source_package(src: @Source, p: &json::Object) {
515-
let name = match p.find_copy(&~"name") {
515+
let name = match p.find(&~"name") {
516516
Some(json::String(n)) => {
517517
if !valid_pkg_name(n) {
518518
warn(~"malformed source json: "
@@ -529,7 +529,7 @@ fn load_one_source_package(src: @Source, p: &json::Object) {
529529
}
530530
};
531531

532-
let uuid = match p.find_copy(&~"uuid") {
532+
let uuid = match p.find(&~"uuid") {
533533
Some(json::String(n)) => {
534534
if !is_uuid(n) {
535535
warn(~"malformed source json: "
@@ -545,15 +545,15 @@ fn load_one_source_package(src: @Source, p: &json::Object) {
545545
}
546546
};
547547

548-
let url = match p.find_copy(&~"url") {
548+
let url = match p.find(&~"url") {
549549
Some(json::String(n)) => n,
550550
_ => {
551551
warn(~"malformed source json: " + src.name + ~" (missing url)");
552552
return;
553553
}
554554
};
555555

556-
let method = match p.find_copy(&~"method") {
556+
let method = match p.find(&~"method") {
557557
Some(json::String(n)) => n,
558558
_ => {
559559
warn(~"malformed source json: "
@@ -562,13 +562,13 @@ fn load_one_source_package(src: @Source, p: &json::Object) {
562562
}
563563
};
564564

565-
let reference = match p.find_copy(&~"ref") {
565+
let reference = match p.find(&~"ref") {
566566
Some(json::String(n)) => Some(n),
567567
_ => None
568568
};
569569

570570
let mut tags = ~[];
571-
match p.find_copy(&~"tags") {
571+
match p.find(&~"tags") {
572572
Some(json::List(js)) => {
573573
for js.each |j| {
574574
match *j {
@@ -580,7 +580,7 @@ fn load_one_source_package(src: @Source, p: &json::Object) {
580580
_ => ()
581581
}
582582

583-
let description = match p.find_copy(&~"description") {
583+
let description = match p.find(&~"description") {
584584
Some(json::String(n)) => n,
585585
_ => {
586586
warn(~"malformed source json: " + src.name

trunk/src/libcore/container.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
#[forbid(deprecated_mode)];
1414
#[forbid(deprecated_pattern)];
1515

16-
use option::Option;
17-
1816
pub trait Container {
1917
/// Return the number of elements in the container
2018
pure fn len(&self) -> uint;
@@ -41,9 +39,6 @@ pub trait Map<K, V>: Mutable {
4139
/// Visit all values
4240
pure fn each_value(&self, f: fn(&V) -> bool);
4341

44-
/// Return the value corresponding to the key in the map
45-
pure fn find(&self, key: &K) -> Option<&self/V>;
46-
4742
/// Insert a key-value pair into the map. An existing value for a
4843
/// key is replaced by the new value. Return true if the key did
4944
/// not already exist in the map.

trunk/src/libcore/core.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ pub mod dvec_iter;
138138
pub mod dlist;
139139
#[path="iter-trait.rs"] #[merge = "iter-trait/dlist.rs"]
140140
pub mod dlist_iter;
141-
pub mod hashmap;
141+
pub mod send_map;
142142

143143

144144
/* Tasks and communication */

trunk/src/libcore/dvec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl<A> DVec<A> {
145145
#[inline(always)]
146146
fn swap_mut(f: &fn(v: ~[mut A]) -> ~[mut A]) {
147147
do self.swap |v| {
148-
vec::from_mut(f(vec::to_mut(move v)))
148+
vec::cast_from_mut(f(vec::cast_to_mut(move v)))
149149
}
150150
}
151151

trunk/src/libcore/f32.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ delegate!(fn exp2(n: c_float) -> c_float = cmath::c_float_utils::exp2)
5656
delegate!(fn abs(n: c_float) -> c_float = cmath::c_float_utils::abs)
5757
delegate!(fn abs_sub(a: c_float, b: c_float) -> c_float =
5858
cmath::c_float_utils::abs_sub)
59-
delegate!(fn floor(n: c_float) -> c_float = cmath::c_float_utils::floor)
6059
delegate!(fn mul_add(a: c_float, b: c_float, c: c_float) -> c_float =
6160
cmath::c_float_utils::mul_add)
6261
delegate!(fn fmax(a: c_float, b: c_float) -> c_float =
@@ -141,6 +140,10 @@ pub pure fn ge(x: f32, y: f32) -> bool { return x >= y; }
141140
#[inline(always)]
142141
pub pure fn gt(x: f32, y: f32) -> bool { return x > y; }
143142

143+
/// Returns `x` rounded down
144+
#[inline(always)]
145+
pub pure fn floor(x: f32) -> f32 { unsafe { floorf32(x) } }
146+
144147
// FIXME (#1999): replace the predicates below with llvm intrinsics or
145148
// calls to the libmath macros in the rust runtime for performance.
146149

@@ -298,6 +301,11 @@ impl f32: num::One {
298301
static pure fn one() -> f32 { 1.0 }
299302
}
300303

304+
#[abi="rust-intrinsic"]
305+
pub extern {
306+
fn floorf32(val: f32) -> f32;
307+
}
308+
301309
//
302310
// Local Variables:
303311
// mode: rust

trunk/src/libcore/f64.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ delegate!(fn exp2(n: c_double) -> c_double = cmath::c_double_utils::exp2)
5757
delegate!(fn abs(n: c_double) -> c_double = cmath::c_double_utils::abs)
5858
delegate!(fn abs_sub(a: c_double, b: c_double) -> c_double =
5959
cmath::c_double_utils::abs_sub)
60-
delegate!(fn floor(n: c_double) -> c_double = cmath::c_double_utils::floor)
6160
delegate!(fn mul_add(a: c_double, b: c_double, c: c_double) -> c_double =
6261
cmath::c_double_utils::mul_add)
6362
delegate!(fn fmax(a: c_double, b: c_double) -> c_double =
@@ -210,12 +209,16 @@ pub pure fn is_infinite(x: f64) -> bool {
210209
return x == infinity || x == neg_infinity;
211210
}
212211

213-
/// Returns true if `x`is a finite number
212+
/// Returns true if `x` is a finite number
214213
#[inline(always)]
215214
pub pure fn is_finite(x: f64) -> bool {
216215
return !(is_NaN(x) || is_infinite(x));
217216
}
218217

218+
/// Returns `x` rounded down
219+
#[inline(always)]
220+
pub pure fn floor(x: f64) -> f64 { unsafe { floorf64(x) } }
221+
219222
// FIXME (#1999): add is_normal, is_subnormal, and fpclassify
220223

221224
/* Module: consts */
@@ -322,6 +325,11 @@ impl f64: num::One {
322325
static pure fn one() -> f64 { 1.0 }
323326
}
324327

328+
#[abi="rust-intrinsic"]
329+
pub extern {
330+
fn floorf64(val: f64) -> f64;
331+
}
332+
325333
//
326334
// Local Variables:
327335
// mode: rust

trunk/src/libcore/gc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use io;
4444
use libc::{size_t, uintptr_t};
4545
use option::{None, Option, Some};
4646
use ptr;
47-
use hashmap::linear::LinearSet;
47+
use send_map::linear::LinearSet;
4848
use stackwalk;
4949
use sys;
5050

trunk/src/libcore/os.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub fn as_c_charp<T>(s: &str, f: fn(*c_char) -> T) -> T {
8484

8585
pub fn fill_charp_buf(f: fn(*mut c_char, size_t) -> bool)
8686
-> Option<~str> {
87-
let buf = vec::to_mut(vec::from_elem(tmpbuf_sz, 0u8 as c_char));
87+
let buf = vec::cast_to_mut(vec::from_elem(tmpbuf_sz, 0u8 as c_char));
8888
do vec::as_mut_buf(buf) |b, sz| {
8989
if f(b, sz as size_t) unsafe {
9090
Some(str::raw::from_buf(b as *u8))
@@ -111,7 +111,7 @@ pub mod win32 {
111111
let mut res = None;
112112
let mut done = false;
113113
while !done {
114-
let buf = vec::to_mut(vec::from_elem(n as uint, 0u16));
114+
let buf = vec::cast_to_mut(vec::from_elem(n as uint, 0u16));
115115
do vec::as_mut_buf(buf) |b, _sz| {
116116
let k : DWORD = f(b, tmpbuf_sz as DWORD);
117117
if k == (0 as DWORD) {
@@ -1269,7 +1269,7 @@ mod tests {
12691269
};
12701270
assert (ostream as uint != 0u);
12711271
let s = ~"hello";
1272-
let mut buf = vec::to_mut(str::to_bytes(s) + ~[0 as u8]);
1272+
let mut buf = vec::cast_to_mut(str::to_bytes(s) + ~[0 as u8]);
12731273
do vec::as_mut_buf(buf) |b, _len| {
12741274
assert (libc::fwrite(b as *c_void, 1u as size_t,
12751275
(str::len(s) + 1u) as size_t, ostream)

0 commit comments

Comments
 (0)