X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_privacy%2Fdiagnostics.rs;h=1b49409970ded6549c6abcf45bfa64b26deea627;hb=bcda58f49133921abd091d7f800732fe2c4e5a98;hp=d124ead5091d3123e6f0869fafb08f29f4612377;hpb=a40f2b6e9282765e3ad4c0e7278a905f05bbdc30;p=rust.git diff --git a/src/librustc_privacy/diagnostics.rs b/src/librustc_privacy/diagnostics.rs index d124ead5091..1b49409970d 100644 --- a/src/librustc_privacy/diagnostics.rs +++ b/src/librustc_privacy/diagnostics.rs @@ -27,8 +27,8 @@ pub fn foo (t: T) {} // same error ``` To solve this error, please ensure that the trait is also public. The trait -can be made inaccessible if necessary by placing it into a private inner module, -but it still has to be marked with `pub`. Example: +can be made inaccessible if necessary by placing it into a private inner +module, but it still has to be marked with `pub`. Example: ```ignore pub trait Foo { // we set the Foo trait public @@ -55,8 +55,8 @@ pub fn bar() -> Bar { // error: private type in public interface ``` To solve this error, please ensure that the type is also public. The type -can be made inaccessible if necessary by placing it into a private inner module, -but it still has to be marked with `pub`. +can be made inaccessible if necessary by placing it into a private inner +module, but it still has to be marked with `pub`. Example: ``` @@ -165,7 +165,7 @@ mod Bar { ``` To solve this issue, please ensure that all of the fields of the tuple struct -are public. Alternatively, provide a new() method to the tuple struct to +are public. Alternatively, provide a `new()` method to the tuple struct to construct it from a given inner value. Example: ``` @@ -205,8 +205,8 @@ pub struct Foo { // is private ``` -To fix this error, please ensure that all the fields of the struct, or -implement a function for easy instantiation. Examples: +To fix this error, please ensure that all the fields of the struct are public, +or implement a function for easy instantiation. Examples: ``` mod Bar {