[PR testsuite/116860] Testsuite adjustment for recently added tests
[official-gcc.git] / gcc / rust / typecheck / rust-type-util.h
blob03874a48bd8e42c199c667000d058cc96053687a
1 // Copyright (C) 2020-2025 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
8 // version.
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.
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_TYPE_UTIL
20 #define RUST_TYPE_UTIL
22 #include "rust-mapping-common.h"
23 #include "rust-tyty.h"
25 namespace Rust {
26 namespace Resolver {
28 bool
29 query_type (HirId reference, TyTy::BaseType **result);
31 bool
32 types_compatable (TyTy::TyWithLocation lhs, TyTy::TyWithLocation rhs,
33 location_t unify_locus, bool emit_errors);
35 TyTy::BaseType *
36 unify_site (HirId id, TyTy::TyWithLocation lhs, TyTy::TyWithLocation rhs,
37 location_t unify_locus);
39 TyTy::BaseType *
40 unify_site_and (HirId id, TyTy::TyWithLocation lhs, TyTy::TyWithLocation rhs,
41 location_t unify_locus, bool emit_errors, bool commit_if_ok,
42 bool implicit_infer_vars, bool cleanup);
44 TyTy::BaseType *
45 coercion_site (HirId id, TyTy::TyWithLocation lhs, TyTy::TyWithLocation rhs,
46 location_t coercion_locus);
48 TyTy::BaseType *
49 try_coercion (HirId id, TyTy::TyWithLocation lhs, TyTy::TyWithLocation rhs,
50 location_t coercion_locus);
52 TyTy::BaseType *
53 cast_site (HirId id, TyTy::TyWithLocation from, TyTy::TyWithLocation to,
54 location_t cast_locus);
56 AssociatedImplTrait *
57 lookup_associated_impl_block (const TyTy::TypeBoundPredicate &bound,
58 const TyTy::BaseType *binding,
59 bool *ambigious = nullptr);
61 } // namespace Resolver
62 } // namespace Rust
64 #endif // RUST_TYPE_UTIL