diff options
author | John Hodge <tpg@mutabah.net> | 2018-05-24 21:07:31 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2018-05-24 21:07:31 +0800 |
commit | 704bb17db9a9610b409d729ac511976ea42514c5 (patch) | |
tree | ae000fe6f06b4b58c1ca51824d359eade00f2edb /src/hir/type.hpp | |
parent | f360a87c6c44f1f32c21b64c7a8a6e530737cbb0 (diff) | |
download | mrust-704bb17db9a9610b409d729ac511976ea42514c5.tar.gz |
HIR - Borrow lifetime annotations included (not actually used or valid)
Diffstat (limited to 'src/hir/type.hpp')
-rw-r--r-- | src/hir/type.hpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/hir/type.hpp b/src/hir/type.hpp index 329af650..652abfa8 100644 --- a/src/hir/type.hpp +++ b/src/hir/type.hpp @@ -84,6 +84,7 @@ extern ::std::ostream& operator<<(::std::ostream& os, const BorrowType& bt); struct LifetimeRef { + // Can either reference a named parameter, or an inferred region ::std::string name; bool operator==(const LifetimeRef& x) const { @@ -178,6 +179,7 @@ public: }), (Tuple, ::std::vector<TypeRef>), (Borrow, struct { + ::HIR::LifetimeRef lifetime; ::HIR::BorrowType type; ::std::unique_ptr<TypeRef> inner; }), @@ -234,7 +236,7 @@ public: return TypeRef(Data::make_Infer({idx, ty_class})); } static TypeRef new_borrow(BorrowType bt, TypeRef inner) { - return TypeRef(Data::make_Borrow({bt, box$(mv$(inner))})); + return TypeRef(Data::make_Borrow({ ::HIR::LifetimeRef(), bt, box$(mv$(inner)) })); } static TypeRef new_pointer(BorrowType bt, TypeRef inner) { return TypeRef(Data::make_Pointer({bt, box$(mv$(inner))})); |