Rollup merge of #62817 - estebank:variant-sp, r=matthewjasper
Tweak span for variant not found error
This commit is contained in:
commit
24a8065c30
@ -1650,7 +1650,10 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||
Applicability::MaybeIncorrect,
|
||||
);
|
||||
} else {
|
||||
err.span_label(span, format!("variant not found in `{}`", qself_ty));
|
||||
err.span_label(
|
||||
assoc_ident.span,
|
||||
format!("variant not found in `{}`", qself_ty),
|
||||
);
|
||||
}
|
||||
|
||||
if let Some(sp) = tcx.hir().span_if_local(adt_def.did) {
|
||||
|
@ -23,9 +23,7 @@ LL | enum Shape {
|
||||
| ---------- variant `Rombus` not found here
|
||||
...
|
||||
LL | println!("My shape is {:?}", Shape::Rombus{ size: 5});
|
||||
| -------^^^^^^
|
||||
| |
|
||||
| variant not found in `Shape`
|
||||
| ^^^^^^ variant not found in `Shape`
|
||||
|
||||
error[E0599]: no variant or associated item named `Squareee` found for type `Shape` in the current scope
|
||||
--> $DIR/suggest-variants.rs:15:12
|
||||
|
Loading…
Reference in New Issue
Block a user