Matthias Krüger
e525bc9592
Rollup merge of #120272 - long-long-float:suppress-suggestions-in-derive-macro, r=oli-obk
...
Suppress suggestions in derive macro
close #118809
I suppress warnings inside derive macros.
For example, the compiler emits following error by a program described in https://github.com/rust-lang/rust/issues/118809#issuecomment-1852256687 with a suggestion that indicates invalid syntax.
```
error[E0308]: `?` operator has incompatible types
--> src/main.rs:3:17
|
3 | #[derive(Debug, Deserialize)]
| ^^^^^^^^^^^ expected `u32`, found `u64`
|
= note: `?` operator cannot convert from `u64` to `u32`
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
help: you can convert a `u64` to a `u32` and panic if the converted value doesn't fit
|
3 | #[derive(Debug, Deserialize.try_into().unwrap())]
| ++++++++++++++++++++
For more information about this error, try `rustc --explain E0308`.
error: could not compile `serde_test` (bin "serde_test") due to 2 previous errors
```
In this PR, suggestions to cast are suppressed.
```
error[E0308]: `?` operator has incompatible types
--> src/main.rs:3:17
|
3 | #[derive(Debug, Deserialize)]
| ^^^^^^^^^^^ expected `u32`, found `u64`
|
= note: `?` operator cannot convert from `u64` to `u32`
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0308`.
error: could not compile `serde_test` (bin "serde_test") due to 2 previous errors
```
2024-02-11 01:37:54 +01:00
..
2024-02-11 02:43:44 +09:00
2023-04-15 16:11:42 -07:00
2023-04-15 16:11:42 -07:00
2024-01-22 20:14:59 +11:00
2023-08-02 13:40:28 +03:00
2023-11-24 19:15:52 +01:00
2023-04-12 22:50:10 +00:00
2023-12-11 09:36:40 +11:00
2024-01-13 12:46:58 -05:00
2024-01-22 20:14:59 +11:00
2023-12-11 09:19:09 +11:00
2024-01-22 20:14:59 +11:00
2024-01-13 12:46:58 -05:00
2023-10-25 12:04:54 +00:00
2023-10-25 12:04:54 +00:00
2023-01-30 20:12:19 +00:00
2024-01-04 03:53:56 +03:00
2023-12-11 09:19:09 +11:00
2023-11-24 19:15:52 +01:00
2024-01-22 20:14:59 +11:00
2023-12-11 09:19:09 +11:00
2023-06-20 17:20:57 +02:00
2023-12-10 13:03:28 -08:00
2023-11-24 19:15:52 +01:00
2023-04-10 22:02:52 +02:00
2023-04-10 22:02:52 +02:00
2023-11-24 19:15:52 +01:00
2024-01-29 17:43:07 +08:00
2024-01-29 17:43:07 +08:00
2023-07-27 10:37:31 +02:00
2023-06-29 13:42:58 +03:00
2023-06-29 13:42:58 +03:00
2023-07-27 10:37:31 +02:00
2023-12-11 09:19:09 +11:00
2023-11-24 19:15:52 +01:00
2023-12-04 22:26:08 +00:00
2024-01-22 20:14:59 +11:00
2024-01-22 20:14:59 +11:00
2024-01-22 20:14:59 +11:00
2024-01-22 20:14:59 +11:00
2023-11-20 13:15:08 +01:00
2023-11-24 19:15:52 +01:00
2023-07-27 10:37:31 +02:00
2024-01-12 11:02:57 +01:00
2024-01-04 03:53:56 +03:00
2024-01-04 03:53:56 +03:00
2024-01-22 20:14:59 +11:00
2024-01-13 12:46:58 -05:00
2023-11-24 19:15:52 +01:00
2024-01-22 20:14:59 +11:00
2023-07-27 10:37:31 +02:00
2023-01-20 17:13:55 -05:00
2023-01-20 17:13:55 -05:00
2023-11-24 19:15:52 +01:00
2023-07-27 10:37:31 +02:00
2023-11-24 19:15:52 +01:00
2024-01-22 20:14:59 +11:00
2024-01-13 12:46:58 -05:00
2023-12-11 09:19:09 +11:00
2023-12-21 16:45:29 +05:30
2023-12-21 16:45:29 +05:30
2024-01-22 20:14:59 +11:00
2024-01-22 20:14:59 +11:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-07-27 10:37:31 +02:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-01-22 20:14:59 +11:00
2023-11-24 19:15:52 +01:00
2023-12-21 16:45:29 +05:30
2023-12-21 16:45:29 +05:30
2024-01-22 20:14:59 +11:00
2024-01-22 20:19:17 +11:00
2023-11-24 19:15:52 +01:00
2023-12-11 09:19:09 +11:00
2023-11-24 19:15:52 +01:00
2023-07-14 16:53:36 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-01-13 12:46:58 -05:00
2023-11-24 19:15:52 +01:00
2024-02-07 10:42:01 +08:00
2024-02-07 10:42:01 +08:00
2024-02-07 10:42:01 +08:00
2023-04-10 22:02:52 +02:00
2023-04-10 22:02:52 +02:00
2023-08-02 14:54:37 +08:00
2023-11-24 19:15:52 +01:00
2024-01-29 17:43:07 +08:00
2024-01-29 17:43:07 +08:00
2024-02-11 02:43:44 +09:00
2024-02-11 02:43:44 +09:00
2023-11-24 19:15:52 +01:00
2024-01-22 20:14:59 +11:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-01 09:16:34 +09:00
2023-11-01 09:16:34 +09:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-10-05 01:04:41 +00:00
2024-01-22 20:14:59 +11:00
2023-11-24 19:15:52 +01:00
2023-07-27 10:37:31 +02:00
2023-07-27 10:37:31 +02:00
2023-11-24 19:15:52 +01:00
2023-08-08 18:09:56 -07:00
2024-01-05 15:23:09 +01:00
2023-07-14 16:53:36 +01:00
2023-04-15 16:11:42 -07:00
2023-04-15 16:11:42 -07:00
2024-01-22 20:14:59 +11:00
2023-07-14 16:53:36 +01:00
2023-07-14 16:53:36 +01:00
2023-11-24 19:15:52 +01:00
2023-08-08 11:40:35 -04:00
2023-07-14 16:53:36 +01:00
2023-11-24 19:15:52 +01:00
2023-12-11 09:19:09 +11:00
2023-07-14 16:53:36 +01:00
2023-08-08 18:09:56 -07:00
2024-01-22 20:14:59 +11:00
2023-01-13 10:13:49 +01:00
2023-01-13 10:13:49 +01:00
2023-10-05 01:04:41 +00:00
2023-01-13 20:36:03 +00:00
2023-10-05 01:04:41 +00:00
2023-01-16 18:33:25 +00:00
2023-01-16 18:33:25 +00:00
2024-01-22 20:14:59 +11:00
2023-03-14 19:05:21 +00:00
2023-03-14 19:05:21 +00:00
2024-01-13 12:46:58 -05:00
2023-11-24 19:15:52 +01:00
2023-10-05 01:04:41 +00:00
2023-10-04 21:09:54 +00:00
2023-11-24 19:15:52 +01:00
2023-03-14 19:05:21 +00:00
2023-03-14 19:12:42 +00:00
2023-03-14 19:05:21 +00:00
2023-03-14 19:12:42 +00:00
2023-03-14 19:05:21 +00:00
2023-03-14 19:12:42 +00:00
2023-03-14 19:05:21 +00:00
2023-11-24 19:15:52 +01:00
2023-04-03 09:24:11 +02:00
2023-10-04 21:09:54 +00:00
2023-04-17 13:01:03 +01:00
2023-11-24 19:15:52 +01:00
2024-01-16 13:27:58 -08:00
2023-12-11 09:19:09 +11:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-12-11 09:36:40 +11:00