mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 20:54:13 +00:00
Test that we do not lint for multiple underscores
This commit is contained in:
parent
02cb24de82
commit
c8d78a70b3
@ -22,6 +22,11 @@ fn unused_underscore(_foo: u32) -> u32 {
|
|||||||
1
|
1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///Test that we do not lint for multiple underscores
|
||||||
|
fn multiple_underscores(__x: u32) -> u32 {
|
||||||
|
__x + 1
|
||||||
|
}
|
||||||
|
|
||||||
// Non-variable bindings with preceding underscore
|
// Non-variable bindings with preceding underscore
|
||||||
fn _fn_test() {}
|
fn _fn_test() {}
|
||||||
struct _StructTest;
|
struct _StructTest;
|
||||||
@ -50,6 +55,7 @@ fn main() {
|
|||||||
// possible false positives
|
// possible false positives
|
||||||
let _ = non_prefix_underscore(foo);
|
let _ = non_prefix_underscore(foo);
|
||||||
let _ = unused_underscore(foo);
|
let _ = unused_underscore(foo);
|
||||||
|
let _ = multiple_underscores(foo);
|
||||||
non_variables();
|
non_variables();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user