3 ms·
please, I have to know, what is evil_lincoln testing?
by AndyKelley 9y ago
please, I have to know, what is evil_lincoln testing?
- steveklabnik 9y agoThis is why I love this file. To understand what evil_lincoln is doing, you have to understand very old Rust. Here's the commit that introduced it: https://github.com/rust-lang/rust/commit/664b0ad3fcead4fe4d22c05065a82a338770c429 https://github.com/rust-lang/rust/commit/664b0ad3fcead4fe4d2... fn evil_lincoln() { let evil <- log "lincoln"; } log was a keyword to print stuff to the screen. Hence the joke, https://en.wikipedia.org/wiki/Lincoln_Logs https://en.wikipedia.org/wiki/Lincoln_Logs Now that log is the println! macro, the joke is lost. It doesn't say explicitly why this is "weird", but given some other comments in the file, // FIXME: Doesn't compile //let _x = log true == (ret 0); I am assuming that using the return value of log was buggy, and so this tested that you could save it in a variable. I don't remember the exact semantics of log, but if it's like println!, it returns (), which is useless, so binding it to a variable is something you'd never write in real code, so it's "weird" in that sense.