Skip to content

Commit 01bcc60

Browse files
committed
Allow newly added non_local_definitions lint in clippy
1 parent 80c81c5 commit 01bcc60

20 files changed

+86
-73
lines changed

src/tools/clippy/tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//@[disabled] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/undocumented_unsafe_blocks/disabled
55

66
#![warn(clippy::undocumented_unsafe_blocks, clippy::unnecessary_safety_comment)]
7-
#![allow(deref_nullptr, clippy::let_unit_value, clippy::missing_safety_doc)]
7+
#![allow(deref_nullptr, non_local_definitions, clippy::let_unit_value, clippy::missing_safety_doc)]
88
#![feature(lint_reasons)]
99

1010
extern crate proc_macro_unsafe;

src/tools/clippy/tests/ui/bool_comparison.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(clippy::needless_if)]
1+
#![allow(non_local_definitions, clippy::needless_if)]
22
#![warn(clippy::bool_comparison)]
33
#![allow(clippy::non_canonical_partial_ord_impl)]
44

src/tools/clippy/tests/ui/bool_comparison.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(clippy::needless_if)]
1+
#![allow(non_local_definitions, clippy::needless_if)]
22
#![warn(clippy::bool_comparison)]
33
#![allow(clippy::non_canonical_partial_ord_impl)]
44

src/tools/clippy/tests/ui/crashes/ice-4760.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(non_local_definitions)]
2+
13
const COUNT: usize = 2;
24
struct Thing;
35
trait Dummy {}

src/tools/clippy/tests/ui/crashes/ice-6179.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
#![warn(clippy::use_self)]
55
#![allow(dead_code, clippy::let_with_type_underscore)]
6+
#![allow(non_local_definitions)]
67

78
struct Foo;
89

src/tools/clippy/tests/ui/explicit_into_iter_loop.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(non_local_definitions)]
12
#![warn(clippy::explicit_into_iter_loop)]
23

34
fn main() {

src/tools/clippy/tests/ui/explicit_into_iter_loop.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(non_local_definitions)]
12
#![warn(clippy::explicit_into_iter_loop)]
23

34
fn main() {

src/tools/clippy/tests/ui/explicit_into_iter_loop.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: it is more concise to loop over containers instead of using explicit iteration methods
2-
--> $DIR/explicit_into_iter_loop.rs:9:18
2+
--> $DIR/explicit_into_iter_loop.rs:10:18
33
|
44
LL | for _ in iterator.into_iter() {}
55
| ^^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `iterator`
@@ -8,31 +8,31 @@ LL | for _ in iterator.into_iter() {}
88
= help: to override `-D warnings` add `#[allow(clippy::explicit_into_iter_loop)]`
99

1010
error: it is more concise to loop over containers instead of using explicit iteration methods
11-
--> $DIR/explicit_into_iter_loop.rs:22:14
11+
--> $DIR/explicit_into_iter_loop.rs:23:14
1212
|
1313
LL | for _ in t.into_iter() {}
1414
| ^^^^^^^^^^^^^ help: to write this more concisely, try: `&t`
1515

1616
error: it is more concise to loop over containers instead of using explicit iteration methods
17-
--> $DIR/explicit_into_iter_loop.rs:25:14
17+
--> $DIR/explicit_into_iter_loop.rs:26:14
1818
|
1919
LL | for _ in r.into_iter() {}
2020
| ^^^^^^^^^^^^^ help: to write this more concisely, try: `r`
2121

2222
error: it is more concise to loop over containers instead of using explicit iteration methods
23-
--> $DIR/explicit_into_iter_loop.rs:33:14
23+
--> $DIR/explicit_into_iter_loop.rs:34:14
2424
|
2525
LL | for _ in mr.into_iter() {}
2626
| ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&*mr`
2727

2828
error: it is more concise to loop over containers instead of using explicit iteration methods
29-
--> $DIR/explicit_into_iter_loop.rs:45:14
29+
--> $DIR/explicit_into_iter_loop.rs:46:14
3030
|
3131
LL | for _ in u.into_iter() {}
3232
| ^^^^^^^^^^^^^ help: to write this more concisely, try: `&mut u`
3333

3434
error: it is more concise to loop over containers instead of using explicit iteration methods
35-
--> $DIR/explicit_into_iter_loop.rs:48:14
35+
--> $DIR/explicit_into_iter_loop.rs:49:14
3636
|
3737
LL | for _ in mr.into_iter() {}
3838
| ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&mut *mr`

src/tools/clippy/tests/ui/explicit_iter_loop.fixed

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
clippy::needless_borrow,
66
clippy::deref_addrof,
77
clippy::unnecessary_mut_passed,
8-
dead_code
8+
dead_code,
9+
non_local_definitions,
910
)]
1011

1112
use core::slice;

src/tools/clippy/tests/ui/explicit_iter_loop.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
clippy::needless_borrow,
66
clippy::deref_addrof,
77
clippy::unnecessary_mut_passed,
8-
dead_code
8+
dead_code,
9+
non_local_definitions,
910
)]
1011

1112
use core::slice;

0 commit comments

Comments
 (0)