Skip to content

Commit 9e24229

Browse files
committed
---
yaml --- r: 15936 b: refs/heads/try c: 15cef37 h: refs/heads/master v: v3
1 parent 4869420 commit 9e24229

File tree

24 files changed

+146
-173
lines changed

24 files changed

+146
-173
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 0b2f2cabbe3fbe6e18cbf0f8a174b7d4789fc938
5+
refs/heads/try: 15cef374b9a16a0f8b40665dbafdf725e9456ffd
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/libcore/future.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ enum future<A> = {
2828
};
2929

3030
#[doc = "Methods on the `future` type"]
31-
impl future<A:copy send> for future<A> {
31+
impl future<A:send> for future<A> {
3232

3333
fn get() -> A {
3434
#[doc = "Get the value of the future"];

branches/try/src/librustsyntax/ast.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,8 @@ enum binop {
201201
bitxor,
202202
bitand,
203203
bitor,
204-
lsl,
205-
lsr,
206-
asr,
204+
shl,
205+
shr,
207206
eq,
208207
lt,
209208
le,

branches/try/src/librustsyntax/ast_util.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ fn binop_to_str(op: binop) -> str {
7272
bitxor { ret "^"; }
7373
bitand { ret "&"; }
7474
bitor { ret "|"; }
75-
lsl { ret "<<"; }
76-
lsr { ret ">>"; }
77-
asr { ret ">>>"; }
75+
shl { ret "<<"; }
76+
shr { ret ">>"; }
7877
eq { ret "=="; }
7978
lt { ret "<"; }
8079
le { ret "<="; }
@@ -90,9 +89,8 @@ pure fn lazy_binop(b: binop) -> bool {
9089
9190
pure fn is_shift_binop(b: binop) -> bool {
9291
alt b {
93-
lsl { true }
94-
lsr { true }
95-
asr { true }
92+
shl { true }
93+
shr { true }
9694
_ { false }
9795
}
9896
}
@@ -353,7 +351,7 @@ fn operator_prec(op: ast::binop) -> uint {
353351
mul | div | rem { 12u }
354352
// 'as' sits between here with 11
355353
add | subtract { 10u }
356-
lsl | lsr | asr { 9u }
354+
shl | shr { 9u }
357355
bitand { 8u }
358356
bitxor { 7u }
359357
bitor { 6u }

branches/try/src/librustsyntax/parse/common.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,8 @@ fn check_restricted_keywords_(p: parser, w: ast::ident) {
114114
fn expect_gt(p: parser) {
115115
if p.token == token::GT {
116116
p.bump();
117-
} else if p.token == token::BINOP(token::LSR) {
117+
} else if p.token == token::BINOP(token::SHR) {
118118
p.swap(token::GT, p.span.lo + 1u, p.span.hi);
119-
} else if p.token == token::BINOP(token::ASR) {
120-
p.swap(token::BINOP(token::LSR), p.span.lo + 1u, p.span.hi);
121119
} else {
122120
let mut s: str = "expecting ";
123121
s += token_to_str(p.reader, token::GT);
@@ -132,8 +130,7 @@ fn parse_seq_to_before_gt<T: copy>(sep: option<token::token>,
132130
p: parser) -> [T] {
133131
let mut first = true;
134132
let mut v = [];
135-
while p.token != token::GT && p.token != token::BINOP(token::LSR) &&
136-
p.token != token::BINOP(token::ASR) {
133+
while p.token != token::GT && p.token != token::BINOP(token::SHR) {
137134
alt sep {
138135
some(t) { if first { first = false; } else { expect(p, t); } }
139136
_ { }

branches/try/src/librustsyntax/parse/lexer.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ fn next_token_inner(rdr: reader) -> token::token {
392392
rdr.bump();
393393
alt rdr.curr {
394394
'=' { rdr.bump(); ret token::LE; }
395-
'<' { ret binop(rdr, token::LSL); }
395+
'<' { ret binop(rdr, token::SHL); }
396396
'-' {
397397
rdr.bump();
398398
alt rdr.curr {
@@ -407,12 +407,7 @@ fn next_token_inner(rdr: reader) -> token::token {
407407
rdr.bump();
408408
alt rdr.curr {
409409
'=' { rdr.bump(); ret token::GE; }
410-
'>' {
411-
if rdr.next() == '>' {
412-
rdr.bump();
413-
ret binop(rdr, token::ASR);
414-
} else { ret binop(rdr, token::LSR); }
415-
}
410+
'>' { ret binop(rdr, token::SHR); }
416411
_ { ret token::GT; }
417412
}
418413
}

branches/try/src/librustsyntax/parse/parser.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,9 +1119,8 @@ fn parse_assign_expr(p: parser) -> @expr {
11191119
token::CARET { aop = bitxor; }
11201120
token::AND { aop = bitand; }
11211121
token::OR { aop = bitor; }
1122-
token::LSL { aop = lsl; }
1123-
token::LSR { aop = lsr; }
1124-
token::ASR { aop = asr; }
1122+
token::SHL { aop = shl; }
1123+
token::SHR { aop = shr; }
11251124
}
11261125
p.get_id(); // see ast_util::op_expr_callee_id
11271126
ret mk_expr(p, lo, rhs.span.hi, expr_assign_op(aop, lhs, rhs));

branches/try/src/librustsyntax/parse/prec.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ fn token_to_binop(tok: token) -> option<ast::binop> {
2525
// 'as' sits between here with 11
2626
BINOP(PLUS) { some(add) }
2727
BINOP(MINUS) { some(subtract) }
28-
BINOP(LSL) { some(lsl) }
29-
BINOP(LSR) { some(lsr) }
30-
BINOP(ASR) { some(asr) }
28+
BINOP(SHL) { some(shl) }
29+
BINOP(SHR) { some(shr) }
3130
BINOP(AND) { some(bitand) }
3231
BINOP(CARET) { some(bitxor) }
3332
BINOP(OR) { some(bitor) }

branches/try/src/librustsyntax/parse/token.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ enum binop {
1414
CARET,
1515
AND,
1616
OR,
17-
LSL,
18-
LSR,
19-
ASR,
17+
SHL,
18+
SHR,
2019
}
2120

2221
enum token {
@@ -78,9 +77,8 @@ fn binop_to_str(o: binop) -> str {
7877
CARET { ret "^"; }
7978
AND { ret "&"; }
8079
OR { ret "|"; }
81-
LSL { ret "<<"; }
82-
LSR { ret ">>"; }
83-
ASR { ret ">>>"; }
80+
SHL { ret "<<"; }
81+
SHR { ret ">>"; }
8482
}
8583
}
8684

branches/try/src/libstd/timer.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ for *at least* that period of time.
2020
* ch - a channel of type T to send a `val` on
2121
* val - a value of type T to send over the provided `ch`
2222
"]
23-
fn delayed_send<T: copy send>(msecs: uint, ch: comm::chan<T>, val: T) {
23+
fn delayed_send<T: send>(msecs: uint, ch: comm::chan<T>, val: T) {
2424
task::spawn() {||
2525
unsafe {
2626
let timer_done_po = comm::port::<()>();
@@ -94,9 +94,7 @@ An `option<T>` representing the outcome of the call. If the call `recv`'d on
9494
the provided port in the allotted timeout period, then the result will be a
9595
`some(T)`. If not, then `none` will be returned.
9696
"]
97-
fn recv_timeout<T: copy send>(msecs: uint, wait_po: comm::port<T>)
98-
-> option<T> {
99-
97+
fn recv_timeout<T: send>(msecs: uint, wait_po: comm::port<T>) -> option<T> {
10098
let timeout_po = comm::port::<()>();
10199
let timeout_ch = comm::chan(timeout_po);
102100
delayed_send(msecs, timeout_ch, ());

branches/try/src/rustc/middle/const_eval.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ fn eval_const_expr(tcx: middle::ty::ctxt, e: @expr) -> const_val {
4444
mul { const_int(a * b) } div { const_int(a / b) }
4545
rem { const_int(a % b) } and | bitand { const_int(a & b) }
4646
or | bitor { const_int(a | b) } bitxor { const_int(a ^ b) }
47-
lsl { const_int(a << b) } lsr { const_int(a >> b) }
48-
asr { const_int(a >>> b) }
47+
shl { const_int(a << b) } shr { const_int(a >> b) }
4948
eq { fromb(a == b) } lt { fromb(a < b) }
5049
le { fromb(a <= b) } ne { fromb(a != b) }
5150
ge { fromb(a >= b) } gt { fromb(a > b) }
@@ -58,9 +57,7 @@ fn eval_const_expr(tcx: middle::ty::ctxt, e: @expr) -> const_val {
5857
mul { const_uint(a * b) } div { const_uint(a / b) }
5958
rem { const_uint(a % b) } and | bitand { const_uint(a & b) }
6059
or | bitor { const_uint(a | b) } bitxor { const_uint(a ^ b) }
61-
lsl { const_int((a << b) as i64) }
62-
lsr { const_int((a >> b) as i64) }
63-
asr { const_int((a >>> b) as i64) }
60+
shl { const_uint(a << b) } shr { const_uint(a >> b) }
6461
eq { fromb(a == b) } lt { fromb(a < b) }
6562
le { fromb(a <= b) } ne { fromb(a != b) }
6663
ge { fromb(a >= b) } gt { fromb(a > b) }

branches/try/src/rustc/middle/kind.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import syntax::{visit, ast_util};
22
import syntax::ast::*;
33
import syntax::codemap::span;
4-
import ty::{kind, kind_sendable, kind_copyable, kind_noncopyable };
4+
import ty::{kind, kind_copyable, kind_sendable, kind_noncopyable};
55
import driver::session::session;
66
import std::map::hashmap;
77
import util::ppaux::{ty_to_str, tys_to_str};
@@ -24,11 +24,10 @@ import freevars::freevar_entry;
2424
// types.
2525

2626
fn kind_to_str(k: kind) -> str {
27-
alt (ty::kind_can_be_copied(k), ty::kind_can_be_sent(k)) {
28-
(false, false) { "noncopyable" }
29-
(false, true) { "sendable" }
30-
(true, false) { "copyable" }
31-
(true, true) { "copy-sendable" }
27+
alt k {
28+
kind_sendable { "sendable" }
29+
kind_copyable { "copyable" }
30+
kind_noncopyable { "noncopyable" }
3231
}
3332
}
3433

branches/try/src/rustc/middle/trans/base.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,9 +1617,12 @@ fn trans_eager_binop(cx: block, op: ast::binop, lhs: ValueRef,
16171617
ast::bitor { Or(cx, lhs, rhs) }
16181618
ast::bitand { And(cx, lhs, rhs) }
16191619
ast::bitxor { Xor(cx, lhs, rhs) }
1620-
ast::lsl { Shl(cx, lhs, rhs) }
1621-
ast::lsr { LShr(cx, lhs, rhs) }
1622-
ast::asr { AShr(cx, lhs, rhs) }
1620+
ast::shl { Shl(cx, lhs, rhs) }
1621+
ast::shr {
1622+
if ty::type_is_signed(intype) {
1623+
AShr(cx, lhs, rhs)
1624+
} else { LShr(cx, lhs, rhs) }
1625+
}
16231626
_ {
16241627
let cmpr = trans_compare(cx, op, lhs, lhs_t, rhs, rhs_t);
16251628
cx = cmpr.bcx;
@@ -4565,9 +4568,11 @@ fn trans_const_expr(cx: @crate_ctxt, e: @ast::expr) -> ValueRef {
45654568
ast::bitxor { llvm::LLVMConstXor(te1, te2) }
45664569
ast::bitand { llvm::LLVMConstAnd(te1, te2) }
45674570
ast::bitor { llvm::LLVMConstOr(te1, te2) }
4568-
ast::lsl { llvm::LLVMConstShl(te1, te2) }
4569-
ast::lsr { llvm::LLVMConstLShr(te1, te2) }
4570-
ast::asr { llvm::LLVMConstAShr(te1, te2) }
4571+
ast::shl { llvm::LLVMConstShl(te1, te2) }
4572+
ast::shr {
4573+
if signed { llvm::LLVMConstAShr(te1, te2) }
4574+
else { llvm::LLVMConstLShr(te1, te2) }
4575+
}
45714576
ast::eq |
45724577
ast::lt |
45734578
ast::le |

0 commit comments

Comments
 (0)