Skip to content

Commit e1f4ddf

Browse files
authored
Rollup merge of #109749 - compiler-errors:new-solver-float-var, r=lcnr
Canonicalize float var as float in new solver Typo in new canonicalizer -- we should be canonicalizing float vars as `CanonicalTyVarKind::Float`, not `CanonicalTyVarKind::Int`. Fixes compiler-errors/next-solver-hir-issues#9
2 parents c1b28c3 + 977694a commit e1f4ddf

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

compiler/rustc_trait_selection/src/solve/canonicalize.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'_, 'tcx> {
291291
if nt != t {
292292
return self.fold_ty(nt);
293293
} else {
294-
CanonicalVarKind::Ty(CanonicalTyVarKind::Int)
294+
CanonicalVarKind::Ty(CanonicalTyVarKind::Float)
295295
}
296296
}
297297
ty::Infer(ty::FreshTy(_) | ty::FreshIntTy(_) | ty::FreshFloatTy(_)) => {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// compile-flags: -Ztrait-solver=next
2+
// check-pass
3+
4+
fn foo(x: f64) {
5+
let y = x + 1.0;
6+
}
7+
8+
fn main() {}

0 commit comments

Comments
 (0)