Rollup merge of #98782 - compiler-errors:specialization-error-span, r=oli-obk

Improve spans for specialization error

Fixes #98777
This commit is contained in:
Matthias Krüger 2022-07-04 23:11:09 +02:00 committed by GitHub
commit da630de3bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 18 deletions

View file

@ -1,8 +1,8 @@
error: cannot specialize on `Binder(ProjectionPredicate(ProjectionTy { substs: [V], item_def_id: DefId(0:6 ~ repeated_projection_type[54ea]::Id::This) }, Ty((I,))), [])`
--> $DIR/repeated_projection_type.rs:19:1
error: cannot specialize on associated type `<V as Id>::This == (I,)`
--> $DIR/repeated_projection_type.rs:19:15
|
LL | impl<I, V: Id<This = (I,)>> X for V {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^
error: aborting due to previous error

View file

@ -1,8 +1,8 @@
error: cannot specialize on trait `HasMethod`
--> $DIR/spec-marker-supertraits.rs:22:1
--> $DIR/spec-marker-supertraits.rs:22:9
|
LL | impl<T: Marker> Spec for T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: aborting due to previous error

View file

@ -1,8 +1,8 @@
error: cannot specialize on trait `Default`
--> $DIR/specialization_super_trait.rs:13:1
--> $DIR/specialization_super_trait.rs:13:9
|
LL | impl<T: Default> SpecMarker for T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^
error: aborting due to previous error

View file

@ -11,10 +11,10 @@ LL | impl<T> SpecMarker for (T, T) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: cannot specialize on trait `Clone`
--> $DIR/specialization_trait.rs:21:1
--> $DIR/specialization_trait.rs:21:9
|
LL | impl<T: Clone> SpecMarker for [T] {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^
error: aborting due to 3 previous errors

View file

@ -1,8 +1,8 @@
error: cannot specialize on trait `SpecMarker`
--> $DIR/specialize_on_trait.rs:15:1
--> $DIR/specialize_on_trait.rs:15:9
|
LL | impl<T: SpecMarker> X for T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^
error: aborting due to previous error