Skip to content

Commit

Permalink
Update float tests to include f16 and f128
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Jun 18, 2024
1 parent 0ca844f commit 5f9ba29
Show file tree
Hide file tree
Showing 44 changed files with 795 additions and 523 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ fn main() {

a.sort_unstable();

// FIXME(f16_f128): add a clamp test once the function is available
let _ = 2.0f32.clamp(3.0f32, 4.0f32);
let _ = 2.0f64.clamp(3.0f64, 4.0f64);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,61 +28,61 @@ LL | a.sort_unstable();
| ^^^^^^^^^^^^^^^^^

error: use of a disallowed method `f32::clamp`
--> tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs:43:13
--> tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs:44:13
|
LL | let _ = 2.0f32.clamp(3.0f32, 4.0f32);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of a disallowed method `regex::Regex::new`
--> tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs:46:61
--> tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs:47:61
|
LL | let indirect: fn(&str) -> Result<Regex, regex::Error> = Regex::new;
| ^^^^^^^^^^

error: use of a disallowed method `f32::clamp`
--> tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs:49:28
--> tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs:50:28
|
LL | let in_call = Box::new(f32::clamp);
| ^^^^^^^^^^

error: use of a disallowed method `regex::Regex::new`
--> tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs:50:53
--> tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs:51:53
|
LL | let in_method_call = ["^", "$"].into_iter().map(Regex::new);
| ^^^^^^^^^^

error: use of a disallowed method `futures::stream::select_all`
--> tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs:53:31
--> tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs:54:31
|
LL | let same_name_as_module = select_all(vec![empty::<()>()]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of a disallowed method `conf_disallowed_methods::local_fn`
--> tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs:55:5
--> tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs:56:5
|
LL | local_fn();
| ^^^^^^^^^^

error: use of a disallowed method `conf_disallowed_methods::local_mod::f`
--> tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs:56:5
--> tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs:57:5
|
LL | local_mod::f();
| ^^^^^^^^^^^^^^

error: use of a disallowed method `conf_disallowed_methods::Struct::method`
--> tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs:58:5
--> tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs:59:5
|
LL | s.method();
| ^^^^^^^^^^

error: use of a disallowed method `conf_disallowed_methods::Trait::provided_method`
--> tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs:59:5
--> tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs:60:5
|
LL | s.provided_method();
| ^^^^^^^^^^^^^^^^^^^

error: use of a disallowed method `conf_disallowed_methods::Trait::implemented_method`
--> tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs:60:5
--> tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs:61:5
|
LL | s.implemented_method();
| ^^^^^^^^^^^^^^^^^^^^^^
Expand Down
4 changes: 4 additions & 0 deletions tests/ui/arithmetic_side_effects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
unconditional_panic
)]
#![feature(const_mut_refs)]
#![feature(f128)]
#![feature(f16)]
#![warn(clippy::arithmetic_side_effects)]

extern crate proc_macro_derive;
Expand Down Expand Up @@ -162,8 +164,10 @@ pub fn association_with_structures_should_not_trigger_the_lint() {
}

pub fn hard_coded_allowed() {
let _ = 1f16 + 1f16;
let _ = 1f32 + 1f32;
let _ = 1f64 + 1f64;
let _ = 1f128 + 1f128;

let _ = Saturating(0u32) + Saturating(0u32);
let _ = String::new() + "";
Expand Down
Loading

0 comments on commit 5f9ba29

Please sign in to comment.