diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2014-05-24 21:35:53 +1000 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2014-05-25 10:23:37 +1000 |
| commit | 9698221f919a80f2a0810e17c8ee8e80da8cefeb (patch) | |
| tree | 29b0bb162d7e94d1ebc91d44d6265f211914934b /src/libsyntax | |
| parent | 9e244d708461d5028066a59e70866f52517e7b85 (diff) | |
| download | rust-9698221f919a80f2a0810e17c8ee8e80da8cefeb.tar.gz rust-9698221f919a80f2a0810e17c8ee8e80da8cefeb.zip | |
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 #12808
Diffstat (limited to 'src/libsyntax')
0 files changed, 0 insertions, 0 deletions
