macro

unimplemented! — Mark a deliberately missing implementation

Indicate an implementation is absent; the macro panics when reached. It communicates an implementation gap rather than an impossible state. For a known unsupported request in a public API, return a documented error instead of panicking. Expression result: !. Expected result (not executed): stdout: 'plain report\n'; no stderr. Common mistake: Treating unimplemented! as a way to return an unsupported-feature Result automatically.

Formal Syntax & Structure

rust syntaxrust
unimplemented!() or unimplemented!("message", arguments...)

Working Example

Example Snippetrust
enum Export { Text, Pdf }fn export(kind: Export) -> &'static str {    match kind {        Export::Text => "plain report",        Export::Pdf => unimplemented!("PDF exporter"),    }}fn main() { println!("{}", export(Export::Text)); }
Rust Reference