Skip to content

Commit e3d7a53

Browse files
committed
---
yaml --- r: 111547 b: refs/heads/master c: bb580f1 h: refs/heads/master i: 111545: 5266d05 111543: 078dd7c v: v3
1 parent 4052d2b commit e3d7a53

Some content is hidden

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

84 files changed

+1495
-660
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: a14c34d670fc76ccc025d5f7ae89ccbb811560c6
2+
refs/heads/master: bb580f1a56138bd5a96ccc95c0f61caab72cf975
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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/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())

trunk/src/librustc/front/feature_gate.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
5757
("linkage", Active),
5858
("struct_inherit", Active),
5959

60+
("quad_precision_float", Active),
61+
6062
// These are used to test this portion of the compiler, they don't actually
6163
// mean anything
6264
("test_accepted_feature", Accepted),
@@ -77,13 +79,15 @@ enum Status {
7779

7880
/// A set of features to be used by later passes.
7981
pub struct Features {
80-
pub default_type_params: Cell<bool>
82+
pub default_type_params: Cell<bool>,
83+
pub quad_precision_float: Cell<bool>
8184
}
8285

8386
impl Features {
8487
pub fn new() -> Features {
8588
Features {
86-
default_type_params: Cell::new(false)
89+
default_type_params: Cell::new(false),
90+
quad_precision_float: Cell::new(false)
8791
}
8892
}
8993
}
@@ -364,4 +368,5 @@ pub fn check_crate(sess: &Session, krate: &ast::Crate) {
364368
sess.abort_if_errors();
365369

366370
sess.features.default_type_params.set(cx.has_feature("default_type_params"));
371+
sess.features.quad_precision_float.set(cx.has_feature("quad_precision_float"));
367372
}

trunk/src/librustc/metadata/common.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ pub static tag_lang_items_item_node_id: uint = 0x73;
170170

171171
pub static tag_item_unnamed_field: uint = 0x74;
172172
pub static tag_items_data_item_visibility: uint = 0x76;
173+
pub static tag_items_data_item_sized: uint = 0x77;
173174

174175
pub static tag_item_method_tps: uint = 0x79;
175176
pub static tag_item_method_fty: uint = 0x7a;

trunk/src/librustc/metadata/decoder.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,19 @@ fn item_visibility(item: ebml::Doc) -> ast::Visibility {
164164
}
165165
}
166166

167+
fn item_sized(item: ebml::Doc) -> ast::Sized {
168+
match reader::maybe_get_doc(item, tag_items_data_item_sized) {
169+
None => ast::StaticSize,
170+
Some(sized_doc) => {
171+
match reader::doc_as_u8(sized_doc) as char {
172+
'd' => ast::DynSize,
173+
's' => ast::StaticSize,
174+
_ => fail!("unknown sized-ness character")
175+
}
176+
}
177+
}
178+
}
179+
167180
fn item_method_sort(item: ebml::Doc) -> char {
168181
let mut ret = 'r';
169182
reader::tagged_docs(item, tag_item_trait_method_sort, |doc| {
@@ -371,6 +384,7 @@ pub fn get_trait_def(cdata: Cmd,
371384
let tp_defs = item_ty_param_defs(item_doc, tcx, cdata,
372385
tag_items_data_item_ty_param_bounds);
373386
let rp_defs = item_region_param_defs(item_doc, cdata);
387+
let sized = item_sized(item_doc);
374388
let mut bounds = ty::EmptyBuiltinBounds();
375389
// Collect the builtin bounds from the encoded supertraits.
376390
// FIXME(#8559): They should be encoded directly.
@@ -382,6 +396,13 @@ pub fn get_trait_def(cdata: Cmd,
382396
});
383397
true
384398
});
399+
// Turn sized into a bound, FIXME(#8559).
400+
if sized == ast::StaticSize {
401+
tcx.lang_items.to_builtin_kind(tcx.lang_items.sized_trait().unwrap()).map(|bound| {
402+
bounds.add(bound);
403+
});
404+
}
405+
385406
ty::TraitDef {
386407
generics: ty::Generics {type_param_defs: tp_defs,
387408
region_param_defs: rp_defs},

0 commit comments

Comments
 (0)