canonicalize float var as float in new solver

This commit is contained in:
Michael Goulet 2023-03-30 01:10:48 +00:00
parent 2fb0e8d162
commit 977694aaec
2 changed files with 9 additions and 1 deletions

View file

@ -291,7 +291,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'_, 'tcx> {
if nt != t {
return self.fold_ty(nt);
} else {
CanonicalVarKind::Ty(CanonicalTyVarKind::Int)
CanonicalVarKind::Ty(CanonicalTyVarKind::Float)
}
}
ty::Infer(ty::FreshTy(_) | ty::FreshIntTy(_) | ty::FreshFloatTy(_)) => {

View file

@ -0,0 +1,8 @@
// compile-flags: -Ztrait-solver=next
// check-pass
fn foo(x: f64) {
let y = x + 1.0;
}
fn main() {}