about summary refs log tree commit diff
path: root/src/librustc_interface
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-05-06 16:58:50 +0200
committerGitHub <noreply@github.com>2020-05-06 16:58:50 +0200
commit14d608f1d8a0b84da5f3bccecb3efb3d35f980dc (patch)
treebb359957d2ab7197b0179d8f59310da9c1108520 /src/librustc_interface
parent339f574809bf8e4166b8de3cdbe7df181d37af3d (diff)
parentf63b8bffefb0f652dc164859f4c8a10329c9117a (diff)
downloadrust-14d608f1d8a0b84da5f3bccecb3efb3d35f980dc.tar.gz
rust-14d608f1d8a0b84da5f3bccecb3efb3d35f980dc.zip
Rollup merge of #71269 - Mark-Simulacrum:sat-float-casts, r=nikic
Define UB in float-to-int casts to saturate

This closes #10184 by defining the behavior there to saturate infinities and values exceeding the integral range (on the lower or upper end). `NaN` is sent to zero.
Diffstat (limited to 'src/librustc_interface')
-rw-r--r--src/librustc_interface/tests.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_interface/tests.rs b/src/librustc_interface/tests.rs
index f600b1dbf54..1c20ea9e824 100644
--- a/src/librustc_interface/tests.rs
+++ b/src/librustc_interface/tests.rs
@@ -559,7 +559,7 @@ fn test_debugging_options_tracking_hash() {
     tracked!(sanitizer, Some(Sanitizer::Address));
     tracked!(sanitizer_memory_track_origins, 2);
     tracked!(sanitizer_recover, vec![Sanitizer::Address]);
-    tracked!(saturating_float_casts, true);
+    tracked!(saturating_float_casts, Some(true));
     tracked!(share_generics, Some(true));
     tracked!(show_span, Some(String::from("abc")));
     tracked!(src_hash_algorithm, Some(SourceFileHashAlgorithm::Sha1));