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

"Rust for C++ programmers" says "Struct fields are private by default" #14016

Closed
ghost opened this issue May 7, 2014 · 3 comments
Closed

"Rust for C++ programmers" says "Struct fields are private by default" #14016

ghost opened this issue May 7, 2014 · 3 comments

Comments

@ghost
Copy link

ghost commented May 7, 2014

Is that correct?

This sentence is right at the start of paragraph "Visibility".

@pnkfelix
Copy link
Member

pnkfelix commented May 7, 2014

Yes, they are private by default. (This was a change made ... semi-recently.)

What is leading you to think that they are not?

For further discussion, see the following tickets and RFC: #8122 , rust-lang/rfcs#1 , RFC 0004

(I will probably close this issue unless someone identifies an actual bug in the language or the documentation.)

@ghost
Copy link
Author

ghost commented May 7, 2014

But the manual says:
"By default, everything in rust is private, with two exceptions. The first exception is that struct fields are public by default"

@ghost
Copy link
Author

ghost commented May 7, 2014

Looks like my mistake. I thought from 0.10 compiler and manual that struct fields are public. And i did not realize that "Rust for C++ programmers" is newer than 0.10. But I see now that in the nigthly version of the manual struct fields are already "private".
Sorry.

@ghost ghost closed this as completed May 7, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant