Improve error message for missing #[sp(var_size)] : attempt to compute <...> wich would overflow
还没有人认领这个 Issue。
评估
调研方向
首先跟踪 simple_parse 的大小检查路径及其对 static_assertions crate 的使用,然后查看 Rust issue #51999,了解其中提到的诊断限制。完成标准是将令人困惑的 overflow 输出替换为一个能够标识 struct 或 enum 字段并在可行时建议使用 #[sp(var_size)] 的错误。
由索引模型根据 Issue 内容生成。
描述
Currently, simple_parse ensures that it does not mistake static/dynamic sizes that it does not know about through the static_assertions crate. Unfortunately when a const assert fails, you get an ugly error message that is confusing at best :
attempt to compute `0_usize - 1_usize`, which would overflow
This error can be fixed by annotating your dynamic fields with #[sp(var_size)]
It would be nice to have an error that says :
- Where the annotation is needed (which field of which struct/enum)
- What needs to be added (the sp attribute above)
This might not be currently possible because of https://github.com/rust-lang/rust/issues/51999
- 主要语言
- Rust
- 星标
- 13
- 派生
- 1
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
elast0ny/simple_parse 的其他 Issue
-
Write tests未关闭enhancement good first issue
难度 4/5 3-5 天 新手友好度 35/100
elast0ny/simple_parse#2 · 1 条评论 · 1 个 reaction ·
查看 elast0ny/simple_parse 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 90/100
chroma-core/chroma#7879 ·
维护者通常 1 天内回复
-
priority middle
难度 1/5 1 小时以内 新手友好度 72/100
KATO-Hiro/AtCoderClans#12838 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复