rust/tests/ui/parser/eq-gt-to-gt-eq.fixed
2023-12-26 20:59:14 -08:00

46 lines
603 B
Rust

// run-rustfix
// Check that we try to correct `=>` to `>=` in conditions.
#![allow(unused)]
fn main() {
let a = 0;
let b = 1;
if a >= b {} //~ERROR
}
fn foo() {
let a = 0;
if a >= 1 {} //~ERROR
}
fn a() {
let a = 0;
if 1 >= a {} //~ERROR
}
fn bar() {
let a = 0;
let b = 1;
if a >= b && a != b {} //~ERROR
}
fn qux() {
let a = 0;
let b = 1;
if a != b && a >= b {} //~ERROR
}
fn baz() {
let a = 0;
let b = 1;
let _ = a >= b; //~ERROR
}
fn b() {
let a = 0;
let b = 1;
match a >= b { //~ERROR
_ => todo!(),
}
}