add test for builtin types N + N unifying with fn call
This commit is contained in:
parent
fd9bb30ab8
commit
8295e4a6cf
4 changed files with 33 additions and 5 deletions
|
@ -267,10 +267,16 @@ impl<'a, 'tcx> AbstractConstBuilder<'a, 'tcx> {
|
|||
|
||||
fn visit_expr(&mut self, expr: &thir::Expr<'tcx>) {
|
||||
self.is_poly |= expr.ty.definitely_has_param_types_or_consts(self.tcx);
|
||||
if self.is_poly {
|
||||
return;
|
||||
if self.is_poly == false {
|
||||
visit::walk_expr(self, expr)
|
||||
}
|
||||
}
|
||||
|
||||
fn visit_pat(&mut self, pat: &thir::Pat<'tcx>) {
|
||||
self.is_poly |= pat.ty.definitely_has_param_types_or_consts(self.tcx);
|
||||
if self.is_poly == false {
|
||||
visit::walk_pat(self, pat);
|
||||
}
|
||||
visit::walk_expr(self, expr);
|
||||
}
|
||||
|
||||
fn visit_const(&mut self, ct: &'tcx ty::Const<'tcx>) {
|
||||
|
@ -280,6 +286,7 @@ impl<'a, 'tcx> AbstractConstBuilder<'a, 'tcx> {
|
|||
|
||||
let mut is_poly_vis = IsThirPolymorphic { is_poly: false, thir: body, tcx };
|
||||
visit::walk_expr(&mut is_poly_vis, &body[body_id]);
|
||||
debug!("AbstractConstBuilder: is_poly={}", is_poly_vis.is_poly);
|
||||
if is_poly_vis.is_poly == false {
|
||||
return Ok(None);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue