diff options
| author | bors <bors@rust-lang.org> | 2021-11-21 10:19:33 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-11-21 10:19:33 +0000 |
| commit | 3bfde2f1f4fc9409ecb63dfe1370df66171cf861 (patch) | |
| tree | ed9e0b4780c7980749b09d4fd1ea9b57202c709a /library/std/src | |
| parent | b8e5ab20ed7a7677a998a163ccf7853764b195e6 (diff) | |
| parent | a54eae94a019a4128265413f3799b8d93a81c2e3 (diff) | |
| download | rust-3bfde2f1f4fc9409ecb63dfe1370df66171cf861.tar.gz rust-3bfde2f1f4fc9409ecb63dfe1370df66171cf861.zip | |
Auto merge of #91104 - matthiaskrgr:rollup-duk33o1, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - #91008 (Adds IEEE 754-2019 minimun and maximum functions for f32/f64) - #91070 (Make `LLVMRustGetOrInsertGlobal` always return a `GlobalVariable`) - #91097 (Add spaces in opaque `impl Trait` with more than one trait) - #91098 (Don't suggest certain fixups (`.field`, `.await`, etc) when reporting errors while matching on arrays ) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/f32/tests.rs | 12 | ||||
| -rw-r--r-- | library/std/src/lib.rs | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/library/std/src/f32/tests.rs b/library/std/src/f32/tests.rs index 0d4b865f339..69fa203ff4e 100644 --- a/library/std/src/f32/tests.rs +++ b/library/std/src/f32/tests.rs @@ -20,6 +20,18 @@ fn test_max_nan() { } #[test] +fn test_minimum() { + assert!(f32::NAN.minimum(2.0).is_nan()); + assert!(2.0f32.minimum(f32::NAN).is_nan()); +} + +#[test] +fn test_maximum() { + assert!(f32::NAN.maximum(2.0).is_nan()); + assert!(2.0f32.maximum(f32::NAN).is_nan()); +} + +#[test] fn test_nan() { let nan: f32 = f32::NAN; assert!(nan.is_nan()); diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index f2490a77ce0..afd8d8edaa1 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -287,6 +287,7 @@ #![feature(exhaustive_patterns)] #![feature(extend_one)] #![feature(fn_traits)] +#![feature(float_minimum_maximum)] #![feature(format_args_nl)] #![feature(gen_future)] #![feature(generator_trait)] |
