drive-by: Fix path spans
This commit is contained in:
parent
ae60015e76
commit
1225a65389
@ -2302,7 +2302,7 @@ fn visit_expr(&mut self, ex: &'v hir::Expr<'v>) {
|
||||
)
|
||||
};
|
||||
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))
|
||||
)];
|
||||
if let Some(generic_arg) = trait_path_segment.args {
|
||||
|
@ -37,8 +37,8 @@ LL | inner::MyTrait::my_fn();
|
||||
|
|
||||
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
|
||||
--> $DIR/E0790.rs:30:13
|
||||
@ -51,8 +51,8 @@ LL | let _ = inner::MyTrait::MY_ASSOC_CONST;
|
||||
|
|
||||
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
|
||||
--> $DIR/E0790.rs:50:5
|
||||
|
@ -9,8 +9,8 @@ LL | let _f: base::Foo = base::HasNew::new();
|
||||
|
|
||||
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user