Comment indentation creates failing doctests

オープン
#3,530 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
tooling

調査の方向性

Start by reproducing the failure with the Rust doc attribute shown in the issue and the documented .clang_arg options. Read the bindgen code that handles C comments and generates Rust documentation to find where indentation becomes a failing doctest. Done means the generated documentation no longer creates a failing doctest for the example; the issue leaves the implementation approach open.

索引モデルが issue の本文から書いたものです。

説明

cargo test fails if the code for which bindings are generated inadvertently contains indented markdown code blocks.

For instance, if this is generated in a library:

#[doc = "This fails\n\n      to compile"]

a doctest is created that fails to compile.

Could this be avoided somehow? For instance, could I disable interpreting C comments as markdown when using

.clang_arg("-fretain-comments-from-system-headers")
.clang_arg("-fparse-all-comments")

E.g. using raw string

#[doc = r#"This does not fail\n\n      to compile"#]

does not seem to create a doctest.

主要言語
Rust
スター
5.3k
フォーク
846
平均マージ
2日 6時間
マージ済み PR(30日)
11

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rust-lang/rust-bindgen のほかの issue

rust-lang/rust-bindgen の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。