-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for const, static, type alias, enum, and method
- Loading branch information
Showing
3 changed files
with
82 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,107 @@ | ||
error: map with zero-sized value type | ||
--> $DIR/zero_sized_map_values.rs:6:13 | ||
--> $DIR/zero_sized_map_values.rs:5:28 | ||
| | ||
LL | const CONST_NOT_OK: Option<HashMap<String, ()>> = None; | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: `-D clippy::zero-sized-map-values` implied by `-D warnings` | ||
= help: consider using a set instead | ||
|
||
error: map with zero-sized value type | ||
--> $DIR/zero_sized_map_values.rs:8:30 | ||
| | ||
LL | static STATIC_NOT_OK: Option<HashMap<String, ()>> = None; | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: consider using a set instead | ||
|
||
error: map with zero-sized value type | ||
--> $DIR/zero_sized_map_values.rs:11:17 | ||
| | ||
LL | type NotOkMap = HashMap<String, ()>; | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: consider using a set instead | ||
|
||
error: map with zero-sized value type | ||
--> $DIR/zero_sized_map_values.rs:15:11 | ||
| | ||
LL | NotOk(HashMap<String, ()>), | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: consider using a set instead | ||
|
||
error: map with zero-sized value type | ||
--> $DIR/zero_sized_map_values.rs:20:13 | ||
| | ||
LL | not_ok: HashMap<String, ()>, | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: `-D clippy::zero-sized-map-values` implied by `-D warnings` | ||
= help: consider using a set instead | ||
|
||
error: map with zero-sized value type | ||
--> $DIR/zero_sized_map_values.rs:8:22 | ||
--> $DIR/zero_sized_map_values.rs:22:22 | ||
| | ||
LL | also_not_ok: Vec<HashMap<usize, ()>>, | ||
| ^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: consider using a set instead | ||
|
||
error: map with zero-sized value type | ||
--> $DIR/zero_sized_map_values.rs:16:30 | ||
--> $DIR/zero_sized_map_values.rs:30:30 | ||
| | ||
LL | fn weird_map(&self, map: HashMap<usize, ()>); | ||
| ^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: consider using a set instead | ||
|
||
error: map with zero-sized value type | ||
--> $DIR/zero_sized_map_values.rs:31:14 | ||
--> $DIR/zero_sized_map_values.rs:38:25 | ||
| | ||
LL | fn not_ok(&self) -> HashMap<String, ()> { | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: consider using a set instead | ||
|
||
error: map with zero-sized value type | ||
--> $DIR/zero_sized_map_values.rs:55:14 | ||
| | ||
LL | fn test(map: HashMap<String, ()>, key: &str) -> HashMap<String, ()> { | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: consider using a set instead | ||
|
||
error: map with zero-sized value type | ||
--> $DIR/zero_sized_map_values.rs:31:49 | ||
--> $DIR/zero_sized_map_values.rs:55:49 | ||
| | ||
LL | fn test(map: HashMap<String, ()>, key: &str) -> HashMap<String, ()> { | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: consider using a set instead | ||
|
||
error: map with zero-sized value type | ||
--> $DIR/zero_sized_map_values.rs:41:9 | ||
--> $DIR/zero_sized_map_values.rs:65:9 | ||
| | ||
LL | let _: HashMap<String, ()> = HashMap::new(); | ||
| ^ | ||
| | ||
= help: consider using a set instead | ||
|
||
error: map with zero-sized value type | ||
--> $DIR/zero_sized_map_values.rs:44:9 | ||
--> $DIR/zero_sized_map_values.rs:65:12 | ||
| | ||
LL | let _: HashMap<String, ()> = HashMap::new(); | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: consider using a set instead | ||
|
||
error: map with zero-sized value type | ||
--> $DIR/zero_sized_map_values.rs:68:9 | ||
| | ||
LL | let _: HashMap<_, _> = std::iter::empty::<(String, ())>().collect(); | ||
| ^ | ||
| | ||
= help: consider using a set instead | ||
|
||
error: aborting due to 7 previous errors | ||
error: aborting due to 13 previous errors | ||
|