Skip to content

Less confusing placeholder when RefCell is exclusively borrowed - #44770

Merged
bors merged 1 commit into
rust-lang:masterfrom
dtolnay:borrowed
Sep 23, 2017
Merged

Less confusing placeholder when RefCell is exclusively borrowed#44770
bors merged 1 commit into
rust-lang:masterfrom
dtolnay:borrowed

Conversation

@dtolnay

Copy link
Copy Markdown
Member

Based on ExpHP's comment in RefCell.borrow_mut get strange result:

it would perhaps be nicer if it didn't put something that could be misinterpreted as a valid string value

The previous Debug implementation would show:

RefCell { value: "<borrowed>" }

The new one is:

RefCell { value: <borrowed> }

Based on ExpHP's comment in
https://users.rust-lang.org/t/refcell-borrow-mut-get-strange-result/12994
> it would perhaps be nicer if it didn't put something that could be
> misinterpreted as a valid string value
The previous Debug implementation would show:
RefCell { value: "<borrowed>" }
The new one is:
RefCell { value: <borrowed> }
@rust-highfive

Copy link
Copy Markdown
Contributor

r? @aturon

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

@sfackler

Copy link
Copy Markdown
Member

LGTM. I think Mutex might have something similar?

@dtolnay

Copy link
Copy Markdown
MemberAuthor

Here is what I ran to check for anything similar. RefCell is the only one outside of tests.

rg '\.field\("[^"]*", &"'

Mutex prints <locked> correctly without quotes but is wrong for other reasons. I filed #44771 to follow up. :(

@dtolnay

Copy link
Copy Markdown
MemberAuthor

@bors r=sfackler rollup

@bors

bors commented Sep 22, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit f9d92d2 has been approved by sfackler

@shepmastershepmaster added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Sep 22, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Sep 23, 2017
Less confusing placeholder when RefCell is exclusively borrowed
Based on ExpHP's comment in [*RefCell.borrow_mut get strange result*](https://users.rust-lang.org/t/refcell-borrow-mut-get-strange-result/12994):
> it would perhaps be nicer if it didn't put something that could be misinterpreted as a valid string value
The previous Debug implementation would show:
RefCell { value: "<borrowed>" }
The new one is:
RefCell { value: <borrowed> }
@frewsxcvfrewsxcv mentioned this pull request Sep 23, 2017
bors added a commit that referenced this pull request Sep 23, 2017
Rollup of 14 pull requests
- Successful merges: #44554, #44648, #44658, #44712, #44717, #44726, #44745, #44746, #44749, #44759, #44770, #44773, #44776, #44778
- Failed merges:
@bors
bors merged commit f9d92d2 into rust-lang:masterSep 23, 2017
@dtolnay
dtolnay deleted the borrowed branch November 19, 2017 08:36
@dtolnaydtolnay added T-libs Relevant to the library team, which will review and decide on the PR/issue. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 14, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-libsRelevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@dtolnay@rust-highfive@sfackler@bors@shepmaster@aturon