os-rust/compiler
Matthias Krüger 13314df21b
Rollup merge of #125572 - mu001999-contrib:dead/enhance, r=pnkfelix
Detect pub structs never constructed and unused associated constants

<!--
If this PR is related to an unstable feature or an otherwise tracked effort,
please link to the relevant tracking issue here. If you don't know of a related
tracking issue or there are none, feel free to ignore this.

This PR will get automatically assigned to a reviewer. In case you would like
a specific user to review your work, you can assign it to them by using

    r​? <reviewer name>
-->

Lints never constructed public structs.

If we don't provide public methods to construct public structs with private fields, and don't construct them in the local crate. They would be never constructed. So that we can detect such public structs.

---
Update:

Also lints unused associated constants in traits.
2024-06-07 20:14:28 +02:00
..
rustc Change SIGPIPE ui from #[unix_sigpipe = "..."] to -Zon-broken-pipe=... 2024-05-02 19:48:29 +02:00
rustc_abi don't inhibit random field reordering on repr(packed(1)) 2024-05-21 19:22:04 +02:00
rustc_arena rename ptr::invalid -> ptr::without_provenance 2024-02-21 20:15:52 +01:00
rustc_ast Rollup merge of #124214 - carbotaniuman:parse_unsafe_attrs, r=michaelwoerister 2024-06-07 20:14:28 +02:00
rustc_ast_ir Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
rustc_ast_lowering Rollup merge of #124214 - carbotaniuman:parse_unsafe_attrs, r=michaelwoerister 2024-06-07 20:14:28 +02:00
rustc_ast_passes Parse unsafe attributes 2024-06-06 20:26:27 -05:00
rustc_ast_pretty Rollup merge of #124214 - carbotaniuman:parse_unsafe_attrs, r=michaelwoerister 2024-06-07 20:14:28 +02:00
rustc_attr Rename buffer_lint_with_diagnostic to buffer_lint 2024-05-21 20:16:39 +00:00
rustc_baked_icu_data
rustc_borrowck Uplift TypeRelation and Relate 2024-06-06 07:50:19 -04:00
rustc_builtin_macros Handle safe case 2024-06-06 20:54:51 -05:00
rustc_codegen_cranelift Misc fixes to cranelift/clippy/miri 2024-06-05 22:25:42 +01:00
rustc_codegen_gcc Uplift TypeRelation and Relate 2024-06-01 12:50:58 -04:00
rustc_codegen_llvm Auto merge of #125406 - tbu-:pr_rm_path_with_extension, r=Nadrieril 2024-06-06 10:24:24 +00:00
rustc_codegen_ssa Revert "Rollup merge of #124976 - petrochenkov:usedcrates, r=oli-obk" 2024-06-06 10:06:28 +00:00
rustc_const_eval Revert "Create const block DefIds in typeck instead of ast lowering" 2024-06-07 08:33:58 +00:00
rustc_data_structures Apply x clippy --fix and x fmt 2024-05-30 09:51:27 +08:00
rustc_driver
rustc_driver_impl Make top-level rustc_parse functions fallible. 2024-06-05 10:38:03 +10:00
rustc_error_codes Rollup merge of #124746 - OliverKillane:E0582-explain-assoc-types-improvement, r=pnkfelix 2024-06-05 18:21:08 +02:00
rustc_error_messages Auto merge of #125410 - fmease:adj-lint-diag-api, r=nnethercote 2024-05-27 08:44:12 +00:00
rustc_errors Auto merge of #125410 - fmease:adj-lint-diag-api, r=nnethercote 2024-05-27 08:44:12 +00:00
rustc_expand Fix formatting 2024-06-06 20:27:25 -05:00
rustc_feature Fix ordering 2024-06-06 20:42:20 -05:00
rustc_fluent_macro Rename SubdiagnosticMessage as SubdiagMessage. 2024-03-05 12:14:49 +11:00
rustc_fs_util Stabilize std::path::absolute 2024-04-24 14:35:02 +00:00
rustc_graphviz Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_hir Auto merge of #125918 - oli-obk:const_block_ice, r=compiler-errors 2024-06-07 09:08:59 +00:00
rustc_hir_analysis Auto merge of #125918 - oli-obk:const_block_ice, r=compiler-errors 2024-06-07 09:08:59 +00:00
rustc_hir_pretty Revert "Create const block DefIds in typeck instead of ast lowering" 2024-06-07 08:33:58 +00:00
rustc_hir_typeck Auto merge of #125918 - oli-obk:const_block_ice, r=compiler-errors 2024-06-07 09:08:59 +00:00
rustc_incremental Run rustfmt on files that need it. 2024-05-24 15:17:21 +10:00
rustc_index Simplify static_assert_sizes. 2024-04-18 15:36:25 +10:00
rustc_index_macros rustc_index: Add a ZERO constant to index types 2024-04-03 19:06:22 +03:00
rustc_infer Uplift TypeRelation and Relate 2024-06-06 07:50:19 -04:00
rustc_interface Revert "Rollup merge of #124976 - petrochenkov:usedcrates, r=oli-obk" 2024-06-06 10:06:28 +00:00
rustc_lexer Improved the compiler code with clippy 2024-04-24 09:41:44 +02:00
rustc_lint Rollup merge of #126040 - Urgau:unreachable_pub-fields-less, r=petrochenkov 2024-06-06 21:10:10 -07:00
rustc_lint_defs Auto merge of #124482 - spastorino:unsafe-extern-blocks, r=oli-obk 2024-06-06 08:14:58 +00:00
rustc_llvm thinlto: only build summary file if needed 2024-05-23 14:58:30 -04:00
rustc_log remove tracing tree indent lines 2024-05-30 15:26:48 +02:00
rustc_macros Make the panic info more useful 2024-06-06 09:47:10 +00:00
rustc_metadata Rollup merge of #126099 - Nilstrieb:crate-loader-cleanups, r=jieyouxu 2024-06-06 21:10:10 -07:00
rustc_middle Auto merge of #125918 - oli-obk:const_block_ice, r=compiler-errors 2024-06-07 09:08:59 +00:00
rustc_mir_build Revert "Create const block DefIds in typeck instead of ast lowering" 2024-06-07 08:33:58 +00:00
rustc_mir_dataflow Remove #[macro_use] extern crate tracing from rustc_mir_dataflow. 2024-05-23 18:02:40 +10:00
rustc_mir_transform Revert "Create const block DefIds in typeck instead of ast lowering" 2024-06-07 08:33:58 +00:00
rustc_monomorphize Auto merge of #125928 - michaelwoerister:fix-cgu-hashstable, r=oli-obk 2024-06-07 04:02:59 +00:00
rustc_next_trait_solver Uplift TypeRelation and Relate 2024-06-06 07:50:19 -04:00
rustc_parse Rollup merge of #124214 - carbotaniuman:parse_unsafe_attrs, r=michaelwoerister 2024-06-07 20:14:28 +02:00
rustc_parse_format Apply x clippy --fix and x fmt 2024-05-30 09:51:27 +08:00
rustc_passes Rollup merge of #125572 - mu001999-contrib:dead/enhance, r=pnkfelix 2024-06-07 20:14:28 +02:00
rustc_pattern_analysis Add Ty to mir::Const::Ty 2024-06-05 22:25:41 +01:00
rustc_privacy Make body_owned_by return the body directly. 2024-05-29 10:04:08 +00:00
rustc_query_impl Remove extern crate rustc_middle from rustc_query_impl. 2024-05-13 08:20:18 +10:00
rustc_query_system Make the panic info more useful 2024-06-06 09:47:10 +00:00
rustc_resolve Revert "Create const block DefIds in typeck instead of ast lowering" 2024-06-07 08:33:58 +00:00
rustc_sanitizers Misc fixes (pattern type lowering, cfi, pretty printing) 2024-06-05 22:25:42 +01:00
rustc_serialize Apply x clippy --fix and x fmt 2024-05-30 09:51:27 +08:00
rustc_session Improve naming and path operations in crate loader 2024-06-06 21:53:29 +02:00
rustc_smir Revert "Rollup merge of #124976 - petrochenkov:usedcrates, r=oli-obk" 2024-06-06 10:06:28 +00:00
rustc_span Parse unsafe attributes 2024-06-06 20:26:27 -05:00
rustc_symbol_mangling Add Ty to ConstKind::Value 2024-06-05 22:25:41 +01:00
rustc_target Improve naming and path operations in crate loader 2024-06-06 21:53:29 +02:00
rustc_trait_selection Uplift TypeRelation and Relate 2024-06-06 07:50:19 -04:00
rustc_traits Align Term methods with GenericArg methods 2024-06-03 20:36:27 -04:00
rustc_transmute Add Ty to ConstKind::Value 2024-06-05 22:25:41 +01:00
rustc_ty_utils ty::Expr reviews 2024-06-05 22:25:42 +01:00
rustc_type_ir Uplift TypeRelation and Relate 2024-06-06 07:50:19 -04:00
rustc_type_ir_macros Uplift TraitPredicate 2024-05-11 18:20:00 -04:00
stable_mir Split smir Const into TyConst and MirConst 2024-06-04 10:14:45 +01:00