1 // Copyright (C) 2020-2022 Free Software Foundation, Inc.
3 // This file is part of GCC.
5 // GCC is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU General Public License as published by the Free
7 // Software Foundation; either version 3, or (at your option) any later
10 // GCC is distributed in the hope that it will be useful, but WITHOUT ANY
11 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 // You should have received a copy of the GNU General Public License
16 // along with GCC; see the file COPYING3. If not see
17 // <http://www.gnu.org/licenses/>.
19 #ifndef RUST_FEATURE_H
20 #define RUST_FEATURE_H
22 #include "rust-session-manager.h"
23 #include "rust-optional.h"
40 ASSOCIATED_TYPE_BOUNDS
,
46 const std::string
&as_string () { return m_name_str
; }
47 Name
name () { return m_name
; }
48 const std::string
&description () { return m_description
; }
49 State
state () { return m_state
; }
51 static Optional
<Name
> as_name (const std::string
&name
);
52 static Feature
create (Name name
);
55 Feature (Name name
, State state
, const char *name_str
,
56 const char *rustc_since
, uint64_t issue_number
,
57 const Optional
<CompileOptions::Edition
> &edition
,
58 const char *description
)
59 : m_state (state
), m_name (name
), m_name_str (name_str
),
60 m_rustc_since (rustc_since
), issue (issue_number
), edition (edition
),
61 m_description (description
)
66 std::string m_name_str
;
67 std::string m_rustc_since
;
69 Optional
<CompileOptions::Edition
> edition
;
70 std::string m_description
;
72 static const std::map
<std::string
, Name
> name_hash_map
;