4e5b31c2b0
Lint on invalid usage of `UnsafeCell::raw_get` in reference casting This PR proposes to take into account `UnsafeCell::raw_get` method call for non-Freeze types for the `invalid_reference_casting` lint. The goal of this is to catch those kind of invalid reference casting: ```rust fn as_mut<T>(x: &T) -> &mut T { unsafe { &mut *std::cell::UnsafeCell::raw_get(x as *const _ as *const _) } //~^ ERROR casting `&T` to `&mut T` is undefined behavior } ``` r? `@est31` |
||
---|---|---|
.. | ||
nonstandard_style | ||
array_into_iter.rs | ||
builtin.rs | ||
context.rs | ||
deref_into_dyn_supertrait.rs | ||
drop_forget_useless.rs | ||
early.rs | ||
enum_intrinsics_non_enums.rs | ||
errors.rs | ||
expect.rs | ||
for_loops_over_fallibles.rs | ||
foreign_modules.rs | ||
hidden_unicode_codepoints.rs | ||
internal.rs | ||
invalid_from_utf8.rs | ||
late.rs | ||
let_underscore.rs | ||
levels.rs | ||
lib.rs | ||
lints.rs | ||
map_unit_fn.rs | ||
methods.rs | ||
multiple_supertrait_upcastable.rs | ||
non_ascii_idents.rs | ||
non_fmt_panic.rs | ||
nonstandard_style.rs | ||
noop_method_call.rs | ||
opaque_hidden_inferred_bound.rs | ||
pass_by_value.rs | ||
passes.rs | ||
ptr_nulls.rs | ||
redundant_semicolon.rs | ||
reference_casting.rs | ||
tests.rs | ||
traits.rs | ||
types.rs | ||
unused.rs |