mir: preserve ident span
Preserve the span of identifiers when lowering to MIR rvalues. Until now
the resulting `Var` or `Port` MIR node would point to the declaration
with its span, rather than the identifier which was used to refer to it.
This results in confusing error messages.
@@ -125,7 +125,7 @@ fn try_lower_expr<'gcx>(
| HirNode::Port(..)
| HirNode::EnumVariant(..)
| HirNode::ValueParam(..)
- | HirNode::GenvarDecl(..) => Ok(lower_expr(cx, binding, env)),
+ | HirNode::GenvarDecl(..) => try_lower_expr(builder, binding),
x => {
builder.cx.emit(
DiagBuilder2::error(format!(
