rust-lang-ja / ac-library-rs

ac-library-rs is a rust port of AtCoder Library (ACL).
Creative Commons Zero v1.0 Universal
217 stars 26 forks source link

Bump Rust version to 1.56.0 #118

Closed TonalidadeHidrica closed 7 months ago

TonalidadeHidrica commented 1 year ago

Currently, the MSRV (Minimum Supported Rust Version) is essentially 1.42.0, which is intednded to work in AtCoder.
Now that AtCoder is updating the version, it may be a good idea to bump supported version, so that we can now use 2021 Edition and various new features.

However we also need to consider other websites (CodeForces, yukicoder, ...) too. I'm going to survey the Rust versions used in other platforms and post them as a succeeding comment.

TonalidadeHidrica commented 1 year ago

Here is a collection of "famous" online judge sites, accompanied by available rust versions. (The choice is very subjective. Feel free to suggest other websites that are somewhat famous. I also tried to include as much Japanese judges as possible.)

FYI:

See also this Wiki, which is not as comprehensive as this list, but contains some more useful information.


Basically, I think we may bump MSRV to Rust 1.56.0, adopting Rust 2021. Apart from GCJ, the only websites that will be no longer supported are AOJ and MojaCoder. Do you think it is OK, or shuold we stick to 1.42-ish versions?

TonalidadeHidrica commented 1 year ago

My bad, I shuold have checked #83 first. Anyway, this issue suggests a completely different direction from #83 , and I want other users' opinions.

TonalidadeHidrica commented 1 year ago

One possible downside of upgrading the edition to 2021 is that it may no longer compile when "expanded."

mizar commented 1 year ago

yukicoder Bumped 1.68.1 (2021).

togatoga commented 10 months ago

@TonalidadeHidrica

Thank you for bringing this topic. I think it's enough to stick with AtCoder platform because ac-library-rs is a rust port of AtCoder Library. For me, it's super painful to keep using 1.42.0 version because some platforms seem not to support 1.42.0. I want to bump the version as soon as possible.

koba-e964 commented 10 months ago

Universal Cup (contest.ucup.ac) seems to support Rust 1.66.0. (evidence: the following code

fn main() {
// 1.66.0
let x = Some((1, "hi"));
let y = None::<(u8, u32)>;

assert_eq!(x.unzip(), (Some(1), Some("hi")));
assert_eq!(y.unzip(), (None, None));
// 1.67.0
assert_eq!(5i32.checked_ilog(5), Some(1));
}

emits a compilation error: https://contest.ucup.ac/submission/225227)

Maybe somewhere between 1.60.0 and 1.70.0 should be fine.

koba-e964 commented 10 months ago

Personal opinion: we want to support AtCoder (1.70.0) and Codeforces (1.72.0) because:

All other platforms are insignificant compared to these two, so we can update to 1.70.0.

koba-e964 commented 7 months ago

Closing because https://github.com/rust-lang-ja/ac-library-rs/pull/137 was merged.