diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-04-03 00:32:00 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-03 00:32:00 +0200 |
| commit | 1eabbd024c0e49d8ca66c804f502c65cbad90ced (patch) | |
| tree | 04acfbfa5c0af0d21c6742ee7019398c57c211c6 /src/librustc_codegen_llvm | |
| parent | 537ccdf3ac44c8c7a8d36cbdbe6fb224afabb7ae (diff) | |
| parent | 56147219a552b8383e66f9e3e8f0c92ea332aaf4 (diff) | |
Rollup merge of #70487 - Mark-Simulacrum:float-unchecked-casts, r=SimonSapin
Stabilize float::to_int_unchecked This renames and stabilizes unsafe floating point to integer casts, which are intended to be the substitute for the currently unsound `as` behavior, once that changes to safe-but-slower saturating casts. As such, I believe this also likely unblocks #10184 (our oldest I-unsound issue!), as once this rolls out to stable it would be far easier IMO to change the behavior of `as` to be safe by default. This does not stabilize the trait or the associated method, as they are deemed internal implementation details (and consumers should not, generally, want to expose them, as in practice all callers likely know statically/without generics what the return type is). Closes #67058
Diffstat (limited to 'src/librustc_codegen_llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/intrinsic.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_codegen_llvm/intrinsic.rs b/src/librustc_codegen_llvm/intrinsic.rs index bc7a9c566b4..5734eae7d59 100644 --- a/src/librustc_codegen_llvm/intrinsic.rs +++ b/src/librustc_codegen_llvm/intrinsic.rs @@ -543,13 +543,13 @@ impl IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> { } } - "float_to_int_approx_unchecked" => { + "float_to_int_unchecked" => { if float_type_width(arg_tys[0]).is_none() { span_invalid_monomorphization_error( tcx.sess, span, &format!( - "invalid monomorphization of `float_to_int_approx_unchecked` \ + "invalid monomorphization of `float_to_int_unchecked` \ intrinsic: expected basic float type, \ found `{}`", arg_tys[0] @@ -570,7 +570,7 @@ impl IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> { tcx.sess, span, &format!( - "invalid monomorphization of `float_to_int_approx_unchecked` \ + "invalid monomorphization of `float_to_int_unchecked` \ intrinsic: expected basic integer type, \ found `{}`", ret_ty |
