Skip to content
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

Consider column information for dbg! (matching 1.76.0's) #1065

Closed
ojeda opened this issue Feb 25, 2024 · 1 comment
Closed

Consider column information for dbg! (matching 1.76.0's) #1065

ojeda opened this issue Feb 25, 2024 · 1 comment
Labels
good first issue Good for newcomers • lib Related to the `rust/` library.

Comments

@ojeda
Copy link
Member

ojeda commented Feb 25, 2024

In the kernel, the std_vendor.rs file contains some functionality that comes from std. In Rust 1.76.0, rust-lang/rust#114962 got merged. This issue is about researching whether updating dbg! to match upstream with the column information would make sense for the kernel as well. For instance, it would be interesting to double-check whether the formatting optimizations apply as expected in the kernel (if not, please create an issue about it). Please submit a patch to the mailing list with the dbg! update, perhaps as an RFC, explaining your findings and why the column information would be useful (or not), similar to what was done in Rust upstream.


This requires submitting a proper patch to the LKML and the Rust for Linux mailing list. Please recall to test your changes (including generating the documentation if changed, running the Rust doctests if changed, etc.), to use a proper title for the commit, to sign your commit under the Developer's Certificate of Origin and to add a Link: tag to this issue. Please see https://rust-for-linux.com/contributing for details.

Please take this issue only if you are new to the kernel development process and you would like to use it as a test to submit your first patch to the kernel. Please do not take it if you do not plan to make other contributions to the kernel.

@ojeda ojeda added • lib Related to the `rust/` library. good first issue Good for newcomers labels Feb 25, 2024
raxyte added a commit to raxyte/linux that referenced this issue Apr 14, 2024
In Rust 1.76.0, the `dbg!()` macro was updated to also format the column
number. The reason cited was usage of a few characters worth of
horizontal space while allowing direct jumps to the source location. [1]

Link: rust-lang/rust#114962 [1]
Link: Rust-for-Linux#1065

Signed-off-by: Raghav Narang <dev@raxyte.com>
ojeda pushed a commit to ojeda/linux that referenced this issue May 5, 2024
In Rust 1.76.0, the `dbg!()` macro was updated to also format the column
number. The reason cited was usage of a few characters worth of
horizontal space while allowing direct jumps to the source location. [1]

Link: rust-lang/rust#114962 [1]
Link: Rust-for-Linux#1065
Signed-off-by: Raghav Narang <dev@raxyte.com>
Reviewed-by: Trevor Gross <tmgross@umich.edu>
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: https://lore.kernel.org/r/eba70259-9b10-4bf7-ac4f-d7accf6b8891@smtp-relay.sendinblue.com
[ Fixed commit author name and removed spurious newline in message. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
@ojeda
Copy link
Member Author

ojeda commented May 17, 2024

This is now in mainline.

@ojeda ojeda closed this as completed May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers • lib Related to the `rust/` library.
Development

No branches or pull requests

1 participant