Skip to content

Commit 1225a65

Browse files
drive-by: Fix path spans
1 parent ae60015 commit 1225a65

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2302,7 +2302,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
23022302
)
23032303
};
23042304
let mut suggestions = vec![(
2305-
trait_path_segment.ident.span.shrink_to_lo(),
2305+
path.span.shrink_to_lo(),
23062306
format!("<{} as ", self.tcx.type_of(impl_def_id))
23072307
)];
23082308
if let Some(generic_arg) = trait_path_segment.args {

src/test/ui/error-codes/E0790.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ LL | inner::MyTrait::my_fn();
3737
|
3838
help: use the fully-qualified path to the only available implementation
3939
|
40-
LL | inner::<MyStruct as MyTrait>::my_fn();
41-
| ++++++++++++ +
40+
LL | <MyStruct as inner::MyTrait>::my_fn();
41+
| ++++++++++++ +
4242

4343
error[E0790]: cannot refer to the associated constant on trait without specifying the corresponding `impl` type
4444
--> $DIR/E0790.rs:30:13
@@ -51,8 +51,8 @@ LL | let _ = inner::MyTrait::MY_ASSOC_CONST;
5151
|
5252
help: use the fully-qualified path to the only available implementation
5353
|
54-
LL | let _ = inner::<MyStruct as MyTrait>::MY_ASSOC_CONST;
55-
| ++++++++++++ +
54+
LL | let _ = <MyStruct as inner::MyTrait>::MY_ASSOC_CONST;
55+
| ++++++++++++ +
5656

5757
error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
5858
--> $DIR/E0790.rs:50:5

src/test/ui/traits/static-method-generic-inference.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ LL | let _f: base::Foo = base::HasNew::new();
99
|
1010
help: use the fully-qualified path to the only available implementation
1111
|
12-
LL | let _f: base::Foo = base::<Foo as HasNew>::new();
13-
| +++++++ +
12+
LL | let _f: base::Foo = <Foo as base::HasNew>::new();
13+
| +++++++ +
1414

1515
error: aborting due to previous error
1616

0 commit comments

Comments
 (0)