about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-02-24 07:48:06 +0100
committerGitHub <noreply@github.com>2022-02-24 07:48:06 +0100
commit3cd1dc1d6ec80efa2cff237d8494d825ab983da6 (patch)
treea409691506547c78ce7f4924122860d931068835 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent8a42e3da0bae5b25d42c0eea29884b31a41215e1 (diff)
parent182d335870265a102c0f6467db65b5e59bd97e24 (diff)
downloadrust-3cd1dc1d6ec80efa2cff237d8494d825ab983da6.tar.gz
rust-3cd1dc1d6ec80efa2cff237d8494d825ab983da6.zip
Rollup merge of #94270 - RalfJung:fn-ptrs, r=oli-obk
Miri: relax fn ptr check

As discussed in https://github.com/rust-lang/unsafe-code-guidelines/issues/72#issuecomment-1025407536, the function pointer check done by Miri is currently overeager: contrary to our usual principle of only checking rather uncontroversial validity invariants, we actually check that the pointer points to a real function.

So, this relaxes the check to what the validity invariant probably will be (and what the reference already says it is): the function pointer must be non-null, and that's it.

The check that CTFE does on the final value of a constant is unchanged -- CTFE recurses through references, so it makes some sense to also recurse through function pointers. We might still want to relax this in the future, but that would be a separate change.

r? `@oli-obk`
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions