mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
remove useless conversions
This commit is contained in:
parent
cc80c5bd07
commit
efd2c20e96
17 changed files with 26 additions and 38 deletions
|
@ -25,7 +25,6 @@ fn eval_goal(ra_fixture: &str) -> Result<ComputedExpr, ConstEvalError> {
|
|||
let scope = &def_map[module_id.local_id].scope;
|
||||
let const_id = scope
|
||||
.declarations()
|
||||
.into_iter()
|
||||
.find_map(|x| match x {
|
||||
hir_def::ModuleDefId::ConstId(x) => {
|
||||
if db.const_data(x).name.as_ref()?.to_string() == "GOAL" {
|
||||
|
|
|
@ -960,7 +960,7 @@ impl<'a> InferenceContext<'a> {
|
|||
Expr::RecordLit { path, fields, .. } => {
|
||||
let subs = fields.iter().map(|f| (f.name.clone(), f.expr));
|
||||
|
||||
self.infer_record_pat_like(path.as_deref(), &rhs_ty, (), lhs.into(), subs)
|
||||
self.infer_record_pat_like(path.as_deref(), &rhs_ty, (), lhs, subs)
|
||||
}
|
||||
Expr::Underscore => rhs_ty.clone(),
|
||||
_ => {
|
||||
|
|
|
@ -220,7 +220,7 @@ impl<'a> InferenceContext<'a> {
|
|||
),
|
||||
Pat::Record { path: p, args: fields, ellipsis: _ } => {
|
||||
let subs = fields.iter().map(|f| (f.name.clone(), f.pat));
|
||||
self.infer_record_pat_like(p.as_deref(), &expected, default_bm, pat.into(), subs)
|
||||
self.infer_record_pat_like(p.as_deref(), &expected, default_bm, pat, subs)
|
||||
}
|
||||
Pat::Path(path) => {
|
||||
// FIXME use correct resolver for the surrounding expression
|
||||
|
|
|
@ -29,7 +29,6 @@ fn eval_goal(ra_fixture: &str, minicore: &str) -> Result<Layout, LayoutError> {
|
|||
let scope = &def_map[module_id.local_id].scope;
|
||||
let adt_id = scope
|
||||
.declarations()
|
||||
.into_iter()
|
||||
.find_map(|x| match x {
|
||||
hir_def::ModuleDefId::AdtId(x) => {
|
||||
let name = match x {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue