Understanding Rust's println! macro return type
This is a straightforward language-knowledge question about Rust's standard library macros. It tests whether a candidate has read the documentation carefully or experimented enough with Rust to understand what the most commonly used output macro actually returns.
The question probes attention to detail: many developers use println! regularly without stopping to think about its signature. Getting this right requires either having looked at the macro's definition or having tried to assign its result to a variable. It's a quick way to separate candidates who have solid Rust fundamentals from those who have only skimmed the surface.
- The distinction between functions that return values and those that return unit type
- How Rust's type system handles side effects
- Reading and interpreting standard library documentation