The Wayback Machine - https://web.archive.org/web/20201228170850/https://github.com/rust-lang/reference/pull/825
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

changed crate to super to fix compile error in the eg. #825

Open
wants to merge 7 commits into
base: master
from

Conversation

@prejrdev
Copy link

@prejrdev prejrdev commented Jun 2, 2020

No description provided.

Copy link
Collaborator

@ehuss ehuss left a comment

Thanks. The code is correct for the 2015 edition, but using super:: should make it valid for both editions.

@@ -134,8 +141,7 @@ pub mod submodule {
}
}
}
# fn main() {}
fn main(){};

This comment has been minimized.

@ehuss

ehuss Jun 2, 2020
Collaborator

These changes should be undone, it breaks the tests.

This comment has been minimized.

@prejrdev

prejrdev Jun 2, 2020
Author

ok, changed and now it passes the tests.

public_api();
let doube_limit = rate_limit * 2;
Comment on lines 124 to 125

This comment has been minimized.

@ehuss

ehuss Jun 2, 2020
Collaborator

I'm not sure this really belongs here. This example (especially this my_method) is here to illustrate the combination of the two rules above. I'm not sure how this relates to those rules?

This comment has been minimized.

@prejrdev

prejrdev Jun 2, 2020
Author

rate_limit is private only to the file itself and can't be accessed outside of it. i added it as an example of that fact to contrast with the note about public_api()

prejrdev added 3 commits Jun 2, 2020
@@ -89,9 +89,6 @@ Here's an example of a program which exemplifies the three cases outlined
above:

```rust
// This module is private, meaning that no external crate can access this

This comment has been minimized.

@ehuss

ehuss Jun 6, 2020
Collaborator

Why was this removed?

@@ -134,7 +137,6 @@ pub mod submodule {
}
}
}

This comment has been minimized.

@ehuss

ehuss Jun 6, 2020
Collaborator

This whitespace change seems unnecessary. It would probably be best to keep consistency with the rest of the file.

src/visibility-and-privacy.md Outdated Show resolved Hide resolved
src/visibility-and-privacy.md Outdated Show resolved Hide resolved
pub fn my_method() {
// Any item in the local crate may invoke the helper module's public
// interface through a combination of the two rules above.
crate_helper_module::crate_helper();
public_api(MAX_RATE);

This comment has been minimized.

@ehuss

ehuss Jun 6, 2020
Collaborator

It would probably be best to have a comment indicating what this is illustrating.

src/visibility-and-privacy.md Outdated Show resolved Hide resolved
prejrdev and others added 3 commits Jun 21, 2020
Co-authored-by: Eric Huss <[email protected]>
Co-authored-by: Eric Huss <[email protected]>
Co-authored-by: Eric Huss <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.