LCOV - code coverage report
Current view: top level - gcc/rust/checks/errors - rust-feature.h (source / functions) Coverage Total Hit
Test: gcc.info Lines: 100.0 % 6 6
Test Date: 2024-12-21 13:15:12 Functions: 100.0 % 1 1
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: - 0 0

             Branch data     Line data    Source code
       1                 :             : // Copyright (C) 2020-2024 Free Software Foundation, Inc.
       2                 :             : 
       3                 :             : // This file is part of GCC.
       4                 :             : 
       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
       8                 :             : // version.
       9                 :             : 
      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
      13                 :             : // for more details.
      14                 :             : 
      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/>.
      18                 :             : 
      19                 :             : #ifndef RUST_FEATURE_H
      20                 :             : #define RUST_FEATURE_H
      21                 :             : 
      22                 :             : #include "rust-session-manager.h"
      23                 :             : #include "optional.h"
      24                 :             : 
      25                 :             : namespace Rust {
      26                 :             : 
      27                 :             : class Feature
      28                 :             : {
      29                 :             : public:
      30                 :             :   enum class State
      31                 :             :   {
      32                 :             :     ACCEPTED,
      33                 :             :     ACTIVE,
      34                 :             :     REMOVED,
      35                 :             :     STABILIZED,
      36                 :             :   };
      37                 :             : 
      38                 :             :   enum class Name
      39                 :             :   {
      40                 :             :     ASSOCIATED_TYPE_BOUNDS,
      41                 :             :     INTRINSICS,
      42                 :             :     RUSTC_ATTRS,
      43                 :             :     DECL_MACRO,
      44                 :             :     AUTO_TRAITS,
      45                 :             :     EXTERN_TYPES,
      46                 :             :     LANG_ITEMS,
      47                 :             :     NO_CORE,
      48                 :             :   };
      49                 :             : 
      50                 :             :   const std::string &as_string () { return m_name_str; }
      51                 :             :   Name name () { return m_name; }
      52                 :             :   const std::string &description () { return m_description; }
      53                 :             :   State state () { return m_state; }
      54                 :           5 :   unsigned issue () { return m_issue; }
      55                 :             : 
      56                 :             :   static tl::optional<Name> as_name (const std::string &name);
      57                 :             :   static Feature create (Name name);
      58                 :             : 
      59                 :             : private:
      60                 :           5 :   Feature (Name name, State state, const char *name_str,
      61                 :             :            const char *rustc_since, unsigned issue_number,
      62                 :             :            const tl::optional<CompileOptions::Edition> &edition,
      63                 :             :            const char *description)
      64                 :           5 :     : m_state (state), m_name (name), m_name_str (name_str),
      65                 :           5 :       m_rustc_since (rustc_since), m_issue (issue_number), edition (edition),
      66                 :           5 :       m_description (description)
      67                 :           5 :   {}
      68                 :             : 
      69                 :             :   State m_state;
      70                 :             :   Name m_name;
      71                 :             :   std::string m_name_str;
      72                 :             :   std::string m_rustc_since;
      73                 :             :   unsigned m_issue;
      74                 :             :   tl::optional<CompileOptions::Edition> edition;
      75                 :             :   std::string m_description;
      76                 :             : 
      77                 :             :   static const std::map<std::string, Name> name_hash_map;
      78                 :             : };
      79                 :             : 
      80                 :             : } // namespace Rust
      81                 :             : #endif
        

Generated by: LCOV version 2.1-beta

LCOV profile is generated on x86_64 machine using following configure options: configure --disable-bootstrap --enable-coverage=opt --enable-languages=c,c++,fortran,go,jit,lto,rust,m2 --enable-host-shared. GCC test suite is run with the built compiler.