Skip to content

Commit cf87d93

Browse files
committed
Bless/fix unrelated tests
1 parent 70913ba commit cf87d93

8 files changed

+40
-23
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -6155,6 +6155,7 @@ Released 2018-09-13
61556155
[`excessive-nesting-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#excessive-nesting-threshold
61566156
[`future-size-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#future-size-threshold
61576157
[`ignore-interior-mutability`]: https://doc.rust-lang.org/clippy/lint_configuration.html#ignore-interior-mutability
6158+
[`large-cell-limit`]: https://doc.rust-lang.org/clippy/lint_configuration.html#large-cell-limit
61586159
[`large-error-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#large-error-threshold
61596160
[`literal-representation-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#literal-representation-threshold
61606161
[`matches-for-let-else`]: https://doc.rust-lang.org/clippy/lint_configuration.html#matches-for-let-else

book/src/lint_configuration.md

+10
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,16 @@ A list of paths to types that should be treated as if they do not contain interi
561561
* [`mutable_key_type`](https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type)
562562

563563

564+
## `large-cell-limit`
565+
The maximum size of a `T` in `RefCell<T>` to suggest to swap to `Cell` if applicable.
566+
567+
**Default Value:** `128`
568+
569+
---
570+
**Affected lints:**
571+
* [`copy_refcell`](https://rust-lang.github.io/rust-clippy/master/index.html#copy_refcell)
572+
573+
564574
## `large-error-threshold`
565575
The maximum size of the `Err`-variant in a `Result` returned from a function
566576

tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ error: error reading Clippy's configuration file: unknown field `foobar`, expect
4444
excessive-nesting-threshold
4545
future-size-threshold
4646
ignore-interior-mutability
47+
large-cell-limit
4748
large-error-threshold
4849
literal-representation-threshold
4950
matches-for-let-else
@@ -128,6 +129,7 @@ error: error reading Clippy's configuration file: unknown field `barfoo`, expect
128129
excessive-nesting-threshold
129130
future-size-threshold
130131
ignore-interior-mutability
132+
large-cell-limit
131133
large-error-threshold
132134
literal-representation-threshold
133135
matches-for-let-else
@@ -212,6 +214,7 @@ error: error reading Clippy's configuration file: unknown field `allow_mixed_uni
212214
excessive-nesting-threshold
213215
future-size-threshold
214216
ignore-interior-mutability
217+
large-cell-limit
215218
large-error-threshold
216219
literal-representation-threshold
217220
matches-for-let-else

tests/ui/await_holding_refcell_ref.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![warn(clippy::await_holding_refcell_ref)]
2+
#![allow(clippy::copy_refcell)]
23

34
use std::cell::RefCell;
45

tests/ui/await_holding_refcell_ref.stderr

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
error: this `RefCell` reference is held across an await point
2-
--> tests/ui/await_holding_refcell_ref.rs:6:9
2+
--> tests/ui/await_holding_refcell_ref.rs:7:9
33
|
44
LL | let b = x.borrow();
55
| ^
66
|
77
= help: ensure the reference is dropped before calling `await`
88
note: these are all the await points this reference is held through
9-
--> tests/ui/await_holding_refcell_ref.rs:8:11
9+
--> tests/ui/await_holding_refcell_ref.rs:9:11
1010
|
1111
LL | baz().await
1212
| ^^^^^
1313
= note: `-D clippy::await-holding-refcell-ref` implied by `-D warnings`
1414
= help: to override `-D warnings` add `#[allow(clippy::await_holding_refcell_ref)]`
1515

1616
error: this `RefCell` reference is held across an await point
17-
--> tests/ui/await_holding_refcell_ref.rs:12:9
17+
--> tests/ui/await_holding_refcell_ref.rs:13:9
1818
|
1919
LL | let b = x.borrow_mut();
2020
| ^
2121
|
2222
= help: ensure the reference is dropped before calling `await`
2323
note: these are all the await points this reference is held through
24-
--> tests/ui/await_holding_refcell_ref.rs:14:11
24+
--> tests/ui/await_holding_refcell_ref.rs:15:11
2525
|
2626
LL | baz().await
2727
| ^^^^^
2828

2929
error: this `RefCell` reference is held across an await point
30-
--> tests/ui/await_holding_refcell_ref.rs:34:9
30+
--> tests/ui/await_holding_refcell_ref.rs:35:9
3131
|
3232
LL | let b = x.borrow_mut();
3333
| ^
3434
|
3535
= help: ensure the reference is dropped before calling `await`
3636
note: these are all the await points this reference is held through
37-
--> tests/ui/await_holding_refcell_ref.rs:37:24
37+
--> tests/ui/await_holding_refcell_ref.rs:38:24
3838
|
3939
LL | let second = baz().await;
4040
| ^^^^^
@@ -43,40 +43,40 @@ LL | let third = baz().await;
4343
| ^^^^^
4444

4545
error: this `RefCell` reference is held across an await point
46-
--> tests/ui/await_holding_refcell_ref.rs:47:9
46+
--> tests/ui/await_holding_refcell_ref.rs:48:9
4747
|
4848
LL | let b = x.borrow_mut();
4949
| ^
5050
|
5151
= help: ensure the reference is dropped before calling `await`
5252
note: these are all the await points this reference is held through
53-
--> tests/ui/await_holding_refcell_ref.rs:50:24
53+
--> tests/ui/await_holding_refcell_ref.rs:51:24
5454
|
5555
LL | let second = baz().await;
5656
| ^^^^^
5757

5858
error: this `RefCell` reference is held across an await point
59-
--> tests/ui/await_holding_refcell_ref.rs:63:13
59+
--> tests/ui/await_holding_refcell_ref.rs:64:13
6060
|
6161
LL | let b = x.borrow_mut();
6262
| ^
6363
|
6464
= help: ensure the reference is dropped before calling `await`
6565
note: these are all the await points this reference is held through
66-
--> tests/ui/await_holding_refcell_ref.rs:65:15
66+
--> tests/ui/await_holding_refcell_ref.rs:66:15
6767
|
6868
LL | baz().await
6969
| ^^^^^
7070

7171
error: this `RefCell` reference is held across an await point
72-
--> tests/ui/await_holding_refcell_ref.rs:76:13
72+
--> tests/ui/await_holding_refcell_ref.rs:77:13
7373
|
7474
LL | let b = x.borrow_mut();
7575
| ^
7676
|
7777
= help: ensure the reference is dropped before calling `await`
7878
note: these are all the await points this reference is held through
79-
--> tests/ui/await_holding_refcell_ref.rs:78:15
79+
--> tests/ui/await_holding_refcell_ref.rs:79:15
8080
|
8181
LL | baz().await
8282
| ^^^^^

tests/ui/clone_on_copy.fixed

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
clippy::unnecessary_operation,
77
clippy::vec_init_then_push,
88
clippy::toplevel_ref_arg,
9-
clippy::needless_borrow
9+
clippy::needless_borrow,
10+
clippy::copy_refcell
1011
)]
1112

1213
use std::cell::RefCell;

tests/ui/clone_on_copy.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
clippy::unnecessary_operation,
77
clippy::vec_init_then_push,
88
clippy::toplevel_ref_arg,
9-
clippy::needless_borrow
9+
clippy::needless_borrow,
10+
clippy::copy_refcell
1011
)]
1112

1213
use std::cell::RefCell;

tests/ui/clone_on_copy.stderr

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: using `clone` on type `i32` which implements the `Copy` trait
2-
--> tests/ui/clone_on_copy.rs:23:5
2+
--> tests/ui/clone_on_copy.rs:24:5
33
|
44
LL | 42.clone();
55
| ^^^^^^^^^^ help: try removing the `clone` call: `42`
@@ -8,49 +8,49 @@ LL | 42.clone();
88
= help: to override `-D warnings` add `#[allow(clippy::clone_on_copy)]`
99

1010
error: using `clone` on type `i32` which implements the `Copy` trait
11-
--> tests/ui/clone_on_copy.rs:27:5
11+
--> tests/ui/clone_on_copy.rs:28:5
1212
|
1313
LL | (&42).clone();
1414
| ^^^^^^^^^^^^^ help: try dereferencing it: `*(&42)`
1515

1616
error: using `clone` on type `i32` which implements the `Copy` trait
17-
--> tests/ui/clone_on_copy.rs:30:5
17+
--> tests/ui/clone_on_copy.rs:31:5
1818
|
1919
LL | rc.borrow().clone();
2020
| ^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*rc.borrow()`
2121

2222
error: using `clone` on type `u32` which implements the `Copy` trait
23-
--> tests/ui/clone_on_copy.rs:33:5
23+
--> tests/ui/clone_on_copy.rs:34:5
2424
|
2525
LL | x.clone().rotate_left(1);
2626
| ^^^^^^^^^ help: try removing the `clone` call: `x`
2727

2828
error: using `clone` on type `i32` which implements the `Copy` trait
29-
--> tests/ui/clone_on_copy.rs:47:5
29+
--> tests/ui/clone_on_copy.rs:48:5
3030
|
3131
LL | m!(42).clone();
3232
| ^^^^^^^^^^^^^^ help: try removing the `clone` call: `m!(42)`
3333

3434
error: using `clone` on type `[u32; 2]` which implements the `Copy` trait
35-
--> tests/ui/clone_on_copy.rs:57:5
35+
--> tests/ui/clone_on_copy.rs:58:5
3636
|
3737
LL | x.clone()[0];
3838
| ^^^^^^^^^ help: try dereferencing it: `(*x)`
3939

4040
error: using `clone` on type `char` which implements the `Copy` trait
41-
--> tests/ui/clone_on_copy.rs:67:14
41+
--> tests/ui/clone_on_copy.rs:68:14
4242
|
4343
LL | is_ascii('z'.clone());
4444
| ^^^^^^^^^^^ help: try removing the `clone` call: `'z'`
4545

4646
error: using `clone` on type `i32` which implements the `Copy` trait
47-
--> tests/ui/clone_on_copy.rs:71:14
47+
--> tests/ui/clone_on_copy.rs:72:14
4848
|
4949
LL | vec.push(42.clone());
5050
| ^^^^^^^^^^ help: try removing the `clone` call: `42`
5151

5252
error: using `clone` on type `Option<i32>` which implements the `Copy` trait
53-
--> tests/ui/clone_on_copy.rs:75:17
53+
--> tests/ui/clone_on_copy.rs:76:17
5454
|
5555
LL | let value = opt.clone()?; // operator precedence needed (*opt)?
5656
| ^^^^^^^^^^^ help: try dereferencing it: `(*opt)`

0 commit comments

Comments
 (0)