mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Give TypeInfo fields and methods more appropriate names
This commit is contained in:
parent
8afa2722b2
commit
b96f1adf5c
30 changed files with 76 additions and 74 deletions
|
@ -345,7 +345,7 @@ impl FlowKind {
|
|||
FlowKind::Return(Some(expr))
|
||||
| FlowKind::Break(Some(expr))
|
||||
| FlowKind::TryReturn { expr, .. } => {
|
||||
ctx.sema.type_of_expr(expr).map(TypeInfo::coerced)
|
||||
ctx.sema.type_of_expr(expr).map(TypeInfo::adjusted)
|
||||
}
|
||||
FlowKind::Try { .. } => {
|
||||
stdx::never!("try does not have defined expr_ty");
|
||||
|
@ -852,7 +852,7 @@ fn either_syntax(value: &Either<ast::IdentPat, ast::SelfParam>) -> &SyntaxNode {
|
|||
|
||||
fn body_return_ty(ctx: &AssistContext, body: &FunctionBody) -> Option<RetType> {
|
||||
match body.tail_expr() {
|
||||
Some(expr) => ctx.sema.type_of_expr(&expr).map(TypeInfo::ty).map(RetType::Expr),
|
||||
Some(expr) => ctx.sema.type_of_expr(&expr).map(TypeInfo::original).map(RetType::Expr),
|
||||
None => Some(RetType::Stmt),
|
||||
}
|
||||
}
|
||||
|
@ -949,7 +949,7 @@ fn expr_err_kind(expr: &ast::Expr, ctx: &AssistContext) -> Option<TryKind> {
|
|||
let text = func_name.syntax().text();
|
||||
|
||||
if text == "Err" {
|
||||
Some(TryKind::Result { ty: ctx.sema.type_of_expr(expr).map(TypeInfo::ty)? })
|
||||
Some(TryKind::Result { ty: ctx.sema.type_of_expr(expr).map(TypeInfo::original)? })
|
||||
} else if text == "None" {
|
||||
Some(TryKind::Option)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue