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 #120469 - estebank:issue-40120, r=TaKO8Ki
Provide more context on derived obligation error primary label
Expand the primary span of E0277 when the immediate unmet bound is not what the user wrote:
```
error[E0277]: the trait bound `i32: Bar` is not satisfied
--> f100.rs:6:6
|
6 | <i32 as Foo>::foo();
| ^^^ the trait `Bar` is not implemented for `i32`, which is required by `i32: Foo`
|
help: this trait has no implementations, consider adding one
--> f100.rs:2:1
|
2 | trait Bar {}
| ^^^^^^^^^
note: required for `i32` to implement `Foo`
--> f100.rs:3:14
|
3 | impl<T: Bar> Foo for T {}
| --- ^^^ ^
| |
| unsatisfied trait bound introduced here
```
Fix#40120.
Copy file name to clipboardexpand all lines: tests/ui/associated-type-bounds/return-type-notation/basic.without.stderr
+1-1
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ error: future cannot be sent between threads safely
13
13
LL | is_send(foo::<T>());
14
14
| ^^^^^^^^^^ future returned by `foo` is not `Send`
15
15
|
16
-
= help: within `impl Future<Output = Result<(), ()>>`, the trait `Send` is not implemented for `impl Future<Output = Result<(), ()>> { <T as Foo>::method() }`
16
+
= help: within `impl Future<Output = Result<(), ()>>`, the trait `Send` is not implemented for `impl Future<Output = Result<(), ()>> { <T as Foo>::method() }`, which is required by `impl Future<Output = Result<(), ()>>: Send`
17
17
note: future is not `Send` as it awaits another future which is not `Send`
| ^^^ the trait `Clone` is not implemented for `str`
5
+
| ^^^ the trait `Clone` is not implemented for `str`, which is required by `for<'b> <<Vec<T> as Cycle>::Next as X<'b, <Vec<T> as Cycle>::Next>>::U: Clone`
6
6
|
7
7
= help: the trait `Clone` is implemented for `String`
8
8
note: required by a bound in `X`
@@ -18,7 +18,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
| ^^^ the trait `Clone` is not implemented for `str`
21
+
| ^^^ the trait `Clone` is not implemented for `str`, which is required by `for<'b> <<Box<T> as Cycle>::Next as X<'b, <Box<T> as Cycle>::Next>>::U: Clone`
22
22
|
23
23
= help: the trait `Clone` is implemented for `String`
Copy file name to clipboardexpand all lines: tests/ui/associated-types/issue-38821.stderr
+16-16
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
2
2
--> $DIR/issue-38821.rs:23:17
3
3
|
4
4
LL | #[derive(Debug, Copy, Clone)]
5
-
| ^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
5
+
| ^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
6
6
|
7
7
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
8
8
--> $DIR/issue-38821.rs:9:18
@@ -21,7 +21,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
21
21
--> $DIR/issue-38821.rs:38:1
22
22
|
23
23
LL | pub enum ColumnInsertValue<Col, Expr> where
24
-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
24
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
25
25
|
26
26
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
27
27
--> $DIR/issue-38821.rs:9:18
@@ -45,7 +45,7 @@ LL | | Col: Column,
45
45
... |
46
46
LL | | Default(Col),
47
47
LL | | }
48
-
| |_^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
48
+
| |_^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
49
49
|
50
50
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
51
51
--> $DIR/issue-38821.rs:9:18
@@ -63,7 +63,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
63
63
--> $DIR/issue-38821.rs:23:10
64
64
|
65
65
LL | #[derive(Debug, Copy, Clone)]
66
-
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
66
+
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
67
67
|
68
68
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
69
69
--> $DIR/issue-38821.rs:9:18
@@ -82,7 +82,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
82
82
--> $DIR/issue-38821.rs:23:10
83
83
|
84
84
LL | #[derive(Debug, Copy, Clone)]
85
-
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
85
+
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
86
86
|
87
87
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
88
88
--> $DIR/issue-38821.rs:9:18
@@ -102,7 +102,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
102
102
--> $DIR/issue-38821.rs:23:10
103
103
|
104
104
LL | #[derive(Debug, Copy, Clone)]
105
-
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
105
+
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
106
106
|
107
107
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
108
108
--> $DIR/issue-38821.rs:9:18
@@ -117,7 +117,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
117
117
--> $DIR/issue-38821.rs:23:10
118
118
|
119
119
LL | #[derive(Debug, Copy, Clone)]
120
-
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
120
+
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
121
121
|
122
122
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
123
123
--> $DIR/issue-38821.rs:9:18
@@ -133,7 +133,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
133
133
--> $DIR/issue-38821.rs:23:17
134
134
|
135
135
LL | #[derive(Debug, Copy, Clone)]
136
-
| ^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
136
+
| ^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
137
137
|
138
138
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
139
139
--> $DIR/issue-38821.rs:9:18
@@ -153,7 +153,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
153
153
--> $DIR/issue-38821.rs:23:23
154
154
|
155
155
LL | #[derive(Debug, Copy, Clone)]
156
-
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
156
+
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
157
157
|
158
158
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
159
159
--> $DIR/issue-38821.rs:9:18
@@ -172,7 +172,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
172
172
--> $DIR/issue-38821.rs:23:23
173
173
|
174
174
LL | #[derive(Debug, Copy, Clone)]
175
-
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
175
+
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
176
176
|
177
177
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
178
178
--> $DIR/issue-38821.rs:9:18
@@ -192,7 +192,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
192
192
--> $DIR/issue-38821.rs:23:23
193
193
|
194
194
LL | #[derive(Debug, Copy, Clone)]
195
-
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
195
+
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
196
196
|
197
197
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
198
198
--> $DIR/issue-38821.rs:9:18
@@ -207,7 +207,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
207
207
--> $DIR/issue-38821.rs:23:23
208
208
|
209
209
LL | #[derive(Debug, Copy, Clone)]
210
-
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
210
+
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
211
211
|
212
212
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
213
213
--> $DIR/issue-38821.rs:9:18
@@ -223,7 +223,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
223
223
--> $DIR/issue-38821.rs:23:10
224
224
|
225
225
LL | #[derive(Debug, Copy, Clone)]
226
-
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
226
+
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
227
227
|
228
228
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
229
229
--> $DIR/issue-38821.rs:9:18
@@ -239,7 +239,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
239
239
--> $DIR/issue-38821.rs:23:10
240
240
|
241
241
LL | #[derive(Debug, Copy, Clone)]
242
-
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
242
+
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
243
243
|
244
244
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
245
245
--> $DIR/issue-38821.rs:9:18
@@ -255,7 +255,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
255
255
--> $DIR/issue-38821.rs:23:23
256
256
|
257
257
LL | #[derive(Debug, Copy, Clone)]
258
-
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
258
+
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
259
259
|
260
260
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
261
261
--> $DIR/issue-38821.rs:9:18
@@ -271,7 +271,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
271
271
--> $DIR/issue-38821.rs:23:23
272
272
|
273
273
LL | #[derive(Debug, Copy, Clone)]
274
-
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
274
+
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
275
275
|
276
276
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
0 commit comments