LCOV - code coverage report
Current view: top level - gcc/rust/typecheck - rust-hir-path-probe-type.h (source / functions) Coverage Total Hit
Test: gcc.info Lines: 100.0 % 6 6
Test Date: 2026-10-03 16:17:38 Functions: 100.0 % 1 1
Legend: Lines:     hit not hit

            Line data    Source code
       1              : // Copyright (C) 2020-2026 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_HIR_PATH_PROBE_TYPE_H
      20              : #define RUST_HIR_PATH_PROBE_TYPE_H
      21              : 
      22              : #include "rust-hir-map.h"
      23              : #include "rust-hir-path-probe.h"
      24              : #include "rust-tyty.h"
      25              : 
      26              : namespace Rust {
      27              : namespace Resolver {
      28              : 
      29          207 : struct TypePathProbeResult
      30              : {
      31              :   std::set<PathProbeCandidate> type_candidates;
      32              :   std::set<PathProbeCandidate> non_type_matches;
      33              : 
      34              :   bool has_type_candidates () const { return !type_candidates.empty (); }
      35              : 
      36              :   bool has_non_type_matches () const { return !non_type_matches.empty (); }
      37              : 
      38              :   bool is_empty () const
      39              :   {
      40              :     return type_candidates.empty () && non_type_matches.empty ();
      41              :   }
      42              : };
      43              : 
      44          207 : class TypePathProbe
      45              : {
      46              : public:
      47              :   static TypePathProbeResult Probe (TyTy::BaseType *receiver,
      48              :                                     const HIR::PathIdentSegment &segment_name);
      49              : 
      50              : private:
      51          207 :   TypePathProbe (TyTy::BaseType *receiver,
      52              :                  const HIR::PathIdentSegment &segment_name)
      53          207 :     : mappings (Analysis::Mappings::get ()), receiver (receiver),
      54          207 :       search (segment_name)
      55          207 :   {}
      56              : 
      57              :   TypePathProbeResult probe ();
      58              : 
      59              :   void probe_generic ();
      60              :   void probe_adt (TyTy::ADTType *adt);
      61              :   void probe_fallback ();
      62              : 
      63              :   bool process_impl_item (HirId id, HIR::ImplItem *item, HIR::ImplBlock *impl);
      64              : 
      65              :   void process_trait_impl_item (HIR::ImplBlock *impl);
      66              : 
      67              :   PathProbeCandidate
      68              :   process_predicate_for_candidates (const TyTy::TypeBoundPredicate &predicate);
      69              : 
      70              :   void insert_candidate (PathProbeCandidate candidate);
      71              : 
      72              :   Analysis::Mappings &mappings;
      73              :   TyTy::BaseType *receiver;
      74              :   const HIR::PathIdentSegment &search;
      75              :   TypePathProbeResult result;
      76              : };
      77              : 
      78              : } // namespace Resolver
      79              : } // namespace Rust
      80              : 
      81              : #endif // RUST_HIR_PATH_PROBE_TYPE_H
        

Generated by: LCOV version 2.4-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.