Skip to content

Commit 53c3083

Browse files
committed
---
yaml --- r: 166435 b: refs/heads/batch c: 553533b h: refs/heads/master i: 166433: a3c51e7 166431: fb814bd v: v3
1 parent 807e8b5 commit 53c3083

Some content is hidden

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

65 files changed

+1309
-372
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2929
refs/heads/issue-18208-method-dispatch-2: 9e1eae4fb9b6527315b4441cf8a0f5ca911d1671
3030
refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
32-
refs/heads/batch: aa37b6dcbb68f6629da2ad8feca7e1af616e6675
32+
refs/heads/batch: 553533b92bfca8ab5ae147defa590cca1426798c
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970

branches/batch/mk/cfg/x86_64-unknown-dragonfly.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ CFG_LIB_NAME_x86_64-unknown-dragonfly=lib$(1).so
77
CFG_STATIC_LIB_NAME_x86_64-unknown-dragonfly=lib$(1).a
88
CFG_LIB_GLOB_x86_64-unknown-dragonfly=lib$(1)-*.so
99
CFG_LIB_DSYM_GLOB_x86_64-unknown-dragonfly=$(1)-*.dylib.dSYM
10-
CFG_JEMALLOC_CFLAGS_x86_64-unknown-dragonfly := -I/usr/include -I/usr/local/include $(CFLAGS)
11-
CFG_GCCISH_CFLAGS_x86_64-unknown-dragonfly := -Wall -Werror -g -fPIC -I/usr/include -I/usr/local/include $(CFLAGS)
12-
CFG_GCCISH_LINK_FLAGS_x86_64-unknown-dragonfly := -shared -fPIC -g -pthread -lrt
10+
CFG_JEMALLOC_CFLAGS_x86_64-unknown-dragonfly := -m64 -I/usr/include -I/usr/local/include $(CFLAGS)
11+
CFG_GCCISH_CFLAGS_x86_64-unknown-dragonfly := -Wall -Werror -g -fPIC -m64 -I/usr/include -I/usr/local/include $(CFLAGS)
12+
CFG_GCCISH_LINK_FLAGS_x86_64-unknown-dragonfly := -shared -fPIC -g -pthread -lrt -m64
1313
CFG_GCCISH_DEF_FLAG_x86_64-unknown-dragonfly := -Wl,--export-dynamic,--dynamic-list=
1414
CFG_GCCISH_PRE_LIB_FLAGS_x86_64-unknown-dragonfly := -Wl,-whole-archive
1515
CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-dragonfly := -Wl,-no-whole-archive

branches/batch/src/doc/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ names, and invoked through a consistent syntax: `name!(...)`. Examples include:
640640
* `stringify!` : pretty-print the Rust expression given as an argument
641641
* `include!` : include the Rust expression in the given file
642642
* `include_str!` : include the contents of the given file as a string
643-
* `include_bin!` : include the contents of the given file as a binary blob
643+
* `include_bytes!` : include the contents of the given file as a binary blob
644644
* `error!`, `warn!`, `info!`, `debug!` : provide diagnostic information.
645645

646646
All of the above extensions are expressions with values.

branches/batch/src/etc/snapshot.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def scrub(b):
3737
"macos": ["bin/rustc"],
3838
"winnt": ["bin/rustc.exe"],
3939
"freebsd": ["bin/rustc"],
40+
"dragonfly": ["bin/rustc"],
4041
}
4142

4243
winnt_runtime_deps_32 = ["libgcc_s_dw2-1.dll",
@@ -86,6 +87,8 @@ def get_kernel(triple):
8687
return "macos"
8788
if os_name == "freebsd":
8889
return "freebsd"
90+
if os_name == "dragonfly":
91+
return "dragonfly"
8992
return "linux"
9093

9194
def get_cpu(triple):

branches/batch/src/libcore/fmt/float.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ use char;
1818
use char::Char;
1919
use fmt;
2020
use iter::{range, DoubleEndedIteratorExt};
21-
use num::{Float, FPNaN, FPInfinite, ToPrimitive};
22-
use num::cast;
21+
use num::{cast, Float, ToPrimitive};
22+
use num::FpCategory as Fp;
2323
use ops::FnOnce;
2424
use result::Result::Ok;
2525
use slice::{mod, SliceExt};
@@ -109,11 +109,11 @@ pub fn float_to_str_bytes_common<T: Float, U, F>(
109109
let _1: T = Float::one();
110110

111111
match num.classify() {
112-
FPNaN => return f("NaN".as_bytes()),
113-
FPInfinite if num > _0 => {
112+
Fp::Nan => return f("NaN".as_bytes()),
113+
Fp::Infinite if num > _0 => {
114114
return f("inf".as_bytes());
115115
}
116-
FPInfinite if num < _0 => {
116+
Fp::Infinite if num < _0 => {
117117
return f("-inf".as_bytes());
118118
}
119119
_ => {}

branches/batch/src/libcore/iter.rs

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2542,6 +2542,64 @@ impl<A: Int> Iterator<A> for RangeStepInclusive<A> {
25422542
}
25432543
}
25442544

2545+
2546+
/// The `Step` trait identifies objects which can be stepped over in both
2547+
/// directions. The `steps_between` function provides a way to
2548+
/// compare two Step objects (it could be provided using `step()` and `Ord`,
2549+
/// but the implementation would be so inefficient as to be useless).
2550+
#[unstable = "Trait is unstable."]
2551+
pub trait Step: Ord {
2552+
/// Change self to the next object.
2553+
fn step(&mut self);
2554+
/// Change self to the previous object.
2555+
fn step_back(&mut self);
2556+
/// The steps_between two step objects.
2557+
/// a should always be less than b, so the result should never be negative.
2558+
/// Return None if it is not possible to calculate steps_between without
2559+
/// overflow.
2560+
fn steps_between(a: &Self, b: &Self) -> Option<uint>;
2561+
}
2562+
2563+
macro_rules! step_impl {
2564+
($($t:ty)*) => ($(
2565+
#[unstable = "Trait is unstable."]
2566+
impl Step for $t {
2567+
#[inline]
2568+
fn step(&mut self) { *self += 1; }
2569+
#[inline]
2570+
fn step_back(&mut self) { *self -= 1; }
2571+
#[inline]
2572+
fn steps_between(a: &$t, b: &$t) -> Option<uint> {
2573+
debug_assert!(a < b);
2574+
Some((*a - *b) as uint)
2575+
}
2576+
}
2577+
)*)
2578+
}
2579+
2580+
macro_rules! step_impl_no_between {
2581+
($($t:ty)*) => ($(
2582+
#[unstable = "Trait is unstable."]
2583+
impl Step for $t {
2584+
#[inline]
2585+
fn step(&mut self) { *self += 1; }
2586+
#[inline]
2587+
fn step_back(&mut self) { *self -= 1; }
2588+
#[inline]
2589+
fn steps_between(_a: &$t, _b: &$t) -> Option<uint> {
2590+
None
2591+
}
2592+
}
2593+
)*)
2594+
}
2595+
2596+
step_impl!(uint u8 u16 u32 int i8 i16 i32);
2597+
#[cfg(target_word_size = "64")]
2598+
step_impl!(u64 i64);
2599+
#[cfg(target_word_size = "32")]
2600+
step_impl_no_between!(u64 i64);
2601+
2602+
25452603
/// An iterator that repeats an element endlessly
25462604
#[deriving(Clone)]
25472605
#[stable]

branches/batch/src/libcore/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
#![allow(unknown_features, raw_pointer_deriving)]
6060
#![feature(globs, intrinsics, lang_items, macro_rules, phase)]
6161
#![feature(simd, unsafe_destructor, slicing_syntax)]
62-
#![feature(default_type_params, unboxed_closures)]
62+
#![feature(default_type_params, unboxed_closures, associated_types)]
6363
#![deny(missing_docs)]
6464

6565
mod macros;

branches/batch/src/libcore/num/f32.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919
use intrinsics;
2020
use mem;
21-
use num::{Float, FPNormal, FPCategory, FPZero, FPSubnormal, FPInfinite, FPNaN};
21+
use num::Float;
22+
use num::FpCategory as Fp;
2223
use num::from_str_radix;
2324
use option::Option;
2425

@@ -156,23 +157,23 @@ impl Float for f32 {
156157
/// Returns `true` if the number is neither zero, infinite, subnormal or NaN.
157158
#[inline]
158159
fn is_normal(self) -> bool {
159-
self.classify() == FPNormal
160+
self.classify() == Fp::Normal
160161
}
161162

162163
/// Returns the floating point category of the number. If only one property
163164
/// is going to be tested, it is generally faster to use the specific
164165
/// predicate instead.
165-
fn classify(self) -> FPCategory {
166+
fn classify(self) -> Fp {
166167
const EXP_MASK: u32 = 0x7f800000;
167168
const MAN_MASK: u32 = 0x007fffff;
168169

169170
let bits: u32 = unsafe { mem::transmute(self) };
170171
match (bits & MAN_MASK, bits & EXP_MASK) {
171-
(0, 0) => FPZero,
172-
(_, 0) => FPSubnormal,
173-
(0, EXP_MASK) => FPInfinite,
174-
(_, EXP_MASK) => FPNaN,
175-
_ => FPNormal,
172+
(0, 0) => Fp::Zero,
173+
(_, 0) => Fp::Subnormal,
174+
(0, EXP_MASK) => Fp::Infinite,
175+
(_, EXP_MASK) => Fp::Nan,
176+
_ => Fp::Normal,
176177
}
177178
}
178179

branches/batch/src/libcore/num/f64.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919
use intrinsics;
2020
use mem;
21-
use num::{Float, FPNormal, FPCategory, FPZero, FPSubnormal, FPInfinite, FPNaN};
21+
use num::Float;
22+
use num::FpCategory as Fp;
2223
use num::from_str_radix;
2324
use option::Option;
2425

@@ -164,23 +165,23 @@ impl Float for f64 {
164165
/// Returns `true` if the number is neither zero, infinite, subnormal or NaN.
165166
#[inline]
166167
fn is_normal(self) -> bool {
167-
self.classify() == FPNormal
168+
self.classify() == Fp::Normal
168169
}
169170

170171
/// Returns the floating point category of the number. If only one property
171172
/// is going to be tested, it is generally faster to use the specific
172173
/// predicate instead.
173-
fn classify(self) -> FPCategory {
174+
fn classify(self) -> Fp {
174175
const EXP_MASK: u64 = 0x7ff0000000000000;
175176
const MAN_MASK: u64 = 0x000fffffffffffff;
176177

177178
let bits: u64 = unsafe { mem::transmute(self) };
178179
match (bits & MAN_MASK, bits & EXP_MASK) {
179-
(0, 0) => FPZero,
180-
(_, 0) => FPSubnormal,
181-
(0, EXP_MASK) => FPInfinite,
182-
(_, EXP_MASK) => FPNaN,
183-
_ => FPNormal,
180+
(0, 0) => Fp::Zero,
181+
(_, 0) => Fp::Subnormal,
182+
(0, EXP_MASK) => Fp::Infinite,
183+
(_, EXP_MASK) => Fp::Nan,
184+
_ => Fp::Normal,
184185
}
185186
}
186187

branches/batch/src/libcore/num/mod.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#![stable]
1616
#![allow(missing_docs)]
1717

18-
pub use self::FPCategory::*;
19-
2018
use {int, i8, i16, i32, i64};
2119
use {uint, u8, u16, u32, u64};
2220
use {f32, f64};
@@ -1222,17 +1220,17 @@ impl_num_cast! { f64, to_f64 }
12221220
/// Used for representing the classification of floating point numbers
12231221
#[deriving(Copy, PartialEq, Show)]
12241222
#[unstable = "may be renamed"]
1225-
pub enum FPCategory {
1223+
pub enum FpCategory {
12261224
/// "Not a Number", often obtained by dividing by zero
1227-
FPNaN,
1225+
Nan,
12281226
/// Positive or negative infinity
1229-
FPInfinite ,
1227+
Infinite ,
12301228
/// Positive or negative zero
1231-
FPZero,
1232-
/// De-normalized floating point representation (less precise than `FPNormal`)
1233-
FPSubnormal,
1229+
Zero,
1230+
/// De-normalized floating point representation (less precise than `Normal`)
1231+
Subnormal,
12341232
/// A regular floating point number
1235-
FPNormal,
1233+
Normal,
12361234
}
12371235

12381236
/// A built-in floating point number.
@@ -1277,7 +1275,7 @@ pub trait Float
12771275
/// Returns true if this number is neither zero, infinite, denormal, or NaN.
12781276
fn is_normal(self) -> bool;
12791277
/// Returns the category that this number falls into.
1280-
fn classify(self) -> FPCategory;
1278+
fn classify(self) -> FpCategory;
12811279

12821280
// FIXME (#5527): These should be associated constants
12831281

branches/batch/src/libcore/ops.rs

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@
5151
//! See the documentation for each trait for a minimum implementation that prints
5252
//! something to the screen.
5353
54+
use clone::Clone;
55+
use iter::{Step, Iterator,DoubleEndedIterator,ExactSizeIterator};
5456
use kinds::Sized;
57+
use option::Option::{mod, Some, None};
5558

5659
/// The `Drop` trait is used to run some code when a value goes out of scope. This
5760
/// is sometimes called a 'destructor'.
@@ -833,6 +836,79 @@ pub trait SliceMut<Sized? Idx, Sized? Result> for Sized? {
833836
fn slice_or_fail_mut<'a>(&'a mut self, from: &Idx, to: &Idx) -> &'a mut Result;
834837
}
835838

839+
840+
/// An unbounded range.
841+
#[deriving(Copy)]
842+
#[lang="full_range"]
843+
pub struct FullRange;
844+
845+
/// A (half-open) range which is bounded at both ends.
846+
#[deriving(Copy)]
847+
#[lang="range"]
848+
pub struct Range<Idx> {
849+
/// The lower bound of the range (inclusive).
850+
pub start: Idx,
851+
/// The upper bound of the range (exclusive).
852+
pub end: Idx,
853+
}
854+
855+
// FIXME(#19391) needs a snapshot
856+
//impl<Idx: Clone + Step<T=uint>> Iterator<Idx> for Range<Idx> {
857+
impl<Idx: Clone + Step> Iterator<Idx> for Range<Idx> {
858+
#[inline]
859+
fn next(&mut self) -> Option<Idx> {
860+
if self.start < self.end {
861+
let result = self.start.clone();
862+
self.start.step();
863+
return Some(result);
864+
}
865+
866+
return None;
867+
}
868+
869+
#[inline]
870+
fn size_hint(&self) -> (uint, Option<uint>) {
871+
if let Some(hint) = Step::steps_between(&self.end, &self.start) {
872+
(hint, Some(hint))
873+
} else {
874+
(0, None)
875+
}
876+
}
877+
}
878+
879+
impl<Idx: Clone + Step> DoubleEndedIterator<Idx> for Range<Idx> {
880+
#[inline]
881+
fn next_back(&mut self) -> Option<Idx> {
882+
if self.start < self.end {
883+
self.end.step_back();
884+
return Some(self.end.clone());
885+
}
886+
887+
return None;
888+
}
889+
}
890+
891+
impl<Idx: Clone + Step> ExactSizeIterator<Idx> for Range<Idx> {}
892+
893+
/// A range which is only bounded below.
894+
#[deriving(Copy)]
895+
#[lang="range_from"]
896+
pub struct RangeFrom<Idx> {
897+
/// The lower bound of the range (inclusive).
898+
pub start: Idx,
899+
}
900+
901+
impl<Idx: Clone + Step> Iterator<Idx> for RangeFrom<Idx> {
902+
#[inline]
903+
fn next(&mut self) -> Option<Idx> {
904+
// Deliberately overflow so we loop forever.
905+
let result = self.start.clone();
906+
self.start.step();
907+
return Some(result);
908+
}
909+
}
910+
911+
836912
/// The `Deref` trait is used to specify the functionality of dereferencing
837913
/// operations like `*v`.
838914
///

0 commit comments

Comments
 (0)