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
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_TYPE_UTIL
20 #define RUST_TYPE_UTIL
22 #include "rust-mapping-common.h"
23 #include "rust-tyty.h"
29 query_type (HirId reference
, TyTy::BaseType
**result
);
32 types_compatable (TyTy::TyWithLocation lhs
, TyTy::TyWithLocation rhs
,
33 location_t unify_locus
, bool emit_errors
);
36 unify_site (HirId id
, TyTy::TyWithLocation lhs
, TyTy::TyWithLocation rhs
,
37 location_t unify_locus
);
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
);
45 coercion_site (HirId id
, TyTy::TyWithLocation lhs
, TyTy::TyWithLocation rhs
,
46 location_t coercion_locus
);
49 try_coercion (HirId id
, TyTy::TyWithLocation lhs
, TyTy::TyWithLocation rhs
,
50 location_t coercion_locus
);
53 cast_site (HirId id
, TyTy::TyWithLocation from
, TyTy::TyWithLocation to
,
54 location_t cast_locus
);
57 lookup_associated_impl_block (const TyTy::TypeBoundPredicate
&bound
,
58 const TyTy::BaseType
*binding
,
59 bool *ambigious
= nullptr);
61 } // namespace Resolver
64 #endif // RUST_TYPE_UTIL