Skip to content

Commit 05a4192

Browse files
committed
---
yaml --- r: 144890 b: refs/heads/try2 c: fd49f6d h: refs/heads/master v: v3
1 parent 86ed727 commit 05a4192

Some content is hidden

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

69 files changed

+219
-291
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: 500077f637114be0ac9e6ef5fb92933c4c97804d
8+
refs/heads/try2: fd49f6dce11033496a87d08d66114a86b2d85d59
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/doc/tutorial-container.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ for i in range(0, 5) {
200200
printf!("%d ", i) // prints "0 1 2 3 4"
201201
}
202202

203-
for i in std::iterator::range_inclusive(0, 5) { // needs explicit import
203+
for i in std::iter::range_inclusive(0, 5) { // needs explicit import
204204
printf!("%d ", i) // prints "0 1 2 3 4 5"
205205
}
206206
~~~

branches/try2/src/etc/unicode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def emit_decomp_module(f, canon, compat, combine):
310310
+ " bsearch_range_value_table(c, combining_class_table)\n"
311311
+ " }\n\n")
312312
f.write(" fn d(c: char, i: &fn(char), k: bool) {\n")
313-
f.write(" use iterator::Iterator;\n");
313+
f.write(" use iter::Iterator;\n");
314314

315315
f.write(" if c <= '\\x7f' { i(c); return; }\n")
316316

branches/try2/src/libextra/bitv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313

1414
use std::cmp;
15-
use std::iterator::RandomAccessIterator;
16-
use std::iterator::{Invert, Enumerate, Repeat, Map, Zip};
15+
use std::iter::RandomAccessIterator;
16+
use std::iter::{Invert, Enumerate, Repeat, Map, Zip};
1717
use std::num;
1818
use std::ops;
1919
use std::uint;

branches/try2/src/libextra/dlist.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
use std::cast;
2626
use std::ptr;
2727
use std::util;
28-
use std::iterator::{FromIterator, Extendable, Invert};
29-
use std::iterator;
28+
use std::iter::Invert;
29+
use std::iter;
3030

3131
use container::Deque;
3232

@@ -593,27 +593,27 @@ impl<A> Extendable<A> for DList<A> {
593593
impl<A: Eq> Eq for DList<A> {
594594
fn eq(&self, other: &DList<A>) -> bool {
595595
self.len() == other.len() &&
596-
iterator::order::eq(self.iter(), other.iter())
596+
iter::order::eq(self.iter(), other.iter())
597597
}
598598

599599
fn ne(&self, other: &DList<A>) -> bool {
600600
self.len() != other.len() ||
601-
iterator::order::ne(self.iter(), other.iter())
601+
iter::order::ne(self.iter(), other.iter())
602602
}
603603
}
604604

605605
impl<A: Eq + Ord> Ord for DList<A> {
606606
fn lt(&self, other: &DList<A>) -> bool {
607-
iterator::order::lt(self.iter(), other.iter())
607+
iter::order::lt(self.iter(), other.iter())
608608
}
609609
fn le(&self, other: &DList<A>) -> bool {
610-
iterator::order::le(self.iter(), other.iter())
610+
iter::order::le(self.iter(), other.iter())
611611
}
612612
fn gt(&self, other: &DList<A>) -> bool {
613-
iterator::order::gt(self.iter(), other.iter())
613+
iter::order::gt(self.iter(), other.iter())
614614
}
615615
fn ge(&self, other: &DList<A>) -> bool {
616-
iterator::order::ge(self.iter(), other.iter())
616+
iter::order::ge(self.iter(), other.iter())
617617
}
618618
}
619619

branches/try2/src/libextra/enum_set.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::iterator::Iterator;
12-
1311
#[deriving(Clone, Eq, IterBytes, ToStr)]
1412
/// A specialized Set implementation to use enum types.
1513
pub struct EnumSet<E> {

branches/try2/src/libextra/json.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
1919
use std::char;
2020
use std::cast::transmute;
21-
use std::iterator;
2221
use std::float;
2322
use std::hashmap::HashMap;
2423
use std::io::WriterUtil;
@@ -489,7 +488,7 @@ pub struct Parser<T> {
489488
}
490489

491490
/// Decode a json value from an Iterator<char>
492-
pub fn Parser<T : iterator::Iterator<char>>(rdr: ~T) -> Parser<T> {
491+
pub fn Parser<T : Iterator<char>>(rdr: ~T) -> Parser<T> {
493492
let mut p = Parser {
494493
rdr: rdr,
495494
ch: '\x00',
@@ -500,7 +499,7 @@ pub fn Parser<T : iterator::Iterator<char>>(rdr: ~T) -> Parser<T> {
500499
p
501500
}
502501

503-
impl<T: iterator::Iterator<char>> Parser<T> {
502+
impl<T: Iterator<char>> Parser<T> {
504503
pub fn parse(&mut self) -> Result<Json, Error> {
505504
match self.parse_value() {
506505
Ok(value) => {
@@ -518,7 +517,7 @@ impl<T: iterator::Iterator<char>> Parser<T> {
518517
}
519518
}
520519

521-
impl<T : iterator::Iterator<char>> Parser<T> {
520+
impl<T : Iterator<char>> Parser<T> {
522521
// FIXME: #8971: unsound
523522
fn eof(&self) -> bool { self.ch == unsafe { transmute(-1u32) } }
524523

branches/try2/src/libextra/num/bigint.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2011,13 +2011,13 @@ mod bigint_tests {
20112011
#[cfg(test)]
20122012
mod bench {
20132013
use super::*;
2014-
use std::{iterator, util};
2014+
use std::{iter, util};
20152015
use std::num::{Zero, One};
20162016
use extra::test::BenchHarness;
20172017

20182018
fn factorial(n: uint) -> BigUint {
20192019
let mut f: BigUint = One::one();
2020-
for i in iterator::range_inclusive(1, n) {
2020+
for i in iter::range_inclusive(1, n) {
20212021
f = f * BigUint::from_uint(i);
20222022
}
20232023
f

branches/try2/src/libextra/priority_queue.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use std::clone::Clone;
1616
use std::unstable::intrinsics::{move_val_init, init};
1717
use std::util::{replace, swap};
1818
use std::vec;
19-
use std::iterator::{FromIterator, Extendable};
2019

2120
/// A priority queue implemented with a binary heap
2221
#[deriving(Clone)]

branches/try2/src/libextra/ringbuf.rs

Lines changed: 3 additions & 3 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::iterator::{FromIterator, Invert, RandomAccessIterator, Extendable};
18+
use std::iter::{Invert, RandomAccessIterator};
1919

2020
use container::Deque;
2121

@@ -694,13 +694,13 @@ mod tests {
694694

695695
#[test]
696696
fn test_from_iterator() {
697-
use std::iterator;
697+
use std::iter;
698698
let v = ~[1,2,3,4,5,6,7];
699699
let deq: RingBuf<int> = v.iter().map(|&x| x).collect();
700700
let u: ~[int] = deq.iter().map(|&x| x).collect();
701701
assert_eq!(u, v);
702702

703-
let mut seq = iterator::count(0u, 2).take(256);
703+
let mut seq = iter::count(0u, 2).take(256);
704704
let deq: RingBuf<uint> = seq.collect();
705705
for (i, &x) in deq.iter().enumerate() {
706706
assert_eq!(2*i, x);

branches/try2/src/libextra/smallintmap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#[allow(missing_doc)];
1717

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

branches/try2/src/libextra/treemap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
1515

1616
use std::util::{swap, replace};
17-
use std::iterator::{FromIterator, Extendable, Peekable};
17+
use std::iter::{Peekable};
1818
use std::cmp::Ordering;
1919

2020
// This is implemented as an AA tree, which is a simplified variation of

branches/try2/src/librustc/back/link.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ use syntax::ast_map::{path, path_mod, path_name, path_pretty_name};
3939
use syntax::attr;
4040
use syntax::attr::{AttrMetaMethods};
4141
use syntax::print::pprust;
42-
use syntax::parse::token;
4342

4443
#[deriving(Clone, Eq)]
4544
pub enum output_type {
@@ -678,8 +677,8 @@ pub fn symbol_hash(tcx: ty::ctxt,
678677
write_string(symbol_hasher, "-");
679678
write_string(symbol_hasher, encoder::encoded_ty(tcx, t));
680679
let mut hash = truncated_hash_result(symbol_hasher);
681-
// Prefix with _ so that it never blends into adjacent digits
682-
hash.unshift_char('_');
680+
// Prefix with 'h' so that it never blends into adjacent digits
681+
hash.unshift_char('h');
683682
// tjc: allocation is unfortunate; need to change std::hash
684683
hash.to_managed()
685684
}
@@ -722,7 +721,7 @@ pub fn sanitize(s: &str) -> ~str {
722721
'a' .. 'z'
723722
| 'A' .. 'Z'
724723
| '0' .. '9'
725-
| '_' | '.' => result.push_char(c),
724+
| '_' | '.' | '$' => result.push_char(c),
726725

727726
_ => {
728727
let mut tstr = ~"";
@@ -847,28 +846,25 @@ pub fn mangle_internal_name_by_type_and_seq(ccx: &mut CrateContext,
847846
name: &str) -> ~str {
848847
let s = ppaux::ty_to_str(ccx.tcx, t);
849848
let hash = get_symbol_hash(ccx, t);
849+
let (_, name) = gensym_name(name);
850850
return mangle(ccx.sess,
851-
~[path_name(ccx.sess.ident_of(s)),
852-
path_name(gensym_name(name))],
851+
~[path_name(ccx.sess.ident_of(s)), name],
853852
Some(hash.as_slice()),
854853
None);
855854
}
856855

857856
pub fn mangle_internal_name_by_path_and_seq(ccx: &mut CrateContext,
858857
mut path: path,
859858
flav: &str) -> ~str {
860-
path.push(path_name(gensym_name(flav)));
859+
let (_, name) = gensym_name(flav);
860+
path.push(name);
861861
mangle(ccx.sess, path, None, None)
862862
}
863863

864864
pub fn mangle_internal_name_by_path(ccx: &mut CrateContext, path: path) -> ~str {
865865
mangle(ccx.sess, path, None, None)
866866
}
867867

868-
pub fn mangle_internal_name_by_seq(_ccx: &mut CrateContext, flav: &str) -> ~str {
869-
return fmt!("%s_%u", flav, token::gensym(flav));
870-
}
871-
872868

873869
pub fn output_dll_filename(os: session::Os, lm: LinkMeta) -> ~str {
874870
let (dll_prefix, dll_suffix) = match os {

branches/try2/src/librustc/metadata/encoder.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,12 +1063,13 @@ fn encode_info_for_item(ecx: &EncodeContext,
10631063
let impl_vtables = ty::lookup_impl_vtables(tcx, def_id);
10641064
encode_impl_vtables(ebml_w, ecx, &impl_vtables);
10651065
}
1066-
encode_path(ecx, ebml_w, path, ast_map::path_name(item.ident));
1066+
let elt = ast_map::impl_pretty_name(opt_trait, ty, item.ident);
1067+
encode_path(ecx, ebml_w, path, elt);
10671068
ebml_w.end_tag();
10681069

10691070
// >:-<
10701071
let mut impl_path = vec::append(~[], path);
1071-
impl_path.push(ast_map::path_name(item.ident));
1072+
impl_path.push(elt);
10721073

10731074
// Iterate down the methods, emitting them. We rely on the
10741075
// assumption that all of the actually implemented methods

branches/try2/src/librustc/middle/check_match.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use middle::typeck::method_map;
1818
use middle::moves;
1919
use util::ppaux::ty_to_str;
2020

21-
use std::iterator;
21+
use std::iter;
2222
use std::num;
2323
use std::vec;
2424
use extra::sort;
@@ -282,7 +282,7 @@ pub fn is_useful(cx: &MatchCheckCtxt, m: &matrix, v: &[@Pat]) -> useful {
282282
_ => max_len
283283
}
284284
};
285-
for n in iterator::range(0u, max_len + 1) {
285+
for n in iter::range(0u, max_len + 1) {
286286
match is_useful_specialized(cx, m, v, vec(n), n, left_ty) {
287287
not_useful => (),
288288
ref u => return *u,

branches/try2/src/librustc/middle/trans/basic_block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use lib::llvm::{llvm, BasicBlockRef};
1212
use middle::trans::value::{UserIterator, Value};
13-
use std::iterator::{Filter, Map};
13+
use std::iter::{Filter, Map};
1414

1515
pub struct BasicBlock(BasicBlockRef);
1616

branches/try2/src/librustc/middle/trans/common.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,17 @@ use std::hashmap::{HashMap};
3939
use std::libc::{c_uint, c_longlong, c_ulonglong, c_char};
4040
use std::vec;
4141
use syntax::ast::Ident;
42-
use syntax::ast_map::{path, path_elt};
42+
use syntax::ast_map::{path, path_elt, path_pretty_name};
4343
use syntax::codemap::Span;
4444
use syntax::parse::token;
4545
use syntax::{ast, ast_map};
4646

4747
pub use middle::trans::context::CrateContext;
4848

49-
pub fn gensym_name(name: &str) -> Ident {
50-
token::str_to_ident(fmt!("%s_%u", name, token::gensym(name)))
49+
pub fn gensym_name(name: &str) -> (Ident, path_elt) {
50+
let name = token::gensym(name);
51+
let ident = Ident::new(name);
52+
(ident, path_pretty_name(ident, name as u64))
5153
}
5254

5355
pub struct tydesc_info {

branches/try2/src/librustc/middle/trans/debuginfo.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ use std::ptr;
6969
use std::vec;
7070
use syntax::codemap::Span;
7171
use syntax::{ast, codemap, ast_util, ast_map, opt_vec};
72+
use syntax::parse::token;
7273
use syntax::parse::token::special_idents;
7374

7475
static DW_LANG_RUST: c_uint = 0x9000;
@@ -513,7 +514,8 @@ pub fn create_function_debug_context(cx: &mut CrateContext,
513514
ast_map::node_expr(ref expr) => {
514515
match expr.node {
515516
ast::ExprFnBlock(ref fn_decl, ref top_level_block) => {
516-
let name = gensym_name("fn");
517+
let name = fmt!("fn%u", token::gensym("fn"));
518+
let name = token::str_to_ident(name);
517519
(name, fn_decl,
518520
// This is not quite right. It should actually inherit the generics of the
519521
// enclosing function.
@@ -2062,7 +2064,7 @@ fn populate_scope_map(cx: &mut CrateContext,
20622064
}
20632065
}
20642066

2065-
ast::ExprForLoop(_, _, _) => {
2067+
ast::ExprForLoop(_, _, _, _) => {
20662068
cx.sess.span_bug(exp.span, "debuginfo::populate_scope_map() - \
20672069
Found unexpanded for-loop.");
20682070
}

branches/try2/src/librustc/middle/trans/meth.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ use std::vec;
3737
use syntax::ast_map::{path, path_mod, path_name, path_pretty_name};
3838
use syntax::ast_util;
3939
use syntax::{ast, ast_map};
40+
use syntax::parse::token;
4041
use syntax::visit;
4142

4243
/**
@@ -568,8 +569,8 @@ pub fn make_vtable(ccx: &mut CrateContext,
568569
}
569570

570571
let tbl = C_struct(components);
571-
let vtable = ccx.sess.str_of(gensym_name("vtable"));
572-
let vt_gvar = do vtable.with_c_str |buf| {
572+
let sym = token::gensym("vtable");
573+
let vt_gvar = do fmt!("vtable%u", sym).with_c_str |buf| {
573574
llvm::LLVMAddGlobal(ccx.llmod, val_ty(tbl).to_ref(), buf)
574575
};
575576
llvm::LLVMSetInitializer(vt_gvar, tbl);

branches/try2/src/librustc/middle/trans/monomorphize.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ use util::ppaux::{Repr,ty_to_str};
3131

3232
use syntax::ast;
3333
use syntax::ast_map;
34-
use syntax::ast_map::path_name;
3534
use syntax::ast_util::local_def;
3635

3736
pub fn monomorphic_fn(ccx: @mut CrateContext,
@@ -194,7 +193,7 @@ pub fn monomorphic_fn(ccx: @mut CrateContext,
194193
}
195194
ccx.monomorphizing.insert(fn_id, depth + 1);
196195

197-
let elt = path_name(gensym_name(ccx.sess.str_of(name)));
196+
let (_, elt) = gensym_name(ccx.sess.str_of(name));
198197
let mut pt = (*pt).clone();
199198
pt.push(elt);
200199
let s = mangle_exported_name(ccx, pt.clone(), mono_ty);

branches/try2/src/libstd/at_vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
1313
use clone::Clone;
1414
use container::Container;
15-
use iterator::Iterator;
15+
use iter::Iterator;
1616
use option::{Option, Some, None};
1717
use sys;
1818
use unstable::raw::Repr;

0 commit comments

Comments
 (0)