rust/tests/ui/lint/fn-ptr-comparisons.stderr
Esteban Küber f0845adb0c Show diff suggestion format on verbose replacement
```
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
  --> $DIR/attempted-access-non-fatal.rs:7:15
   |
LL |     let _ = 2.l;
   |               ^
   |
help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix
   |
LL -     let _ = 2.l;
LL +     let _ = 2.0f64;
   |
```
2025-02-10 20:21:39 +00:00

184 lines
8.1 KiB
Plaintext

warning: function pointer comparisons do not produce meaningful results since their addresses are not guaranteed to be unique
--> $DIR/fn-ptr-comparisons.rs:26:13
|
LL | let _ = f == a;
| ^^^^^^
|
= note: the address of the same function can vary between different codegen units
= note: furthermore, different functions could have the same address after being merged together
= note: for more information visit <https://doc.rust-lang.org/nightly/core/ptr/fn.fn_addr_eq.html>
= note: `#[warn(unpredictable_function_pointer_comparisons)]` on by default
help: refactor your code, or use `std::ptr::fn_addr_eq` to suppress the lint
|
LL - let _ = f == a;
LL + let _ = std::ptr::fn_addr_eq(f, a as fn());
|
warning: function pointer comparisons do not produce meaningful results since their addresses are not guaranteed to be unique
--> $DIR/fn-ptr-comparisons.rs:28:13
|
LL | let _ = f != a;
| ^^^^^^
|
= note: the address of the same function can vary between different codegen units
= note: furthermore, different functions could have the same address after being merged together
= note: for more information visit <https://doc.rust-lang.org/nightly/core/ptr/fn.fn_addr_eq.html>
help: refactor your code, or use `std::ptr::fn_addr_eq` to suppress the lint
|
LL - let _ = f != a;
LL + let _ = !std::ptr::fn_addr_eq(f, a as fn());
|
warning: function pointer comparisons do not produce meaningful results since their addresses are not guaranteed to be unique
--> $DIR/fn-ptr-comparisons.rs:30:13
|
LL | let _ = f == g;
| ^^^^^^
|
= note: the address of the same function can vary between different codegen units
= note: furthermore, different functions could have the same address after being merged together
= note: for more information visit <https://doc.rust-lang.org/nightly/core/ptr/fn.fn_addr_eq.html>
help: refactor your code, or use `std::ptr::fn_addr_eq` to suppress the lint
|
LL - let _ = f == g;
LL + let _ = std::ptr::fn_addr_eq(f, g);
|
warning: function pointer comparisons do not produce meaningful results since their addresses are not guaranteed to be unique
--> $DIR/fn-ptr-comparisons.rs:32:13
|
LL | let _ = f == f;
| ^^^^^^
|
= note: the address of the same function can vary between different codegen units
= note: furthermore, different functions could have the same address after being merged together
= note: for more information visit <https://doc.rust-lang.org/nightly/core/ptr/fn.fn_addr_eq.html>
help: refactor your code, or use `std::ptr::fn_addr_eq` to suppress the lint
|
LL - let _ = f == f;
LL + let _ = std::ptr::fn_addr_eq(f, f);
|
warning: function pointer comparisons do not produce meaningful results since their addresses are not guaranteed to be unique
--> $DIR/fn-ptr-comparisons.rs:34:13
|
LL | let _ = g == g;
| ^^^^^^
|
= note: the address of the same function can vary between different codegen units
= note: furthermore, different functions could have the same address after being merged together
= note: for more information visit <https://doc.rust-lang.org/nightly/core/ptr/fn.fn_addr_eq.html>
help: refactor your code, or use `std::ptr::fn_addr_eq` to suppress the lint
|
LL - let _ = g == g;
LL + let _ = std::ptr::fn_addr_eq(g, g);
|
warning: function pointer comparisons do not produce meaningful results since their addresses are not guaranteed to be unique
--> $DIR/fn-ptr-comparisons.rs:36:13
|
LL | let _ = g == g;
| ^^^^^^
|
= note: the address of the same function can vary between different codegen units
= note: furthermore, different functions could have the same address after being merged together
= note: for more information visit <https://doc.rust-lang.org/nightly/core/ptr/fn.fn_addr_eq.html>
help: refactor your code, or use `std::ptr::fn_addr_eq` to suppress the lint
|
LL - let _ = g == g;
LL + let _ = std::ptr::fn_addr_eq(g, g);
|
warning: function pointer comparisons do not produce meaningful results since their addresses are not guaranteed to be unique
--> $DIR/fn-ptr-comparisons.rs:38:13
|
LL | let _ = &g == &g;
| ^^^^^^^^
|
= note: the address of the same function can vary between different codegen units
= note: furthermore, different functions could have the same address after being merged together
= note: for more information visit <https://doc.rust-lang.org/nightly/core/ptr/fn.fn_addr_eq.html>
help: refactor your code, or use `std::ptr::fn_addr_eq` to suppress the lint
|
LL - let _ = &g == &g;
LL + let _ = std::ptr::fn_addr_eq(g, g);
|
warning: function pointer comparisons do not produce meaningful results since their addresses are not guaranteed to be unique
--> $DIR/fn-ptr-comparisons.rs:40:13
|
LL | let _ = a as fn() == g;
| ^^^^^^^^^^^^^^
|
= note: the address of the same function can vary between different codegen units
= note: furthermore, different functions could have the same address after being merged together
= note: for more information visit <https://doc.rust-lang.org/nightly/core/ptr/fn.fn_addr_eq.html>
help: refactor your code, or use `std::ptr::fn_addr_eq` to suppress the lint
|
LL - let _ = a as fn() == g;
LL + let _ = std::ptr::fn_addr_eq(a as fn(), g);
|
warning: function pointer comparisons do not produce meaningful results since their addresses are not guaranteed to be unique
--> $DIR/fn-ptr-comparisons.rs:44:13
|
LL | let _ = cfn == c;
| ^^^^^^^^
|
= note: the address of the same function can vary between different codegen units
= note: furthermore, different functions could have the same address after being merged together
= note: for more information visit <https://doc.rust-lang.org/nightly/core/ptr/fn.fn_addr_eq.html>
help: refactor your code, or use `std::ptr::fn_addr_eq` to suppress the lint
|
LL - let _ = cfn == c;
LL + let _ = std::ptr::fn_addr_eq(cfn, c as extern "C" fn());
|
warning: function pointer comparisons do not produce meaningful results since their addresses are not guaranteed to be unique
--> $DIR/fn-ptr-comparisons.rs:48:13
|
LL | let _ = argsfn == args;
| ^^^^^^^^^^^^^^
|
= note: the address of the same function can vary between different codegen units
= note: furthermore, different functions could have the same address after being merged together
= note: for more information visit <https://doc.rust-lang.org/nightly/core/ptr/fn.fn_addr_eq.html>
help: refactor your code, or use `std::ptr::fn_addr_eq` to suppress the lint
|
LL - let _ = argsfn == args;
LL + let _ = std::ptr::fn_addr_eq(argsfn, args as extern "C" fn(i32) -> i32);
|
warning: function pointer comparisons do not produce meaningful results since their addresses are not guaranteed to be unique
--> $DIR/fn-ptr-comparisons.rs:52:13
|
LL | let _ = t == test;
| ^^^^^^^^^
|
= note: the address of the same function can vary between different codegen units
= note: furthermore, different functions could have the same address after being merged together
= note: for more information visit <https://doc.rust-lang.org/nightly/core/ptr/fn.fn_addr_eq.html>
help: refactor your code, or use `std::ptr::fn_addr_eq` to suppress the lint
|
LL - let _ = t == test;
LL + let _ = std::ptr::fn_addr_eq(t, test as unsafe extern "C" fn());
|
warning: function pointer comparisons do not produce meaningful results since their addresses are not guaranteed to be unique
--> $DIR/fn-ptr-comparisons.rs:56:13
|
LL | let _ = a1.f == a2.f;
| ^^^^^^^^^^^^
|
= note: the address of the same function can vary between different codegen units
= note: furthermore, different functions could have the same address after being merged together
= note: for more information visit <https://doc.rust-lang.org/nightly/core/ptr/fn.fn_addr_eq.html>
help: refactor your code, or use `std::ptr::fn_addr_eq` to suppress the lint
|
LL - let _ = a1.f == a2.f;
LL + let _ = std::ptr::fn_addr_eq(a1.f, a2.f);
|
warning: 12 warnings emitted