1 // Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution.
4 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7 // option. This file may not be copied, modified, or distributed
8 // except according to those terms.
10 #[warn(clippy::eval_order_dependence)]
14 clippy::many_single_char_names,
17 clippy::blacklisted_name
26 // Example from iss#277
32 // Does it work in weird places?
33 // ...in the base for a struct expression?
38 let base = Foo { a: 4, b: 5 };
46 // ...inside a closure?
54 // ...not across a closure?
56 let b = (y, || y = 1);
58 // && and || evaluate left-to-right.
68 // Make sure we don't get confused by alpha conversion.
75 // No warning if we don't read the variable...
80 // ...if the assignment is in a closure...
87 // ... or the access is under an address.
99 // Limitation: l-values other than simple variables don't trigger
101 let mut tup = (0, 0);
106 // Limitation: you can get away with a read under address-of.