diff --git a/src/librustc_typeck/check/cast.rs b/src/librustc_typeck/check/cast.rs index 981e6d2c47eef..fed9755bc3b24 100644 --- a/src/librustc_typeck/check/cast.rs +++ b/src/librustc_typeck/check/cast.rs @@ -613,6 +613,7 @@ impl<'a, 'tcx> CastCheck<'tcx> { (Int(CEnum), Int(_)) => Ok(CastKind::EnumCast), (Int(Char) | Int(Bool), Int(_)) => Ok(CastKind::PrimIntCast), + (Float, Int(_)) if std::env::var_os("RUSTC_BOOTSTRAP").is_none() => Err(CastError::IllegalCast), (Int(_) | Float, Int(_) | Float) => Ok(CastKind::NumericCast), } }