Error on Rust Palayground?

3 views
Skip to first unread message

Chester Wyke

unread,
Aug 14, 2022, 4:42:08 PMAug 14
to Begin Rust
Hi,

I'm working through the begin rust book and using rust playground. In chapter 2 section 3 there is a code example which works find on my local machine but gives me an error in rust playground. The relevant part of the code snippet is:

fn main(/* hey, I can do this! */) {
// snip
}

The comment inside of the brackets in main appears to be causing some confusion on rust playground. If changed to:

fn main() {
   // snip
}

Then it works fine with no error. Going to file an issue with rust playground but just mentioning it in case anyone else is bumping up against this issue.

Chester Wyke

unread,
Aug 14, 2022, 4:58:50 PMAug 14
to Begin Rust
Turns out there is an existing issue for this. I will update with the conclusion of the output of the ticket. I proposed to submit a PR to fix it so that it will work with the example.

Just out of curiosity did it always used to do this on this example, or were the examples tried locally (where it works without issue) or did rust playground change after the book was written? Not trying to assign fault in any way just curious. Really enjoying the book so far. Working well with my 6 year old (have to teach her some of the math as we go but that's a plus not a problem).

Michael Snoyman

unread,
Aug 15, 2022, 7:06:39 AMAug 15
to Begin Rust
Thanks for tracking that down! To answer your question: I _think_ we tested that code sample (and all the others) in the Playground, but I can't be 100% certain.

I'm really happy to hear it's going well! I think a 6 year old is the youngest user of the book I've heard of so far. I'd certainly be interested to hear more about how the progress goes.
--
You received this message because you are subscribed to the Google Groups "Begin Rust" group.
To unsubscribe from this group and stop receiving emails from it, send an email to begin-rust+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chester Wyke

unread,
Aug 15, 2022, 2:46:18 PMAug 15
to Begin Rust
Hi,

Thanks for the response. Happy to let you know how it goes. So far it's going well. She's enjoying the math she needs to learn in the process. Right now she's having fun building the trees for section 2.4
Reply all
Reply to author
Forward
0 new messages