Remove mention of possibility to specify the MSRV with a tilde/caret#6386
Remove mention of possibility to specify the MSRV with a tilde/caret#6386
Conversation
|
r? @ebroto (rust-highfive has picked a reviewer for you, use r? to override) |
|
|
||
| Tilde/Caret version requirements (like `^1.0` or `~1.2`) can be specified as well. | ||
| You can also omit the patch version when specifying the MSRV, so `msrv = 1.30` | ||
| is equivalent to `msrv = 1.30.0`. |
There was a problem hiding this comment.
@flip1995 I think omitting the patch version might not work. Parsing 1.30 doesn't throw an error but, comparisons with the Lint's MSRV are not correct. Specifying the MSRV as ^1.30 works though
I just ran the snippet below
use semver::{Version, VersionReq};
fn main() {
const MANUAL_STRIP_MSRV: Version = Version {
major: 1,
minor: 45,
patch: 0,
pre: Vec::new(),
build: Vec::new(),
};
match VersionReq::parse("1.30") {
Ok(vReq) => {
if !vReq.matches(&MANUAL_STRIP_MSRV) {
println!("Will lint!")
} else {
println!("Won't lint!")
}
},
Err(_) => println!("Error")
}
}There was a problem hiding this comment.
Oh, that's bad. We have to fix this and improve our testing.
There was a problem hiding this comment.
After playing around a bit, I think, that VersionReq is broken 😅 Look at this: Playground
Not what I would expect for the output. I think @taiki-e is right and we should write our own version parser.
There was a problem hiding this comment.
@flip1995 shall we also open an issue on semver?
There was a problem hiding this comment.
Yeah, can you please do this. I'm currently writing a RustVersion crate.
There was a problem hiding this comment.
@ebroto using Version for both is what we did initially but then thought that being able to ignore the patch version would be a nice to have since major changes aren't introduced in patches
I've opened an issue here: dtolnay/semver#221, maybe you guys can add your observations?
There was a problem hiding this comment.
@flip1995 I can work on switching to this new crate instead of using semver
There was a problem hiding this comment.
@flip1995 I can work on switching to this new crate instead of using
semver
That would be great. I want to get this crate to 100% code coverage though. This will be my weekend project.
There was a problem hiding this comment.
@suyash458 rustc-semver now has 100% code coverage (tested in CI) and has a 1.0.0 release.
There was a problem hiding this comment.
@suyash458
rustc-semvernow has 100% code coverage (tested in CI) and has a 1.0.0 release.
And it's not even the weekend yet 😄
|
@bors r+ |
|
📌 Commit 6eb2c27 has been approved by |
|
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
As @taiki-e explained in #6379 (comment), mentioning this might be problematic.
changelog: none