Skip to content

WIP Add MIR argument for #[track_caller] (RFC 2091 3/N)#65258

Closed
anp wants to merge 6 commits intorust-lang:masterfrom
anp:mir-location-param
Closed

WIP Add MIR argument for #[track_caller] (RFC 2091 3/N)#65258
anp wants to merge 6 commits intorust-lang:masterfrom
anp:mir-location-param

Conversation

@anp
Copy link
Copy Markdown
Contributor

@anp anp commented Oct 10, 2019

Making this work requires making core::panic::Location a lang item, which is the first commit on this branch (prior are from the depended-on PR).

Depends on: #65182
Tracking issue: #47809
RFC text

TODO:

  • add a location parameter to MIR of #[track_caller] in rustc_mir::build (reference existing implicit arguments work if needed)
  • fix ty::Instance::fn_sig to contain the new type
    • note to self: check on by-val vs. by-ref for this arg used &'static per @eddyb
  • add a "dummy" location parameter to calls from ReifyShim (see other shims for generating things in shims, ask @eddyb if fighting consteval)
  • pass the "correct" location parameter to the function in all calls to ty::Instance::resolve
  • wire up intrinsic::caller_location in MIR construction (reference move_val_init intrinsic)
  • test it can't be called from non-caller-tracked functions (reference other intrinsics for how to type-check)
  • make sure MIR inlining uses resolve, "change the ty::Instance::resolve callsite there"
  • test that directly nested #[track_caller]s pass the same callsite
  • test that indirectly nested #[track_caller]s pass distinct callsites
  • check that all rfc-2091 tests are un-ice'd

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-track_caller `#![feature(track_caller)]` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants