summaryrefslogtreecommitdiffstats
path: root/src/test/ui/type/type-check/assignment-in-if.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/type/type-check/assignment-in-if.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/type/type-check/assignment-in-if.rs b/src/test/ui/type/type-check/assignment-in-if.rs
index 8da7b32b4..ada250df2 100644
--- a/src/test/ui/type/type-check/assignment-in-if.rs
+++ b/src/test/ui/type/type-check/assignment-in-if.rs
@@ -40,4 +40,23 @@ fn main() {
) {
println!("{}", x);
}
+
+ if x == x && x = x && x == x {
+ //~^ ERROR mismatched types
+ //~| ERROR mismatched types
+ //~| ERROR mismatched types
+ println!("{}", x);
+ }
+
+ if x == x && x == x && x = x {
+ //~^ ERROR mismatched types
+ //~| ERROR mismatched types
+ println!("{}", x);
+ }
+
+ if x = 1 && x == 1 {
+ //~^ ERROR mismatched types
+ //~| ERROR mismatched types
+ println!("{}", x);
+ }
}