Skip to content

Commit

Permalink
drive-by: Fix path spans
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Dec 14, 2022
1 parent ae60015 commit 1225a65
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2302,7 +2302,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
)
};
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 {
Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/error-codes/E0790.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/traits/static-method-generic-inference.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1225a65

Please sign in to comment.