use more accurate spans for user type ascriptions

This commit is contained in:
Lukas Markeffsky
2024-09-10 18:47:10 +02:00
parent b52dea8230
commit d1e82d438f
13 changed files with 52 additions and 38 deletions

View File

@@ -453,12 +453,14 @@ pub enum ExprKind<'tcx> {
source: ExprId,
/// Type that the user gave to this expression
user_ty: UserTy<'tcx>,
user_ty_span: Span,
},
/// A type ascription on a value, e.g. `42: i32`.
/// A type ascription on a value, e.g. `type_ascribe!(42, i32)` or `42 as i32`.
ValueTypeAscription {
source: ExprId,
/// Type that the user gave to this expression
user_ty: UserTy<'tcx>,
user_ty_span: Span,
},
/// A closure definition.
Closure(Box<ClosureExpr<'tcx>>),