Skip to content

Commit 29041ef

Browse files
committed
---
yaml --- r: 57756 b: refs/heads/incoming c: ab8068c h: refs/heads/master v: v3
1 parent bc2d8e7 commit 29041ef

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: bf67eb2362b7d0f37012f2d6dac604c3bbacd2c6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: f39152e07baf03fc1ff4c8b2c1678ac857b4a512
9+
refs/heads/incoming: ab8068c9f2cbcce4411020b04dafe2055044f96a
1010
refs/heads/dist-snap: 00dbbd01c2aee72982b3e0f9511ae1d4428c3ba9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/librustc/middle/const_eval.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,9 @@ pub fn eval_const_expr_partial(tcx: middle::ty::ctxt, e: @expr)
299299
add => Ok(const_int(a + b)),
300300
subtract => Ok(const_int(a - b)),
301301
mul => Ok(const_int(a * b)),
302-
quot if b == 0 => Err(~"quotient zero"),
302+
quot if b == 0 => Err(~"attempted quotient with a divisor of zero"),
303303
quot => Ok(const_int(a / b)),
304-
rem if b == 0 => Err(~"remainder zero"),
304+
rem if b == 0 => Err(~"attempted remainder with a divisor of zero"),
305305
rem => Ok(const_int(a % b)),
306306
and | bitand => Ok(const_int(a & b)),
307307
or | bitor => Ok(const_int(a | b)),
@@ -321,9 +321,9 @@ pub fn eval_const_expr_partial(tcx: middle::ty::ctxt, e: @expr)
321321
add => Ok(const_uint(a + b)),
322322
subtract => Ok(const_uint(a - b)),
323323
mul => Ok(const_uint(a * b)),
324-
quot if b == 0 => Err(~"quotient zero"),
324+
quot if b == 0 => Err(~"attempted quotient with a divisor of zero"),
325325
quot => Ok(const_uint(a / b)),
326-
rem if b == 0 => Err(~"remainder zero"),
326+
rem if b == 0 => Err(~"attempted remainder with a divisor of zero"),
327327
rem => Ok(const_uint(a % b)),
328328
and | bitand => Ok(const_uint(a & b)),
329329
or | bitor => Ok(const_uint(a | b)),

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -785,9 +785,9 @@ pub fn cast_shift_rhs(op: ast::binop,
785785
pub fn fail_if_zero(cx: block, span: span, quotrem: ast::binop,
786786
rhs: ValueRef, rhs_t: ty::t) -> block {
787787
let text = if quotrem == ast::quot {
788-
@~"quotient zero"
788+
@~"attempted quotient with a divisor of zero"
789789
} else {
790-
@~"remainder zero"
790+
@~"attempted remainder with a divisor of zero"
791791
};
792792
let is_zero = match ty::get(rhs_t).sty {
793793
ty::ty_int(t) => {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
enum test {
2-
quot_zero = 1/0, //~ERROR expected constant: quotient zero
3-
rem_zero = 1%0 //~ERROR expected constant: remainder zero
2+
quot_zero = 1/0, //~ERROR expected constant: attempted quotient with a divisor of zero
3+
rem_zero = 1%0 //~ERROR expected constant: attempted remainder with a divisor of zero
44
}
55

66
fn main() {}

branches/incoming/src/test/run-fail/divide-by-zero.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:quotient zero
11+
// error-pattern:attempted quotient with a divisor of zero
1212
fn main() {
1313
let y = 0;
1414
let z = 1 / y;

branches/incoming/src/test/run-fail/mod-zero.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:remainder zero
11+
// error-pattern:attempted remainder with a divisor of zero
1212
fn main() {
1313
let y = 0;
1414
let z = 1 % y;

0 commit comments

Comments
 (0)