rust icon indicating copy to clipboard operation
rust copied to clipboard

Tracking Issue for `const_location_fields`

Open lilasta opened this issue 2 years ago • 3 comments

Feature gate: #![feature(const_location_fields)]

This is a tracking issue for core::panic::Location methods as const functions.

Public API

// core::panic::location
impl Location {
    pub const fn file(&self) -> &str;
    pub const fn line(&self) -> u32;
    pub const fn column(&self) -> u32;
}

Steps / History

  • [x] Implementation: #101030
  • [ ] Final comment period (FCP)
  • [ ] Stabilization PR

Unresolved Questions

  • None yet.

lilasta avatar Oct 11 '22 06:10 lilasta

anything needed before both this and #76156 can be stabilized?

programmerjake avatar Feb 19 '24 07:02 programmerjake

@programmerjake I think there is no blocker for stabilization since the functions just return a field value. However, I'm not sure if Location::caller can be stabilized. Additional testing is probably needed regarding its use in const generic parameters, macros, and so on.

lilasta avatar Feb 25 '24 08:02 lilasta

@programmerjake @lilasta doesn't seem to be any blockers here and this has sat long enough so all what's missing is someone sending the pr to stabilise it, so feel free to do so if you are interested

Dylan-DPC avatar Mar 06 '24 10:03 Dylan-DPC

FCP started in #76156 which also covers this issue.

Amanieu avatar Mar 22 '24 08:03 Amanieu