rust/compiler/rustc_lint/src
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
..
nonstandard_style
array_into_iter.rs
builtin.rs Auto merge of #114723 - petrochenkov:noplugin2, r=davidtwco 2023-08-13 10:59:36 +00:00
context.rs rustc: Move features from Session to GlobalCtxt 2023-08-11 16:51:50 +08:00
deref_into_dyn_supertrait.rs
drop_forget_useless.rs
early.rs rustc: Move features from Session to GlobalCtxt 2023-08-11 16:51:50 +08:00
enum_intrinsics_non_enums.rs
errors.rs
expect.rs
for_loops_over_fallibles.rs
foreign_modules.rs Simplify clashing_extern_declarations. 2023-08-04 16:09:13 +00:00
hidden_unicode_codepoints.rs
internal.rs
invalid_from_utf8.rs
late.rs Use {Local}ModDefId in many queries 2023-08-14 07:22:48 +00:00
let_underscore.rs
levels.rs rustc: Move features from Session to GlobalCtxt 2023-08-11 16:51:50 +08:00
lib.rs Use {Local}ModDefId in many queries 2023-08-14 07:22:48 +00:00
lints.rs Rollup merge of #114486 - Urgau:const-context-nan-suggestion-114471, r=compiler-errors 2023-08-06 03:56:09 +02:00
map_unit_fn.rs
methods.rs
multiple_supertrait_upcastable.rs Add missing feature gate in multiple_supertrait_upcastable doc 2023-07-31 12:28:53 +01:00
non_ascii_idents.rs Reword confusable idents lint 2023-08-04 16:46:08 +00:00
non_fmt_panic.rs
nonstandard_style.rs
noop_method_call.rs fix 2023-07-23 09:58:31 +00:00
opaque_hidden_inferred_bound.rs
pass_by_value.rs
passes.rs
ptr_nulls.rs Also add label with original type for function pointers 2023-08-03 10:57:11 +02:00
redundant_semicolon.rs
reference_casting.rs Improve invalid_reference_casting lint 2023-08-15 10:14:45 +02:00
tests.rs
traits.rs
types.rs Rollup merge of #114486 - Urgau:const-context-nan-suggestion-114471, r=compiler-errors 2023-08-06 03:56:09 +02:00
unused.rs match scrutinee need necessary parentheses for structs 2023-08-14 18:05:13 +08:00