Skip to content

Commit e96b522

Browse files
committed
---
yaml --- r: 144901 b: refs/heads/try2 c: 889e1b9 h: refs/heads/master i: 144899: eac9c2d v: v3
1 parent a63602b commit e96b522

Some content is hidden

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

88 files changed

+745
-723
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: 60a0dbc095d83964ba668c89e25261ead3df55f4
8+
refs/heads/try2: 889e1b9731615a6b03b0e46662edb70c6ca7e7ad
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::iter::range_inclusive(0, 5) { // needs explicit import
203+
for i in std::iterator::range_inclusive(0, 5) { // needs explicit import
204204
printf!("%d ", i) // prints "0 1 2 3 4 5"
205205
}
206206
~~~

branches/try2/mk/rt.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ LIBUV_NO_LOAD = run-benchmarks.target.mk run-tests.target.mk \
176176

177177
export PYTHONPATH := $(PYTHONPATH):$$(S)src/gyp/pylib
178178

179-
$$(LIBUV_MAKEFILE_$(1)_$(2)): $$(LIBUV_DEPS)
179+
$$(LIBUV_MAKEFILE_$(1)_$(2)):
180180
(cd $(S)src/libuv/ && \
181181
$$(CFG_PYTHON) ./gyp_uv -f make -Dtarget_arch=$$(LIBUV_ARCH_$(1)) -D ninja \
182182
-Goutput_dir=$$(@D) --generator-output $$(@D))

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 iter::Iterator;\n");
313+
f.write(" use iterator::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::iter::RandomAccessIterator;
16-
use std::iter::{Invert, Enumerate, Repeat, Map, Zip};
15+
use std::iterator::RandomAccessIterator;
16+
use std::iterator::{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::iter::Invert;
29-
use std::iter;
28+
use std::iterator::{FromIterator, Extendable, Invert};
29+
use std::iterator;
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-
iter::order::eq(self.iter(), other.iter())
596+
iterator::order::eq(self.iter(), other.iter())
597597
}
598598

599599
fn ne(&self, other: &DList<A>) -> bool {
600600
self.len() != other.len() ||
601-
iter::order::ne(self.iter(), other.iter())
601+
iterator::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-
iter::order::lt(self.iter(), other.iter())
607+
iterator::order::lt(self.iter(), other.iter())
608608
}
609609
fn le(&self, other: &DList<A>) -> bool {
610-
iter::order::le(self.iter(), other.iter())
610+
iterator::order::le(self.iter(), other.iter())
611611
}
612612
fn gt(&self, other: &DList<A>) -> bool {
613-
iter::order::gt(self.iter(), other.iter())
613+
iterator::order::gt(self.iter(), other.iter())
614614
}
615615
fn ge(&self, other: &DList<A>) -> bool {
616-
iter::order::ge(self.iter(), other.iter())
616+
iterator::order::ge(self.iter(), other.iter())
617617
}
618618
}
619619

branches/try2/src/libextra/enum_set.rs

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

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

branches/try2/src/libextra/json.rs

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

490491
/// Decode a json value from an Iterator<char>
491-
pub fn Parser<T : Iterator<char>>(rdr: ~T) -> Parser<T> {
492+
pub fn Parser<T : iterator::Iterator<char>>(rdr: ~T) -> Parser<T> {
492493
let mut p = Parser {
493494
rdr: rdr,
494495
ch: '\x00',
@@ -499,7 +500,7 @@ pub fn Parser<T : Iterator<char>>(rdr: ~T) -> Parser<T> {
499500
p
500501
}
501502

502-
impl<T: Iterator<char>> Parser<T> {
503+
impl<T: iterator::Iterator<char>> Parser<T> {
503504
pub fn parse(&mut self) -> Result<Json, Error> {
504505
match self.parse_value() {
505506
Ok(value) => {
@@ -517,7 +518,7 @@ impl<T: Iterator<char>> Parser<T> {
517518
}
518519
}
519520

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

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::{iter, util};
2014+
use std::{iterator, 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 iter::range_inclusive(1, n) {
2020+
for i in iterator::range_inclusive(1, n) {
20212021
f = f * BigUint::from_uint(i);
20222022
}
20232023
f

branches/try2/src/libextra/priority_queue.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ 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};
1920

2021
/// A priority queue implemented with a binary heap
2122
#[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::iter::{Invert, RandomAccessIterator};
18+
use std::iterator::{FromIterator, Invert, RandomAccessIterator, Extendable};
1919

2020
use container::Deque;
2121

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

695695
#[test]
696696
fn test_from_iterator() {
697-
use std::iter;
697+
use std::iterator;
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 = iter::count(0u, 2).take(256);
703+
let mut seq = iterator::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::iter::{Enumerate, FilterMap, Invert};
18+
use std::iterator::{Iterator, 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::iter::{Peekable};
17+
use std::iterator::{FromIterator, Extendable, 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/lib/llvm.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,12 @@ pub mod llvm {
873873
pub fn LLVMAddFunctionAttrString(Fn: ValueRef, Name: *c_char);
874874
#[fast_ffi]
875875
pub fn LLVMGetFunctionAttr(Fn: ValueRef) -> c_ulonglong;
876+
877+
#[fast_ffi]
878+
pub fn LLVMAddReturnAttribute(Fn: ValueRef, PA: c_uint);
879+
#[fast_ffi]
880+
pub fn LLVMRemoveReturnAttribute(Fn: ValueRef, PA: c_uint);
881+
876882
#[fast_ffi]
877883
pub fn LLVMRemoveFunctionAttr(Fn: ValueRef,
878884
PA: c_ulonglong,

branches/try2/src/librustc/middle/cfg/construct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ impl CFGBuilder {
389389
self.straightline(expr, pred, [r, l])
390390
}
391391

392+
ast::ExprLog(l, r) |
392393
ast::ExprIndex(_, l, r) |
393394
ast::ExprBinary(_, _, l, r) => { // NB: && and || handled earlier
394395
self.straightline(expr, pred, [l, r])
@@ -404,7 +405,6 @@ impl CFGBuilder {
404405
self.straightline(expr, pred, [e])
405406
}
406407

407-
ast::ExprLogLevel |
408408
ast::ExprMac(*) |
409409
ast::ExprInlineAsm(*) |
410410
ast::ExprSelf |

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::iter;
21+
use std::iterator;
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 iter::range(0u, max_len + 1) {
285+
for n in iterator::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/dataflow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,12 +702,12 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> {
702702
join_bits(&self.dfcx.oper, temp, in_out);
703703
}
704704

705+
ast::ExprLog(l, r) |
705706
ast::ExprIndex(_, l, r) |
706707
ast::ExprBinary(_, _, l, r) => {
707708
self.walk_exprs([l, r], in_out, loop_scopes);
708709
}
709710

710-
ast::ExprLogLevel |
711711
ast::ExprLit(*) |
712712
ast::ExprPath(*) |
713713
ast::ExprSelf => {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ pub enum LangItem {
5959

6060
StrEqFnLangItem, // 19
6161
UniqStrEqFnLangItem, // 20
62+
LogTypeFnLangItem, // 21
6263
FailFnLangItem, // 22
6364
FailBoundsCheckFnLangItem, // 23
6465
ExchangeMallocFnLangItem, // 24
@@ -237,6 +238,9 @@ impl LanguageItems {
237238
pub fn uniq_str_eq_fn(&self) -> Option<DefId> {
238239
self.items[UniqStrEqFnLangItem as uint]
239240
}
241+
pub fn log_type_fn(&self) -> Option<DefId> {
242+
self.items[LogTypeFnLangItem as uint]
243+
}
240244
pub fn fail_fn(&self) -> Option<DefId> {
241245
self.items[FailFnLangItem as uint]
242246
}
@@ -353,6 +357,7 @@ impl<'self> LanguageItemCollector<'self> {
353357

354358
item_refs.insert(@"str_eq", StrEqFnLangItem as uint);
355359
item_refs.insert(@"uniq_str_eq", UniqStrEqFnLangItem as uint);
360+
item_refs.insert(@"log_type", LogTypeFnLangItem as uint);
356361
item_refs.insert(@"fail_", FailFnLangItem as uint);
357362
item_refs.insert(@"fail_bounds_check",
358363
FailBoundsCheckFnLangItem as uint);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ fn visit_expr(v: &mut LivenessVisitor, expr: @Expr, this: @mut IrMaps) {
526526

527527
// otherwise, live nodes are not required:
528528
ExprIndex(*) | ExprField(*) | ExprVstore(*) | ExprVec(*) |
529-
ExprCall(*) | ExprMethodCall(*) | ExprTup(*) | ExprLogLevel |
529+
ExprCall(*) | ExprMethodCall(*) | ExprTup(*) | ExprLog(*) |
530530
ExprBinary(*) | ExprAddrOf(*) |
531531
ExprDoBody(*) | ExprCast(*) | ExprUnary(*) | ExprBreak(_) |
532532
ExprAgain(_) | ExprLit(_) | ExprRet(*) | ExprBlock(*) |
@@ -1217,6 +1217,7 @@ impl Liveness {
12171217
self.propagate_through_expr(l, ln)
12181218
}
12191219

1220+
ExprLog(l, r) |
12201221
ExprIndex(_, l, r) |
12211222
ExprBinary(_, _, l, r) => {
12221223
self.propagate_through_exprs([l, r], succ)
@@ -1239,7 +1240,6 @@ impl Liveness {
12391240
}
12401241
}
12411242

1242-
ExprLogLevel |
12431243
ExprLit(*) => {
12441244
succ
12451245
}
@@ -1496,7 +1496,7 @@ fn check_expr(vt: &mut ErrorCheckVisitor, expr: @Expr, this: @Liveness) {
14961496
// no correctness conditions related to liveness
14971497
ExprCall(*) | ExprMethodCall(*) | ExprIf(*) | ExprMatch(*) |
14981498
ExprWhile(*) | ExprLoop(*) | ExprIndex(*) | ExprField(*) |
1499-
ExprVstore(*) | ExprVec(*) | ExprTup(*) | ExprLogLevel |
1499+
ExprVstore(*) | ExprVec(*) | ExprTup(*) | ExprLog(*) |
15001500
ExprBinary(*) | ExprDoBody(*) |
15011501
ExprCast(*) | ExprUnary(*) | ExprRet(*) | ExprBreak(*) |
15021502
ExprAgain(*) | ExprLit(_) | ExprBlock(*) |

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ impl mem_categorization_ctxt {
429429
ast::ExprDoBody(*) | ast::ExprUnary(*) |
430430
ast::ExprMethodCall(*) | ast::ExprCast(*) | ast::ExprVstore(*) |
431431
ast::ExprVec(*) | ast::ExprTup(*) | ast::ExprIf(*) |
432-
ast::ExprLogLevel | ast::ExprBinary(*) | ast::ExprWhile(*) |
432+
ast::ExprLog(*) | ast::ExprBinary(*) | ast::ExprWhile(*) |
433433
ast::ExprBlock(*) | ast::ExprLoop(*) | ast::ExprMatch(*) |
434434
ast::ExprLit(*) | ast::ExprBreak(*) | ast::ExprMac(*) |
435435
ast::ExprAgain(*) | ast::ExprStruct(*) | ast::ExprRepeat(*) |

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,6 @@ impl VisitContext {
480480
self.use_expr(base, Read, visitor);
481481
}
482482

483-
ExprLogLevel |
484483
ExprInlineAsm(*) |
485484
ExprBreak(*) |
486485
ExprAgain(*) |
@@ -490,6 +489,11 @@ impl VisitContext {
490489
self.consume_block(blk, visitor);
491490
}
492491

492+
ExprLog(a_expr, b_expr) => {
493+
self.consume_expr(a_expr, visitor);
494+
self.use_expr(b_expr, Read, visitor);
495+
}
496+
493497
ExprWhile(cond_expr, ref blk) => {
494498
self.consume_expr(cond_expr, visitor);
495499
self.consume_block(blk, visitor);

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

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,21 +1716,15 @@ pub fn create_llargs_for_fn_args(cx: @mut FunctionContext,
17161716
let llarg = unsafe {llvm::LLVMGetParam(cx.llfn, arg_n as c_uint) };
17171717

17181718
match ty::get(arg_ty).sty {
1719-
// `~` pointers never alias other parameters, because
1720-
// ownership was transferred
1719+
// `~` pointer parameters never alias because ownership is transferred
17211720
ty::ty_uniq(*) |
17221721
ty::ty_evec(_, ty::vstore_uniq) |
17231722
ty::ty_closure(ty::ClosureTy {sigil: ast::OwnedSigil, _}) => {
17241723
unsafe {
1725-
llvm::LLVMAddAttribute(
1726-
llarg, lib::llvm::NoAliasAttribute as c_uint);
1724+
llvm::LLVMAddAttribute(llarg, lib::llvm::NoAliasAttribute as c_uint);
17271725
}
17281726
}
1729-
// FIXME: #6785: `&mut` can only alias `&const` and
1730-
// `@mut`, we should check for those in the other
1731-
// parameters and then mark it as `noalias` if there
1732-
// aren't any
1733-
_ => {}
1727+
_ => ()
17341728
}
17351729

17361730
llarg
@@ -1952,6 +1946,18 @@ pub fn trans_fn(ccx: @mut CrateContext,
19521946
param_substs.repr(ccx.tcx));
19531947
let _icx = push_ctxt("trans_fn");
19541948
let output_type = ty::ty_fn_ret(ty::node_id_to_type(ccx.tcx, id));
1949+
1950+
match ty::get(output_type).sty {
1951+
// `~` pointer return values never alias because ownership is transferred
1952+
ty::ty_uniq(*) |
1953+
ty::ty_evec(_, ty::vstore_uniq) => {
1954+
unsafe {
1955+
llvm::LLVMAddReturnAttribute(llfndecl, lib::llvm::NoAliasAttribute as c_uint);
1956+
}
1957+
}
1958+
_ => ()
1959+
}
1960+
19551961
trans_closure(ccx,
19561962
path.clone(),
19571963
decl,

0 commit comments

Comments
 (0)