Skip to content

Commit 9792ec6

Browse files
committed
auto merge of #9174 : thestinger/rust/bot, r=catamorphism
An expression such as `bottom == not_bottom` or `not_bottom == bottom` already compiled, but this fixes the case where both sides are `bottom`.
2 parents 55b43fa + 298f06f commit 9792ec6

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/librustc/middle/ty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4326,7 +4326,7 @@ pub fn is_binopable(cx: ctxt, ty: t, op: ast::BinOp) -> bool {
43264326
/*char*/ [f, f, f, f, t, t, f, f],
43274327
/*int*/ [t, t, t, t, t, t, t, f],
43284328
/*float*/ [t, t, t, f, t, t, f, f],
4329-
/*bot*/ [t, t, t, t, f, f, t, t],
4329+
/*bot*/ [t, t, t, t, t, t, t, t],
43304330
/*raw ptr*/ [f, f, f, f, t, t, f, f]];
43314331

43324332
return tbl[tycat(cx, ty)][opcat(op)];

src/test/run-fail/binop-fail-3.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// error-pattern:quux
12+
fn foo() -> ! { fail!("quux"); }
13+
fn main() { foo() == foo(); }

0 commit comments

Comments
 (0)