Fix impl Trait suggestion
This commit is contained in:
parent
50eefc0d77
commit
f36c643d4f
2 changed files with 3 additions and 7 deletions
|
@ -777,7 +777,7 @@ fn compare_synthetic_generics<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||||
let new_generics_span = tcx
|
let new_generics_span = tcx
|
||||||
.sess
|
.sess
|
||||||
.codemap()
|
.codemap()
|
||||||
.generate_fn_name_span(impl_m.span)?
|
.generate_fn_name_span(impl_span)?
|
||||||
.shrink_to_hi();
|
.shrink_to_hi();
|
||||||
// in case there are generics, just replace them
|
// in case there are generics, just replace them
|
||||||
let generics_span = impl_m
|
let generics_span = impl_m
|
||||||
|
|
|
@ -21,12 +21,8 @@ LL | fn bar(&self, _: &impl Debug) { }
|
||||||
| ^^^^^^^^^^ expected generic parameter, found `impl Trait`
|
| ^^^^^^^^^^ expected generic parameter, found `impl Trait`
|
||||||
help: try changing the `impl Trait` argument to a generic parameter
|
help: try changing the `impl Trait` argument to a generic parameter
|
||||||
|
|
|
|
||||||
LL | fn bar<U: Debug><U: Debug>(&self, _: &U);
|
LL | fn bar<U: Debug>(&self, _: &U) { }
|
||||||
LL | }
|
| ^^^^^^^^^^ ^
|
||||||
LL |
|
|
||||||
LL | impl Bar for () {
|
|
||||||
LL | fn bar(&self, _: &U) { }
|
|
||||||
|
|
|
||||||
|
|
||||||
error[E0643]: method `hash` has incompatible signature for trait
|
error[E0643]: method `hash` has incompatible signature for trait
|
||||||
--> $DIR/impl-generic-mismatch.rs:38:33
|
--> $DIR/impl-generic-mismatch.rs:38:33
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue