about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/errors.rs
diff options
context:
space:
mode:
authorLuca Versari <veluca93@gmail.com>2024-07-13 19:35:05 +0200
committerLuca Versari <veluca93@gmail.com>2024-11-01 22:24:35 +0100
commitc8b76bcf58298cced4ef3ca9dd823eb318fc11f5 (patch)
tree3418691183ea0ba07f66ad7a2aba5ce557105dff /compiler/rustc_const_eval/src/errors.rs
parent4d296eabe4c5cfbce9bb68e6221bca2165aae97b (diff)
downloadrust-c8b76bcf58298cced4ef3ca9dd823eb318fc11f5.tar.gz
rust-c8b76bcf58298cced4ef3ca9dd823eb318fc11f5.zip
Emit warning when calling/declaring functions with unavailable vectors.
On some architectures, vector types may have a different ABI depending
on whether the relevant target features are enabled. (The ABI when the
feature is disabled is often not specified, but LLVM implements some
de-facto ABI.)

As discussed in rust-lang/lang-team#235, this turns out to very easily
lead to unsound code.

This commit makes it a post-monomorphization future-incompat warning to
declare or call functions using those vector types in a context in which
the corresponding target features are disabled, if using an ABI for
which the difference is relevant. This ensures that these functions are
always called with a consistent ABI.

See the [nomination comment](https://github.com/rust-lang/rust/pull/127731#issuecomment-2288558187)
for more discussion.

Part of #116558
Diffstat (limited to 'compiler/rustc_const_eval/src/errors.rs')
0 files changed, 0 insertions, 0 deletions