Skip to content

Commit 39406d4

Browse files
committed
---
yaml --- r: 111549 b: refs/heads/master c: b5dd3f0 h: refs/heads/master i: 111547: e3d7a53 v: v3
1 parent 6a3508b commit 39406d4

File tree

149 files changed

+4218
-3844
lines changed

Some content is hidden

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

149 files changed

+4218
-3844
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: aa849fb6ca1f8a9019e97e274c62a3bcd645936d
2+
refs/heads/master: b5dd3f05fe95168b5569d0f519636149479eb6ac
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b5dd3f05fe95168b5569d0f519636149479eb6ac
55
refs/heads/try: 38201d7c6bf0c32b0e5bdc8ecd63976ebc1b3a4c

trunk/mk/rt.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ $$(COMPRT_LIB_$(1)): $$(COMPRT_DEPS) $$(MKFILE_DEPS)
247247
RANLIB="$$(AR_$(1)) s" \
248248
CFLAGS="$$(CFG_GCCISH_CFLAGS_$(1))" \
249249
TargetTriple=$(1) \
250-
triple-runtime
251-
$$(Q)cp $$(COMPRT_BUILD_DIR_$(1))/triple/runtime/libcompiler_rt.a $$(COMPRT_LIB_$(1))
250+
triple-builtins
251+
$$(Q)cp $$(COMPRT_BUILD_DIR_$(1))/triple/builtins/libcompiler_rt.a $$(COMPRT_LIB_$(1))
252252

253253
################################################################################
254254
# libbacktrace

trunk/src/compiler-rt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit f4b221571ce6f05714c1f1c6fa48f1393499989c
1+
Subproject commit ed112ca1e4275e1c5707a898f2bf6164707ba378

trunk/src/doc/guide-tasks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ be distributed on the available cores.
306306
fn partial_sum(start: uint) -> f64 {
307307
let mut local_sum = 0f64;
308308
for num in range(start*100000, (start+1)*100000) {
309-
local_sum += (num as f64 + 1.0).powf(&-2.0);
309+
local_sum += (num as f64 + 1.0).powf(-2.0);
310310
}
311311
local_sum
312312
}
@@ -343,7 +343,7 @@ extern crate sync;
343343
use sync::Arc;
344344
345345
fn pnorm(nums: &[f64], p: uint) -> f64 {
346-
nums.iter().fold(0.0, |a,b| a+(*b).powf(&(p as f64)) ).powf(&(1.0 / (p as f64)))
346+
nums.iter().fold(0.0, |a, b| a + b.powf(p as f64)).powf(1.0 / (p as f64))
347347
}
348348
349349
fn main() {

trunk/src/doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pleasant high-level features include:
3333
This is an introductory tutorial for the Rust programming language. It
3434
covers the fundamentals of the language, including the syntax, the
3535
type system and memory model, generics, and modules. [Additional
36-
tutorials](#what-next) cover specific language features in greater
36+
tutorials](#what-next?) cover specific language features in greater
3737
depth.
3838

3939
This tutorial assumes that the reader is already familiar with one or
@@ -2253,7 +2253,7 @@ defining one.
22532253
22542254
The type parameters bound by a trait are in scope in each of the
22552255
method declarations. So, re-declaring the type parameter
2256-
`T` as an explicit type parameter for `len`, in either the trait or
2256+
`T` as an explicit type parameter for `length`, in either the trait or
22572257
the impl, would be a compile-time error.
22582258
22592259
Within a trait definition, `Self` is a special type that you can think

trunk/src/etc/get-snapshot.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ def unpack_snapshot(triple, dl_path):
5050
if len(sys.argv) == 3:
5151
dl_path = sys.argv[2]
5252
else:
53-
snap = determine_curr_snapshot(triple)
53+
# There are no 64-bit Windows snapshots yet, so we'll use 32-bit ones instead, for now
54+
snap_triple = triple if triple != "x86_64-w64-mingw32" else "i686-pc-mingw32"
55+
snap = determine_curr_snapshot(snap_triple)
5456
dl = os.path.join(download_dir_base, snap)
5557
url = download_url_base + "/" + snap
5658
print("determined most recent snapshot: " + snap)

trunk/src/libgreen/macros.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,9 @@ macro_rules! rtabort (
5252

5353
pub fn dumb_println(args: &fmt::Arguments) {
5454
use std::io;
55-
use libc;
55+
use std::rt;
5656

57-
struct Stderr;
58-
impl io::Writer for Stderr {
59-
fn write(&mut self, data: &[u8]) -> io::IoResult<()> {
60-
unsafe {
61-
libc::write(libc::STDERR_FILENO,
62-
data.as_ptr() as *libc::c_void,
63-
data.len() as libc::size_t);
64-
}
65-
Ok(()) // just ignore the result
66-
}
67-
}
68-
let mut w = Stderr;
57+
let mut w = rt::Stderr;
6958
let _ = fmt::writeln(&mut w as &mut io::Writer, args);
7059
}
7160

trunk/src/libhexfloat/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ pub fn expand_syntax_ext(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) ->
105105
Some(Ident{ident, span}) => match token::get_ident(ident).get() {
106106
"f32" => Some(ast::TyF32),
107107
"f64" => Some(ast::TyF64),
108+
"f128" => Some(ast::TyF128),
108109
_ => {
109110
cx.span_err(span, "invalid floating point type in hexfloat!");
110111
None

trunk/src/libnative/io/pipe_unix.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,14 @@ impl UnixDatagram {
232232

233233
pub struct UnixListener {
234234
inner: Inner,
235+
path: CString,
235236
}
236237

237238
impl UnixListener {
238239
pub fn bind(addr: &CString) -> IoResult<UnixListener> {
239-
bind(addr, libc::SOCK_STREAM).map(|fd| UnixListener { inner: fd })
240+
bind(addr, libc::SOCK_STREAM).map(|fd| {
241+
UnixListener { inner: fd, path: addr.clone() }
242+
})
240243
}
241244

242245
fn fd(&self) -> fd_t { self.inner.fd }
@@ -283,3 +286,14 @@ impl rtio::RtioUnixAcceptor for UnixAcceptor {
283286
self.native_accept().map(|s| ~s as ~rtio::RtioPipe:Send)
284287
}
285288
}
289+
290+
impl Drop for UnixListener {
291+
fn drop(&mut self) {
292+
// Unlink the path to the socket to ensure that it doesn't linger. We're
293+
// careful to unlink the path before we close the file descriptor to
294+
// prevent races where we unlink someone else's path.
295+
unsafe {
296+
let _ = libc::unlink(self.path.with_ref(|p| p));
297+
}
298+
}
299+
}

trunk/src/libnum/complex.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ impl<T: Clone + Float> Cmplx<T> {
8282
/// Calculate |self|
8383
#[inline]
8484
pub fn norm(&self) -> T {
85-
self.re.hypot(&self.im)
85+
self.re.hypot(self.im)
8686
}
8787
}
8888

8989
impl<T: Clone + Float> Cmplx<T> {
9090
/// Calculate the principal Arg of self.
9191
#[inline]
9292
pub fn arg(&self) -> T {
93-
self.im.atan2(&self.re)
93+
self.im.atan2(self.re)
9494
}
9595
/// Convert to polar form (r, theta), such that `self = r * exp(i
9696
/// * theta)`

trunk/src/libnum/rational.rs

Lines changed: 41 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use Integer;
1515
use std::cmp;
1616
use std::fmt;
1717
use std::from_str::FromStr;
18-
use std::num::{Zero,One,ToStrRadix,FromStrRadix,Round};
18+
use std::num::{Zero, One, ToStrRadix, FromStrRadix};
1919
use bigint::{BigInt, BigUint, Sign, Plus, Minus};
2020

2121
/// Represents the ratio between 2 numbers.
@@ -113,6 +113,40 @@ impl<T: Clone + Integer + Ord>
113113
pub fn recip(&self) -> Ratio<T> {
114114
Ratio::new_raw(self.denom.clone(), self.numer.clone())
115115
}
116+
117+
pub fn floor(&self) -> Ratio<T> {
118+
if *self < Zero::zero() {
119+
Ratio::from_integer((self.numer - self.denom + One::one()) / self.denom)
120+
} else {
121+
Ratio::from_integer(self.numer / self.denom)
122+
}
123+
}
124+
125+
pub fn ceil(&self) -> Ratio<T> {
126+
if *self < Zero::zero() {
127+
Ratio::from_integer(self.numer / self.denom)
128+
} else {
129+
Ratio::from_integer((self.numer + self.denom - One::one()) / self.denom)
130+
}
131+
}
132+
133+
#[inline]
134+
pub fn round(&self) -> Ratio<T> {
135+
if *self < Zero::zero() {
136+
Ratio::from_integer((self.numer - self.denom + One::one()) / self.denom)
137+
} else {
138+
Ratio::from_integer((self.numer + self.denom - One::one()) / self.denom)
139+
}
140+
}
141+
142+
#[inline]
143+
pub fn trunc(&self) -> Ratio<T> {
144+
Ratio::from_integer(self.numer / self.denom)
145+
}
146+
147+
pub fn fract(&self) -> Ratio<T> {
148+
Ratio::new_raw(self.numer % self.denom, self.denom.clone())
149+
}
116150
}
117151

118152
impl Ratio<BigInt> {
@@ -238,45 +272,6 @@ impl<T: Clone + Integer + Ord>
238272
impl<T: Clone + Integer + Ord>
239273
Num for Ratio<T> {}
240274

241-
/* Utils */
242-
impl<T: Clone + Integer + Ord>
243-
Round for Ratio<T> {
244-
245-
fn floor(&self) -> Ratio<T> {
246-
if *self < Zero::zero() {
247-
Ratio::from_integer((self.numer - self.denom + One::one()) / self.denom)
248-
} else {
249-
Ratio::from_integer(self.numer / self.denom)
250-
}
251-
}
252-
253-
fn ceil(&self) -> Ratio<T> {
254-
if *self < Zero::zero() {
255-
Ratio::from_integer(self.numer / self.denom)
256-
} else {
257-
Ratio::from_integer((self.numer + self.denom - One::one()) / self.denom)
258-
}
259-
}
260-
261-
#[inline]
262-
fn round(&self) -> Ratio<T> {
263-
if *self < Zero::zero() {
264-
Ratio::from_integer((self.numer - self.denom + One::one()) / self.denom)
265-
} else {
266-
Ratio::from_integer((self.numer + self.denom - One::one()) / self.denom)
267-
}
268-
}
269-
270-
#[inline]
271-
fn trunc(&self) -> Ratio<T> {
272-
Ratio::from_integer(self.numer / self.denom)
273-
}
274-
275-
fn fract(&self) -> Ratio<T> {
276-
Ratio::new_raw(self.numer % self.denom, self.denom.clone())
277-
}
278-
}
279-
280275
/* String conversions */
281276
impl<T: fmt::Show> fmt::Show for Ratio<T> {
282277
/// Renders as `numer/denom`.
@@ -636,19 +631,19 @@ mod test {
636631

637632
// f32
638633
test(3.14159265359f32, ("13176795", "4194304"));
639-
test(2f32.powf(&100.), ("1267650600228229401496703205376", "1"));
640-
test(-2f32.powf(&100.), ("-1267650600228229401496703205376", "1"));
641-
test(1.0 / 2f32.powf(&100.), ("1", "1267650600228229401496703205376"));
634+
test(2f32.powf(100.), ("1267650600228229401496703205376", "1"));
635+
test(-2f32.powf(100.), ("-1267650600228229401496703205376", "1"));
636+
test(1.0 / 2f32.powf(100.), ("1", "1267650600228229401496703205376"));
642637
test(684729.48391f32, ("1369459", "2"));
643638
test(-8573.5918555f32, ("-4389679", "512"));
644639

645640
// f64
646641
test(3.14159265359f64, ("3537118876014453", "1125899906842624"));
647-
test(2f64.powf(&100.), ("1267650600228229401496703205376", "1"));
648-
test(-2f64.powf(&100.), ("-1267650600228229401496703205376", "1"));
642+
test(2f64.powf(100.), ("1267650600228229401496703205376", "1"));
643+
test(-2f64.powf(100.), ("-1267650600228229401496703205376", "1"));
649644
test(684729.48391f64, ("367611342500051", "536870912"));
650645
test(-8573.5918555, ("-4713381968463931", "549755813888"));
651-
test(1.0 / 2f64.powf(&100.), ("1", "1267650600228229401496703205376"));
646+
test(1.0 / 2f64.powf(100.), ("1", "1267650600228229401496703205376"));
652647
}
653648

654649
#[test]

trunk/src/librand/distributions/gamma.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl IndependentSample<f64> for GammaSmallShape {
147147
fn ind_sample<R: Rng>(&self, rng: &mut R) -> f64 {
148148
let Open01(u) = rng.gen::<Open01<f64>>();
149149

150-
self.large_shape.ind_sample(rng) * u.powf(&self.inv_shape)
150+
self.large_shape.ind_sample(rng) * u.powf(self.inv_shape)
151151
}
152152
}
153153
impl IndependentSample<f64> for GammaLargeShape {

trunk/src/librustc/driver/driver.rs

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ pub fn phase_3_run_analysis_passes(sess: Session,
299299
last_private_map: last_private_map
300300
} =
301301
time(time_passes, "resolution", (), |_|
302-
middle::resolve::resolve_crate(&sess, lang_items, krate));
302+
middle::resolve::resolve_crate(&sess, &lang_items, krate));
303303

304304
// Discard MTWT tables that aren't required past resolution.
305305
syntax::ext::mtwt::clear_tables();
@@ -316,7 +316,7 @@ pub fn phase_3_run_analysis_passes(sess: Session,
316316
sess.diagnostic(), krate)));
317317

318318
let freevars = time(time_passes, "freevar finding", (), |_|
319-
freevars::annotate_freevars(def_map, krate));
319+
freevars::annotate_freevars(&def_map, krate));
320320

321321
let region_map = time(time_passes, "region resolution", (), |_|
322322
middle::region::resolve_crate(&sess, krate));
@@ -328,7 +328,7 @@ pub fn phase_3_run_analysis_passes(sess: Session,
328328
freevars, region_map, lang_items);
329329

330330
// passes are timed inside typeck
331-
let (method_map, vtable_map) = typeck::check_crate(&ty_cx, trait_map, krate);
331+
typeck::check_crate(&ty_cx, trait_map, krate);
332332

333333
time(time_passes, "check static items", (), |_|
334334
middle::check_static::check_crate(&ty_cx, krate));
@@ -338,56 +338,52 @@ pub fn phase_3_run_analysis_passes(sess: Session,
338338
middle::const_eval::process_crate(krate, &ty_cx));
339339

340340
time(time_passes, "const checking", (), |_|
341-
middle::check_const::check_crate(krate, def_map, method_map, &ty_cx));
341+
middle::check_const::check_crate(krate, &ty_cx));
342342

343343
let maps = (external_exports, last_private_map);
344344
let (exported_items, public_items) =
345345
time(time_passes, "privacy checking", maps, |(a, b)|
346-
middle::privacy::check_crate(&ty_cx, &method_map, &exp_map2,
347-
a, b, krate));
346+
middle::privacy::check_crate(&ty_cx, &exp_map2, a, b, krate));
348347

349348
time(time_passes, "effect checking", (), |_|
350-
middle::effect::check_crate(&ty_cx, method_map, krate));
349+
middle::effect::check_crate(&ty_cx, krate));
351350

352351
let middle::moves::MoveMaps {moves_map, moved_variables_set,
353352
capture_map} =
354353
time(time_passes, "compute moves", (), |_|
355-
middle::moves::compute_moves(&ty_cx, method_map, krate));
354+
middle::moves::compute_moves(&ty_cx, krate));
356355

357356
time(time_passes, "match checking", (), |_|
358-
middle::check_match::check_crate(&ty_cx, method_map,
359-
&moves_map, krate));
357+
middle::check_match::check_crate(&ty_cx, &moves_map, krate));
360358

361359
time(time_passes, "liveness checking", (), |_|
362-
middle::liveness::check_crate(&ty_cx, method_map,
363-
&capture_map, krate));
360+
middle::liveness::check_crate(&ty_cx, &capture_map, krate));
364361

365362
let root_map =
366363
time(time_passes, "borrow checking", (), |_|
367-
middle::borrowck::check_crate(&ty_cx, method_map,
368-
&moves_map, &moved_variables_set,
364+
middle::borrowck::check_crate(&ty_cx, &moves_map,
365+
&moved_variables_set,
369366
&capture_map, krate));
370367

371368
drop(moves_map);
372369
drop(moved_variables_set);
373370

374371
time(time_passes, "kind checking", (), |_|
375-
kind::check_crate(&ty_cx, method_map, krate));
372+
kind::check_crate(&ty_cx, krate));
376373

377374
let reachable_map =
378375
time(time_passes, "reachability checking", (), |_|
379-
reachable::find_reachable(&ty_cx, method_map, &exported_items));
376+
reachable::find_reachable(&ty_cx, &exported_items));
380377

381378
time(time_passes, "death checking", (), |_| {
382379
middle::dead::check_crate(&ty_cx,
383-
method_map,
384380
&exported_items,
385381
&reachable_map,
386382
krate)
387383
});
388384

389385
time(time_passes, "lint checking", (), |_|
390-
lint::check_crate(&ty_cx, method_map, &exported_items, krate));
386+
lint::check_crate(&ty_cx, &exported_items, krate));
391387

392388
CrateAnalysis {
393389
exp_map2: exp_map2,
@@ -396,8 +392,6 @@ pub fn phase_3_run_analysis_passes(sess: Session,
396392
public_items: public_items,
397393
maps: astencode::Maps {
398394
root_map: root_map,
399-
method_map: method_map,
400-
vtable_map: vtable_map,
401395
capture_map: RefCell::new(capture_map)
402396
},
403397
reachable: reachable_map

trunk/src/librustc/front/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@ fn fold_item_underscore(cx: &mut Context, item: &ast::Item_) -> ast::Item_ {
103103
.map(|x| *x).collect();
104104
ast::ItemImpl((*a).clone(), (*b).clone(), c, methods)
105105
}
106-
ast::ItemTrait(ref a, ref b, ref methods) => {
106+
ast::ItemTrait(ref a, b, ref c, ref methods) => {
107107
let methods = methods.iter()
108108
.filter(|m| trait_method_in_cfg(cx, *m) )
109109
.map(|x| (*x).clone())
110110
.collect();
111-
ast::ItemTrait((*a).clone(), (*b).clone(), methods)
111+
ast::ItemTrait((*a).clone(), b, (*c).clone(), methods)
112112
}
113113
ast::ItemStruct(def, ref generics) => {
114114
ast::ItemStruct(fold_struct(cx, def), generics.clone())

0 commit comments

Comments
 (0)