Skip to content

Commit d5a38e4

Browse files
committed
---
yaml --- r: 108901 b: refs/heads/dist-snap c: 5d1d285 h: refs/heads/master i: 108899: 473ff86 v: v3
1 parent 0b77e9d commit d5a38e4

File tree

159 files changed

+2357
-1974
lines changed

Some content is hidden

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

159 files changed

+2357
-1974
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 3bf724e44bd691871e700d90e0665743112577d5
9+
refs/heads/dist-snap: 5d1d285623f8d454a62ca16cf8ec2533aad23305
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/RELEASES.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,8 +745,8 @@ Version 0.2 (March 2012)
745745
* Merged per-platform std::{os*, fs*} to core::{libc, os}
746746
* Extensive cleanup, regularization in libstd, libcore
747747

748-
Version 0.1 (January 2012)
749-
---------------------------
748+
Version 0.1 (January 20, 2012)
749+
-------------------------------
750750

751751
* Most language features work, including:
752752
* Unique pointers, unique closures, move semantics

branches/dist-snap/src/libcollections/btree.rs

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ impl<K: Clone + TotalOrd, V: Clone> Clone for BTree<K, V> {
9292
}
9393
}
9494

95+
impl<K: TotalOrd, V: TotalEq> Eq for BTree<K, V> {
96+
fn eq(&self, other: &BTree<K, V>) -> bool {
97+
self.equals(other)
98+
}
99+
}
95100

96101
impl<K: TotalOrd, V: TotalEq> TotalEq for BTree<K, V> {
97102
///Testing equality on BTrees by comparing the root.
@@ -100,6 +105,12 @@ impl<K: TotalOrd, V: TotalEq> TotalEq for BTree<K, V> {
100105
}
101106
}
102107

108+
impl<K: TotalOrd, V: TotalEq> Ord for BTree<K, V> {
109+
fn lt(&self, other: &BTree<K, V>) -> bool {
110+
self.cmp(other) == Less
111+
}
112+
}
113+
103114
impl<K: TotalOrd, V: TotalEq> TotalOrd for BTree<K, V> {
104115
///Returns an ordering based on the root nodes of each BTree.
105116
fn cmp(&self, other: &BTree<K, V>) -> Ordering {
@@ -191,6 +202,12 @@ impl<K: Clone + TotalOrd, V: Clone> Clone for Node<K, V> {
191202
}
192203
}
193204

205+
impl<K: TotalOrd, V: TotalEq> Eq for Node<K, V> {
206+
fn eq(&self, other: &Node<K, V>) -> bool {
207+
self.equals(other)
208+
}
209+
}
210+
194211
impl<K: TotalOrd, V: TotalEq> TotalEq for Node<K, V> {
195212
///Returns whether two nodes are equal based on the keys of each element.
196213
///Two nodes are equal if all of their keys are the same.
@@ -215,6 +232,12 @@ impl<K: TotalOrd, V: TotalEq> TotalEq for Node<K, V> {
215232
}
216233
}
217234

235+
impl<K: TotalOrd, V: TotalEq> Ord for Node<K, V> {
236+
fn lt(&self, other: &Node<K, V>) -> bool {
237+
self.cmp(other) == Less
238+
}
239+
}
240+
218241
impl<K: TotalOrd, V: TotalEq> TotalOrd for Node<K, V> {
219242
///Implementation of TotalOrd for Nodes.
220243
fn cmp(&self, other: &Node<K, V>) -> Ordering {
@@ -380,13 +403,25 @@ impl<K: Clone + TotalOrd, V: Clone> Clone for Leaf<K, V> {
380403
}
381404
}
382405

406+
impl<K: TotalOrd, V: TotalEq> Eq for Leaf<K, V> {
407+
fn eq(&self, other: &Leaf<K, V>) -> bool {
408+
self.equals(other)
409+
}
410+
}
411+
383412
impl<K: TotalOrd, V: TotalEq> TotalEq for Leaf<K, V> {
384413
///Implementation of equals function for leaves that compares LeafElts.
385414
fn equals(&self, other: &Leaf<K, V>) -> bool {
386415
self.elts.equals(&other.elts)
387416
}
388417
}
389418

419+
impl<K: TotalOrd, V: TotalEq> Ord for Leaf<K, V> {
420+
fn lt(&self, other: &Leaf<K, V>) -> bool {
421+
self.cmp(other) == Less
422+
}
423+
}
424+
390425
impl<K: TotalOrd, V: TotalEq> TotalOrd for Leaf<K, V> {
391426
///Returns an ordering based on the first element of each Leaf.
392427
fn cmp(&self, other: &Leaf<K, V>) -> Ordering {
@@ -602,13 +637,25 @@ impl<K: Clone + TotalOrd, V: Clone> Clone for Branch<K, V> {
602637
}
603638
}
604639

640+
impl<K: TotalOrd, V: TotalEq> Eq for Branch<K, V> {
641+
fn eq(&self, other: &Branch<K, V>) -> bool {
642+
self.equals(other)
643+
}
644+
}
645+
605646
impl<K: TotalOrd, V: TotalEq> TotalEq for Branch<K, V> {
606647
///Equals function for Branches--compares all the elements in each branch
607648
fn equals(&self, other: &Branch<K, V>) -> bool {
608649
self.elts.equals(&other.elts)
609650
}
610651
}
611652

653+
impl<K: TotalOrd, V: TotalEq> Ord for Branch<K, V> {
654+
fn lt(&self, other: &Branch<K, V>) -> bool {
655+
self.cmp(other) == Less
656+
}
657+
}
658+
612659
impl<K: TotalOrd, V: TotalEq> TotalOrd for Branch<K, V> {
613660
///Compares the first elements of two branches to determine an ordering
614661
fn cmp(&self, other: &Branch<K, V>) -> Ordering {
@@ -663,13 +710,25 @@ impl<K: Clone + TotalOrd, V: Clone> Clone for LeafElt<K, V> {
663710
}
664711
}
665712

713+
impl<K: TotalOrd, V: TotalEq> Eq for LeafElt<K, V> {
714+
fn eq(&self, other: &LeafElt<K, V>) -> bool {
715+
self.equals(other)
716+
}
717+
}
718+
666719
impl<K: TotalOrd, V: TotalEq> TotalEq for LeafElt<K, V> {
667720
///TotalEq for LeafElts
668721
fn equals(&self, other: &LeafElt<K, V>) -> bool {
669722
self.key.equals(&other.key) && self.value.equals(&other.value)
670723
}
671724
}
672725

726+
impl<K: TotalOrd, V: TotalEq> Ord for LeafElt<K, V> {
727+
fn lt(&self, other: &LeafElt<K, V>) -> bool {
728+
self.cmp(other) == Less
729+
}
730+
}
731+
673732
impl<K: TotalOrd, V: TotalEq> TotalOrd for LeafElt<K, V> {
674733
///Returns an ordering based on the keys of the LeafElts.
675734
fn cmp(&self, other: &LeafElt<K, V>) -> Ordering {
@@ -705,13 +764,25 @@ impl<K: Clone + TotalOrd, V: Clone> Clone for BranchElt<K, V> {
705764
}
706765
}
707766

767+
impl<K: TotalOrd, V: TotalEq> Eq for BranchElt<K, V>{
768+
fn eq(&self, other: &BranchElt<K, V>) -> bool {
769+
self.equals(other)
770+
}
771+
}
772+
708773
impl<K: TotalOrd, V: TotalEq> TotalEq for BranchElt<K, V>{
709774
///TotalEq for BranchElts
710775
fn equals(&self, other: &BranchElt<K, V>) -> bool {
711776
self.key.equals(&other.key)&&self.value.equals(&other.value)
712777
}
713778
}
714779

780+
impl<K: TotalOrd, V: TotalEq> Ord for BranchElt<K, V> {
781+
fn lt(&self, other: &BranchElt<K, V>) -> bool {
782+
self.cmp(other) == Less
783+
}
784+
}
785+
715786
impl<K: TotalOrd, V: TotalEq> TotalOrd for BranchElt<K, V> {
716787
///Fulfills TotalOrd for BranchElts
717788
fn cmp(&self, other: &BranchElt<K, V>) -> Ordering {

branches/dist-snap/src/libcollections/dlist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ impl<A: Eq> Eq for DList<A> {
607607
}
608608
}
609609

610-
impl<A: Eq + Ord> Ord for DList<A> {
610+
impl<A: Ord> Ord for DList<A> {
611611
fn lt(&self, other: &DList<A>) -> bool {
612612
iter::order::lt(self.iter(), other.iter())
613613
}

branches/dist-snap/src/libextra/workcache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ use std::io::{File, MemWriter};
8888
*
8989
*/
9090

91-
#[deriving(Clone, Eq, Encodable, Decodable, TotalOrd, TotalEq)]
91+
#[deriving(Clone, Eq, Encodable, Decodable, Ord, TotalOrd, TotalEq)]
9292
struct WorkKey {
9393
kind: ~str,
9494
name: ~str

branches/dist-snap/src/librustc/back/archive.rs

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use metadata::filesearch;
1616
use lib::llvm::{ArchiveRef, llvm};
1717

1818
use std::cast;
19+
use std::vec_ng::Vec;
1920
use std::io::fs;
2021
use std::io;
2122
use std::libc;
@@ -41,7 +42,7 @@ fn run_ar(sess: Session, args: &str, cwd: Option<&Path>,
4142
paths: &[&Path]) -> ProcessOutput {
4243
let ar = get_ar_prog(sess);
4344

44-
let mut args = ~[args.to_owned()];
45+
let mut args = vec!(args.to_owned());
4546
let mut paths = paths.iter().map(|p| p.as_str().unwrap().to_owned());
4647
args.extend(&mut paths);
4748
debug!("{} {}", ar, args.connect(" "));
@@ -89,17 +90,25 @@ impl Archive {
8990
}
9091

9192
/// Read a file in the archive
92-
pub fn read(&self, file: &str) -> ~[u8] {
93+
pub fn read(&self, file: &str) -> Vec<u8> {
9394
// Apparently if "ar p" is used on windows, it generates a corrupt file
9495
// which has bad headers and LLVM will immediately choke on it
9596
if cfg!(windows) && cfg!(windows) { // FIXME(#10734) double-and
9697
let loc = TempDir::new("rsar").unwrap();
9798
let archive = os::make_absolute(&self.dst);
9899
run_ar(self.sess, "x", Some(loc.path()), [&archive,
99100
&Path::new(file)]);
100-
fs::File::open(&loc.path().join(file)).read_to_end().unwrap()
101+
let result: Vec<u8> =
102+
fs::File::open(&loc.path().join(file)).read_to_end()
103+
.unwrap()
104+
.move_iter()
105+
.collect();
106+
result
101107
} else {
102-
run_ar(self.sess, "p", None, [&self.dst, &Path::new(file)]).output
108+
run_ar(self.sess,
109+
"p",
110+
None,
111+
[&self.dst, &Path::new(file)]).output.move_iter().collect()
103112
}
104113
}
105114

@@ -119,11 +128,11 @@ impl Archive {
119128
lto: bool) -> io::IoResult<()> {
120129
let object = format!("{}.o", name);
121130
let bytecode = format!("{}.bc", name);
122-
let mut ignore = ~[METADATA_FILENAME, bytecode.as_slice()];
131+
let mut ignore = vec!(METADATA_FILENAME, bytecode.as_slice());
123132
if lto {
124133
ignore.push(object.as_slice());
125134
}
126-
self.add_archive(rlib, name, ignore)
135+
self.add_archive(rlib, name, ignore.as_slice())
127136
}
128137

129138
/// Adds an arbitrary file to this archive
@@ -143,7 +152,7 @@ impl Archive {
143152
}
144153

145154
/// Lists all files in an archive
146-
pub fn files(&self) -> ~[~str] {
155+
pub fn files(&self) -> Vec<~str> {
147156
let output = run_ar(self.sess, "t", None, [&self.dst]);
148157
let output = str::from_utf8(output.output).unwrap();
149158
// use lines_any because windows delimits output with `\r\n` instead of
@@ -168,7 +177,7 @@ impl Archive {
168177
// all SYMDEF files as these are just magical placeholders which get
169178
// re-created when we make a new archive anyway.
170179
let files = try!(fs::readdir(loc.path()));
171-
let mut inputs = ~[];
180+
let mut inputs = Vec::new();
172181
for file in files.iter() {
173182
let filename = file.filename_str().unwrap();
174183
if skip.iter().any(|s| *s == filename) { continue }
@@ -182,7 +191,7 @@ impl Archive {
182191
if inputs.len() == 0 { return Ok(()) }
183192

184193
// Finally, add all the renamed files to this archive
185-
let mut args = ~[&self.dst];
194+
let mut args = vec!(&self.dst);
186195
args.extend(&mut inputs.iter());
187196
run_ar(self.sess, "r", None, args.as_slice());
188197
Ok(())

branches/dist-snap/src/librustc/back/arm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ use syntax::abi;
1515

1616
pub fn get_target_strs(target_triple: ~str, target_os: abi::Os) -> target_strs::t {
1717
let cc_args = if target_triple.contains("thumb") {
18-
~[~"-mthumb"]
18+
vec!(~"-mthumb")
1919
} else {
20-
~[~"-marm"]
20+
vec!(~"-marm")
2121
};
2222
return target_strs::t {
2323
module_asm: ~"",

0 commit comments

Comments
 (0)