2022-10-06 07:44:38 +00:00
|
|
|
error: `Box::new(_)` of default value
|
2024-04-04 17:52:55 +00:00
|
|
|
--> tests/ui/box_default.rs:34:32
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
2024-04-04 17:52:55 +00:00
|
|
|
LL | let string1: Box<String> = Box::new(Default::default());
|
2022-10-23 13:18:45 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()`
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::box-default` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::box_default)]`
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
|
|
error: `Box::new(_)` of default value
|
2024-04-04 17:52:55 +00:00
|
|
|
--> tests/ui/box_default.rs:35:32
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
2024-04-04 17:52:55 +00:00
|
|
|
LL | let string2: Box<String> = Box::new(String::new());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()`
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
|
|
error: `Box::new(_)` of default value
|
2024-04-04 17:52:55 +00:00
|
|
|
--> tests/ui/box_default.rs:36:41
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
2024-04-04 17:52:55 +00:00
|
|
|
LL | let impl1: Box<ImplementsDefault> = Box::new(Default::default());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()`
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
|
|
error: `Box::new(_)` of default value
|
2024-04-04 17:52:55 +00:00
|
|
|
--> tests/ui/box_default.rs:37:29
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
2024-04-04 17:52:55 +00:00
|
|
|
LL | let vec: Box<Vec<u8>> = Box::new(Vec::new());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()`
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
|
|
error: `Box::new(_)` of default value
|
2024-04-04 17:52:55 +00:00
|
|
|
--> tests/ui/box_default.rs:38:25
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
2024-04-04 17:52:55 +00:00
|
|
|
LL | let byte: Box<u8> = Box::new(u8::default());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()`
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
|
|
error: `Box::new(_)` of default value
|
2024-04-04 17:52:55 +00:00
|
|
|
--> tests/ui/box_default.rs:39:45
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
2024-04-04 17:52:55 +00:00
|
|
|
LL | let vec2: Box<Vec<ImplementsDefault>> = Box::new(vec![]);
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: try: `Box::default()`
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
|
|
error: `Box::new(_)` of default value
|
2024-04-04 17:52:55 +00:00
|
|
|
--> tests/ui/box_default.rs:40:32
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
2024-04-04 17:52:55 +00:00
|
|
|
LL | let vec3: Box<Vec<bool>> = Box::new(Vec::from([]));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()`
|
2022-10-23 13:18:45 +00:00
|
|
|
|
|
|
|
error: `Box::new(_)` of default value
|
2024-04-04 17:52:55 +00:00
|
|
|
--> tests/ui/box_default.rs:42:25
|
2022-10-23 13:18:45 +00:00
|
|
|
|
|
2024-04-04 17:52:55 +00:00
|
|
|
LL | let plain_default = Box::new(Default::default());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()`
|
2022-10-23 13:18:45 +00:00
|
|
|
|
|
|
|
error: `Box::new(_)` of default value
|
2024-04-04 17:52:55 +00:00
|
|
|
--> tests/ui/box_default.rs:59:16
|
2022-10-23 13:18:45 +00:00
|
|
|
|
|
|
|
|
LL | call_ty_fn(Box::new(u8::default()));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()`
|
|
|
|
|
2024-04-04 17:52:55 +00:00
|
|
|
error: aborting due to 9 previous errors
|
2022-10-06 07:44:38 +00:00
|
|
|
|