Skip to content

Commit e2666dc

Browse files
committed
---
yaml --- r: 55789 b: refs/heads/master c: ab8068c h: refs/heads/master i: 55787: 8c42904 v: v3
1 parent 83967bf commit e2666dc

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: f39152e07baf03fc1ff4c8b2c1678ac857b4a512
2+
refs/heads/master: ab8068c9f2cbcce4411020b04dafe2055044f96a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 79a2b2eafc3c766cecec8a5f76317693bae9ed17
55
refs/heads/try: 8eb2bab100b42f0ba751552d8eff00eb2134c55a

trunk/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)),

trunk/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() {}

trunk/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;

trunk/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)