since and before for stable versions do not consider the date of nightly build
还没有人认领这个 Issue。
评估
调研方向
先阅读 README 中对 since 和 before 的定义,然后使用报告中所示的 nightly cargo 命令复现该行为,并检查版本检测的入口点。使用 stable 1.74.0 的发布日期和带日期的 nightly 示例进行检查。完成的标准是,before 和 since 代码片段能针对这些编译器日期选择预期的代码。
由索引模型根据 Issue 内容生成。
描述
According to the README, #[rustversion::since(1.74)] should be
True on that stable release and any later compiler, including beta and nightly.
The key word in this sentence is later. Stable Rust 1.74.0 was released on 2023-11-16, but nightly-2023-09-14 is a nightly that came out more than 2 months before. The following snippet succeeds to compile when it should fail because the nightly is older than 1.74:
#[rustversion::since(1.74)]
fn main() {
println!("Hello, world!");
}
cargo +nightly-2023-09-13 b
Compiling rustversion v1.0.14
Compiling rust-version-test v0.1.0 (D:\git-repos\github\rust-version-test)
Finished dev [unoptimized + debuginfo] target(s) in 2.26s
Similarly, the below snippet fails to compile on nightly-2023-09-14:
#[rustversion::before(1.74)]
fn main() {
println!("Hello, world!");
}
cargo +nightly-2023-09-14 b
Compiling rustversion v1.0.14
Compiling rust-version-test v0.1.0 (D:\git-repos\github\rust-version-test)
error[E0601]: `main` function not found in crate `rust_version_test`
--> src\main.rs:4:2
|
4 | }
| ^ consider adding a `main` function to `src\main.rs`
For more information about this error, try `rustc --explain E0601`.
error: could not compile `rust-version-test` (bin "rust-version-test") due to previous error
- 主要语言
- Rust
- 星标
- 397
- 派生
- 22
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
dtolnay/rustversion 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
dtolnay/rustversion#69 ·
-
难度 3/5 1-2 天 新手友好度 35/100
dtolnay/rustversion#66 ·
-
难度 3/5 1-2 天 新手友好度 35/100
dtolnay/rustversion#41 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
dtolnay/rustversion#26 · 1 条评论 ·
查看 dtolnay/rustversion 的全部 Issue
相似的 Issue
-
priority: low
难度 2/5 1-3 小时 新手友好度 67/100
storytold/photocraft#15350 ·
维护者通常 1 天内回复
-
area:davinci
难度 2/5 1-3 小时 新手友好度 72/100
ubugeeei-prod/vize#13167 ·
维护者通常 1 天内回复
-
area:ui enhancement
难度 2/5 1-3 小时 新手友好度 74/100
transit-audio/transit#738 ·
维护者通常 1 天内回复
-
enhancement good first issue help wanted
难度 2/5 1-3 小时 新手友好度 91/100
hocinehacherouf/liberarr#78 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复