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
use std::io;//! This is a crate to say hello to the world/// Main entry functionfnmain(){println!("Hello, world!");}
This is because the compiler expects inner comments only before the first item (something like this). It doesn't point this out however, instead, it gives the rather cryptic error message:
<anon>:3:1: 3:46 error: expected outer comment
<anon>:3 //! This is a crate to say hello to the world
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It should say something like "Please place the inner comment to the top".
From reading the code, an error message like this would be sufficient.
Can that be achieved by changing the if near line 38:
if attr.node.style != ast::AttrStyle::Outer{returnErr(self.fatal("expected outer comment"));}
to something like
match attr.node.style{
ast::AttrStyle::Inner => returnErr(self.fatal("Expected outer comment. Inner comments are only allowed at the top, before any item.")),
ast::AttrStyle::Outer => (),
_ => returnErr(self.fatal("expected outer comment")),}
? I haven't tested because I haven't set up a development setup of rustc (and don't know whether there is a better way to do it).
The text was updated successfully, but these errors were encountered:
This piece of code fails compilation (playbot):
This is because the compiler expects inner comments only before the first item (something like this). It doesn't point this out however, instead, it gives the rather cryptic error message:
It should say something like "Please place the inner comment to the top".
From reading the code, an error message like this would be sufficient.
Can that be achieved by changing the if near line 38:
to something like
? I haven't tested because I haven't set up a development setup of rustc (and don't know whether there is a better way to do it).
The text was updated successfully, but these errors were encountered: