-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stabilize const_caller_location
and const_location_fields
#122291
Conversation
rustbot has assigned @Mark-Simulacrum. Use r? to explicitly pick a reviewer |
This still needs FCP. |
I've written a stabilization report. Is the content sufficient to request the initiation of FCP? (I apologize as it's my first time submitting a stabilization PR) Stabilization ReportSummaryThe const_location_fields feature enables the utilization of the file, line, and column fields of core::location::Location in a const context. use core::panic::Location;
const LOCATION: &Location<'static> = Location::caller();
const FILE: &str = LOCATION.file();
const LINE: u32 = LOCATION.line();
const COLUMN: u32 = LOCATION.column(); This feature is used in conjunction with Location::caller (tracked in
Tests |
We discussed this in the libs-api meeting today. We are happy to const-stabilize these methods, but this should happen alongside the const-stabilization of |
c6f8b7d
to
d324d6d
Compare
const_location_fields
const_caller_location
and const_location_fields
FCP started in #76156. |
FCP has finished, this PR should be changed to also stabilize const_caller_location. |
Isn't it already included in the PR? |
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.
Thank you!
@bors r+ |
…ields, r=dtolnay Stabilize `const_caller_location` and `const_location_fields` Closes rust-lang#102911. Closes rust-lang#76156. tests: [library/core/tests/panic/location.rs](https://github.com/rust-lang/rust/blob/3521a2f2f317cb978063842485c7d1bc86ec82b6/library/core/tests/panic/location.rs) API: ```rust // core::panic::location impl Location { pub const fn caller() -> &'static Location<'static>; pub const fn file(&self) -> &str; pub const fn line(&self) -> u32; pub const fn column(&self) -> u32; } ```
…ields, r=dtolnay Stabilize `const_caller_location` and `const_location_fields` Closes rust-lang#102911. Closes rust-lang#76156. tests: [library/core/tests/panic/location.rs](https://github.com/rust-lang/rust/blob/3521a2f2f317cb978063842485c7d1bc86ec82b6/library/core/tests/panic/location.rs) API: ```rust // core::panic::location impl Location { pub const fn caller() -> &'static Location<'static>; pub const fn file(&self) -> &str; pub const fn line(&self) -> u32; pub const fn column(&self) -> u32; } ```
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#114788 (impl get_mut_or_init and get_mut_or_try_init for OnceCell and OnceLock) - rust-lang#122291 (Stabilize `const_caller_location` and `const_location_fields`) - rust-lang#123321 (Bump dependencies) - rust-lang#123339 (optimize tidy check on `src/tools/tidy/src/issues.txt`) - rust-lang#123357 (CI: Redirect stderr to stdout to order GHA logs) - rust-lang#123504 (bootstrap: split cargo-miri test into separate Step) r? `@ghost` `@rustbot` modify labels: rollup
…ields, r=dtolnay Stabilize `const_caller_location` and `const_location_fields` Closes rust-lang#102911. Closes rust-lang#76156. tests: [library/core/tests/panic/location.rs](https://github.com/rust-lang/rust/blob/3521a2f2f317cb978063842485c7d1bc86ec82b6/library/core/tests/panic/location.rs) API: ```rust // core::panic::location impl Location { pub const fn caller() -> &'static Location<'static>; pub const fn file(&self) -> &str; pub const fn line(&self) -> u32; pub const fn column(&self) -> u32; } ```
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#114788 (impl get_mut_or_init and get_mut_or_try_init for OnceCell and OnceLock) - rust-lang#122291 (Stabilize `const_caller_location` and `const_location_fields`) - rust-lang#123339 (optimize tidy check on `src/tools/tidy/src/issues.txt`) - rust-lang#123357 (CI: Redirect stderr to stdout to order GHA logs) - rust-lang#123504 (bootstrap: split cargo-miri test into separate Step) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#114788 (impl get_mut_or_init and get_mut_or_try_init for OnceCell and OnceLock) - rust-lang#122291 (Stabilize `const_caller_location` and `const_location_fields`) - rust-lang#123357 (CI: Redirect stderr to stdout to order GHA logs) - rust-lang#123504 (bootstrap: split cargo-miri test into separate Step) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#122291 - lilasta:stabilize_const_location_fields, r=dtolnay Stabilize `const_caller_location` and `const_location_fields` Closes rust-lang#102911. Closes rust-lang#76156. tests: [library/core/tests/panic/location.rs](https://github.com/rust-lang/rust/blob/3521a2f2f317cb978063842485c7d1bc86ec82b6/library/core/tests/panic/location.rs) API: ```rust // core::panic::location impl Location { pub const fn caller() -> &'static Location<'static>; pub const fn file(&self) -> &str; pub const fn line(&self) -> u32; pub const fn column(&self) -> u32; } ```
Closes #102911. Closes #76156.
tests: library/core/tests/panic/location.rs
API: