]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/require-parens-for-chained-comparison.rs
Add 'compiler/rustc_codegen_cranelift/' from commit '793d26047f994e23415f8f6bb5686ff2...
[rust.git] / src / test / ui / parser / require-parens-for-chained-comparison.rs
1 fn f<T>() {}
2 struct X;
3
4 fn main() {
5     false == false == false;
6     //~^ ERROR comparison operators cannot be chained
7     //~| HELP split the comparison into two
8
9     false == 0 < 2;
10     //~^ ERROR comparison operators cannot be chained
11     //~| HELP parenthesize the comparison
12
13     f<X>();
14     //~^ ERROR comparison operators cannot be chained
15     //~| HELP use `::<...>` instead of `<...>` to specify type arguments
16
17     f<Result<Option<X>, Option<Option<X>>>(1, 2);
18     //~^ ERROR comparison operators cannot be chained
19     //~| HELP use `::<...>` instead of `<...>` to specify type arguments
20
21     use std::convert::identity;
22     let _ = identity<u8>;
23     //~^ ERROR comparison operators cannot be chained
24     //~| HELP use `::<...>` instead of `<...>` to specify type arguments
25     //~| HELP or use `(...)` if you meant to specify fn arguments
26 }