Line data Source code
1 :
2 : // Copyright (C) 2026 Free Software Foundation, Inc.
3 :
4 : // This file is part of GCC.
5 :
6 : // GCC is free software; you can redistribute it and/or modify it under
7 : // the terms of the GNU General Public License as published by the Free
8 : // Software Foundation; either version 3, or (at your option) any later
9 : // version.
10 :
11 : // GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 : // WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 : // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 : // for more details.
15 :
16 : // You should have received a copy of the GNU General Public License
17 : // along with GCC; see the file COPYING3. If not see
18 : // <http://www.gnu.org/licenses/>.
19 :
20 : #include "rust-feature-store.h"
21 :
22 : namespace Rust {
23 : namespace Features {
24 :
25 : EarlyFeatureGateStore &
26 4525 : EarlyFeatureGateStore::get ()
27 : {
28 4525 : static EarlyFeatureGateStore instance{};
29 4525 : return instance;
30 : }
31 :
32 : void
33 4 : EarlyFeatureGateStore::add (Feature::Name name, Error error)
34 : {
35 4 : potential_errors.emplace (name, error);
36 4 : }
37 :
38 : std::pair<Feature::Name, Error>
39 4 : EarlyFeatureGateStore::get_error ()
40 : {
41 4 : auto ret = potential_errors.front ();
42 4 : potential_errors.pop ();
43 4 : return ret;
44 : }
45 :
46 : } // namespace Features
47 : } // namespace Rust
|