Skip to content

Commit 129aaf6

Browse files
committed
---
yaml --- r: 139023 b: refs/heads/try2 c: 38ac809 h: refs/heads/master i: 139021: 974c259 139019: 02b2696 139015: 7242e93 139007: ec0376a v: v3
1 parent 5573538 commit 129aaf6

File tree

12 files changed

+46
-70
lines changed

12 files changed

+46
-70
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: e75a843efa66fbcbe7db8473c3ee8f26fa2230ff
8+
refs/heads/try2: 38ac809cc7f0d4da8cc16951f8a9852f4b052c1f
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libcore/core.rc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ Implicitly, all crates behave as if they included the following prologue:
5656

5757
// On Linux, link to the runtime with -lrt.
5858
#[cfg(target_os = "linux")]
59-
#[doc(hidden)]
6059
pub mod linkhack {
6160
#[link_args="-lrustrt -lrt"]
6261
#[link_args = "-lpthread"]
@@ -253,7 +252,7 @@ pub mod rt;
253252
// A curious inner-module that's not exported that contains the binding
254253
// 'core' so that macro-expanded references to core::error and such
255254
// can be resolved within libcore.
256-
#[doc(hidden)]
255+
#[doc(hidden)] // FIXME #3538
257256
pub mod core {
258257
#[cfg(stage0)]
259258
pub const error : u32 = 1_u32;

branches/try2/src/libcore/iter.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ pub trait ReverseIter<A>: BaseIter<A> {
3131
pure fn each_reverse(&self, blk: &fn(&A) -> bool);
3232
}
3333

34-
pub trait MutableIter<A>: BaseIter<A> {
35-
fn each_mut(&mut self, blk: &fn(&mut A) -> bool);
36-
}
37-
3834
pub trait ExtendedIter<A> {
3935
pure fn eachi(&self, blk: &fn(uint, v: &A) -> bool);
4036
pure fn all(&self, blk: &fn(&A) -> bool) -> bool;

branches/try2/src/libcore/option.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ use ops::Add;
4646
use kinds::Copy;
4747
use util;
4848
use num::Zero;
49-
use iter::{BaseIter, MutableIter};
49+
use iter::BaseIter;
5050

5151
#[cfg(test)] use ptr;
5252
#[cfg(test)] use str;
@@ -323,13 +323,6 @@ impl<T> BaseIter<T> for Option<T> {
323323
}
324324
}
325325
326-
impl<T> MutableIter<T> for Option<T> {
327-
#[inline(always)]
328-
fn each_mut(&mut self, f: &fn(&'self mut T) -> bool) {
329-
match *self { None => (), Some(ref mut t) => { f(t); } }
330-
}
331-
}
332-
333326
pub impl<T> Option<T> {
334327
/// Returns true if the option equals `none`
335328
#[inline(always)]

branches/try2/src/libcore/prelude.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ pub use clone::Clone;
2727
pub use cmp::{Eq, Ord, TotalOrd, Ordering, Less, Equal, Greater};
2828
pub use container::{Container, Mutable, Map, Set};
2929
pub use hash::Hash;
30-
pub use iter::{BaseIter, ReverseIter, MutableIter, ExtendedIter, EqIter};
31-
pub use iter::{CopyableIter, CopyableOrderedIter, CopyableNonstrictIter};
32-
pub use iter::Times;
30+
pub use iter::{BaseIter, ReverseIter, ExtendedIter, EqIter, CopyableIter};
31+
pub use iter::{CopyableOrderedIter, CopyableNonstrictIter, Times};
3332
pub use num::NumCast;
3433
pub use path::GenericPath;
3534
pub use path::Path;
@@ -44,10 +43,6 @@ pub use vec::{CopyableVector, ImmutableVector};
4443
pub use vec::{ImmutableEqVector, ImmutableCopyableVector};
4544
pub use vec::{OwnedVector, OwnedCopyableVector};
4645

47-
/* Reexported runtime types */
48-
pub use comm::{stream, Port, Chan, GenericChan, GenericSmartChan, GenericPort, Peekable};
49-
pub use task::spawn;
50-
5146
/* Reexported modules */
5247

5348
pub use at_vec;

branches/try2/src/libcore/str.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,6 +2273,7 @@ pub trait StrSlice {
22732273
pure fn to_owned(&self) -> ~str;
22742274
pure fn to_managed(&self) -> @str;
22752275
pure fn char_at(&self, i: uint) -> char;
2276+
fn to_bytes(&self) -> ~[u8];
22762277
}
22772278
22782279
/// Extension methods for strings
@@ -2416,6 +2417,8 @@ impl StrSlice for &self/str {
24162417
24172418
#[inline]
24182419
pure fn char_at(&self, i: uint) -> char { char_at(*self, i) }
2420+
2421+
fn to_bytes(&self) -> ~[u8] { to_bytes(*self) }
24192422
}
24202423
24212424
pub trait OwnedStr {

branches/try2/src/libcore/vec.rs

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,7 @@ pub pure fn each<T>(v: &r/[T], f: &fn(&r/T) -> bool) {
13571357
/// a vector with mutable contents and you would like
13581358
/// to mutate the contents as you iterate.
13591359
#[inline(always)]
1360-
pub fn each_mut<T>(v: &'r mut [T], f: &fn(elem: &'r mut T) -> bool) {
1360+
pub fn each_mut<T>(v: &mut [T], f: &fn(elem: &mut T) -> bool) {
13611361
let mut i = 0;
13621362
let n = v.len();
13631363
while i < n {
@@ -2280,9 +2280,11 @@ pub mod bytes {
22802280
// ___________________________________________________________________________
22812281
// ITERATION TRAIT METHODS
22822282

2283-
impl<A> iter::BaseIter<A> for &'self [A] {
2283+
impl<A> iter::BaseIter<A> for &self/[A] {
22842284
#[inline(always)]
2285-
pure fn each(&self, blk: &fn(v: &'self A) -> bool) { each(*self, blk) }
2285+
pub pure fn each(&self, blk: &fn(v: &'self A) -> bool) {
2286+
each(*self, blk)
2287+
}
22862288
#[inline(always)]
22872289
pure fn size_hint(&self) -> Option<uint> { Some(self.len()) }
22882290
}
@@ -2303,29 +2305,6 @@ impl<A> iter::BaseIter<A> for @[A] {
23032305
pure fn size_hint(&self) -> Option<uint> { Some(self.len()) }
23042306
}
23052307

2306-
impl<A> iter::MutableIter<A> for &'self mut [A] {
2307-
#[inline(always)]
2308-
fn each_mut(&mut self, blk: &fn(v: &'self mut A) -> bool) {
2309-
each_mut(*self, blk)
2310-
}
2311-
}
2312-
2313-
// FIXME(#4148): This should be redundant
2314-
impl<A> iter::MutableIter<A> for ~[A] {
2315-
#[inline(always)]
2316-
fn each_mut(&mut self, blk: &fn(v: &'self mut A) -> bool) {
2317-
each_mut(*self, blk)
2318-
}
2319-
}
2320-
2321-
// FIXME(#4148): This should be redundant
2322-
impl<A> iter::MutableIter<A> for @mut [A] {
2323-
#[inline(always)]
2324-
fn each_mut(&mut self, blk: &fn(v: &mut A) -> bool) {
2325-
each_mut(*self, blk)
2326-
}
2327-
}
2328-
23292308
impl<A> iter::ExtendedIter<A> for &self/[A] {
23302309
pub pure fn eachi(&self, blk: &fn(uint, v: &A) -> bool) {
23312310
iter::eachi(self, blk)

branches/try2/src/librustdoc/rustdoc.rc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ fn run(config: Config) {
116116
// Remove things marked doc(hidden)
117117
prune_hidden_pass::mk_pass(),
118118
// Remove things that are private
119-
prune_private_pass::mk_pass(),
119+
// XXX enable this after 'export' is removed in favor of 'pub'
120+
// prune_private_pass::mk_pass(),
120121
// Extract brief documentation from the full descriptions
121122
desc_to_brief_pass::mk_pass(),
122123
// Massage the text to remove extra indentation

branches/try2/src/libstd/treemap.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pure fn lt<K: Ord + TotalOrd, V>(a: &TreeMap<K, V>,
7272
}
7373
};
7474

75-
a_len < b_len
75+
return a_len < b_len;
7676
}
7777

7878
impl<K: Ord + TotalOrd, V> Ord for TreeMap<K, V> {
@@ -694,13 +694,22 @@ fn remove<K: TotalOrd, V>(node: &mut Option<~TreeNode<K, V>>,
694694

695695
skew(save);
696696

697-
for save.right.each_mut |right| {
697+
match save.right {
698+
Some(ref mut right) => {
698699
skew(right);
699-
for right.right.each_mut |x| { skew(x) }
700+
match right.right {
701+
Some(ref mut x) => { skew(x) },
702+
None => ()
703+
}
704+
}
705+
None => ()
700706
}
701707

702708
split(save);
703-
for save.right.each_mut |x| { split(x) }
709+
match save.right {
710+
Some(ref mut x) => { split(x) },
711+
None => ()
712+
}
704713
}
705714

706715
return removed;
@@ -709,7 +718,7 @@ fn remove<K: TotalOrd, V>(node: &mut Option<~TreeNode<K, V>>,
709718
}
710719

711720
*node = None;
712-
true
721+
return true;
713722
}
714723

715724
#[cfg(test)]

branches/try2/src/libsyntax/codemap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl cmp::Eq for span {
140140

141141
impl<S:Encoder> Encodable<S> for span {
142142
/* Note #1972 -- spans are encoded but not decoded */
143-
fn encode(&self, _s: &S) { _s.emit_nil() }
143+
fn encode(&self, _s: &S) { }
144144
}
145145

146146
impl<D:Decoder> Decodable<D> for span {

branches/try2/src/libsyntax/parse/mod.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,10 @@ mod test {
297297
use std;
298298
use core::io;
299299
use core::option::None;
300+
use core::str;
300301
use util::testing::*;
301302

302-
#[test] fn to_json_str<E : Encodable<std::json::Encoder>>(val: @E) -> ~str {
303+
#[test] fn to_json_str (val: @Encodable<std::json::Encoder>) -> ~str {
303304
do io::with_str_writer |writer| {
304305
val.encode(~std::json::Encoder(writer));
305306
}
@@ -311,18 +312,18 @@ mod test {
311312
@~"fn foo (x : int) { x; }",
312313
~[],
313314
new_parse_sess(None));
314-
check_equal(to_json_str(@tts),
315-
~"[[\"tt_tok\",[null,[\"IDENT\",[\"fn\",false]]]],\
316-
[\"tt_tok\",[null,[\"IDENT\",[\"foo\",false]]]],\
317-
[\"tt_delim\",[[[\"tt_tok\",[null,[\"LPAREN\",[]]]],\
318-
[\"tt_tok\",[null,[\"IDENT\",[\"x\",false]]]],\
319-
[\"tt_tok\",[null,[\"COLON\",[]]]],\
320-
[\"tt_tok\",[null,[\"IDENT\",[\"int\",false]]]],\
321-
[\"tt_tok\",[null,[\"RPAREN\",[]]]]]]],\
322-
[\"tt_delim\",[[[\"tt_tok\",[null,[\"LBRACE\",[]]]],\
323-
[\"tt_tok\",[null,[\"IDENT\",[\"x\",false]]]],\
324-
[\"tt_tok\",[null,[\"SEMI\",[]]]],\
325-
[\"tt_tok\",[null,[\"RBRACE\",[]]]]]]]]"
315+
check_equal(to_json_str(@tts as @Encodable<std::json::Encoder>),
316+
~"[[\"tt_tok\",[,[\"IDENT\",[\"fn\",false]]]],\
317+
[\"tt_tok\",[,[\"IDENT\",[\"foo\",false]]]],\
318+
[\"tt_delim\",[[[\"tt_tok\",[,[\"LPAREN\",[]]]],\
319+
[\"tt_tok\",[,[\"IDENT\",[\"x\",false]]]],\
320+
[\"tt_tok\",[,[\"COLON\",[]]]],\
321+
[\"tt_tok\",[,[\"IDENT\",[\"int\",false]]]],\
322+
[\"tt_tok\",[,[\"RPAREN\",[]]]]]]],\
323+
[\"tt_delim\",[[[\"tt_tok\",[,[\"LBRACE\",[]]]],\
324+
[\"tt_tok\",[,[\"IDENT\",[\"x\",false]]]],\
325+
[\"tt_tok\",[,[\"SEMI\",[]]]],\
326+
[\"tt_tok\",[,[\"RBRACE\",[]]]]]]]]"
326327
);
327328
let ast1 = new_parser_from_tts(new_parse_sess(None),~[],tts)
328329
.parse_item(~[]);

branches/try2/src/rustllvm/RustWrapper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,10 +433,10 @@ LLVMRustWriteOutputFile(LLVMPassManagerRef PMR,
433433
Options.EnableSegmentedStacks = EnableSegmentedStacks;
434434

435435
std::string Err;
436-
std::string Trip(Triple::normalize(triple));
436+
const Target *TheTarget = TargetRegistry::lookupTarget(triple, Err);
437437
std::string FeaturesStr;
438+
std::string Trip(triple);
438439
std::string CPUStr("generic");
439-
const Target *TheTarget = TargetRegistry::lookupTarget(Trip, Err);
440440
TargetMachine *Target =
441441
TheTarget->createTargetMachine(Trip, CPUStr, FeaturesStr,
442442
Options, Reloc::PIC_,

0 commit comments

Comments
 (0)