Rollup merge of #32761 - tshepang:assert, r=steveklabnik

avoid "==" in assert! when one of the values is a bool

Is suspect this is something of an idiom
This commit is contained in:
Steve Klabnik 2016-04-06 12:12:09 -07:00
commit 3531a1a0da
5 changed files with 12 additions and 12 deletions

View file

@ -26,12 +26,12 @@ impl Foo for LocalOverride {
}
fn test_foo() {
assert!(0i8.foo() == false);
assert!(0i32.foo() == false);
assert!(0i64.foo() == true);
assert!(!0i8.foo());
assert!(!0i32.foo());
assert!(0i64.foo());
assert!(LocalDefault.foo() == false);
assert!(LocalOverride.foo() == true);
assert!(!LocalDefault.foo());
assert!(LocalOverride.foo());
}
fn test_bar() {

View file

@ -35,9 +35,9 @@ impl Foo for i64 {
}
fn test_foo() {
assert!(0i8.foo() == false);
assert!(0i32.foo() == false);
assert!(0i64.foo() == true);
assert!(!0i8.foo());
assert!(!0i32.foo());
assert!(0i64.foo());
}
// Next, test mixture of explicit `default` and provided methods: