mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 13:13:34 +00:00
added test against const lookup
This commit is contained in:
parent
b66bccc45a
commit
79bf820170
1 changed files with 4 additions and 0 deletions
|
@ -5,6 +5,8 @@
|
|||
|
||||
use std::cmp::{min, max};
|
||||
|
||||
const LARGE : usize = 3;
|
||||
|
||||
fn main() {
|
||||
let x;
|
||||
x = 2usize;
|
||||
|
@ -15,6 +17,8 @@ fn main() {
|
|||
|
||||
min(3, max(1, x)); // ok, could be 1, 2 or 3 depending on x
|
||||
|
||||
min(1, max(LARGE, x)); // no error, we don't lookup consts here
|
||||
|
||||
let s;
|
||||
s = "Hello";
|
||||
|
||||
|
|
Loading…
Reference in a new issue