Skip to content

Commit 596df1e

Browse files
committed
---
yaml --- r: 13114 b: refs/heads/master c: 7fee392 h: refs/heads/master v: v3
1 parent 455897a commit 596df1e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
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: ccb54f0ce0002667fbda58cc8bafd356b39e8671
2+
refs/heads/master: 7fee392de5e977038d233861d5d619164f96f338
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/rustc/middle/const_eval.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ fn eval_const_expr(tcx: middle::ty::ctxt, e: @expr) -> const_val {
4949
le { fromb(a <= b) } ne { fromb(a != b) }
5050
ge { fromb(a >= b) } gt { fromb(a > b) }
5151
}
52-
5352
}
5453
(const_uint(a), const_uint(b)) {
5554
alt check op {
@@ -63,6 +62,17 @@ fn eval_const_expr(tcx: middle::ty::ctxt, e: @expr) -> const_val {
6362
ge { fromb(a >= b) } gt { fromb(a > b) }
6463
}
6564
}
65+
// shifts can have any integral type as their rhs
66+
(const_int(a), const_uint(b)) {
67+
alt check op {
68+
shl { const_int(a << b) } shr { const_int(a >> b) }
69+
}
70+
}
71+
(const_uint(a), const_int(b)) {
72+
alt check op {
73+
shl { const_uint(a << b) } shr { const_uint(a >> b) }
74+
}
75+
}
6676
}
6777
}
6878
expr_cast(base, _) {

0 commit comments

Comments
 (0)