Repository: lalrpop/lalrpop (language: rust)

Issue:
Define MSRV for 1.0
What will be the minimum supported rust version requirement of lalrpop? By looking CI, it looks like just `stable`.
That can be fine. But documenting will be a good idea.

- Our MSRV: Current stable version of Rust https://github.com/lalrpop/lalrpop/issues/742#issuecomment-1518503250
- [ ] Update cargo.toml
- [ ] Update contributing.md
- [x] Update CI to run on matching rust version


Discussion / hints:
I was curious as to what the low-end would be for MSRV. `cargo-msrv` seems to show the minimum as being Rust 1.56.1(which makes sense as that roughly lines up with the 2021 edition). The inline format args mentioned in #744 was introduced in 1.58 https://github.com/rust-lang/rust/pull/90473/. I'll note that `regex` is set to move to 1.60 https://github.com/rust-lang/regex/commit/a0d85bf413be73705de57c58d7f85c0fd963c9bf.

I'm personally fine with tracking `stable` but I would be curious to find out what the impact would be in terms of projects using lalrpop. If that's too aggressive, tracking the msrv of `regex` might be a good idea(and kind of offloads the decision to lalrpop's most popular dependency?).
@Pat-Lafon  That sounds like a good suggestion.
I believe the msrv can also be specified in the `cargo.toml`, maybe add that to checklist?
I missed the `#[default]` suggestion aswell in #744, this was introduced in 1.62... just of note. https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1620-2022-06-30
Not to block further patches, I'd like to suggest to mark 1.60 as current MSRV and listen more users' feedback before going to 1.0.
There are only 6 months gap after the 2021 edition, but will prohibit lalrpop users to have fragmented copies of `regex` from their dependency tree.

We can make it back or forward later before actually mark 1.0 - though backward will be a bit painful.

cc @nikomatsakis @yannham
One of my wishlist is this one: https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html#cargo-improvements-workspace-inheritance-and-multi-target-builds
I would not want to hold ourselves to the same standard as regex, personally. I'm not a big fan of old MSRVs. Rust doesn't backport security requirements and I don't think that people should use older builds. I recognize that just declaring stable is a bit aggressive. I would be more inclined to do something like "N-2" -- i.e., we track stable, but we hold off on adopting newer features gratuitously.
That sounds good enough. I will remove 1.60 build from CI and add the stable policy to Readme.
N-2 looks good enough to add message to pull request template rather than readme.

Fix patch:
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 000000000..6b05730d0
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,7 @@
+<!--
+Thanks for your contribution!
+
+We always run tests on the current stable version of Rust.
+To avoid unexpected CI result, consider updating Rust if you're using an earlier version.
+
+-->
\ No newline at end of file
diff --git a/Cargo.toml b/Cargo.toml
index eb5b0c8eb..fad05b18f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -14,6 +14,11 @@ authors = ["Niko Matsakis <niko@alum.mit.edu>"]
 license = "Apache-2.0 OR MIT"
 version = "0.19.9" # LALRPOP
 edition = "2021"
+# This is (very) soft limit of the minimum supported version.
+# Please update it when lalrpop requires a new feature.
+# We prefer to avoid the latest 2 stable versions. (e.g. at most 1.64 when stable is 1.66)
+# NOTE: Don't forget to update test.yaml as well.
+rust-version = "1.64"
 
 [workspace.dependencies]
 diff = { version = "0.1.12", default_features = false }
diff --git a/lalrpop-util/Cargo.toml b/lalrpop-util/Cargo.toml
index a858526c3..3584e97b9 100644
--- a/lalrpop-util/Cargo.toml
+++ b/lalrpop-util/Cargo.toml
@@ -8,6 +8,7 @@ edition.workspace = true
 authors.workspace = true
 license.workspace = true
 version.workspace = true
+rust-version.workspace = true
 
 [dependencies]
 regex = { workspace = true, optional = true }
diff --git a/lalrpop/Cargo.toml b/lalrpop/Cargo.toml
index f4cac6d83..8cf3f26a5 100644
--- a/lalrpop/Cargo.toml
+++ b/lalrpop/Cargo.toml
@@ -11,6 +11,7 @@ edition.workspace = true
 authors.workspace = true
 license.workspace = true
 version.workspace = true
+rust-version.workspace = true
 
 exclude = ["build.rs"]
 


Test patch:
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 7913cb1fc..f7d57a220 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -19,6 +19,7 @@ jobs:
     strategy:
       matrix:
         rust:
+          - "1.64"
           - stable
           - beta
           - nightly
diff --git a/lalrpop-test/Cargo.toml b/lalrpop-test/Cargo.toml
index 4edd3cb85..0d8ea458c 100644
--- a/lalrpop-test/Cargo.toml
+++ b/lalrpop-test/Cargo.toml
@@ -8,6 +8,7 @@ edition.workspace = true
 authors.workspace = true
 license.workspace = true
 version.workspace = true
+rust-version.workspace = true
 
 [dependencies]
 diff.workspace = true