You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of rust-lang#90519 - estebank:issue-84003, r=petrochenkov
Keep spans for generics in `#[derive(_)]` desugaring
Keep the spans for generics coming from a `derive`d Item, so that errors
and suggestions have better detail.
Fixrust-lang#84003.
LL | struct Bar<T, N>(T, N, NotDefined, <i32 as Iterator>::Item, Vec<i32>, String);
46
+
| +++
47
+
48
+
error[E0412]: cannot find type `NotDefined` in this scope
49
+
--> $DIR/issue-50480.rs:12:21
50
+
|
51
+
LL | struct Bar<T>(T, N, NotDefined, <i32 as Iterator>::Item, Vec<i32>, String);
52
+
| ^^^^^^^^^^ not found in this scope
12
53
13
54
error[E0277]: `i32` is not an iterator
14
-
--> $DIR/issue-50480.rs:3:24
55
+
--> $DIR/issue-50480.rs:3:27
15
56
|
16
-
LL | struct Foo(NotDefined, <i32 as Iterator>::Item, Vec<i32>, String);
17
-
| ^^^^^^^^^^^^^^^^^^^^^^^ `i32` is not an iterator
57
+
LL | struct Foo(N, NotDefined, <i32 as Iterator>::Item, Vec<i32>, String);
58
+
| ^^^^^^^^^^^^^^^^^^^^^^^ `i32` is not an iterator
18
59
|
19
60
= help: the trait `Iterator` is not implemented for `i32`
20
61
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
@@ -25,14 +66,36 @@ error[E0204]: the trait `Copy` may not be implemented for this type
25
66
LL | #[derive(Clone, Copy)]
26
67
| ^^^^
27
68
LL |
28
-
LL | struct Foo(NotDefined, <i32 as Iterator>::Item, Vec<i32>, String);
29
-
| -------- ------ this field does not implement `Copy`
30
-
| |
31
-
| this field does not implement `Copy`
69
+
LL | struct Foo(N, NotDefined, <i32 as Iterator>::Item, Vec<i32>, String);
70
+
| -------- ------ this field does not implement `Copy`
71
+
| |
72
+
| this field does not implement `Copy`
73
+
|
74
+
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
75
+
76
+
error[E0277]: `i32` is not an iterator
77
+
--> $DIR/issue-50480.rs:12:33
78
+
|
79
+
LL | struct Bar<T>(T, N, NotDefined, <i32 as Iterator>::Item, Vec<i32>, String);
80
+
| ^^^^^^^^^^^^^^^^^^^^^^^ `i32` is not an iterator
81
+
|
82
+
= help: the trait `Iterator` is not implemented for `i32`
83
+
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
84
+
85
+
error[E0204]: the trait `Copy` may not be implemented for this type
86
+
--> $DIR/issue-50480.rs:10:17
87
+
|
88
+
LL | #[derive(Clone, Copy)]
89
+
| ^^^^
90
+
LL |
91
+
LL | struct Bar<T>(T, N, NotDefined, <i32 as Iterator>::Item, Vec<i32>, String);
92
+
| -------- ------ this field does not implement `Copy`
93
+
| |
94
+
| this field does not implement `Copy`
32
95
|
33
96
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
34
97
35
-
error: aborting due to 4 previous errors
98
+
error: aborting due to 10 previous errors
36
99
37
100
Some errors have detailed explanations: E0204, E0277, E0412.
38
101
For more information about an error, try `rustc --explain E0204`.
0 commit comments