Skip to content

Commit ef098a7

Browse files
committed
---
yaml --- r: 107628 b: refs/heads/dist-snap c: 8c805fa h: refs/heads/master v: v3
1 parent 9f7f897 commit ef098a7

Some content is hidden

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

57 files changed

+827
-1066
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: b869f36e787530989172db7a9ec233785f93dca3
9+
refs/heads/dist-snap: 8c805fa70bdbcbce07862d59eaf6524e4306bf46
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ LLVM_COMPONENTS=x86 arm mips ipo bitreader bitwriter linker asmparser jit mcjit
367367
interpreter instrumentation
368368

369369
# Only build these LLVM tools
370-
LLVM_TOOLS=bugpoint llc llvm-ar llvm-as llvm-dis llvm-mc opt
370+
LLVM_TOOLS=bugpoint llc llvm-ar llvm-as llvm-dis llvm-mc opt llvm-extract
371371

372372
define DEF_LLVM_VARS
373373
# The configure script defines these variables with the target triples

branches/dist-snap/doc/guide-container.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,8 @@ The `DoubleEndedIterator` trait represents an iterator able to yield elements
336336
from either end of a range. It inherits from the `Iterator` trait and extends
337337
it with the `next_back` function.
338338

339-
A `DoubleEndedIterator` can be flipped with the `invert` adaptor, returning
340-
another `DoubleEndedIterator` with `next` and `next_back` exchanged.
339+
A `DoubleEndedIterator` can have its direction changed with the `rev` adaptor,
340+
returning another `DoubleEndedIterator` with `next` and `next_back` exchanged.
341341

342342
~~~
343343
let xs = [1, 2, 3, 4, 5, 6];
@@ -347,7 +347,7 @@ println!("{:?}", it.next()); // prints `Some(&2)`
347347
println!("{:?}", it.next_back()); // prints `Some(&6)`
348348
349349
// prints `5`, `4` and `3`
350-
for &x in it.invert() {
350+
for &x in it.rev() {
351351
println!("{}", x)
352352
}
353353
~~~
@@ -366,7 +366,7 @@ let mut it = xs.iter().chain(ys.iter()).map(|&x| x * 2);
366366
println!("{:?}", it.next()); // prints `Some(2)`
367367
368368
// prints `16`, `14`, `12`, `10`, `8`, `6`, `4`
369-
for x in it.invert() {
369+
for x in it.rev() {
370370
println!("{}", x);
371371
}
372372
~~~

branches/dist-snap/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ let y = x.clone();
10961096
10971097
let z = x;
10981098
1099-
// and now, it can no longer be used since it has been moved from
1099+
// and now, it can no longer be used since it has been moved
11001100
~~~
11011101

11021102
The mutability of a value may be changed by moving it to a new owner:

branches/dist-snap/src/etc/check-summary.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python
22
# xfail-license
33

4+
import glob
45
import sys
56

67
if __name__ == '__main__':
@@ -24,7 +25,8 @@ def summarise(fname):
2425
def count(t):
2526
return sum(map(lambda (f, s): len(s.get(t, [])), summaries))
2627
logfiles = sys.argv[1:]
27-
map(summarise, logfiles)
28+
for files in map(glob.glob, logfiles):
29+
map(summarise, files)
2830
ok = count('ok')
2931
failed = count('failed')
3032
ignored = count('ignored')

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use std::cmp;
1515
use std::iter::RandomAccessIterator;
16-
use std::iter::{Invert, Enumerate, Repeat, Map, Zip};
16+
use std::iter::{Rev, Enumerate, Repeat, Map, Zip};
1717
use std::num;
1818
use std::ops;
1919
use std::uint;
@@ -387,7 +387,7 @@ impl Bitv {
387387
}
388388
}
389389

390-
/// Invert all bits
390+
/// Flip all bits
391391
#[inline]
392392
pub fn negate(&mut self) {
393393
match self.rep {
@@ -428,8 +428,8 @@ impl Bitv {
428428
}
429429

430430
#[inline]
431-
pub fn rev_iter<'a>(&'a self) -> Invert<Bits<'a>> {
432-
self.iter().invert()
431+
pub fn rev_iter<'a>(&'a self) -> Rev<Bits<'a>> {
432+
self.iter().rev()
433433
}
434434

435435
/// Returns `true` if all bits are 0

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
use std::cast;
2626
use std::ptr;
2727
use std::util;
28-
use std::iter::Invert;
28+
use std::iter::Rev;
2929
use std::iter;
3030

3131
use container::Deque;
@@ -368,8 +368,8 @@ impl<T> DList<T> {
368368

369369
/// Provide a reverse iterator
370370
#[inline]
371-
pub fn rev_iter<'a>(&'a self) -> Invert<Items<'a, T>> {
372-
self.iter().invert()
371+
pub fn rev_iter<'a>(&'a self) -> Rev<Items<'a, T>> {
372+
self.iter().rev()
373373
}
374374

375375
/// Provide a forward iterator with mutable references
@@ -388,8 +388,8 @@ impl<T> DList<T> {
388388
}
389389
/// Provide a reverse iterator with mutable references
390390
#[inline]
391-
pub fn mut_rev_iter<'a>(&'a mut self) -> Invert<MutItems<'a, T>> {
392-
self.mut_iter().invert()
391+
pub fn mut_rev_iter<'a>(&'a mut self) -> Rev<MutItems<'a, T>> {
392+
self.mut_iter().rev()
393393
}
394394

395395

@@ -401,8 +401,8 @@ impl<T> DList<T> {
401401

402402
/// Consume the list into an iterator yielding elements by value, in reverse
403403
#[inline]
404-
pub fn move_rev_iter(self) -> Invert<MoveItems<T>> {
405-
self.move_iter().invert()
404+
pub fn move_rev_iter(self) -> Rev<MoveItems<T>> {
405+
self.move_iter().rev()
406406
}
407407
}
408408

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
1616
use std::num;
1717
use std::vec;
18-
use std::iter::{Invert, RandomAccessIterator};
18+
use std::iter::{Rev, RandomAccessIterator};
1919

2020
use container::Deque;
2121

@@ -192,8 +192,8 @@ impl<T> RingBuf<T> {
192192
}
193193

194194
/// Back-to-front iterator.
195-
pub fn rev_iter<'a>(&'a self) -> Invert<Items<'a, T>> {
196-
self.iter().invert()
195+
pub fn rev_iter<'a>(&'a self) -> Rev<Items<'a, T>> {
196+
self.iter().rev()
197197
}
198198

199199
/// Front-to-back iterator which returns mutable values.
@@ -223,8 +223,8 @@ impl<T> RingBuf<T> {
223223
}
224224

225225
/// Back-to-front iterator which returns mutable values.
226-
pub fn mut_rev_iter<'a>(&'a mut self) -> Invert<MutItems<'a, T>> {
227-
self.mut_iter().invert()
226+
pub fn mut_rev_iter<'a>(&'a mut self) -> Rev<MutItems<'a, T>> {
227+
self.mut_iter().rev()
228228
}
229229
}
230230

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#[allow(missing_doc)];
1717

18-
use std::iter::{Enumerate, FilterMap, Invert};
18+
use std::iter::{Enumerate, FilterMap, Rev};
1919
use std::util::replace;
2020
use std::vec;
2121

@@ -140,14 +140,14 @@ impl<V> SmallIntMap<V> {
140140
/// An iterator visiting all key-value pairs in descending order by the keys.
141141
/// Iterator element type is (uint, &'r V)
142142
pub fn rev_iter<'r>(&'r self) -> RevEntries<'r, V> {
143-
self.iter().invert()
143+
self.iter().rev()
144144
}
145145

146146
/// An iterator visiting all key-value pairs in descending order by the keys,
147147
/// with mutable references to the values
148148
/// Iterator element type is (uint, &'r mut V)
149149
pub fn mut_rev_iter<'r>(&'r mut self) -> RevMutEntries <'r, V> {
150-
self.mut_iter().invert()
150+
self.mut_iter().rev()
151151
}
152152

153153
/// Empties the hash map, moving all values into the specified closure
@@ -241,7 +241,7 @@ pub struct Entries<'a, T> {
241241

242242
iterator!(impl Entries -> (uint, &'a T), get_ref)
243243
double_ended_iterator!(impl Entries -> (uint, &'a T), get_ref)
244-
pub type RevEntries<'a, T> = Invert<Entries<'a, T>>;
244+
pub type RevEntries<'a, T> = Rev<Entries<'a, T>>;
245245

246246
pub struct MutEntries<'a, T> {
247247
priv front: uint,
@@ -251,7 +251,7 @@ pub struct MutEntries<'a, T> {
251251

252252
iterator!(impl MutEntries -> (uint, &'a mut T), get_mut_ref)
253253
double_ended_iterator!(impl MutEntries -> (uint, &'a mut T), get_mut_ref)
254-
pub type RevMutEntries<'a, T> = Invert<MutEntries<'a, T>>;
254+
pub type RevMutEntries<'a, T> = Rev<MutEntries<'a, T>>;
255255

256256
#[cfg(test)]
257257
mod test_map {

branches/dist-snap/src/libnative/io/process.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ fn spawn_process_os(prog: &str, args: &[~str],
460460
fail!("failure in dup3(err_fd, 2): {}", os::last_os_error());
461461
}
462462
// close all other fds
463-
for fd in range(3, getdtablesize()).invert() {
463+
for fd in range(3, getdtablesize()).rev() {
464464
if fd != output.fd() {
465465
close(fd as c_int);
466466
}

branches/dist-snap/src/libnative/io/timer_timerfd.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ fn helper(input: libc::c_int, messages: Port<Req>) {
8585
events.len() as libc::c_int, -1)
8686
} {
8787
0 => fail!("epoll_wait returned immediately!"),
88+
-1 if os::errno() == libc::EINTR as int => { continue }
8889
-1 => fail!("epoll wait failed: {}", os::last_os_error()),
8990
n => n
9091
};

branches/dist-snap/src/librustc/driver/session.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@ impl Session_ {
250250
pub fn span_note(&self, sp: Span, msg: &str) {
251251
self.span_diagnostic.span_note(sp, msg)
252252
}
253+
pub fn span_end_note(&self, sp: Span, msg: &str) {
254+
self.span_diagnostic.span_end_note(sp, msg)
255+
}
253256
pub fn note(&self, msg: &str) {
254257
self.span_diagnostic.handler().note(msg)
255258
}

branches/dist-snap/src/librustc/metadata/creader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ impl CrateLoader for Loader {
420420
}
421421
}
422422

423-
fn get_exported_macros(&mut self, cnum: ast::CrateNum) -> ~[@ast::Item] {
423+
fn get_exported_macros(&mut self, cnum: ast::CrateNum) -> ~[~str] {
424424
csearch::get_exported_macros(self.env.sess.cstore, cnum)
425425
}
426426

branches/dist-snap/src/librustc/metadata/csearch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ pub fn get_macro_registrar_fn(cstore: @cstore::CStore,
307307

308308
pub fn get_exported_macros(cstore: @cstore::CStore,
309309
crate_num: ast::CrateNum)
310-
-> ~[@ast::Item] {
310+
-> ~[~str] {
311311
let cdata = cstore.get_crate_data(crate_num);
312312
decoder::get_exported_macros(cdata)
313313
}

branches/dist-snap/src/librustc/metadata/decoder.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use metadata::tydecode::{parse_ty_data, parse_def_id,
2323
use middle::ty::{ImplContainer, TraitContainer};
2424
use middle::ty;
2525
use middle::typeck;
26-
use middle::astencode;
2726
use middle::astencode::vtable_decoder_helpers;
2827

2928
use std::at_vec;
@@ -1282,12 +1281,12 @@ pub fn get_macro_registrar_fn(cdata: Cmd) -> Option<ast::DefId> {
12821281
.map(|doc| item_def_id(doc, cdata))
12831282
}
12841283

1285-
pub fn get_exported_macros(cdata: Cmd) -> ~[@ast::Item] {
1284+
pub fn get_exported_macros(cdata: Cmd) -> ~[~str] {
12861285
let macros = reader::get_doc(reader::Doc(cdata.data()),
12871286
tag_exported_macros);
12881287
let mut result = ~[];
12891288
reader::tagged_docs(macros, tag_macro_def, |macro_doc| {
1290-
result.push(astencode::decode_exported_macro(macro_doc));
1289+
result.push(macro_doc.as_str());
12911290
true
12921291
});
12931292
result

branches/dist-snap/src/librustc/metadata/encoder.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ use syntax::ast_map;
3737
use syntax::ast_util::*;
3838
use syntax::attr;
3939
use syntax::attr::AttrMetaMethods;
40+
use syntax::codemap;
4041
use syntax::diagnostic::SpanHandler;
4142
use syntax::parse::token::special_idents;
4243
use syntax::ast_util;
@@ -71,6 +72,7 @@ pub struct EncodeParams<'a> {
7172
cstore: @cstore::CStore,
7273
encode_inlined_item: encode_inlined_item<'a>,
7374
reachable: @RefCell<HashSet<ast::NodeId>>,
75+
codemap: @codemap::CodeMap,
7476
}
7577

7678
struct Stats {
@@ -101,6 +103,7 @@ pub struct EncodeContext<'a> {
101103
encode_inlined_item: encode_inlined_item<'a>,
102104
type_abbrevs: abbrev_map,
103105
reachable: @RefCell<HashSet<ast::NodeId>>,
106+
codemap: @codemap::CodeMap,
104107
}
105108

106109
pub fn reachable(ecx: &EncodeContext, id: NodeId) -> bool {
@@ -1714,8 +1717,10 @@ impl<'a, 'b> Visitor<()> for MacroDefVisitor<'a, 'b> {
17141717
fn visit_item(&mut self, item: &Item, _: ()) {
17151718
match item.node {
17161719
ItemMac(..) => {
1720+
let def = self.ecx.codemap.span_to_snippet(item.span)
1721+
.expect("Unable to find source for macro");
17171722
self.ebml_w.start_tag(tag_macro_def);
1718-
astencode::encode_exported_macro(self.ebml_w, item);
1723+
self.ebml_w.wr_str(def);
17191724
self.ebml_w.end_tag();
17201725
}
17211726
_ => {}
@@ -1881,6 +1886,7 @@ fn encode_metadata_inner(wr: &mut MemWriter, parms: EncodeParams, crate: &Crate)
18811886
link_meta,
18821887
reachable,
18831888
non_inlineable_statics,
1889+
codemap,
18841890
..
18851891
} = parms;
18861892
let type_abbrevs = @RefCell::new(HashMap::new());
@@ -1897,6 +1903,7 @@ fn encode_metadata_inner(wr: &mut MemWriter, parms: EncodeParams, crate: &Crate)
18971903
encode_inlined_item: encode_inlined_item,
18981904
type_abbrevs: type_abbrevs,
18991905
reachable: reachable,
1906+
codemap: codemap,
19001907
};
19011908

19021909
let mut ebml_w = writer::Encoder(wr);

branches/dist-snap/src/librustc/metadata/filesearch.rs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,24 @@ fn make_rustpkg_target_lib_path(dir: &Path,
160160
}
161161

162162
pub fn get_or_default_sysroot() -> Path {
163-
match os::self_exe_path() {
164-
option::Some(p) => { let mut p = p; p.pop(); p }
163+
// Follow symlinks. If the resolved path is relative, make it absolute.
164+
fn canonicalize(path: Option<Path>) -> Option<Path> {
165+
path.and_then(|mut path|
166+
match io::io_error::cond.trap(|_| ()).inside(|| fs::readlink(&path)) {
167+
Some(canon) => {
168+
if canon.is_absolute() {
169+
Some(canon)
170+
} else {
171+
path.pop();
172+
Some(path.join(canon))
173+
}
174+
},
175+
None => Some(path),
176+
})
177+
}
178+
179+
match canonicalize(os::self_exe_name()) {
180+
option::Some(p) => { let mut p = p; p.pop(); p.pop(); p }
165181
option::None => fail!("can't determine value for sysroot")
166182
}
167183
}

0 commit comments

Comments
 (0)