Let type_is_integral return false for bool type
This commit is contained in:
parent
9556629da2
commit
6d5428cb4e
@ -2435,7 +2435,7 @@ pub fn type_structurally_contains_uniques(cx: ctxt, ty: t) -> bool {
|
||||
|
||||
pub fn type_is_integral(ty: t) -> bool {
|
||||
match get(ty).sty {
|
||||
ty_infer(IntVar(_)) | ty_int(_) | ty_uint(_) | ty_bool => true,
|
||||
ty_infer(IntVar(_)) | ty_int(_) | ty_uint(_) => true,
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
|
3
src/test/compile-fail/unop-neg-bool.rs
Normal file
3
src/test/compile-fail/unop-neg-bool.rs
Normal file
@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
-true; //~ ERROR cannot apply unary operator `-` to type `bool`
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user