Skip to content

Commit bfc7c70

Browse files
committed
---
yaml --- r: 3020 b: refs/heads/master c: dfdd6db h: refs/heads/master v: v3
1 parent 8b10246 commit bfc7c70

File tree

7 files changed

+15
-23
lines changed

7 files changed

+15
-23
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 7a066ba547ab900d22fd435652fd9106ba180dfa
2+
refs/heads/master: dfdd6dbc5464147d984470086ab27c950d60d83e

trunk/src/comp/front/ast.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ fn binop_to_str(binop op) -> str {
183183
tag unop {
184184
box(mutability);
185185
deref;
186-
bitnot;
187186
not;
188187
neg;
189188
}
@@ -195,7 +194,6 @@ fn unop_to_str(unop op) -> str {
195194
ret "@";
196195
}
197196
case (deref) {ret "*";}
198-
case (bitnot) {ret "~";}
199197
case (not) {ret "!";}
200198
case (neg) {ret "-";}
201199
}

trunk/src/comp/front/parser.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,13 +1172,6 @@ fn parse_prefix_expr(&parser p) -> @ast::expr {
11721172
ex = ast::expr_unary(ast::not, e, p.get_ann());
11731173
}
11741174

1175-
case (token::TILDE) {
1176-
p.bump();
1177-
auto e = parse_prefix_expr(p);
1178-
hi = e.span.hi;
1179-
ex = ast::expr_unary(ast::bitnot, e, p.get_ann());
1180-
}
1181-
11821175
case (token::BINOP(?b)) {
11831176
alt (b) {
11841177
case (token::MINUS) {

trunk/src/comp/middle/trans.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3388,11 +3388,6 @@ fn trans_unary(&@block_ctxt cx, ast::unop op,
33883388
auto e_ty = ty::expr_ty(cx.fcx.lcx.ccx.tcx, e);
33893389

33903390
alt (op) {
3391-
case (ast::bitnot) {
3392-
sub = autoderef(sub.bcx, sub.val,
3393-
ty::expr_ty(cx.fcx.lcx.ccx.tcx, e));
3394-
ret res(sub.bcx, sub.bcx.build.Not(sub.val));
3395-
}
33963391
case (ast::not) {
33973392
sub = autoderef(sub.bcx, sub.val,
33983393
ty::expr_ty(cx.fcx.lcx.ccx.tcx, e));

trunk/src/comp/middle/typeck.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,6 +1580,16 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
15801580
}
15811581
}
15821582
}
1583+
case (ast::not) {
1584+
if (!type_is_integral(fcx, oper.span, oper_t) &&
1585+
structure_of(fcx, oper.span, oper_t)
1586+
!= ty::ty_bool) {
1587+
fcx.ccx.tcx.sess.span_err(expr.span,
1588+
#fmt("mismatched types: expected bool or \
1589+
integer but found %s",
1590+
ty_to_str(fcx.ccx.tcx, oper_t)));
1591+
}
1592+
}
15831593
case (_) { oper_t = strip_boxes(fcx, expr.span, oper_t); }
15841594
}
15851595

trunk/src/lib/bitv.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@ fn uint_bits() -> uint {
3232
}
3333

3434
fn create(uint nbits, bool init) -> t {
35-
auto elt = if (init) {
36-
~0u
37-
} else {
38-
0u
39-
};
35+
auto elt = if (init) { !0u } else { 0u };
4036

4137
auto storage = vec::init_elt_mut[uint](elt, nbits / uint_bits() + 1u);
4238
ret rec(storage = storage, nbits = nbits);
@@ -139,7 +135,7 @@ fn set_all(&t v) {
139135

140136
fn invert(&t v) {
141137
for each (uint i in uint::range(0u, vec::len(v.storage))) {
142-
v.storage.(i) = ~v.storage.(i);
138+
v.storage.(i) = !v.storage.(i);
143139
}
144140
}
145141

@@ -163,7 +159,7 @@ fn set(&t v, uint i, bool x) {
163159
v.storage.(w) = if (x) {
164160
v.storage.(w) | flag
165161
} else {
166-
v.storage.(w) & ~flag
162+
v.storage.(w) & !flag
167163
};
168164
}
169165

trunk/src/lib/sha1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ fn mk_sha1() -> sha1 {
110110
t = 0;
111111
while (t < 20) {
112112
temp = circular_shift(5u32, a)
113-
+ ((b & c) | ((~b) & d)) + e + w.(t) + k0;
113+
+ ((b & c) | ((!b) & d)) + e + w.(t) + k0;
114114
e = d;
115115
d = c;
116116
c = circular_shift(30u32, b);

0 commit comments

Comments
 (0)