On 02/15/2013 04:55 PM, John Clements wrote:
This program:

pub trait MyTrait {
     /// doc comment with nothing after it...
}

...signals the error:

oiseau:/tmp clements> rustc --test bar.rs
bar.rs:3:0: 3:1 error: unexpected token: `}`
bar.rs:3 }
          ^

This looks ilke a parser bug to me, but maybe it's deliberately illegal to have 
a doc comment with nothing after it ?

John


It's a bit of both. It is deliberate that a doc comment (which desugars to an attribute) must precede something, but that results in crazy errors like this that confuse people.

Here are some related issues about problems with doc comments:

https://github.com/mozilla/rust/issues/2789
https://github.com/mozilla/rust/issues/4106
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to