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

chore: Rust 1.81で追加された機能を利用する #827

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

qryxip
Copy link
Member

@qryxip qryxip commented Sep 5, 2024

内容

Announcing Rust 1.81.0 | Rust Blog

  • #[allow(…)]#[expect(…)]に置き換えます。不要になった警告抑制をすみやかに消せるようにするためです。
    • C APIのnon_camel_case_typesだけ、Rust Analyzerがまだ#[expect(…)]に対応していなくてClippyとは別に文句を言ってくるため#[allow(…)]のままにしています。
      [追記] test_utilで生成しているc_api.rsについても、OSによってbindgenの生成コードが変わって管理が面倒なので#[expect(…)]にするのは諦めました。
  • #[allow(…)], #[expect(…)], #[forbid(…)]のすべてにreason = "…"を書きます。
    • allowexpectreasonをどういう文体で書くか迷ったのですが、コメントのような感じで書くことにしました。forbidの方はエラーメッセージとしての文体に。

関連 Issue

Rust 1.81: #826
前回: #816

その他

@qryxip qryxip force-pushed the chore-use-features-of-rust-1-81 branch from 9bd038e to 7e818b7 Compare September 5, 2024 18:36
Comment on lines -75 to +78
// https://crates.io/crates/rstest_reuse#use-rstest_resuse-at-the-top-of-your-crate
#[allow(clippy::single_component_path_imports)]
#[expect(
clippy::single_component_path_imports,
reason = "https://crates.io/crates/rstest_reuse/0.6.0#use-rstest_resuse-at-the-top-of-your-crate"
)]
Copy link
Member Author

@qryxip qryxip Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rstest_reuse v0.7.0ではreadmeからこのセクションが消えてた、のですがクレートの構成が未だにproc-macro一本のまま。大丈夫になったとは思えないのですがなんで消しちゃったのかよくわからない…
la10736/rstest@aca3c60

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あ、もしかしたら「rstest_reuse自体の他のマクロ」を呼ばないような設計になったのかも。

@qryxip qryxip force-pushed the chore-use-features-of-rust-1-81 branch from 7e818b7 to 60ee889 Compare September 5, 2024 18:49
Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

理由書かないといけないの、かなりいいですね。
いろんなプロジェクトのLinterをdisableにするコメントがいくつかありますが、そこでも必須寄りに考えても良いかもですね。

@Hiroshiba Hiroshiba merged commit 088ef7e into VOICEVOX:main Sep 6, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants