How to solve errors in Rustlings

In the introduction part, nothing happened. But during the next part, an error occurred. I don't know where the problem is. Please help me.

error: cannot find macro `printline` in this scope
 --> exercises\00_intro\intro2.rs:3:5
  |
3 |     printline!("Hello world!");
  |     ^^^^^^^^^ help: a macro with a similar name exists: `println`
 --> /rustc/9fc6b43126469e3858e2fe86cafb4f0fd5068869\library\std\src\macros.rs:138:1
  |
  = note: similarly named macro `println` defined here

error: could not compile `exercises` (bin "intro2") due to 1 previous error


Progress: [#>--------------------------------------------------------------------------------------------------]   1/94
Current exercise: exercises/00_intro/intro2.rs

h:hint / l:list / c:check all / x:reset / q:quit ?

Fixing errors is your task on these rustlings exercises.
I recommend reading the output in detail and see if that helps you figure it out.

4 Likes
In case you are really completely stuck, here the solution
fn main() {
    // TODO: Fix the code to print "Hello world!".
-   printline!("Hello world!");
+   println!("Hello world!");
}

To add to what @jer said, a lot of work has been put into trying to make Rust error messages helpful, so it is a good idea to get used to reading them. In this case, the error message points to exactly where the problem is and also suggests a fix.

3 Likes