mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-23 11:58:04 +03:00
Remove redundant error checking around ExprMethodCall
This commit is contained in:
@@ -3551,15 +3551,7 @@ fn check_expr_with_expectation_and_lvalue_pref(&self,
|
||||
ret_ty
|
||||
}
|
||||
hir::ExprMethodCall(name, ref tps, ref args) => {
|
||||
let ty = self.check_method_call(expr, name, &args[..], &tps[..], expected, lvalue_pref);
|
||||
let arg_tys = args.iter().map(|a| self.expr_ty(&a));
|
||||
let args_err = arg_tys.fold(false, |rest_err, a| rest_err || a.references_error());
|
||||
if args_err {
|
||||
self.write_error(id)
|
||||
}
|
||||
else {
|
||||
ty
|
||||
}
|
||||
self.check_method_call(expr, name, &args[..], &tps[..], expected, lvalue_pref)
|
||||
}
|
||||
hir::ExprCast(ref e, ref t) => {
|
||||
if let hir::TyFixedLengthVec(_, ref count_expr) = t.node {
|
||||
|
||||
Reference in New Issue
Block a user