@@ -228,37 +228,14 @@ pub(super) fn underscore(
228228 return None ;
229229 }
230230 let parent = token. parent ( ) ?;
231- let _it = match_ast ! {
231+ match_ast ! {
232232 match parent {
233- ast:: InferType ( it) => it ,
234- ast:: UnderscoreExpr ( it) => return type_info_of ( sema, config, & Either :: Left ( ast:: Expr :: UnderscoreExpr ( it) ) , edition, display_target) ,
235- ast:: WildcardPat ( it) => return type_info_of ( sema, config, & Either :: Right ( ast:: Pat :: WildcardPat ( it) ) , edition, display_target) ,
236- _ => return None ,
233+ ast:: InferType ( it) => type_info ( sema , config , TypeInfo { original : sema . resolve_type ( & ast :: Type :: InferType ( it ) ) ? , adjusted : None } , edition , display_target ) ,
234+ ast:: UnderscoreExpr ( it) => type_info ( sema, config, sema . type_of_expr ( & ast:: Expr :: UnderscoreExpr ( it) ) ? , edition, display_target) ,
235+ ast:: WildcardPat ( it) => type_info ( sema, config, sema . type_of_pat ( & ast:: Pat :: WildcardPat ( it) ) ? , edition, display_target) ,
236+ _ => None ,
237237 }
238- } ;
239- // let it = infer_type.syntax().parent()?;
240- // match_ast! {
241- // match it {
242- // ast::LetStmt(_it) => (),
243- // ast::Param(_it) => (),
244- // ast::RetType(_it) => (),
245- // ast::TypeArg(_it) => (),
246-
247- // ast::CastExpr(_it) => (),
248- // ast::ParenType(_it) => (),
249- // ast::TupleType(_it) => (),
250- // ast::PtrType(_it) => (),
251- // ast::RefType(_it) => (),
252- // ast::ArrayType(_it) => (),
253- // ast::SliceType(_it) => (),
254- // ast::ForType(_it) => (),
255- // _ => return None,
256- // }
257- // }
258-
259- // FIXME: https://github.com/rust-lang/rust-analyzer/issues/11762, this currently always returns Unknown
260- // type_info(sema, config, sema.resolve_type(&ast::Type::InferType(it))?, None)
261- None
238+ }
262239}
263240
264241pub ( super ) fn keyword (
0 commit comments