diff options
author | robojumper <[email protected]> | 2020-05-28 20:42:22 +0100 |
---|---|---|
committer | robojumper <[email protected]> | 2020-05-28 20:42:22 +0100 |
commit | 367487fe88dca78cffad5138673d5259f7f7ba6b (patch) | |
tree | 2846ebee3a16875674aed26b534f905a30cb598f /crates/ra_hir_def/src/type_ref.rs | |
parent | 190a0595a478d059fdd95a179fe38d59cb6379be (diff) |
Support raw_ref_op's raw reference operator
Diffstat (limited to 'crates/ra_hir_def/src/type_ref.rs')
-rw-r--r-- | crates/ra_hir_def/src/type_ref.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/crates/ra_hir_def/src/type_ref.rs b/crates/ra_hir_def/src/type_ref.rs index 5bdad9efd..86a77b704 100644 --- a/crates/ra_hir_def/src/type_ref.rs +++ b/crates/ra_hir_def/src/type_ref.rs | |||
@@ -35,6 +35,22 @@ impl Mutability { | |||
35 | } | 35 | } |
36 | } | 36 | } |
37 | 37 | ||
38 | #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] | ||
39 | pub enum Rawness { | ||
40 | RawPtr, | ||
41 | Ref, | ||
42 | } | ||
43 | |||
44 | impl Rawness { | ||
45 | pub fn from_raw(is_raw: bool) -> Rawness { | ||
46 | if is_raw { | ||
47 | Rawness::RawPtr | ||
48 | } else { | ||
49 | Rawness::Ref | ||
50 | } | ||
51 | } | ||
52 | } | ||
53 | |||
38 | /// Compare ty::Ty | 54 | /// Compare ty::Ty |
39 | #[derive(Clone, PartialEq, Eq, Hash, Debug)] | 55 | #[derive(Clone, PartialEq, Eq, Hash, Debug)] |
40 | pub enum TypeRef { | 56 | pub enum TypeRef { |