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