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

Make Debug representations of [Lazy, Once]*[Cell, Lock] consistent with Mutex and RwLock #109318

Merged
merged 1 commit into from Aug 1, 2023

Conversation

joboet
Copy link
Contributor

@joboet joboet commented Mar 18, 2023

Mutex prints <locked> as a field value when its inner value cannot be accessed, but the lazy types print a fixed string like "OnceCell(Uninit)". This could cause confusion if the inner type is a unit type named Uninit and does not respect the pretty-printing flag. With this change, the format message is now "OnceCell(<uninit>)", consistent with Mutex.

@rustbot
Copy link
Collaborator

rustbot commented Mar 18, 2023

r? @joshtriplett

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 18, 2023
@rustbot
Copy link
Collaborator

rustbot commented Mar 18, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rustbot
Copy link
Collaborator

rustbot commented Mar 18, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@bors
Copy link
Contributor

bors commented Apr 1, 2023

☔ The latest upstream changes (presumably #109483) made this pull request unmergeable. Please resolve the merge conflicts.

…istent with `Mutex` and `RwLock`

`Mutex` prints `<locked>` as a field value when its inner value cannot be accessed, but the lazy types print a fixed string like "`OnceCell(Uninit)`". This could cause confusion if the inner type is a unit type named `Uninit` and does not respect the pretty-printing flag. With this change, the format message is now "`OnceCell(<uninit>)`", consistent with `Mutex`.
@workingjubilee
Copy link
Contributor

r? libs-api

Please FCP (or, if this is a trivial enough change, decide it doesn't need FCP). This is a simple change that makes the Debug formats more consistent but it is user-facing.

@rustbot rustbot assigned dtolnay and unassigned joshtriplett Jul 31, 2023
@workingjubilee workingjubilee added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. I-libs-api-nominated The issue / PR has been nominated for discussion during a libs-api team meeting. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 31, 2023
@workingjubilee
Copy link
Contributor

For the record, I am in favor.

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dtolnay
Copy link
Member

dtolnay commented Jul 31, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Jul 31, 2023

📌 Commit b7e68df has been approved by dtolnay

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 31, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 31, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#109318 (Make `Debug` representations of `[Lazy, Once]*[Cell, Lock]` consistent with `Mutex` and `RwLock`)
 - rust-lang#113701 (Re-export core::ffi::FromBytesUntilNulError in std::ffi)
 - rust-lang#113804 (Resolve correct archive version name in `opt-dist`)
 - rust-lang#114165 (Add missing rvalues to smir)
 - rust-lang#114182 (clean up after 113312)
 - rust-lang#114193 (Update lexer emoji diagnostics to Unicode 15.0)
 - rust-lang#114200 (Detect trait upcasting through struct tail unsizing in new solver select)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit bcfa49f into rust-lang:master Aug 1, 2023
11 checks passed
@rustbot rustbot added this to the 1.73.0 milestone Aug 1, 2023
@dtolnay dtolnay removed the I-libs-api-nominated The issue / PR has been nominated for discussion during a libs-api team meeting. label Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants