diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-01 16:33:45 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-01 16:33:45 +0000 |
commit | c92c9fdc52ee04a88ee2950a93afc34b4870616b (patch) | |
tree | 4d0b7da08fe7955d7a676a075e9011e296d55e86 /crates/project_model/src | |
parent | 56a7bf7ede12f6bec194265ea4a95911c9e469bd (diff) | |
parent | 273d2f91234367bd1348a6c4d84df22fe35becf5 (diff) |
Merge #7123
7123: Add support for Rust 2021. r=lnicola a=m-ou-se
This adds `2021` in all places where rust-analyzer already knew about `2015` and `2018`.
The only edition-specific behaviour I could find in the source code was gated on a direct comparison with `Edition2015`, so `Edition2021` should (correctly) behave the same as `Edition2018`:
https://github.com/rust-analyzer/rust-analyzer/blob/56a7bf7ede12f6bec194265ea4a95911c9e469bd/crates/hir_def/src/nameres/path_resolution.rs#L132
Co-authored-by: Mara Bos <[email protected]>
Diffstat (limited to 'crates/project_model/src')
-rw-r--r-- | crates/project_model/src/project_json.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/project_model/src/project_json.rs b/crates/project_model/src/project_json.rs index aab279223..af884eb84 100644 --- a/crates/project_model/src/project_json.rs +++ b/crates/project_model/src/project_json.rs | |||
@@ -139,6 +139,8 @@ enum EditionData { | |||
139 | Edition2015, | 139 | Edition2015, |
140 | #[serde(rename = "2018")] | 140 | #[serde(rename = "2018")] |
141 | Edition2018, | 141 | Edition2018, |
142 | #[serde(rename = "2021")] | ||
143 | Edition2021, | ||
142 | } | 144 | } |
143 | 145 | ||
144 | impl From<EditionData> for Edition { | 146 | impl From<EditionData> for Edition { |
@@ -146,6 +148,7 @@ impl From<EditionData> for Edition { | |||
146 | match data { | 148 | match data { |
147 | EditionData::Edition2015 => Edition::Edition2015, | 149 | EditionData::Edition2015 => Edition::Edition2015, |
148 | EditionData::Edition2018 => Edition::Edition2018, | 150 | EditionData::Edition2018 => Edition::Edition2018, |
151 | EditionData::Edition2021 => Edition::Edition2021, | ||
149 | } | 152 | } |
150 | } | 153 | } |
151 | } | 154 | } |