Skip to content

Conversation

@dtolnay
Copy link
Member

@dtolnay dtolnay commented Sep 22, 2017

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
Contributor

r? @aturon

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

@sfackler
Copy link
Member

LGTM. I think Mutex might have something similar?

@dtolnay
Copy link
Member Author

dtolnay commented Sep 22, 2017

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
Member Author

dtolnay commented Sep 22, 2017

@bors r=sfackler rollup

@bors
Copy link
Collaborator

bors commented Sep 22, 2017

📌 Commit f9d92d2 has been approved by sfackler

@shepmaster shepmaster 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> }
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:master Sep 23, 2017
@dtolnay dtolnay deleted the borrowed branch November 19, 2017 08:36
@dtolnay dtolnay 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 free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-libs Relevant 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