Skip to content

wrapping hidden code in doctest corrupts it #3182

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

Closed
scampi opened this issue Nov 7, 2018 · 0 comments · Fixed by #3183
Closed

wrapping hidden code in doctest corrupts it #3182

scampi opened this issue Nov 7, 2018 · 0 comments · Fixed by #3183
Labels
a-comments bug Panic, non-idempotency, invalid code, etc. only-with-option requires a non-default option value to reproduce

Comments

@scampi
Copy link
Contributor

scampi commented Nov 7, 2018

For example, the hidden line at https://github.com/rust-lang-nursery/stdsimd/blob/f244bd2a598f1542fceb1767cf62416c3d366934/stdsimd/mod.rs#L211 is wrapped over multiple lines, which fails the execution of the doctest with the following error:

--- src/../../../stdsimd/mod.rs - stdsimd::arch (line 210) stdout ----
error: incorrect close delimiter: `)`
 --> src/../../../stdsimd/mod.rs:212:8
  |
2 | #![cfg_attr(not(dox), feature(cfg_target_feature, target_feature
  |            -                 - close delimiter possibly meant for this
  |            |
  |            close delimiter possibly meant for this
3 | extern crate stdsimd;
4 | fn main() {
  |           - un-closed delimiter
5 | stdsimd))]
  |        ^ incorrect close delimiter
error: unexpected close delimiter: `}`
  --> src/../../../stdsimd/mod.rs:248:1
   |
41 | }
   | ^ unexpected close delimiter
thread 'src/../../../stdsimd/mod.rs - stdsimd::arch (line 210)' panicked at 'couldn't compile the test', librustdoc/test.rs:323:13

An issue on rustdoc is opened to follow this at rust-lang/rust#55713 but in the meantime disabling the wrap_comments parameter for doctest would be needed to avoid failing builds.

@topecongiro topecongiro added a-comments only-with-option requires a non-default option value to reproduce labels Nov 8, 2018
@nrc nrc added the bug Panic, non-idempotency, invalid code, etc. label Nov 9, 2018
@nrc nrc closed this as completed in #3183 Nov 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-comments bug Panic, non-idempotency, invalid code, etc. only-with-option requires a non-default option value to reproduce
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants