Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc comments get broken #175

Open
martin-t opened this issue Oct 9, 2019 · 1 comment
Open

Doc comments get broken #175

martin-t opened this issue Oct 9, 2019 · 1 comment
Labels
readability Generated code is hard to read and can be simplified

Comments

@martin-t
Copy link

martin-t commented Oct 9, 2019

/// Does nothing
void test1() {}

/** Stilll nothing
 */
void test2() {}

results in

// / Does nothing
#[no_mangle]
pub unsafe extern "C" fn test1() { }
/* * Stilll nothing
 */
#[no_mangle]
pub unsafe extern "C" fn test2() { }

There's an extra space after the comment's first 2 chars.

Tested on the website and latest git (d1bbe9f).

@rinon
Copy link
Contributor

rinon commented Oct 16, 2019

Yes, this escaping of doc comments was intentional as not all doc comments in all positions are valid in rust (see #61). I'll keep this open as we can probably improve doc comment handling by parsing the comment and position and allowing valid combinations.

@rinon rinon added the readability Generated code is hard to read and can be simplified label Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
readability Generated code is hard to read and can be simplified
Projects
None yet
Development

No branches or pull requests

2 participants