about summary refs log tree commit diff
path: root/compiler/rustc_passes/src
diff options
context:
space:
mode:
authorNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2023-07-02 17:50:24 +0200
committerNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2023-10-25 23:15:18 +0200
commitb6657a8ad43baf28a540879af55d588b7bb29029 (patch)
treeef277fad372fa042d8d74c78cd0abb8bd623bcc8 /compiler/rustc_passes/src
parente76cb8c49831ff80d7d2e16319c86edbaa9edb8c (diff)
downloadrust-b6657a8ad43baf28a540879af55d588b7bb29029.tar.gz
rust-b6657a8ad43baf28a540879af55d588b7bb29029.zip
Never consider raw pointer casts to be trival
HIR typeck tries to figure out which casts are trivial by doing them as
coercions and seeing whether this works. Since HIR typeck is oblivious
of lifetimes, this doesn't work for pointer casts that only change the
lifetime of the pointee, which are, as borrowck will tell you, not
trivial.

This change makes it so that raw pointer casts are never considered
trivial.

This also incidentally fixes the "trivial cast" lint false positive on
the same code. Unfortunately, "trivial cast" lints are now never emitted
on raw pointer casts, even if they truly are trivial. This could be
fixed by also doing the lint in borrowck for raw pointers specifically.
Diffstat (limited to 'compiler/rustc_passes/src')
0 files changed, 0 insertions, 0 deletions