1- error: `#[derive(From)]` can only be used on structs with a single field
2- --> $DIR/deriving-from-wrong-target.rs:8:1
1+ error: `#[derive(From)]` used on a struct with no fields
2+ --> $DIR/deriving-from-wrong-target.rs:7:10
33 |
4+ LL | #[derive(From)]
5+ | ^^^^
6+ LL |
47LL | struct S1;
5- | ^^^^^^^^^^
8+ | ^^
9+ |
10+ = note: `#[derive(From)]` can only be used on structs with exactly one field
611
7- error: `#[derive(From)]` can only be used on structs with a single field
8- --> $DIR/deriving-from-wrong-target.rs:12:1
12+ error: `#[derive(From)]` used on a struct with no fields
13+ --> $DIR/deriving-from-wrong-target.rs:11:10
914 |
15+ LL | #[derive(From)]
16+ | ^^^^
17+ LL |
1018LL | struct S2 {}
11- | ^^^^^^^^^^^^
19+ | ^^
20+ |
21+ = note: `#[derive(From)]` can only be used on structs with exactly one field
1222
13- error: `#[derive(From)]` can only be used on structs with a single field
14- --> $DIR/deriving-from-wrong-target.rs:16:1
23+ error: `#[derive(From)]` used on a struct with multiple fields
24+ --> $DIR/deriving-from-wrong-target.rs:15:10
1525 |
26+ LL | #[derive(From)]
27+ | ^^^^
28+ LL |
1629LL | struct S3(u32, bool);
17- | ^^^^^^^^^^^^^^^^^^^^^
30+ | ^^
31+ |
32+ = note: `#[derive(From)]` can only be used on structs with exactly one field
1833
19- error: `#[derive(From)]` can only be used on structs with a single field
20- --> $DIR/deriving-from-wrong-target.rs:21:1
21- |
22- LL | / struct S4 {
23- LL | | a: u32,
24- LL | | b: bool,
25- LL | | }
26- | |_^
34+ error: `#[derive(From)]` used on a struct with multiple fields
35+ --> $DIR/deriving-from-wrong-target.rs:19:10
36+ |
37+ LL | #[derive(From)]
38+ | ^^^^
39+ LL |
40+ LL | struct S4 {
41+ | ^^
42+ |
43+ = note: `#[derive(From)]` can only be used on structs with exactly one field
2744
28- error: `#[derive(From)]` can only be used on structs with a single field
29- --> $DIR/deriving-from-wrong-target.rs:27:1
45+ error: `#[derive(From)]` used on an enum
46+ --> $DIR/deriving-from-wrong-target.rs:26:10
3047 |
48+ LL | #[derive(From)]
49+ | ^^^^
50+ LL |
3151LL | enum E1 {}
32- | ^^^^^^^^^^
33-
34- error: `#[derive(From)]` can only be used on structs with a single field
35- --> $DIR/deriving-from-wrong-target.rs:32:1
36- |
37- LL | / enum E2 {
38- LL | | V1,
39- LL | | V2,
40- LL | | }
41- | |_^
42-
43- error: `#[derive(From)]` can only be used on structs with a single field
44- --> $DIR/deriving-from-wrong-target.rs:39:1
45- |
46- LL | / enum E3 {
47- LL | | V1(u32),
48- LL | | V2(bool),
49- LL | | }
50- | |_^
52+ | ^^
53+ |
54+ = note: `#[derive(From)]` can only be used on structs with exactly one field
5155
5256error[E0277]: the size for values of type `T` cannot be known at compilation time
53- --> $DIR/deriving-from-wrong-target.rs:44 :10
57+ --> $DIR/deriving-from-wrong-target.rs:30 :10
5458 |
5559LL | #[derive(From)]
5660 | ^^^^ doesn't have a size known at compile-time
@@ -67,7 +71,7 @@ LL + struct SUnsizedField<T> {
6771 |
6872
6973error[E0277]: the size for values of type `T` cannot be known at compilation time
70- --> $DIR/deriving-from-wrong-target.rs:44 :10
74+ --> $DIR/deriving-from-wrong-target.rs:30 :10
7175 |
7276LL | #[derive(From)]
7377 | ^^^^ doesn't have a size known at compile-time
@@ -76,7 +80,7 @@ LL | struct SUnsizedField<T: ?Sized> {
7680 | - this type parameter needs to be `Sized`
7781 |
7882note: required because it appears within the type `SUnsizedField<T>`
79- --> $DIR/deriving-from-wrong-target.rs:47 :8
83+ --> $DIR/deriving-from-wrong-target.rs:33 :8
8084 |
8185LL | struct SUnsizedField<T: ?Sized> {
8286 | ^^^^^^^^^^^^^
@@ -88,7 +92,7 @@ LL + struct SUnsizedField<T> {
8892 |
8993
9094error[E0277]: the size for values of type `T` cannot be known at compilation time
91- --> $DIR/deriving-from-wrong-target.rs:48 :11
95+ --> $DIR/deriving-from-wrong-target.rs:34 :11
9296 |
9397LL | struct SUnsizedField<T: ?Sized> {
9498 | - this type parameter needs to be `Sized`
@@ -106,6 +110,6 @@ help: function arguments must have a statically known size, borrowed types alway
106110LL | last: &T,
107111 | +
108112
109- error: aborting due to 10 previous errors
113+ error: aborting due to 8 previous errors
110114
111115For more information about this error, try `rustc --explain E0277`.
0 commit comments