Skip to content

Commit 5266d05

Browse files
committed
---
yaml --- r: 111545 b: refs/heads/master c: f197e69 h: refs/heads/master i: 111543: 078dd7c v: v3
1 parent fe06a19 commit 5266d05

Some content is hidden

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

86 files changed

+680
-1495
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: e049a7003b686002d5c091ec0465d07e5c5ff7a6
2+
refs/heads/master: f197e695ca68c488bce4289d2e79177ecb093a42
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-builtins
251-
$$(Q)cp $$(COMPRT_BUILD_DIR_$(1))/triple/builtins/libcompiler_rt.a $$(COMPRT_LIB_$(1))
250+
triple-runtime
251+
$$(Q)cp $$(COMPRT_BUILD_DIR_$(1))/triple/runtime/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 ed112ca1e4275e1c5707a898f2bf6164707ba378
1+
Subproject commit f4b221571ce6f05714c1f1c6fa48f1393499989c

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 `length`, in either the trait or
2256+
`T` as an explicit type parameter for `len`, 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: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ def unpack_snapshot(triple, dl_path):
5050
if len(sys.argv) == 3:
5151
dl_path = sys.argv[2]
5252
else:
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)
53+
snap = determine_curr_snapshot(triple)
5654
dl = os.path.join(download_dir_base, snap)
5755
url = download_url_base + "/" + snap
5856
print("determined most recent snapshot: " + snap)

trunk/src/libgreen/macros.rs

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

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

57-
let mut w = rt::Stderr;
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;
5869
let _ = fmt::writeln(&mut w as &mut io::Writer, args);
5970
}
6071

trunk/src/libhexfloat/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ 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),
109108
_ => {
110109
cx.span_err(span, "invalid floating point type in hexfloat!");
111110
None

trunk/src/libnative/io/pipe_unix.rs

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

233233
pub struct UnixListener {
234234
inner: Inner,
235-
path: CString,
236235
}
237236

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

245242
fn fd(&self) -> fd_t { self.inner.fd }
@@ -286,14 +283,3 @@ impl rtio::RtioUnixAcceptor for UnixAcceptor {
286283
self.native_accept().map(|s| ~s as ~rtio::RtioPipe:Send)
287284
}
288285
}
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: 46 additions & 41 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};
18+
use std::num::{Zero,One,ToStrRadix,FromStrRadix,Round};
1919
use bigint::{BigInt, BigUint, Sign, Plus, Minus};
2020

2121
/// Represents the ratio between 2 numbers.
@@ -113,40 +113,6 @@ 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-
}
150116
}
151117

152118
impl Ratio<BigInt> {
@@ -272,6 +238,45 @@ impl<T: Clone + Integer + Ord>
272238
impl<T: Clone + Integer + Ord>
273239
Num for Ratio<T> {}
274240

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+
275280
/* String conversions */
276281
impl<T: fmt::Show> fmt::Show for Ratio<T> {
277282
/// Renders as `numer/denom`.
@@ -631,19 +636,19 @@ mod test {
631636

632637
// f32
633638
test(3.14159265359f32, ("13176795", "4194304"));
634-
test(2f32.powf(100.), ("1267650600228229401496703205376", "1"));
635-
test(-2f32.powf(100.), ("-1267650600228229401496703205376", "1"));
636-
test(1.0 / 2f32.powf(100.), ("1", "1267650600228229401496703205376"));
639+
test(2f32.powf(&100.), ("1267650600228229401496703205376", "1"));
640+
test(-2f32.powf(&100.), ("-1267650600228229401496703205376", "1"));
641+
test(1.0 / 2f32.powf(&100.), ("1", "1267650600228229401496703205376"));
637642
test(684729.48391f32, ("1369459", "2"));
638643
test(-8573.5918555f32, ("-4389679", "512"));
639644

640645
// f64
641646
test(3.14159265359f64, ("3537118876014453", "1125899906842624"));
642-
test(2f64.powf(100.), ("1267650600228229401496703205376", "1"));
643-
test(-2f64.powf(100.), ("-1267650600228229401496703205376", "1"));
647+
test(2f64.powf(&100.), ("1267650600228229401496703205376", "1"));
648+
test(-2f64.powf(&100.), ("-1267650600228229401496703205376", "1"));
644649
test(684729.48391f64, ("367611342500051", "536870912"));
645650
test(-8573.5918555, ("-4713381968463931", "549755813888"));
646-
test(1.0 / 2f64.powf(100.), ("1", "1267650600228229401496703205376"));
651+
test(1.0 / 2f64.powf(&100.), ("1", "1267650600228229401496703205376"));
647652
}
648653

649654
#[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, b, ref c, ref methods) => {
106+
ast::ItemTrait(ref a, ref b, 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, (*c).clone(), methods)
111+
ast::ItemTrait((*a).clone(), (*b).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: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
5757
("linkage", Active),
5858
("struct_inherit", Active),
5959

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

8078
/// A set of features to be used by later passes.
8179
pub struct Features {
82-
pub default_type_params: Cell<bool>,
83-
pub quad_precision_float: Cell<bool>
80+
pub default_type_params: Cell<bool>
8481
}
8582

8683
impl Features {
8784
pub fn new() -> Features {
8885
Features {
89-
default_type_params: Cell::new(false),
90-
quad_precision_float: Cell::new(false)
86+
default_type_params: Cell::new(false)
9187
}
9288
}
9389
}
@@ -368,5 +364,4 @@ pub fn check_crate(sess: &Session, krate: &ast::Crate) {
368364
sess.abort_if_errors();
369365

370366
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"));
372367
}

trunk/src/librustc/metadata/common.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ 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;
174173

175174
pub static tag_item_method_tps: uint = 0x79;
176175
pub static tag_item_method_fty: uint = 0x7a;

trunk/src/librustc/metadata/decoder.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -164,19 +164,6 @@ 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-
180167
fn item_method_sort(item: ebml::Doc) -> char {
181168
let mut ret = 'r';
182169
reader::tagged_docs(item, tag_item_trait_method_sort, |doc| {
@@ -384,7 +371,6 @@ pub fn get_trait_def(cdata: Cmd,
384371
let tp_defs = item_ty_param_defs(item_doc, tcx, cdata,
385372
tag_items_data_item_ty_param_bounds);
386373
let rp_defs = item_region_param_defs(item_doc, cdata);
387-
let sized = item_sized(item_doc);
388374
let mut bounds = ty::EmptyBuiltinBounds();
389375
// Collect the builtin bounds from the encoded supertraits.
390376
// FIXME(#8559): They should be encoded directly.
@@ -396,13 +382,6 @@ pub fn get_trait_def(cdata: Cmd,
396382
});
397383
true
398384
});
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-
406385
ty::TraitDef {
407386
generics: ty::Generics {type_param_defs: tp_defs,
408387
region_param_defs: rp_defs},

0 commit comments

Comments
 (0)