| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
#ifndef RUST_HIR_BOUND_ABSTRACT_H |
| 20 |
#define RUST_HIR_BOUND_ABSTRACT_H |
| 21 |
|
| 22 |
#include "rust-hir-visitable.h" |
| 23 |
#include "rust-system.h" |
| 24 |
#include "rust-hir-map.h" |
| 25 |
|
| 26 |
namespace Rust { |
| 27 |
namespace HIR { |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
class TypeParamBound : public FullVisitable |
| 32 |
{ |
| 33 |
public: |
| 34 |
using FullVisitable::accept_vis; |
| 35 |
enum BoundType |
| 36 |
{ |
| 37 |
LIFETIME, |
| 38 |
TRAITBOUND |
| 39 |
}; |
| 40 |
|
| 41 |
virtual ~TypeParamBound () {} |
| 42 |
|
| 43 |
|
| 44 |
std::unique_ptr<TypeParamBound> clone_type_param_bound () const |
| 45 |
{ |
| 46 |
return std::unique_ptr<TypeParamBound> (clone_type_param_bound_impl ()); |
| 47 |
} |
| 48 |
|
| 49 |
virtual std::string as_string () const = 0; |
| 50 |
|
| 51 |
virtual Analysis::NodeMapping get_mappings () const = 0; |
| 52 |
|
| 53 |
virtual location_t get_locus () const = 0; |
| 54 |
|
| 55 |
virtual BoundType get_bound_type () const = 0; |
| 56 |
|
| 57 |
protected: |
| 58 |
|
| 59 |
virtual TypeParamBound *clone_type_param_bound_impl () const = 0; |
| 60 |
}; |
| 61 |
|
| 62 |
} |
| 63 |
} |
| 64 |
|
| 65 |
#endif |