forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Paper over privacy issues with Deref by changing field names.
Types that implement Deref can cause weird error messages due to their private fields conflicting with a field of the type they deref to, e.g., previously struct Foo { x: int } let a: Arc<Foo> = ...; println!("{}", a.x); would complain the the `x` field of `Arc` was private (since Arc has a private field called `x`) rather than just ignoring it. This patch doesn't fix that issue, but does mean one would have to write `a._ptr` to hit the same error message, which seems far less common. (This patch `_`-prefixes all private fields of `Deref`-implementing types.) cc rust-lang#12808
- Loading branch information
Showing
5 changed files
with
93 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
9698221
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.
r=alexcrichton