Skip to content

Commit bcae6f5

Browse files
committed
---
yaml --- r: 106616 b: refs/heads/try c: 2302ce9 h: refs/heads/master v: v3
1 parent b0f0eb0 commit bcae6f5

File tree

16 files changed

+651
-608
lines changed

16 files changed

+651
-608
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: b8ef9fd9c9f642ce7b8aed82782a1ed745d08d64
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b8601a3d8b91ad3b653d143307611f2f5c75617e
5-
refs/heads/try: db4f757367fcb0ad6e9644dc93218cf4a662e862
5+
refs/heads/try: 2302ce903d8e5a3b9fad345a3942c1a9c191cf17
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/man/rustc.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH RUSTC "1" "March 2014" "rustc 0.10-pre" "User Commands"
1+
.TH RUSTC "1" "July 2013" "rustc 0.7" "User Commands"
22
.SH NAME
33
rustc \- rust compiler
44
.SH SYNOPSIS

branches/try/man/rustdoc.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH RUSTDOC "1" "March 2014" "rustdoc 0.10-pre" "User Commands"
1+
.TH RUSTDOC "1" "July 2013" "rustdoc 0.7" "User Commands"
22
.SH NAME
33
rustdoc \- generate documentation from Rust source code
44
.SH SYNOPSIS

branches/try/src/librustc/middle/resolve.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ use middle::pat_util::pat_bindings;
1919

2020
use syntax::ast::*;
2121
use syntax::ast;
22-
use syntax::ast_util::{def_id_of_def, local_def, mtwt_resolve};
22+
use syntax::ast_util::{def_id_of_def, local_def};
2323
use syntax::ast_util::{path_to_ident, walk_pat, trait_method_to_ty_method};
24+
use syntax::ext::mtwt;
2425
use syntax::parse::token::special_idents;
2526
use syntax::parse::token;
2627
use syntax::print::pprust::path_to_str;
@@ -4176,7 +4177,7 @@ impl Resolver {
41764177
fn binding_mode_map(&mut self, pat: @Pat) -> BindingMap {
41774178
let mut result = HashMap::new();
41784179
pat_bindings(self.def_map, pat, |binding_mode, _id, sp, path| {
4179-
let name = mtwt_resolve(path_to_ident(path));
4180+
let name = mtwt::resolve(path_to_ident(path));
41804181
result.insert(name,
41814182
binding_info {span: sp,
41824183
binding_mode: binding_mode});
@@ -4411,7 +4412,7 @@ impl Resolver {
44114412
// what you want).
44124413

44134414
let ident = path.segments.get(0).identifier;
4414-
let renamed = mtwt_resolve(ident);
4415+
let renamed = mtwt::resolve(ident);
44154416

44164417
match self.resolve_bare_identifier_pattern(ident) {
44174418
FoundStructOrEnumVariant(def, lp)
@@ -4965,7 +4966,7 @@ impl Resolver {
49654966
let search_result;
49664967
match namespace {
49674968
ValueNS => {
4968-
let renamed = mtwt_resolve(ident);
4969+
let renamed = mtwt::resolve(ident);
49694970
let mut value_ribs = self.value_ribs.borrow_mut();
49704971
search_result = self.search_ribs(value_ribs.get(),
49714972
renamed,
@@ -5213,7 +5214,7 @@ impl Resolver {
52135214
let rib = label_ribs.get()[label_ribs.get().len() -
52145215
1];
52155216
let mut bindings = rib.bindings.borrow_mut();
5216-
let renamed = mtwt_resolve(label);
5217+
let renamed = mtwt::resolve(label);
52175218
bindings.get().insert(renamed, def_like);
52185219
}
52195220

@@ -5225,7 +5226,7 @@ impl Resolver {
52255226

52265227
ExprBreak(Some(label)) | ExprAgain(Some(label)) => {
52275228
let mut label_ribs = self.label_ribs.borrow_mut();
5228-
let renamed = mtwt_resolve(label);
5229+
let renamed = mtwt::resolve(label);
52295230
match self.search_ribs(label_ribs.get(), renamed, expr.span) {
52305231
None =>
52315232
self.resolve_error(expr.span,

branches/try/src/libstd/num/cmath.rs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,26 @@ pub mod c_double {
2828
pub fn atan(n: c_double) -> c_double;
2929
pub fn atan2(a: c_double, b: c_double) -> c_double;
3030
pub fn cbrt(n: c_double) -> c_double;
31+
pub fn ceil(n: c_double) -> c_double;
32+
pub fn copysign(x: c_double, y: c_double) -> c_double;
33+
pub fn cos(n: c_double) -> c_double;
3134
pub fn cosh(n: c_double) -> c_double;
3235
pub fn erf(n: c_double) -> c_double;
3336
pub fn erfc(n: c_double) -> c_double;
37+
pub fn exp(n: c_double) -> c_double;
3438
// rename: for consistency with underscore usage elsewhere
3539
#[link_name="expm1"]
3640
pub fn exp_m1(n: c_double) -> c_double;
41+
pub fn exp2(n: c_double) -> c_double;
42+
#[link_name="fabs"]
43+
pub fn abs(n: c_double) -> c_double;
3744
// rename: for clarity and consistency with add/sub/mul/div
3845
#[link_name="fdim"]
3946
pub fn abs_sub(a: c_double, b: c_double) -> c_double;
47+
pub fn floor(n: c_double) -> c_double;
48+
// rename: for clarity and consistency with add/sub/mul/div
49+
#[link_name="fma"]
50+
pub fn mul_add(a: c_double, b: c_double, c: c_double) -> c_double;
4051
#[link_name="fmax"]
4152
pub fn fmax(a: c_double, b: c_double) -> c_double;
4253
#[link_name="fmin"]
@@ -52,22 +63,34 @@ pub mod c_double {
5263
#[cfg(windows)]
5364
#[link_name="__lgamma_r"]
5465
pub fn lgamma(n: c_double, sign: &mut c_int) -> c_double;
66+
// renamed: ln seems more natural
67+
#[link_name="log"]
68+
pub fn ln(n: c_double) -> c_double;
5569
// renamed: "logb" /often/ is confused for log2 by beginners
5670
#[link_name="logb"]
5771
pub fn log_radix(n: c_double) -> c_double;
5872
// renamed: to be consitent with log as ln
5973
#[link_name="log1p"]
6074
pub fn ln_1p(n: c_double) -> c_double;
75+
pub fn log10(n: c_double) -> c_double;
76+
pub fn log2(n: c_double) -> c_double;
6177
#[link_name="ilogb"]
6278
pub fn ilog_radix(n: c_double) -> c_int;
6379
pub fn modf(n: c_double, iptr: &mut c_double) -> c_double;
80+
pub fn pow(n: c_double, e: c_double) -> c_double;
81+
// FIXME (#1379): enable when rounding modes become available
82+
// fn rint(n: c_double) -> c_double;
83+
pub fn round(n: c_double) -> c_double;
6484
// rename: for consistency with logradix
6585
#[link_name="scalbn"]
6686
pub fn ldexp_radix(n: c_double, i: c_int) -> c_double;
87+
pub fn sin(n: c_double) -> c_double;
6788
pub fn sinh(n: c_double) -> c_double;
89+
pub fn sqrt(n: c_double) -> c_double;
6890
pub fn tan(n: c_double) -> c_double;
6991
pub fn tanh(n: c_double) -> c_double;
7092
pub fn tgamma(n: c_double) -> c_double;
93+
pub fn trunc(n: c_double) -> c_double;
7194

7295
// These are commonly only available for doubles
7396

@@ -98,18 +121,34 @@ pub mod c_float {
98121
pub fn atan2(a: c_float, b: c_float) -> c_float;
99122
#[link_name="cbrtf"]
100123
pub fn cbrt(n: c_float) -> c_float;
124+
#[link_name="ceilf"]
125+
pub fn ceil(n: c_float) -> c_float;
126+
#[link_name="copysignf"]
127+
pub fn copysign(x: c_float, y: c_float) -> c_float;
128+
#[link_name="cosf"]
129+
pub fn cos(n: c_float) -> c_float;
101130
#[link_name="coshf"]
102131
pub fn cosh(n: c_float) -> c_float;
103132
#[link_name="erff"]
104133
pub fn erf(n: c_float) -> c_float;
105134
#[link_name="erfcf"]
106135
pub fn erfc(n: c_float) -> c_float;
136+
#[link_name="expf"]
137+
pub fn exp(n: c_float) -> c_float;
107138
#[link_name="expm1f"]
108139
pub fn exp_m1(n: c_float) -> c_float;
140+
#[link_name="exp2f"]
141+
pub fn exp2(n: c_float) -> c_float;
142+
#[link_name="fabsf"]
143+
pub fn abs(n: c_float) -> c_float;
109144
#[link_name="fdimf"]
110145
pub fn abs_sub(a: c_float, b: c_float) -> c_float;
146+
#[link_name="floorf"]
147+
pub fn floor(n: c_float) -> c_float;
111148
#[link_name="frexpf"]
112149
pub fn frexp(n: c_float, value: &mut c_int) -> c_float;
150+
#[link_name="fmaf"]
151+
pub fn mul_add(a: c_float, b: c_float, c: c_float) -> c_float;
113152
#[link_name="fmaxf"]
114153
pub fn fmax(a: c_float, b: c_float) -> c_float;
115154
#[link_name="fminf"]
@@ -129,23 +168,41 @@ pub mod c_float {
129168
#[link_name="__lgammaf_r"]
130169
pub fn lgamma(n: c_float, sign: &mut c_int) -> c_float;
131170

171+
#[link_name="logf"]
172+
pub fn ln(n: c_float) -> c_float;
132173
#[link_name="logbf"]
133174
pub fn log_radix(n: c_float) -> c_float;
134175
#[link_name="log1pf"]
135176
pub fn ln_1p(n: c_float) -> c_float;
177+
#[link_name="log2f"]
178+
pub fn log2(n: c_float) -> c_float;
179+
#[link_name="log10f"]
180+
pub fn log10(n: c_float) -> c_float;
136181
#[link_name="ilogbf"]
137182
pub fn ilog_radix(n: c_float) -> c_int;
138183
#[link_name="modff"]
139184
pub fn modf(n: c_float, iptr: &mut c_float) -> c_float;
185+
#[link_name="powf"]
186+
pub fn pow(n: c_float, e: c_float) -> c_float;
187+
// FIXME (#1379): enable when rounding modes become available
188+
// #[link_name="rintf"] fn rint(n: c_float) -> c_float;
189+
#[link_name="roundf"]
190+
pub fn round(n: c_float) -> c_float;
140191
#[link_name="scalbnf"]
141192
pub fn ldexp_radix(n: c_float, i: c_int) -> c_float;
193+
#[link_name="sinf"]
194+
pub fn sin(n: c_float) -> c_float;
142195
#[link_name="sinhf"]
143196
pub fn sinh(n: c_float) -> c_float;
197+
#[link_name="sqrtf"]
198+
pub fn sqrt(n: c_float) -> c_float;
144199
#[link_name="tanf"]
145200
pub fn tan(n: c_float) -> c_float;
146201
#[link_name="tanhf"]
147202
pub fn tanh(n: c_float) -> c_float;
148203
#[link_name="tgammaf"]
149204
pub fn tgamma(n: c_float) -> c_float;
205+
#[link_name="truncf"]
206+
pub fn trunc(n: c_float) -> c_float;
150207
}
151208
}

branches/try/src/libstd/num/f32.rs

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
//! Operations and constants for 32-bits floats (`f32` type)
12-
1312
#[allow(missing_doc)];
1413

1514
use prelude::*;
@@ -46,32 +45,37 @@ macro_rules! delegate(
4645

4746
delegate!(
4847
// intrinsics
49-
fn sqrt(n: f32) -> f32 = intrinsics::sqrtf32,
50-
fn powi(n: f32, e: i32) -> f32 = intrinsics::powif32,
51-
fn sin(n: f32) -> f32 = intrinsics::sinf32,
48+
fn abs(n: f32) -> f32 = intrinsics::fabsf32,
5249
fn cos(n: f32) -> f32 = intrinsics::cosf32,
53-
fn pow(n: f32, e: f32) -> f32 = intrinsics::powf32,
5450
fn exp(n: f32) -> f32 = intrinsics::expf32,
5551
fn exp2(n: f32) -> f32 = intrinsics::exp2f32,
52+
fn floor(x: f32) -> f32 = intrinsics::floorf32,
5653
fn ln(n: f32) -> f32 = intrinsics::logf32,
5754
fn log10(n: f32) -> f32 = intrinsics::log10f32,
5855
fn log2(n: f32) -> f32 = intrinsics::log2f32,
5956
fn mul_add(a: f32, b: f32, c: f32) -> f32 = intrinsics::fmaf32,
60-
fn abs(n: f32) -> f32 = intrinsics::fabsf32,
61-
fn copysign(x: f32, y: f32) -> f32 = intrinsics::copysignf32,
62-
fn floor(x: f32) -> f32 = intrinsics::floorf32,
57+
fn pow(n: f32, e: f32) -> f32 = intrinsics::powf32,
58+
// fn powi(n: f32, e: c_int) -> f32 = intrinsics::powif32,
59+
fn sin(n: f32) -> f32 = intrinsics::sinf32,
60+
fn sqrt(n: f32) -> f32 = intrinsics::sqrtf32,
61+
62+
// LLVM 3.3 required to use intrinsics for these four
63+
fn ceil(n: c_float) -> c_float = cmath::c_float::ceil,
64+
fn trunc(n: c_float) -> c_float = cmath::c_float::trunc,
65+
/*
6366
fn ceil(n: f32) -> f32 = intrinsics::ceilf32,
6467
fn trunc(n: f32) -> f32 = intrinsics::truncf32,
6568
fn rint(n: f32) -> f32 = intrinsics::rintf32,
6669
fn nearbyint(n: f32) -> f32 = intrinsics::nearbyintf32,
67-
fn round(n: f32) -> f32 = intrinsics::roundf32,
70+
*/
6871

6972
// cmath
7073
fn acos(n: c_float) -> c_float = cmath::c_float::acos,
7174
fn asin(n: c_float) -> c_float = cmath::c_float::asin,
7275
fn atan(n: c_float) -> c_float = cmath::c_float::atan,
7376
fn atan2(a: c_float, b: c_float) -> c_float = cmath::c_float::atan2,
7477
fn cbrt(n: c_float) -> c_float = cmath::c_float::cbrt,
78+
fn copysign(x: c_float, y: c_float) -> c_float = cmath::c_float::copysign,
7579
fn cosh(n: c_float) -> c_float = cmath::c_float::cosh,
7680
// fn erf(n: c_float) -> c_float = cmath::c_float::erf,
7781
// fn erfc(n: c_float) -> c_float = cmath::c_float::erfc,
@@ -85,6 +89,7 @@ delegate!(
8589
fn ln_1p(n: c_float) -> c_float = cmath::c_float::ln_1p,
8690
// fn ilog_radix(n: c_float) -> c_int = cmath::c_float::ilog_radix,
8791
// fn modf(n: c_float, iptr: &mut c_float) -> c_float = cmath::c_float::modf,
92+
fn round(n: c_float) -> c_float = cmath::c_float::round,
8893
// fn ldexp_radix(n: c_float, i: c_int) -> c_float = cmath::c_float::ldexp_radix,
8994
fn sinh(n: c_float) -> c_float = cmath::c_float::sinh,
9095
fn tan(n: c_float) -> c_float = cmath::c_float::tan,
@@ -306,16 +311,6 @@ impl Bounded for f32 {
306311
impl Primitive for f32 {}
307312

308313
impl Float for f32 {
309-
#[inline]
310-
fn max(self, other: f32) -> f32 {
311-
unsafe { cmath::c_float::fmax(self, other) }
312-
}
313-
314-
#[inline]
315-
fn min(self, other: f32) -> f32 {
316-
unsafe { cmath::c_float::fmin(self, other) }
317-
}
318-
319314
#[inline]
320315
fn nan() -> f32 { 0.0 / 0.0 }
321316

branches/try/src/libstd/num/f64.rs

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ use num::{Zero, One, Bounded, strconv};
2323
use num;
2424
use intrinsics;
2525

26+
pub use cmp::{min, max};
27+
2628
macro_rules! delegate(
2729
(
2830
$(
@@ -46,32 +48,37 @@ macro_rules! delegate(
4648

4749
delegate!(
4850
// intrinsics
49-
fn sqrt(n: f64) -> f64 = intrinsics::sqrtf64,
50-
fn powi(n: f64, e: i32) -> f64 = intrinsics::powif64,
51-
fn sin(n: f64) -> f64 = intrinsics::sinf64,
51+
fn abs(n: f64) -> f64 = intrinsics::fabsf64,
5252
fn cos(n: f64) -> f64 = intrinsics::cosf64,
53-
fn pow(n: f64, e: f64) -> f64 = intrinsics::powf64,
5453
fn exp(n: f64) -> f64 = intrinsics::expf64,
5554
fn exp2(n: f64) -> f64 = intrinsics::exp2f64,
55+
fn floor(x: f64) -> f64 = intrinsics::floorf64,
5656
fn ln(n: f64) -> f64 = intrinsics::logf64,
5757
fn log10(n: f64) -> f64 = intrinsics::log10f64,
5858
fn log2(n: f64) -> f64 = intrinsics::log2f64,
5959
fn mul_add(a: f64, b: f64, c: f64) -> f64 = intrinsics::fmaf64,
60-
fn abs(n: f64) -> f64 = intrinsics::fabsf64,
61-
fn copysign(x: f64, y: f64) -> f64 = intrinsics::copysignf64,
62-
fn floor(x: f64) -> f64 = intrinsics::floorf64,
60+
fn pow(n: f64, e: f64) -> f64 = intrinsics::powf64,
61+
// fn powi(n: f64, e: c_int) -> f64 = intrinsics::powif64,
62+
fn sin(n: f64) -> f64 = intrinsics::sinf64,
63+
fn sqrt(n: f64) -> f64 = intrinsics::sqrtf64,
64+
65+
// LLVM 3.3 required to use intrinsics for these four
66+
fn ceil(n: c_double) -> c_double = cmath::c_double::ceil,
67+
fn trunc(n: c_double) -> c_double = cmath::c_double::trunc,
68+
/*
6369
fn ceil(n: f64) -> f64 = intrinsics::ceilf64,
6470
fn trunc(n: f64) -> f64 = intrinsics::truncf64,
65-
fn rint(n: f64) -> f64 = intrinsics::rintf64,
66-
fn nearbyint(n: f64) -> f64 = intrinsics::nearbyintf64,
67-
fn round(n: f64) -> f64 = intrinsics::roundf64,
71+
fn rint(n: c_double) -> c_double = intrinsics::rintf64,
72+
fn nearbyint(n: c_double) -> c_double = intrinsics::nearbyintf64,
73+
*/
6874

6975
// cmath
7076
fn acos(n: c_double) -> c_double = cmath::c_double::acos,
7177
fn asin(n: c_double) -> c_double = cmath::c_double::asin,
7278
fn atan(n: c_double) -> c_double = cmath::c_double::atan,
7379
fn atan2(a: c_double, b: c_double) -> c_double = cmath::c_double::atan2,
7480
fn cbrt(n: c_double) -> c_double = cmath::c_double::cbrt,
81+
fn copysign(x: c_double, y: c_double) -> c_double = cmath::c_double::copysign,
7582
fn cosh(n: c_double) -> c_double = cmath::c_double::cosh,
7683
// fn erf(n: c_double) -> c_double = cmath::c_double::erf,
7784
// fn erfc(n: c_double) -> c_double = cmath::c_double::erfc,
@@ -85,6 +92,7 @@ delegate!(
8592
fn ln_1p(n: c_double) -> c_double = cmath::c_double::ln_1p,
8693
// fn ilog_radix(n: c_double) -> c_int = cmath::c_double::ilog_radix,
8794
// fn modf(n: c_double, iptr: &mut c_double) -> c_double = cmath::c_double::modf,
95+
fn round(n: c_double) -> c_double = cmath::c_double::round,
8896
// fn ldexp_radix(n: c_double, i: c_int) -> c_double = cmath::c_double::ldexp_radix,
8997
fn sinh(n: c_double) -> c_double = cmath::c_double::sinh,
9098
fn tan(n: c_double) -> c_double = cmath::c_double::tan,
@@ -305,16 +313,6 @@ impl Bounded for f64 {
305313
impl Primitive for f64 {}
306314

307315
impl Float for f64 {
308-
#[inline]
309-
fn max(self, other: f64) -> f64 {
310-
unsafe { cmath::c_double::fmax(self, other) }
311-
}
312-
313-
#[inline]
314-
fn min(self, other: f64) -> f64 {
315-
unsafe { cmath::c_double::fmin(self, other) }
316-
}
317-
318316
#[inline]
319317
fn nan() -> f64 { 0.0 / 0.0 }
320318

branches/try/src/libstd/num/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,6 @@ pub enum FPCategory {
313313
pub trait Float: Signed
314314
+ Round
315315
+ Primitive {
316-
fn max(self, other: Self) -> Self;
317-
fn min(self, other: Self) -> Self;
318-
319316
// FIXME (#5527): These should be associated constants
320317
fn nan() -> Self;
321318
fn infinity() -> Self;

0 commit comments

Comments
 (0)