Fix incorrect suggestion when calling an associated type with a type anchor
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
This commit is contained in:
parent
c9995d2492
commit
1d036f408e
3 changed files with 3 additions and 3 deletions
|
|
@ -724,7 +724,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
{
|
||||
let def_path = tcx.def_path_str(adt_def.did());
|
||||
err.span_suggestion(
|
||||
ty.span.to(item_ident.span),
|
||||
sugg_span,
|
||||
format!("to construct a value of type `{}`, use the explicit path", def_path),
|
||||
def_path,
|
||||
Applicability::MachineApplicable,
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ impl Trait for () {
|
|||
type Assoc = T;
|
||||
|
||||
fn f() {
|
||||
<T();
|
||||
T();
|
||||
//~^ ERROR no associated item named `Assoc` found for unit type `()` in the current scope
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ LL | <Self>::Assoc();
|
|||
help: to construct a value of type `T`, use the explicit path
|
||||
|
|
||||
LL - <Self>::Assoc();
|
||||
LL + <T();
|
||||
LL + T();
|
||||
|
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue