-
Notifications
You must be signed in to change notification settings - Fork 13.4k
WIP Add a shim for functions annotated with #[track_caller]
(RFC 2091 #2/N)
#65082
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Some changes occurred in diagnostic error codes |
(rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for precision: I ask for failing examples not only for consistency but also to be sure that the error code will still be used by the compiler.
Do you mean this as a test? There are some UI tests that do this. Also minor nit: the diffs you reviewed are from #65037. |
@anp Consider this as a backup. It'll at least force the one removing the error code to update the long error explanation. |
d22bbc0
to
94e1c55
Compare
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
- The attribute is behind a feature gate. - Error if both #[naked] and #[track_caller] are applied to the same function. - Error if #[track_caller] is applied to a non-function item. - Error if ABI is not "rust" - Error if #[track_caller] is applied to a trait function. Error codes and descriptions are pending.
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
Prevents number collision with another approved PR.
94e1c55
to
c352eda
Compare
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
☔ The latest upstream changes (presumably #64906) made this pull request unmergeable. Please resolve the merge conflicts. |
I had some fun with git history and opened a new PR: #65182 |
Add `Instance::resolve_for_fn_ptr` (RFC 2091 #2/N) Supercedes: #65082 Depends on: #65037 Tracking issue: #47809 [RFC text](https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md) steps taken: * [x] add a `ReifyShim` that is similar to `VirtualShim` in behavior (see #54183) * [x] add `ty::Instance::resolve_for_fn_ptr` (leave `ty::Instance::resolve_vtable` alone), migrate appropriate callers * [x] `resolve_for_fn_ptr` returns the shim if calling a `#[track_caller]` function
Depends on: #65037
Tracking issue: #47809
RFC text
TODO:
ReifyShim
that is similar toVirtualShim
in behavior (see Implement by-value object safety #54183)ty::Instance::resolve_for_fn_ptr
(leavety::Instance::resolve_vtable
alone), migrate appropriate callersresolve_for_fn_ptr
returns the shim if calling a#[track_caller]
function