Skip to content

bat #58076

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

Closed
drvegass opened this issue Feb 2, 2019 · 2 comments
Closed

bat #58076

drvegass opened this issue Feb 2, 2019 · 2 comments

Comments

@drvegass
Copy link

drvegass commented Feb 2, 2019

fn main() {
    println!("Hello, world!");
}

(Playground)

Output:

Hello, world!

Errors:

   Compiling playground v0.0.1 (/playground)
    Finished release [optimized] target(s) in 0.46s
     Running `target/release/playground`

@killercup
Copy link
Member

I'm sorry, I don't understand what you are trying to say with this. What is the meaning of the headline "bat"? Can you explain what the issue is, what you expected to happen, what didn't work as expected?

@totorigolo
Copy link

Is the problem that, on the Playground, on the right-hand side of the screen, it's written "Standard Error"?

--- Standard Error ---                                  <-- here?
   Compiling playground v0.0.1 (/playground)
    Finished release [optimized] target(s) in 0.46s
     Running `target/release/playground`

--- Standard Output ---
Hello, world!

This doesn't mean that the execution ran into an error. According to Wikipedia:

Standard error is another output stream typically used by programs to output error messages or diagnostics. It is a stream independent of standard output and can be redirected separately.

Basically, we usually use stderr (STandarD ERRor) to log some messages, such as errors, diagnostics or general information, which are not directly related to the program you're writing. Here, the output tells you that the compiler successfully optimized and compiled your program (in 0.46s), and then that the program is running (hence the text on stdout (STandarD OUTput)).

We're lucky, the "Hello, World!" isn't broken 😉


If I'm correct, then I suggest you to read the Rust Book (https://doc.rust-lang.org/book/). It explains how to use Rust, and If I remember correctly introduces stdout and stderr. For the time being, just remember that println!() prints on stdout.

Moreover, if you need help, go to the Discord (https://discordapp.com/invite/rust-lang or the forum (https://users.rust-lang.org/) instead of this GitHub repository (frankly, you won't need to come here until you don't know how to use Rust).

PS: Please rename your Issue with a title like "What does "Standard Error" mean?" or "Why does Cargo output on stderr". "bat" doesn't help us understand your problem 🙂

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

4 participants