diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-04-09 05:29:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-09 05:29:45 +0200 |
| commit | 4f00396f149713b920a74055419f5ab3a8d6a066 (patch) | |
| tree | 62bd6d3e2cc2cd653b3a176d4f84a11d8cdd4a60 /src/test/rustdoc-ui/coverage/json.rs | |
| parent | ecc4e2a647533ddabb7a1b69f6ab1385c3f4003c (diff) | |
| parent | 45589b52fe215b7090bf88683927716c25197203 (diff) | |
| download | rust-4f00396f149713b920a74055419f5ab3a8d6a066.tar.gz rust-4f00396f149713b920a74055419f5ab3a8d6a066.zip | |
Rollup merge of #70916 - Centril:track-caller-ffi, r=eddyb
Support `#[track_caller]` on functions in `extern "Rust" { ... }`
Fixes https://github.com/rust-lang/rust/issues/70830 which is the follow-up to @eddyb's suggestion in https://github.com/rust-lang/rust/pull/69251#discussion_r380791634 to allow `#[track_caller]` on `fn`s in FFI imports, that is, on functions in `extern "Rust" { ... }` blocks.
This requires that the other side, the FFI export, also have the `#[track_caller]` attribute. Otherwise, undefined behavior is triggered and the blame lies, as usual, with the `unsafe { ... }` block which called the FFI imported function.
After this PR, all forms of `fn` items with the right ABI (`"Rust"`) support `#[track_caller]`.
As a drive-by, the PR also hardens the check rejecting `#[naked] #[track_caller]` such that methods and other forms of `fn` items are also considered.
r? @eddyb
cc @rust-lang/lang
Diffstat (limited to 'src/test/rustdoc-ui/coverage/json.rs')
0 files changed, 0 insertions, 0 deletions
