mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-01 04:18:20 +00:00
internal: port rust-analyzer to new Salsa
This commit is contained in:
parent
394374e769
commit
74620e64ec
161 changed files with 3075 additions and 2331 deletions
|
|
@ -19,6 +19,16 @@ impl Edition {
|
|||
/// The current latest stable edition, note this is usually not the right choice in code.
|
||||
pub const CURRENT_FIXME: Edition = Edition::Edition2021;
|
||||
|
||||
pub fn from_u32(u32: u32) -> Edition {
|
||||
match u32 {
|
||||
0 => Edition::Edition2015,
|
||||
1 => Edition::Edition2018,
|
||||
2 => Edition::Edition2021,
|
||||
3 => Edition::Edition2024,
|
||||
_ => panic!("invalid edition"),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn at_least_2024(self) -> bool {
|
||||
self >= Edition::Edition2024
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue