Skip to content

Commit 2aabb0f

Browse files
Point at impl self type for impl wf obligations
1 parent d76e168 commit 2aabb0f

31 files changed

+97
-97
lines changed

compiler/rustc_hir_analysis/src/check/wfcheck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,7 @@ fn check_impl<'tcx>(
12721272
wfcx.param_env,
12731273
wfcx.body_id,
12741274
&trait_pred,
1275-
ast_trait_ref.path.span,
1275+
ast_self_ty.span,
12761276
item,
12771277
);
12781278
debug!(?obligations);

tests/ui/associated-types/hr-associated-type-bound-param-6.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0277]: the trait bound `for<'b> T: X<'b, T>` is not satisfied
2-
--> $DIR/hr-associated-type-bound-param-6.rs:12:12
2+
--> $DIR/hr-associated-type-bound-param-6.rs:12:25
33
|
44
LL | impl<S, T> X<'_, T> for (S,) {
5-
| ^^^^^^^^ the trait `for<'b> X<'b, T>` is not implemented for `T`
5+
| ^^^^ the trait `for<'b> X<'b, T>` is not implemented for `T`
66
|
77
help: consider restricting type parameter `T`
88
|

tests/ui/associated-types/hr-associated-type-projection-1.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0271]: type mismatch resolving `<T as Deref>::Target == T`
2-
--> $DIR/hr-associated-type-projection-1.rs:13:33
2+
--> $DIR/hr-associated-type-projection-1.rs:13:55
33
|
44
LL | impl<T: Copy + std::ops::Deref> UnsafeCopy<'_, T> for T {
5-
| - this type parameter ^^^^^^^^^^^^^^^^^ expected type parameter `T`, found associated type
5+
| - this type parameter ^ expected type parameter `T`, found associated type
66
|
77
= note: expected type parameter `T`
88
found associated type `<T as Deref>::Target`

tests/ui/builtin-superkinds/builtin-superkinds-double-superkind.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0277]: `T` cannot be sent between threads safely
2-
--> $DIR/builtin-superkinds-double-superkind.rs:6:24
2+
--> $DIR/builtin-superkinds-double-superkind.rs:6:32
33
|
44
LL | impl <T: Sync+'static> Foo for (T,) { }
5-
| ^^^ `T` cannot be sent between threads safely
5+
| ^^^^ `T` cannot be sent between threads safely
66
|
77
= note: required because it appears within the type `(T,)`
88
note: required by a bound in `Foo`
@@ -16,10 +16,10 @@ LL | impl <T: Sync+'static + std::marker::Send> Foo for (T,) { }
1616
| +++++++++++++++++++
1717

1818
error[E0277]: `T` cannot be shared between threads safely
19-
--> $DIR/builtin-superkinds-double-superkind.rs:9:16
19+
--> $DIR/builtin-superkinds-double-superkind.rs:9:24
2020
|
2121
LL | impl <T: Send> Foo for (T,T) { }
22-
| ^^^ `T` cannot be shared between threads safely
22+
| ^^^^^ `T` cannot be shared between threads safely
2323
|
2424
= note: required because it appears within the type `(T, T)`
2525
note: required by a bound in `Foo`

tests/ui/builtin-superkinds/builtin-superkinds-in-metadata.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0277]: `T` cannot be sent between threads safely
2-
--> $DIR/builtin-superkinds-in-metadata.rs:13:23
2+
--> $DIR/builtin-superkinds-in-metadata.rs:13:56
33
|
44
LL | impl <T:Sync+'static> RequiresRequiresShareAndSend for X<T> { }
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `T` cannot be sent between threads safely
5+
| ^^^^ `T` cannot be sent between threads safely
66
|
77
note: required because it appears within the type `X<T>`
88
--> $DIR/builtin-superkinds-in-metadata.rs:9:8

tests/ui/builtin-superkinds/builtin-superkinds-self-type.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0310]: the parameter type `T` may not live long enough
2-
--> $DIR/builtin-superkinds-self-type.rs:10:16
2+
--> $DIR/builtin-superkinds-self-type.rs:10:24
33
|
44
LL | impl <T: Sync> Foo for T { }
5-
| ^^^ ...so that the type `T` will meet its required lifetime bounds...
5+
| ^ ...so that the type `T` will meet its required lifetime bounds...
66
|
77
note: ...that is required by this bound
88
--> $DIR/builtin-superkinds-self-type.rs:6:24

tests/ui/builtin-superkinds/builtin-superkinds-simple.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0277]: `Rc<i8>` cannot be sent between threads safely
2-
--> $DIR/builtin-superkinds-simple.rs:6:6
2+
--> $DIR/builtin-superkinds-simple.rs:6:14
33
|
44
LL | impl Foo for std::rc::Rc<i8> { }
5-
| ^^^ `Rc<i8>` cannot be sent between threads safely
5+
| ^^^^^^^^^^^^^^^ `Rc<i8>` cannot be sent between threads safely
66
|
77
= help: the trait `Send` is not implemented for `Rc<i8>`
88
note: required by a bound in `Foo`

tests/ui/builtin-superkinds/builtin-superkinds-typaram-not-send.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0277]: `T` cannot be sent between threads safely
2-
--> $DIR/builtin-superkinds-typaram-not-send.rs:5:24
2+
--> $DIR/builtin-superkinds-typaram-not-send.rs:5:32
33
|
44
LL | impl <T: Sync+'static> Foo for T { }
5-
| ^^^ `T` cannot be sent between threads safely
5+
| ^ `T` cannot be sent between threads safely
66
|
77
note: required by a bound in `Foo`
88
--> $DIR/builtin-superkinds-typaram-not-send.rs:3:13

tests/ui/chalkify/impl_wf.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0277]: the size for values of type `str` cannot be known at compilation time
2-
--> $DIR/impl_wf.rs:11:6
2+
--> $DIR/impl_wf.rs:11:14
33
|
44
LL | impl Foo for str { }
5-
| ^^^ doesn't have a size known at compile-time
5+
| ^^^ doesn't have a size known at compile-time
66
|
77
= help: the trait `Sized` is not implemented for `str`
88
note: required by a bound in `Foo`
@@ -12,10 +12,10 @@ LL | trait Foo: Sized { }
1212
| ^^^^^ required by this bound in `Foo`
1313

1414
error[E0277]: the trait bound `f32: Foo` is not satisfied
15-
--> $DIR/impl_wf.rs:22:6
15+
--> $DIR/impl_wf.rs:22:19
1616
|
1717
LL | impl Baz<f32> for f32 { }
18-
| ^^^^^^^^ the trait `Foo` is not implemented for `f32`
18+
| ^^^ the trait `Foo` is not implemented for `f32`
1919
|
2020
= help: the trait `Foo` is implemented for `i32`
2121
note: required by a bound in `Baz`

tests/ui/coherence/coherence-overlap-trait-alias.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0283]: type annotations needed: cannot satisfy `u32: C`
2-
--> $DIR/coherence-overlap-trait-alias.rs:15:6
2+
--> $DIR/coherence-overlap-trait-alias.rs:15:12
33
|
44
LL | impl C for u32 {}
5-
| ^
5+
| ^^^
66
|
77
note: multiple `impl`s satisfying `u32: C` found
88
--> $DIR/coherence-overlap-trait-alias.rs:14:1

0 commit comments

Comments
 (0)