Skip to content

Commit aef0743

Browse files
committed
---
yaml --- r: 12931 b: refs/heads/master c: f5b9ebf h: refs/heads/master i: 12929: 788f7a6 12927: bc1d0bb v: v3
1 parent 94a2cb5 commit aef0743

File tree

25 files changed

+345
-146
lines changed

25 files changed

+345
-146
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 15cef374b9a16a0f8b40665dbafdf725e9456ffd
2+
refs/heads/master: f5b9ebffa0a1390a6783547e1d1f5e20913756eb
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/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:send> for future<A> {
31+
impl future<A:copy send> for future<A> {
3232

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

trunk/src/librustsyntax/ast.rs

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

trunk/src/librustsyntax/ast_util.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ fn binop_to_str(op: binop) -> str {
7272
bitxor { ret "^"; }
7373
bitand { ret "&"; }
7474
bitor { ret "|"; }
75-
shl { ret "<<"; }
76-
shr { ret ">>"; }
75+
lsl { ret "<<"; }
76+
lsr { ret ">>"; }
77+
asr { ret ">>>"; }
7778
eq { ret "=="; }
7879
lt { ret "<"; }
7980
le { ret "<="; }
@@ -89,8 +90,9 @@ pure fn lazy_binop(b: binop) -> bool {
8990
9091
pure fn is_shift_binop(b: binop) -> bool {
9192
alt b {
92-
shl { true }
93-
shr { true }
93+
lsl { true }
94+
lsr { true }
95+
asr { true }
9496
_ { false }
9597
}
9698
}
@@ -351,7 +353,7 @@ fn operator_prec(op: ast::binop) -> uint {
351353
mul | div | rem { 12u }
352354
// 'as' sits between here with 11
353355
add | subtract { 10u }
354-
shl | shr { 9u }
356+
lsl | lsr | asr { 9u }
355357
bitand { 8u }
356358
bitxor { 7u }
357359
bitor { 6u }

trunk/src/librustsyntax/parse/common.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@ 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::SHR) {
117+
} else if p.token == token::BINOP(token::LSR) {
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);
119121
} else {
120122
let mut s: str = "expecting ";
121123
s += token_to_str(p.reader, token::GT);
@@ -130,7 +132,8 @@ fn parse_seq_to_before_gt<T: copy>(sep: option<token::token>,
130132
p: parser) -> [T] {
131133
let mut first = true;
132134
let mut v = [];
133-
while p.token != token::GT && p.token != token::BINOP(token::SHR) {
135+
while p.token != token::GT && p.token != token::BINOP(token::LSR) &&
136+
p.token != token::BINOP(token::ASR) {
134137
alt sep {
135138
some(t) { if first { first = false; } else { expect(p, t); } }
136139
_ { }

trunk/src/librustsyntax/parse/lexer.rs

Lines changed: 7 additions & 2 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::SHL); }
395+
'<' { ret binop(rdr, token::LSL); }
396396
'-' {
397397
rdr.bump();
398398
alt rdr.curr {
@@ -407,7 +407,12 @@ fn next_token_inner(rdr: reader) -> token::token {
407407
rdr.bump();
408408
alt rdr.curr {
409409
'=' { rdr.bump(); ret token::GE; }
410-
'>' { ret binop(rdr, token::SHR); }
410+
'>' {
411+
if rdr.next() == '>' {
412+
rdr.bump();
413+
ret binop(rdr, token::ASR);
414+
} else { ret binop(rdr, token::LSR); }
415+
}
411416
_ { ret token::GT; }
412417
}
413418
}

trunk/src/librustsyntax/parse/parser.rs

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

trunk/src/librustsyntax/parse/prec.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ 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(SHL) { some(shl) }
29-
BINOP(SHR) { some(shr) }
28+
BINOP(LSL) { some(lsl) }
29+
BINOP(LSR) { some(lsr) }
30+
BINOP(ASR) { some(asr) }
3031
BINOP(AND) { some(bitand) }
3132
BINOP(CARET) { some(bitxor) }
3233
BINOP(OR) { some(bitor) }

trunk/src/librustsyntax/parse/token.rs

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

2122
enum token {
@@ -77,8 +78,9 @@ fn binop_to_str(o: binop) -> str {
7778
CARET { ret "^"; }
7879
AND { ret "&"; }
7980
OR { ret "|"; }
80-
SHL { ret "<<"; }
81-
SHR { ret ">>"; }
81+
LSL { ret "<<"; }
82+
LSR { ret ">>"; }
83+
ASR { ret ">>>"; }
8284
}
8385
}
8486

trunk/src/libstd/timer.rs

Lines changed: 4 additions & 2 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: send>(msecs: uint, ch: comm::chan<T>, val: T) {
23+
fn delayed_send<T: copy send>(msecs: uint, ch: comm::chan<T>, val: T) {
2424
task::spawn() {||
2525
unsafe {
2626
let timer_done_po = comm::port::<()>();
@@ -94,7 +94,9 @@ 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: send>(msecs: uint, wait_po: comm::port<T>) -> option<T> {
97+
fn recv_timeout<T: copy send>(msecs: uint, wait_po: comm::port<T>)
98+
-> option<T> {
99+
98100
let timeout_po = comm::port::<()>();
99101
let timeout_ch = comm::chan(timeout_po);
100102
delayed_send(msecs, timeout_ch, ());

trunk/src/rustc/middle/const_eval.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ 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-
shl { const_int(a << b) } shr { const_int(a >> b) }
47+
lsl { const_int(a << b) } lsr { const_int(a >> b) }
48+
asr { const_int(a >>> b) }
4849
eq { fromb(a == b) } lt { fromb(a < b) }
4950
le { fromb(a <= b) } ne { fromb(a != b) }
5051
ge { fromb(a >= b) } gt { fromb(a > b) }
@@ -57,7 +58,9 @@ fn eval_const_expr(tcx: middle::ty::ctxt, e: @expr) -> const_val {
5758
mul { const_uint(a * b) } div { const_uint(a / b) }
5859
rem { const_uint(a % b) } and | bitand { const_uint(a & b) }
5960
or | bitor { const_uint(a | b) } bitxor { const_uint(a ^ b) }
60-
shl { const_uint(a << b) } shr { 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) }
6164
eq { fromb(a == b) } lt { fromb(a < b) }
6265
le { fromb(a <= b) } ne { fromb(a != b) }
6366
ge { fromb(a >= b) } gt { fromb(a > b) }

trunk/src/rustc/middle/kind.rs

Lines changed: 6 additions & 5 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_copyable, kind_sendable, kind_noncopyable};
4+
import ty::{kind, kind_sendable, kind_copyable, kind_noncopyable };
55
import driver::session::session;
66
import std::map::hashmap;
77
import util::ppaux::{ty_to_str, tys_to_str};
@@ -24,10 +24,11 @@ import freevars::freevar_entry;
2424
// types.
2525

2626
fn kind_to_str(k: kind) -> str {
27-
alt k {
28-
kind_sendable { "sendable" }
29-
kind_copyable { "copyable" }
30-
kind_noncopyable { "noncopyable" }
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" }
3132
}
3233
}
3334

trunk/src/rustc/middle/trans/base.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,12 +1617,9 @@ 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::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-
}
1620+
ast::lsl { Shl(cx, lhs, rhs) }
1621+
ast::lsr { LShr(cx, lhs, rhs) }
1622+
ast::asr { AShr(cx, lhs, rhs) }
16261623
_ {
16271624
let cmpr = trans_compare(cx, op, lhs, lhs_t, rhs, rhs_t);
16281625
cx = cmpr.bcx;
@@ -4568,11 +4565,9 @@ fn trans_const_expr(cx: @crate_ctxt, e: @ast::expr) -> ValueRef {
45684565
ast::bitxor { llvm::LLVMConstXor(te1, te2) }
45694566
ast::bitand { llvm::LLVMConstAnd(te1, te2) }
45704567
ast::bitor { llvm::LLVMConstOr(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-
}
4568+
ast::lsl { llvm::LLVMConstShl(te1, te2) }
4569+
ast::lsr { llvm::LLVMConstLShr(te1, te2) }
4570+
ast::asr { llvm::LLVMConstAShr(te1, te2) }
45764571
ast::eq |
45774572
ast::lt |
45784573
ast::le |

0 commit comments

Comments
 (0)