]> git.lizzy.rs Git - rust.git/blob - tests/ui/types_fn_to_int.stderr
Adapt the *.stderr files of the ui-tests to the tool_lints
[rust.git] / tests / ui / types_fn_to_int.stderr
1 error: casting a `fn(usize) -> Foo {Foo::A}` to `i32` may truncate the function address value.
2   --> $DIR/types_fn_to_int.rs:12:14
3    |
4 12 |     let _y = x as i32;
5    |              ^^^^^^^^ help: if you need the address of the function, consider: `x as usize`
6    |
7    = note: #[deny(clippy::fn_to_numeric_cast_with_truncation)] on by default
8
9 error: casting a `fn(usize) -> Foo {Foo::A}` to `i32` may truncate the function address value.
10   --> $DIR/types_fn_to_int.rs:13:15
11    |
12 13 |     let _y1 = Foo::A as i32;
13    |               ^^^^^^^^^^^^^ help: if you need the address of the function, consider: `Foo::A as usize`
14
15 error: casting a `fn(usize) -> Foo {Foo::A}` to `u32` may truncate the function address value.
16   --> $DIR/types_fn_to_int.rs:14:14
17    |
18 14 |     let _y = x as u32;
19    |              ^^^^^^^^ help: if you need the address of the function, consider: `x as usize`
20
21 error: casting a `fn() -> i32 {bar}` to `u32` may truncate the function address value.
22   --> $DIR/types_fn_to_int.rs:15:14
23    |
24 15 |     let _z = bar as u32;
25    |              ^^^^^^^^^^ help: if you need the address of the function, consider: `bar as usize`
26
27 error: casting a `fn() -> i32 {bar}` to `i64` may truncate the function address value.
28   --> $DIR/types_fn_to_int.rs:16:14
29    |
30 16 |     let _y = bar as i64;
31    |              ^^^^^^^^^^ help: if you need the address of the function, consider: `bar as usize`
32
33 error: casting a `fn() -> i32 {bar}` to `u64` is bad style.
34   --> $DIR/types_fn_to_int.rs:17:14
35    |
36 17 |     let _y = bar as u64;
37    |              ^^^^^^^^^^ help: if you need the address of the function, consider: `bar as usize`
38    |
39    = note: `-D clippy::fn-to-numeric-cast` implied by `-D warnings`
40
41 error: casting a `fn(usize) -> Foo {Foo::A}` to `i128` is bad style.
42   --> $DIR/types_fn_to_int.rs:18:14
43    |
44 18 |     let _z = Foo::A as i128;
45    |              ^^^^^^^^^^^^^^ help: if you need the address of the function, consider: `Foo::A as usize`
46
47 error: casting a `fn(usize) -> Foo {Foo::A}` to `u128` is bad style.
48   --> $DIR/types_fn_to_int.rs:19:14
49    |
50 19 |     let _z = Foo::A as u128;
51    |              ^^^^^^^^^^^^^^ help: if you need the address of the function, consider: `Foo::A as usize`
52
53 error: casting a `fn() -> i32 {bar}` to `i128` is bad style.
54   --> $DIR/types_fn_to_int.rs:20:14
55    |
56 20 |     let _z = bar as i128;
57    |              ^^^^^^^^^^^ help: if you need the address of the function, consider: `bar as usize`
58
59 error: casting a `fn() -> i32 {bar}` to `u128` is bad style.
60   --> $DIR/types_fn_to_int.rs:21:14
61    |
62 21 |     let _z = bar as u128;
63    |              ^^^^^^^^^^^ help: if you need the address of the function, consider: `bar as usize`
64
65 error: aborting due to 10 previous errors
66