`format!` in a `proptest!` test: "macro `format!` is not supported yet" when a local module `alloc` is in scope
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 58/100
調査の方向性
Start by running the linked minimal reproducer from the issue and reading the proptest! macro expansion path in the Relax Rust JIT repository. Compare how format! is resolved inside and outside the generated test, with a local alloc module in scope. Done means the reproducer passes under relax test while preserving the shadowing module.
索引モデルが issue の本文から書いたものです。
説明
format! inside a proptest! test fails to expand when a local module named alloc is in scope:
mod gpu {
pub mod alloc {
pub fn bytes(n: usize) -> Vec<u8> { vec![0; n] }
}
}
use gpu::alloc;
#[cfg(test)]
mod tests {
use super::*;
use proptest::prelude::*;
proptest! {
#[test]
fn formats(n in 0usize..100) {
let s = format!("{n}");
prop_assert!(!s.is_empty());
}
}
}
cargo test: test result: ok. 1 passed
relax test: src/lib.rs:19:5: internal: macro `format!` is not supported yet
It looks like the local alloc shadows the alloc crate that format! comes from. Each of these makes it pass:
- deleting
use gpu::alloc; - calling
format!from an ordinary function in a child module with the sameuse super::*;, with noproptest!.
Minimal reproducer (proptest only), checked on 193e0b6c.
- 主要言語
- Rust
- スター
- 601
- フォーク
- 34
- 平均マージ
- 1時間 58分
- マージ済み PR(30日)
- 45
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
makepad/relax のほかの issue
-
std: `SliceIndex<str>` missing for `std::ops` ranges, so generic `R: SliceIndex<str>` bounds failオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 18/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 18/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
CI/CD ignore-for-release
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
eclipse-ankaios/ankaios#844 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
symposium-dev/symposium#530 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
topgrade-rs/topgrade#2540 ·
メンテナーはふだん 1 日以内に返信