Skip to content

Unstable Book: const_caller_location leads to a closed tracking issue #76105

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

Closed
ArekPiekarz opened this issue Aug 30, 2020 · 2 comments
Closed

Comments

@ArekPiekarz
Copy link
Contributor

In Unstable Book the section const_caller_location leads to a closed tracking issue #47809 about a general caller tracking. There is a forked new issue about tracking callers for closures, but it seems unrelated to working in const functions.

This functionality is still not stabilized, because trying to use it like this:

#[track_caller]
const fn foo() -> &'static std::panic::Location<'static> {
    std::panic::Location::caller()
}

gives error:

error: `std::panic::Location::<'a>::caller` is not yet stable as a const fn
 --> src/lib.rs:3:5
  |
3 |     std::panic::Location::caller()
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: add `#![feature(const_caller_location)]` to the crate attributes to enable

Thus it looks like const_caller_location should have its own tracking issue.

@tesuji
Copy link
Contributor

tesuji commented Aug 30, 2020

You could make this issue an tracking issue for that feature.
Could you rename the issue and make a PR to change this line ?

#[rustc_const_unstable(feature = "const_caller_location", issue = "47809")]

@ArekPiekarz
Copy link
Contributor Author

Thanks for the suggestion, I'll create another issue as tracking so I don't have to edit this one and so this conversation does not look out of place, then make a PR.

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Sep 5, 2020
…racking_issue, r=joshtriplett

Update tracking issue for const_caller_location

Update the tracking issue to rust-lang#76156, as suggested in rust-lang#76105.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Sep 6, 2020
…racking_issue, r=joshtriplett

Update tracking issue for const_caller_location

Update the tracking issue to rust-lang#76156, as suggested in rust-lang#76105.
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 6, 2020
…cking_issue, r=joshtriplett

Update tracking issue for const_caller_location

Update the tracking issue to rust-lang#76156, as suggested in rust-lang#76105.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants