Skip to content

Commit 37551e9

Browse files
committed
Auto merge of #56770 - satyarohith:patch-1, r=Centril
docs(rustc): make hello() public Running the example code [here](https://doc.rust-lang.org/rustc/what-is-rustc.html#basic-usage) throws error: ``` error[E0603]: function `hello` is private --> src/main.rs:4:10 | 4 | foo::hello(); | ^^^^^ ``` Making `hello()` public fixes the problem.
2 parents 50f3d6e + 9da1dd7 commit 37551e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/doc/rustc/src/what-is-rustc.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn main() {
5050
And a `foo.rs` that had this:
5151

5252
```rust,ignore
53-
fn hello() {
53+
pub fn hello() {
5454
println!("Hello, world!");
5555
}
5656
```
@@ -65,4 +65,4 @@ No need to tell `rustc` about `foo.rs`; the `mod` statements give it
6565
everything that it needs. This is different than how you would use a C
6666
compiler, where you invoke the compiler on each file, and then link
6767
everything together. In other words, the *crate* is a translation unit, not a
68-
particular module.
68+
particular module.

0 commit comments

Comments
 (0)