canonicalize float var as float in new solver
This commit is contained in:
@@ -291,7 +291,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'_, 'tcx> {
|
|||||||
if nt != t {
|
if nt != t {
|
||||||
return self.fold_ty(nt);
|
return self.fold_ty(nt);
|
||||||
} else {
|
} else {
|
||||||
CanonicalVarKind::Ty(CanonicalTyVarKind::Int)
|
CanonicalVarKind::Ty(CanonicalTyVarKind::Float)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ty::Infer(ty::FreshTy(_) | ty::FreshIntTy(_) | ty::FreshFloatTy(_)) => {
|
ty::Infer(ty::FreshTy(_) | ty::FreshIntTy(_) | ty::FreshFloatTy(_)) => {
|
||||||
|
|||||||
8
tests/ui/traits/new-solver/float-canonical.rs
Normal file
8
tests/ui/traits/new-solver/float-canonical.rs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
// compile-flags: -Ztrait-solver=next
|
||||||
|
// check-pass
|
||||||
|
|
||||||
|
fn foo(x: f64) {
|
||||||
|
let y = x + 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
||||||
Reference in New Issue
Block a user