Skip to content

Commit 56e38d2

Browse files
committed
---
yaml --- r: 159518 b: refs/heads/master c: 7ef2007 h: refs/heads/master v: v3
1 parent 8083da8 commit 56e38d2

File tree

235 files changed

+2895
-5002
lines changed

Some content is hidden

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

235 files changed

+2895
-5002
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: 1628b98183bfec13e9407a905324dda047c3a550
2+
refs/heads/master: 7ef200774fbb8e5f4961f63a83cf5bbe27cd5f8f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 9c96a79a74f10bed18b031ce0ac4126c56d6cfb3
55
refs/heads/try: f58aad6dce273570fb130b4df008ef9acd5a5be2

trunk/mk/crates.mk

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ TARGET_CRATES := libc std green native flate arena term \
5353
serialize sync getopts collections test time rand \
5454
log regex graphviz core rbml alloc rustrt \
5555
unicode
56-
HOST_CRATES := syntax rustc rustc_trans rustdoc regex_macros fmt_macros \
56+
HOST_CRATES := syntax rustc rustdoc regex_macros fmt_macros \
5757
rustc_llvm rustc_back
5858
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5959
TOOLS := compiletest rustdoc rustc
@@ -69,12 +69,11 @@ DEPS_graphviz := std
6969
DEPS_green := std native:context_switch
7070
DEPS_native := std
7171
DEPS_syntax := std term serialize log fmt_macros arena libc
72-
DEPS_rustc_trans := rustc rustc_back rustc_llvm libc
7372
DEPS_rustc := syntax flate arena serialize getopts rbml \
7473
time log graphviz rustc_llvm rustc_back
7574
DEPS_rustc_llvm := native:rustllvm libc std
7675
DEPS_rustc_back := std syntax rustc_llvm flate log libc
77-
DEPS_rustdoc := rustc rustc_trans native:hoedown serialize getopts \
76+
DEPS_rustdoc := rustc native:hoedown serialize getopts \
7877
test time
7978
DEPS_flate := std native:miniz
8079
DEPS_arena := std
@@ -97,7 +96,7 @@ DEPS_fmt_macros = std
9796

9897
TOOL_DEPS_compiletest := test getopts native
9998
TOOL_DEPS_rustdoc := rustdoc native
100-
TOOL_DEPS_rustc := rustc_trans native
99+
TOOL_DEPS_rustc := rustc native
101100
TOOL_SOURCE_compiletest := $(S)src/compiletest/compiletest.rs
102101
TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
103102
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
@@ -113,8 +112,8 @@ ONLY_RLIB_unicode := 1
113112
# You should not need to edit below this line
114113
################################################################################
115114

116-
DOC_CRATES := $(filter-out rustc, $(filter-out rustc_trans, $(filter-out syntax, $(CRATES))))
117-
COMPILER_DOC_CRATES := rustc rustc_trans syntax
115+
DOC_CRATES := $(filter-out rustc, $(filter-out syntax, $(CRATES)))
116+
COMPILER_DOC_CRATES := rustc syntax
118117

119118
# This macro creates some simple definitions for each crate being built, just
120119
# some munging of all of the parameters above.

trunk/src/doc/reference.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2513,6 +2513,11 @@ The currently implemented features of the reference compiler are:
25132513
closure as `once` is unlikely to be supported going forward. So
25142514
they are hidden behind this feature until they are to be removed.
25152515

2516+
* `overloaded_calls` - Allow implementing the `Fn*` family of traits on user
2517+
types, allowing overloading the call operator (`()`).
2518+
This feature may still undergo changes before being
2519+
stabilized.
2520+
25162521
* `phase` - Usage of the `#[phase]` attribute allows loading compiler plugins
25172522
for custom lints or syntax extensions. The implementation is
25182523
considered unwholesome and in need of overhaul, and it is not clear
@@ -2555,8 +2560,11 @@ The currently implemented features of the reference compiler are:
25552560
* `trace_macros` - Allows use of the `trace_macros` macro, which is a nasty
25562561
hack that will certainly be removed.
25572562

2558-
* `unboxed_closures` - Rust's new closure design, which is currently a work in
2559-
progress feature with many known bugs.
2563+
* `unboxed_closure_sugar` - Allows using `|Foo| -> Bar` as a trait bound
2564+
meaning one of the `Fn` traits. Still
2565+
experimental.
2566+
2567+
* `unboxed_closures` - A work in progress feature with many known bugs.
25602568

25612569
* `unsafe_destructor` - Allows use of the `#[unsafe_destructor]` attribute,
25622570
which is considered wildly unsafe and will be

trunk/src/driver/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
extern crate "rustdoc" as this;
1313

1414
#[cfg(rustc)]
15-
extern crate "rustc_trans" as this;
15+
extern crate "rustc" as this;
1616

1717
fn main() { this::main() }

trunk/src/libcore/iter.rs

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,9 @@ use cmp;
6565
use cmp::Ord;
6666
use mem;
6767
use num::{ToPrimitive, Int};
68-
use ops::{Add, Deref};
68+
use ops::Add;
6969
use option::{Option, Some, None};
7070
use uint;
71-
7271
#[deprecated = "renamed to Extend"] pub use self::Extend as Extendable;
7372

7473
/// Conversion from an `Iterator`
@@ -1022,44 +1021,6 @@ impl<T: Clone> MinMaxResult<T> {
10221021
}
10231022
}
10241023

1025-
/// A trait for iterators that contain cloneable elements
1026-
pub trait CloneIteratorExt<A> {
1027-
/// Creates an iterator that clones the elements it yields. Useful for converting an
1028-
/// Iterator<&T> to an Iterator<T>.
1029-
fn cloned(self) -> Cloned<Self>;
1030-
}
1031-
1032-
1033-
impl<A: Clone, D: Deref<A>, I: Iterator<D>> CloneIteratorExt<A> for I {
1034-
fn cloned(self) -> Cloned<I> {
1035-
Cloned { it: self }
1036-
}
1037-
}
1038-
1039-
/// An iterator that clones the elements of an underlying iterator
1040-
pub struct Cloned<I> {
1041-
it: I,
1042-
}
1043-
1044-
impl<A: Clone, D: Deref<A>, I: Iterator<D>> Iterator<A> for Cloned<I> {
1045-
fn next(&mut self) -> Option<A> {
1046-
self.it.next().cloned()
1047-
}
1048-
1049-
fn size_hint(&self) -> (uint, Option<uint>) {
1050-
self.it.size_hint()
1051-
}
1052-
}
1053-
1054-
impl<A: Clone, D: Deref<A>, I: DoubleEndedIterator<D>>
1055-
DoubleEndedIterator<A> for Cloned<I> {
1056-
fn next_back(&mut self) -> Option<A> {
1057-
self.it.next_back().cloned()
1058-
}
1059-
}
1060-
1061-
impl<A: Clone, D: Deref<A>, I: ExactSize<D>> ExactSize<A> for Cloned<I> {}
1062-
10631024
/// A trait for iterators that are cloneable.
10641025
pub trait CloneableIterator {
10651026
/// Repeats an iterator endlessly

trunk/src/libcore/num/mod.rs

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,28 @@ pub fn div_rem<T: Div<T, T> + Rem<T, T>>(x: T, y: T) -> (T, T) {
3939
}
4040

4141
/// Raises a `base` to the power of `exp`, using exponentiation by squaring.
42+
///
43+
/// # Example
44+
///
45+
/// ```rust
46+
/// use std::num;
47+
///
48+
/// assert_eq!(num::pow(2i, 4), 16);
49+
/// ```
4250
#[inline]
43-
#[deprecated = "Use Int::pow() instead, as in 2i.pow(4)"]
44-
pub fn pow<T: Int>(base: T, exp: uint) -> T {
45-
base.pow(exp)
51+
pub fn pow<T: Int>(mut base: T, mut exp: uint) -> T {
52+
if exp == 1 { base }
53+
else {
54+
let mut acc: T = Int::one();
55+
while exp > 0 {
56+
if (exp & 1) == 1 {
57+
acc = acc * base;
58+
}
59+
base = base * base;
60+
exp = exp >> 1;
61+
}
62+
acc
63+
}
4664
}
4765

4866
/// A built-in signed or unsigned integer.
@@ -343,29 +361,6 @@ pub trait Int
343361
None => Int::max_value(),
344362
}
345363
}
346-
347-
/// Raises self to the power of `exp`, using exponentiation by squaring.
348-
///
349-
/// # Example
350-
///
351-
/// ```rust
352-
/// use std::num::Int;
353-
///
354-
/// assert_eq!(2i.pow(4), 16);
355-
/// ```
356-
#[inline]
357-
fn pow(self, mut exp: uint) -> Self {
358-
let mut base = self;
359-
let mut acc: Self = Int::one();
360-
while exp > 0 {
361-
if (exp & 1) == 1 {
362-
acc = acc * base;
363-
}
364-
base = base * base;
365-
exp /= 2;
366-
}
367-
acc
368-
}
369364
}
370365

371366
macro_rules! checked_op {

trunk/src/libcore/option.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ use result::{Result, Ok, Err};
153153
use slice;
154154
use slice::AsSlice;
155155
use clone::Clone;
156-
use ops::Deref;
157156

158157
// Note that this is not a lang item per se, but it has a hidden dependency on
159158
// `Iterator`, which is one. The compiler assumes that the `next` method of
@@ -695,12 +694,11 @@ impl<T> Option<T> {
695694
}
696695
}
697696

698-
impl<'a, T: Clone, D: Deref<T>> Option<D> {
699-
/// Maps an Option<D> to an Option<T> by dereffing and cloning the contents of the Option.
700-
/// Useful for converting an Option<&T> to an Option<T>.
697+
impl<'a, T: Clone> Option<&'a T> {
698+
/// Maps an Option<&T> to an Option<T> by cloning the contents of the Option<&T>.
701699
#[unstable = "recently added as part of collections reform"]
702700
pub fn cloned(self) -> Option<T> {
703-
self.map(|t| t.deref().clone())
701+
self.map(|t| t.clone())
704702
}
705703
}
706704

trunk/src/libcoretest/iter.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -440,23 +440,6 @@ fn test_rev() {
440440
vec![16, 14, 12, 10, 8, 6]);
441441
}
442442

443-
#[test]
444-
fn test_cloned() {
445-
let xs = [2u8, 4, 6, 8];
446-
447-
let mut it = xs.iter().cloned();
448-
assert_eq!(it.len(), 4);
449-
assert_eq!(it.next(), Some(2));
450-
assert_eq!(it.len(), 3);
451-
assert_eq!(it.next(), Some(4));
452-
assert_eq!(it.len(), 2);
453-
assert_eq!(it.next_back(), Some(8));
454-
assert_eq!(it.len(), 1);
455-
assert_eq!(it.next_back(), Some(6));
456-
assert_eq!(it.len(), 0);
457-
assert_eq!(it.next_back(), None);
458-
}
459-
460443
#[test]
461444
fn test_double_ended_map() {
462445
let xs = [1i, 2, 3, 4, 5, 6];

trunk/src/libcoretest/option.rs

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -241,29 +241,14 @@ fn test_collect() {
241241
assert!(v == None);
242242
}
243243

244-
#[test]
245244
fn test_cloned() {
246-
let val1 = 1u32;
247-
let mut val2 = 2u32;
248-
let val1_ref = &val1;
249-
let opt_none: Option<&'static u32> = None;
250-
let opt_ref = Some(&val1);
251-
let opt_ref_ref = Some(&val1_ref);
252-
let opt_mut_ref = Some(&mut val2);
253-
254-
// None works
255-
assert_eq!(opt_none.clone(), None);
256-
assert_eq!(opt_none.cloned(), None);
257-
258-
// Mutable refs work
259-
assert_eq!(opt_mut_ref.cloned(), Some(2u32));
260-
261-
// Immutable ref works
262-
assert_eq!(opt_ref.clone(), Some(&val1));
263-
assert_eq!(opt_ref.cloned(), Some(1u32));
264-
265-
// Double Immutable ref works
266-
assert_eq!(opt_ref_ref.clone(), Some(&val1_ref));
267-
assert_eq!(opt_ref_ref.clone().cloned(), Some(&val1));
268-
assert_eq!(opt_ref_ref.cloned().cloned(), Some(1u32));
245+
let s = 1u32;
246+
let n: Option<&'static u32> = None;
247+
let o = Some(&s);
248+
249+
assert_eq!(o.clone(), Some(&s));
250+
assert_eq!(o.cloned(), Some(1u32));
251+
252+
assert_eq!(n.clone(), None);
253+
assert_eq!(n.cloned(), None);
269254
}

trunk/src/libgraphviz/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl<'a> dot::GraphWalk<'a, Nd, Ed> for Edges {
9090
fn target(&self, e: &Ed) -> Nd { let &(_,t) = e; t }
9191
}
9292
93-
# pub fn main() { render_to(&mut Vec::new()) }
93+
# pub fn main() { use std::io::MemWriter; render_to(&mut MemWriter::new()) }
9494
```
9595
9696
```no_run
@@ -182,7 +182,7 @@ impl<'a> dot::GraphWalk<'a, Nd, Ed<'a>> for Graph {
182182
fn target(&self, e: &Ed) -> Nd { let & &(_,t) = e; t }
183183
}
184184
185-
# pub fn main() { render_to(&mut Vec::new()) }
185+
# pub fn main() { use std::io::MemWriter; render_to(&mut MemWriter::new()) }
186186
```
187187
188188
```no_run
@@ -246,7 +246,7 @@ impl<'a> dot::GraphWalk<'a, Nd<'a>, Ed<'a>> for Graph {
246246
fn target(&self, e: &Ed<'a>) -> Nd<'a> { let &(_,t) = e; t }
247247
}
248248
249-
# pub fn main() { render_to(&mut Vec::new()) }
249+
# pub fn main() { use std::io::MemWriter; render_to(&mut MemWriter::new()) }
250250
```
251251
252252
```no_run
@@ -274,7 +274,7 @@ pub fn main() {
274274
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
275275
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
276276
html_root_url = "http://doc.rust-lang.org/nightly/")]
277-
#![feature(globs, slicing_syntax)]
277+
#![feature(globs)]
278278

279279
pub use self::LabelText::*;
280280

@@ -553,7 +553,7 @@ mod tests {
553553
use self::NodeLabels::*;
554554
use super::{Id, LabelText, LabelStr, EscStr, Labeller};
555555
use super::{Nodes, Edges, GraphWalk, render};
556-
use std::io::{BufReader, IoResult};
556+
use std::io::{MemWriter, BufReader, IoResult};
557557
use std::str;
558558

559559
/// each node is an index in a vector in the graph.
@@ -702,9 +702,9 @@ mod tests {
702702
}
703703

704704
fn test_input(g: LabelledGraph) -> IoResult<String> {
705-
let mut writer = Vec::new();
705+
let mut writer = MemWriter::new();
706706
render(&g, &mut writer).unwrap();
707-
let mut r = BufReader::new(writer[]);
707+
let mut r = BufReader::new(writer.get_ref());
708708
r.read_to_string()
709709
}
710710

@@ -809,15 +809,15 @@ r#"digraph hasse_diagram {
809809
"branch2",
810810
"afterward"));
811811

812-
let mut writer = Vec::new();
812+
let mut writer = MemWriter::new();
813813

814814
let g = LabelledGraphWithEscStrs::new(
815815
"syntax_tree", labels,
816816
vec!(edge(0, 1, "then"), edge(0, 2, "else"),
817817
edge(1, 3, ";"), edge(2, 3, ";" )));
818818

819819
render(&g, &mut writer).unwrap();
820-
let mut r = BufReader::new(writer[]);
820+
let mut r = BufReader::new(writer.get_ref());
821821
let r = r.read_to_string();
822822

823823
assert_eq!(r.unwrap().as_slice(),

0 commit comments

Comments
 (0)