rust/compiler
Matthias Krüger 2667d853a6
Rollup merge of #114784 - Urgau:many-improve-invalid_reference_casting-lint, r=est31
Improve `invalid_reference_casting` lint

This PR improves the `invalid_reference_casting` lint:
 - by considering an unlimited number of casts instead only const to mut ptr
 - by also considering ptr-to-integer and integer-to-ptr casts
 - by also taking into account [`ptr::cast`](https://doc.rust-lang.org/std/primitive.pointer.html#method.cast), [`ptr::cast`](https://doc.rust-lang.org/std/primitive.pointer.html#method.cast-1) and [`ptr::cast_const`](https://doc.rust-lang.org/std/primitive.pointer.html#method.cast_const)

Most of this improvements comes from skimming Github Code Search result for [`&mut \*.*as \*const`](https://github.com/search?q=lang%3Arust+%2F%26mut+%5C*.*as+%5C*const%2F&type=code)

r? ``@est31`` (maybe)
2023-08-16 20:10:37 +02:00
..
rustc
rustc_abi
rustc_arena
rustc_ast Auto merge of #114545 - fee1-dead-contrib:lower-impl-effect, r=oli-obk 2023-08-08 19:23:41 +00:00
rustc_ast_lowering Move scrutinee HirId into MatchSource::TryDesugar 2023-08-14 21:43:56 +00:00
rustc_ast_passes rustc: Move features from Session to GlobalCtxt 2023-08-11 16:51:50 +08:00
rustc_ast_pretty
rustc_attr rustc: Move features from Session to GlobalCtxt 2023-08-11 16:51:50 +08:00
rustc_baked_icu_data
rustc_borrowck review 2023-08-14 15:27:14 +02:00
rustc_builtin_macros rustc: Move features from Session to GlobalCtxt 2023-08-11 16:51:50 +08:00
rustc_codegen_cranelift reverse change in rustc_codegen_cranelift 2023-08-15 00:09:20 +08:00
rustc_codegen_gcc Auto merge of #114467 - Amanieu:asm-unstable-features, r=davidtwco 2023-08-15 11:59:02 +00:00
rustc_codegen_llvm Auto merge of #114467 - Amanieu:asm-unstable-features, r=davidtwco 2023-08-15 11:59:02 +00:00
rustc_codegen_ssa Rollup merge of #114711 - lqd:linker-inference, r=petrochenkov 2023-08-15 14:29:45 +02:00
rustc_const_eval Remove constness from ImplSource::Param 2023-08-14 02:17:30 +00:00
rustc_data_structures Auto merge of #114339 - ttsugriy:unsafe-utf8, r=davidtwco 2023-08-08 10:25:37 +00:00
rustc_driver
rustc_driver_impl rustc: Move crate_types from Session to GlobalCtxt 2023-08-09 14:17:54 +08:00
rustc_error_codes Auto merge of #109348 - cjgillot:issue-109146, r=petrochenkov 2023-08-05 11:52:07 +00:00
rustc_error_messages
rustc_errors Auto merge of #114104 - oli-obk:syn2, r=compiler-errors 2023-08-04 18:46:19 +00:00
rustc_expand rustc: Move features from Session to GlobalCtxt 2023-08-11 16:51:50 +08:00
rustc_feature Update compiler/rustc_feature/src/active.rs 2023-08-15 02:13:17 +08:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz
rustc_hir Move scrutinee HirId into MatchSource::TryDesugar 2023-08-14 21:43:56 +00:00
rustc_hir_analysis Rollup merge of #114746 - compiler-errors:atb-no-const, r=TaKO8Ki 2023-08-16 08:43:50 +02:00
rustc_hir_pretty Auto merge of #114545 - fee1-dead-contrib:lower-impl-effect, r=oli-obk 2023-08-08 19:23:41 +00:00
rustc_hir_typeck Auto merge of #112500 - lukas-code:span-ctxt, r=petrochenkov 2023-08-16 14:47:01 +00:00
rustc_incremental Pass WorkProductMap to build_dep_graph instead of FxIndexMap 2023-08-13 16:07:48 +00:00
rustc_index
rustc_infer Rollup merge of #114819 - estebank:issue-78124, r=compiler-errors 2023-08-15 20:34:25 +02:00
rustc_interface Fix review comment 2023-08-14 16:16:51 +00:00
rustc_lexer
rustc_lint Rollup merge of #114784 - Urgau:many-improve-invalid_reference_casting-lint, r=est31 2023-08-16 20:10:37 +02:00
rustc_lint_defs more nits 2023-08-15 03:44:21 +00:00
rustc_llvm add a csky-unknown-linux-gnuabiv2 target 2023-08-14 23:02:36 +08:00
rustc_log
rustc_macros
rustc_metadata Remove metadata_loader query 2023-08-13 16:38:50 +00:00
rustc_middle Auto merge of #114536 - cjgillot:eval-lint-levels, r=TaKO8Ki 2023-08-16 04:26:12 +00:00
rustc_mir_build Rollup merge of #114819 - estebank:issue-78124, r=compiler-errors 2023-08-15 20:34:25 +02:00
rustc_mir_dataflow Rollup merge of #114505 - ouz-a:cleanup_mir, r=RalfJung 2023-08-06 17:26:29 +02:00
rustc_mir_transform Store BCB counters externally, not directly in the BCB graph 2023-08-13 12:18:06 +10:00
rustc_monomorphize Store the laziness of type aliases in the DefKind 2023-08-07 15:54:31 +02:00
rustc_parse Remove reached_eof from ParseSess 2023-08-13 13:33:37 +00:00
rustc_parse_format
rustc_passes Rollup merge of #114819 - estebank:issue-78124, r=compiler-errors 2023-08-15 20:34:25 +02:00
rustc_plugin_impl
rustc_privacy Use {Local}ModDefId in many queries 2023-08-14 07:22:48 +00:00
rustc_query_impl
rustc_query_system Pass WorkProductMap to build_dep_graph instead of FxIndexMap 2023-08-13 16:07:48 +00:00
rustc_resolve rustc: Move features from Session to GlobalCtxt 2023-08-11 16:51:50 +08:00
rustc_serialize
rustc_session Remove reached_eof from ParseSess 2023-08-13 13:33:37 +00:00
rustc_smir Rollup merge of #114859 - spastorino:add-smir-cx-trait-fns, r=compiler-errors 2023-08-16 08:43:52 +02:00
rustc_span Rollup merge of #114784 - Urgau:many-improve-invalid_reference_casting-lint, r=est31 2023-08-16 20:10:37 +02:00
rustc_symbol_mangling Auto merge of #114672 - lenawanel:master, r=compiler-errors 2023-08-11 09:30:41 +00:00
rustc_target Rollup merge of #114711 - lqd:linker-inference, r=petrochenkov 2023-08-15 14:29:45 +02:00
rustc_trait_selection Rollup merge of #114819 - estebank:issue-78124, r=compiler-errors 2023-08-15 20:34:25 +02:00
rustc_traits
rustc_transmute
rustc_ty_utils Rollup merge of #114670 - compiler-errors:issue-114660, r=cjgillot 2023-08-09 23:00:00 +02:00
rustc_type_ir Comment nits 2023-08-10 23:22:03 +00:00