about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/errors.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-10-12 23:00:55 +0200
committerGitHub <noreply@github.com>2024-10-12 23:00:55 +0200
commit57be141f8a03edd6236dc00a3772fc27673a64c3 (patch)
tree9db209e80f16798851f9e7ac7e8149573f32a7ac /compiler/rustc_codegen_llvm/src/errors.rs
parent6b9676b45431a1e531b9c5f7bd289fc36a312749 (diff)
parent867e776fa6220b17963c34b572fb3c8aa0ace2a3 (diff)
downloadrust-57be141f8a03edd6236dc00a3772fc27673a64c3.tar.gz
rust-57be141f8a03edd6236dc00a3772fc27673a64c3.zip
Rollup merge of #128784 - tdittr:check-abi-on-fn-ptr, r=compiler-errors
Check ABI target compatibility for function pointers

Tracking issue: https://github.com/rust-lang/rust/issues/130260
Related tracking issue: #87678

Compatibility of an ABI for a target was previously only performed on function definitions and `extern` blocks. This PR adds it also to function pointers to be consistent.

This might have broken some of the `tests/ui/` depending on the platform, so a try run seems like a good idea.

Also this might break existing code, because we now emit extra errors. Does this require a crater run?

# Example
```rust
// build with: --target=x86_64-unknown-linux-gnu

// These raise E0570
extern "thiscall" fn foo() {}
extern "thiscall" { fn bar() }

// This did not raise any error
fn baz(f: extern "thiscall" fn()) { f() }
```

# Open Questions
* [x] Should this report a future incompatibility warning like #87678 ?
* [ ] Is this the best place to perform the check?
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/errors.rs')
0 files changed, 0 insertions, 0 deletions