You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fnmain(){/// print to terminalprintln!("Hello, world!");}
Error:
rustc 1.14.0-nightly (289f3a4ca 2016-09-29)
error: attributes on non-item statements and expressions are experimental. (see issue #15701)
--> <anon>:2:5
|
2 | /// print to terminal
| ^^^^^^^^^^^^^^^^^^^^^
The current error message is pretty unfortunate for new users. Imagine someone saw /// everywhere and just assumed it was the comment syntax. Then they are presented with this weird error about attributes, items, statements, experimental features, and issue numbers, and all they wanted to do was comment their code! Many advanced users don't even know doc comments desugar to attributes in my experience.
Ideally we would detect this and print a help message suggesting the correct non-doc comment syntax.
Code: playpen
Error:
The current error message is pretty unfortunate for new users. Imagine someone saw
///
everywhere and just assumed it was the comment syntax. Then they are presented with this weird error about attributes, items, statements, experimental features, and issue numbers, and all they wanted to do was comment their code! Many advanced users don't even know doc comments desugar to attributes in my experience.Ideally we would detect this and print a
help
message suggesting the correct non-doc comment syntax.cc @joshtriplett
The text was updated successfully, but these errors were encountered: