rust/compiler
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
..
rustc
rustc_abi Fix rustc_abi build on stable 2024-01-16 21:15:31 +01:00
rustc_arena Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_ast Remove unnecessary min_specialization after bootstrap 2024-02-10 18:15:11 +11:00
rustc_ast_lowering Remove unused fn 2024-02-10 03:52:13 +00:00
rustc_ast_passes Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_ast_pretty Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_attr Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_baked_icu_data
rustc_borrowck Auto merge of #120843 - matthiaskrgr:rollup-med37z5, r=matthiaskrgr 2024-02-09 15:34:48 +00:00
rustc_builtin_macros Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_codegen_cranelift Auto merge of #120843 - matthiaskrgr:rollup-med37z5, r=matthiaskrgr 2024-02-09 15:34:48 +00:00
rustc_codegen_gcc Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_codegen_llvm Remove unnecessary #![feature(min_specialization)] 2024-02-10 12:26:14 +11:00
rustc_codegen_ssa Rollup merge of #120865 - saethlin:missing-o-files, r=nnethercote 2024-02-10 13:12:31 +01:00
rustc_const_eval detect consts that reference extern statics 2024-02-10 16:13:48 +01:00
rustc_data_structures Rollup merge of #120846 - petrochenkov:jobs, r=oli-obk 2024-02-10 00:58:38 +01:00
rustc_driver
rustc_driver_impl Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_error_codes unstably allow constants to refer to statics and read from immutable statics 2024-02-10 16:12:55 +01:00
rustc_error_messages Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_errors Rollup merge of #120272 - long-long-float:suppress-suggestions-in-derive-macro, r=oli-obk 2024-02-11 01:37:54 +01:00
rustc_expand Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_feature unstably allow constants to refer to statics and read from immutable statics 2024-02-10 16:12:55 +01:00
rustc_fluent_macro Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_fs_util Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_graphviz Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_hir Remove unnecessary min_specialization after bootstrap 2024-02-10 18:15:11 +11:00
rustc_hir_analysis Rollup merge of #120870 - Zalathar:allow-min-spec, r=oli-obk 2024-02-10 13:12:31 +01:00
rustc_hir_pretty Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_hir_typeck Rollup merge of #120870 - Zalathar:allow-min-spec, r=oli-obk 2024-02-10 13:12:31 +01:00
rustc_incremental Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_index Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_index_macros Step all bootstrap cfgs forward 2024-02-08 07:44:34 -05:00
rustc_infer Rollup merge of #120870 - Zalathar:allow-min-spec, r=oli-obk 2024-02-10 13:12:31 +01:00
rustc_interface Rollup merge of #120828 - nnethercote:fix-stash-steal, r=oli-obk 2024-02-09 14:41:52 +01:00
rustc_lexer Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_lint Rollup merge of #120866 - Zalathar:no-min-spec, r=compiler-errors 2024-02-10 13:12:31 +01:00
rustc_lint_defs Remove unnecessary #![feature(min_specialization)] 2024-02-10 12:26:14 +11:00
rustc_llvm Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_log Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_macros Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_metadata Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_middle detect consts that reference extern statics 2024-02-10 16:13:48 +01:00
rustc_mir_build Remove unnecessary min_specialization after bootstrap 2024-02-10 18:15:11 +11:00
rustc_mir_dataflow Remove unnecessary min_specialization after bootstrap 2024-02-10 18:15:11 +11:00
rustc_mir_transform Auto merge of #117206 - cjgillot:jump-threading-default, r=tmiasko 2024-02-10 22:15:18 +00:00
rustc_monomorphize Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_next_trait_solver Add CoroutineClosure to TyKind, AggregateKind, UpvarArgs 2024-02-06 02:22:58 +00:00
rustc_parse Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_parse_format Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_passes Remove unnecessary #![feature(min_specialization)] 2024-02-10 12:26:14 +11:00
rustc_pattern_analysis Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_privacy Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_query_impl Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_query_system Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_resolve Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_serialize Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_session Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_smir Add a new debug_assertions instrinsic (compiler) 2024-02-08 11:49:08 -05:00
rustc_span Rollup merge of #120272 - long-long-float:suppress-suggestions-in-derive-macro, r=oli-obk 2024-02-11 01:37:54 +01:00
rustc_symbol_mangling Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_target Remove unnecessary min_specialization after bootstrap 2024-02-10 18:15:11 +11:00
rustc_trait_selection Rollup merge of #120870 - Zalathar:allow-min-spec, r=oli-obk 2024-02-10 13:12:31 +01:00
rustc_traits Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_transmute Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_ty_utils Auto merge of #120712 - compiler-errors:async-closures-harmonize, r=oli-obk 2024-02-10 07:15:15 +00:00
rustc_type_ir Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
stable_mir Add a new debug_assertions instrinsic (compiler) 2024-02-08 11:49:08 -05:00