mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +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
|
@ -153,7 +153,8 @@ impl FunctionBuilder {
|
|||
// type, but that the current state of their code doesn't allow that return type
|
||||
// to be accurately inferred.
|
||||
let (ret_ty, should_render_snippet) = {
|
||||
match ctx.sema.type_of_expr(&ast::Expr::CallExpr(call.clone())).map(TypeInfo::ty) {
|
||||
match ctx.sema.type_of_expr(&ast::Expr::CallExpr(call.clone())).map(TypeInfo::original)
|
||||
{
|
||||
Some(ty) if ty.is_unknown() || ty.is_unit() => (make::ty_unit(), true),
|
||||
Some(ty) => {
|
||||
let rendered = ty.display_source_code(ctx.db(), target_module.into());
|
||||
|
@ -331,7 +332,7 @@ fn fn_arg_type(
|
|||
target_module: hir::Module,
|
||||
fn_arg: &ast::Expr,
|
||||
) -> Option<String> {
|
||||
let ty = ctx.sema.type_of_expr(fn_arg)?.coerced();
|
||||
let ty = ctx.sema.type_of_expr(fn_arg)?.adjusted();
|
||||
if ty.is_unknown() {
|
||||
return None;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue