delay bug instead of skipping check_expr
This commit is contained in:
parent
6d7684101a
commit
8af683de34
6 changed files with 50 additions and 11 deletions
|
@ -315,11 +315,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
}
|
||||
// FIXME: currently we never try to compose autoderefs
|
||||
// and ReifyFnPointer/UnsafeFnPointer, but we could.
|
||||
_ => bug!(
|
||||
"while adjusting {:?}, can't compose {:?} and {:?}",
|
||||
expr,
|
||||
entry.get(),
|
||||
adj
|
||||
_ => self.tcx.sess.delay_span_bug(
|
||||
expr.span,
|
||||
&format!(
|
||||
"while adjusting {:?}, can't compose {:?} and {:?}",
|
||||
expr,
|
||||
entry.get(),
|
||||
adj
|
||||
),
|
||||
),
|
||||
};
|
||||
*entry.get_mut() = adj;
|
||||
|
|
|
@ -234,11 +234,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
// This is more complicated than just checking type equality, as arguments could be coerced
|
||||
// This version writes those types back so further type checking uses the narrowed types
|
||||
let demand_compatible = |idx, final_arg_types: &mut Vec<Option<(Ty<'tcx>, Ty<'tcx>)>>| {
|
||||
// Do not check argument compatibility if the number of args do not match
|
||||
if arg_count_error.is_some() {
|
||||
return;
|
||||
}
|
||||
|
||||
let formal_input_ty: Ty<'tcx> = formal_input_tys[idx];
|
||||
let expected_input_ty: Ty<'tcx> = expected_input_tys[idx];
|
||||
let provided_arg = &provided_args[idx];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue