From 4833972067c00170269c7ee7a04f1a8ce1e1d15b Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Fri, 1 Jan 2021 17:22:23 +0100 Subject: Add support for Rust 2021. --- crates/base_db/src/input.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'crates/base_db') diff --git a/crates/base_db/src/input.rs b/crates/base_db/src/input.rs index 9567bcc42..2dd8fbe67 100644 --- a/crates/base_db/src/input.rs +++ b/crates/base_db/src/input.rs @@ -190,10 +190,11 @@ pub struct CrateData { pub proc_macro: Vec, } -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum Edition { - Edition2018, Edition2015, + Edition2018, + Edition2021, } #[derive(Default, Debug, Clone, PartialEq, Eq)] @@ -393,6 +394,7 @@ impl FromStr for Edition { let res = match s { "2015" => Edition::Edition2015, "2018" => Edition::Edition2018, + "2021" => Edition::Edition2021, _ => return Err(ParseEditionError { invalid_input: s.to_string() }), }; Ok(res) @@ -404,6 +406,7 @@ impl fmt::Display for Edition { f.write_str(match self { Edition::Edition2015 => "2015", Edition::Edition2018 => "2018", + Edition::Edition2021 => "2021", }) } } -- cgit v1.2.3