1
Fork 0

drive-by: Fix path spans

This commit is contained in:
Michael Goulet 2022-11-12 20:03:20 +00:00
parent ae60015e76
commit 1225a65389
3 changed files with 7 additions and 7 deletions

View file

@ -2302,7 +2302,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
) )
}; };
let mut suggestions = vec![( let mut suggestions = vec![(
trait_path_segment.ident.span.shrink_to_lo(), path.span.shrink_to_lo(),
format!("<{} as ", self.tcx.type_of(impl_def_id)) format!("<{} as ", self.tcx.type_of(impl_def_id))
)]; )];
if let Some(generic_arg) = trait_path_segment.args { if let Some(generic_arg) = trait_path_segment.args {

View file

@ -37,7 +37,7 @@ LL | inner::MyTrait::my_fn();
| |
help: use the fully-qualified path to the only available implementation help: use the fully-qualified path to the only available implementation
| |
LL | inner::<MyStruct as MyTrait>::my_fn(); LL | <MyStruct as inner::MyTrait>::my_fn();
| ++++++++++++ + | ++++++++++++ +
error[E0790]: cannot refer to the associated constant on trait without specifying the corresponding `impl` type error[E0790]: cannot refer to the associated constant on trait without specifying the corresponding `impl` type
@ -51,7 +51,7 @@ LL | let _ = inner::MyTrait::MY_ASSOC_CONST;
| |
help: use the fully-qualified path to the only available implementation help: use the fully-qualified path to the only available implementation
| |
LL | let _ = inner::<MyStruct as MyTrait>::MY_ASSOC_CONST; LL | let _ = <MyStruct as inner::MyTrait>::MY_ASSOC_CONST;
| ++++++++++++ + | ++++++++++++ +
error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type

View file

@ -9,7 +9,7 @@ LL | let _f: base::Foo = base::HasNew::new();
| |
help: use the fully-qualified path to the only available implementation help: use the fully-qualified path to the only available implementation
| |
LL | let _f: base::Foo = base::<Foo as HasNew>::new(); LL | let _f: base::Foo = <Foo as base::HasNew>::new();
| +++++++ + | +++++++ +
error: aborting due to previous error error: aborting due to previous error