diff options
Diffstat (limited to 'crates/ra_hir_expand/src')
-rw-r--r-- | crates/ra_hir_expand/src/name.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_expand/src/quote.rs | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/crates/ra_hir_expand/src/name.rs b/crates/ra_hir_expand/src/name.rs index 4f2f702c0..9e68dd98d 100644 --- a/crates/ra_hir_expand/src/name.rs +++ b/crates/ra_hir_expand/src/name.rs | |||
@@ -152,6 +152,8 @@ pub const RANGE_INCLUSIVE_TYPE: Name = Name::new_inline_ascii(b"RangeInclusive") | |||
152 | pub const RANGE_TO_INCLUSIVE_TYPE: Name = Name::new_inline_ascii(b"RangeToInclusive"); | 152 | pub const RANGE_TO_INCLUSIVE_TYPE: Name = Name::new_inline_ascii(b"RangeToInclusive"); |
153 | pub const RANGE_TO_TYPE: Name = Name::new_inline_ascii(b"RangeTo"); | 153 | pub const RANGE_TO_TYPE: Name = Name::new_inline_ascii(b"RangeTo"); |
154 | pub const RANGE_TYPE: Name = Name::new_inline_ascii(b"Range"); | 154 | pub const RANGE_TYPE: Name = Name::new_inline_ascii(b"Range"); |
155 | pub const NEG_TYPE: Name = Name::new_inline_ascii(b"Neg"); | ||
156 | pub const NOT_TYPE: Name = Name::new_inline_ascii(b"Not"); | ||
155 | 157 | ||
156 | // Builtin Macros | 158 | // Builtin Macros |
157 | pub const FILE_MACRO: Name = Name::new_inline_ascii(b"file"); | 159 | pub const FILE_MACRO: Name = Name::new_inline_ascii(b"file"); |
diff --git a/crates/ra_hir_expand/src/quote.rs b/crates/ra_hir_expand/src/quote.rs index 4f698ff13..aa8a5f23f 100644 --- a/crates/ra_hir_expand/src/quote.rs +++ b/crates/ra_hir_expand/src/quote.rs | |||
@@ -16,7 +16,7 @@ macro_rules! __quote { | |||
16 | { | 16 | { |
17 | let children = $crate::__quote!($($tt)*); | 17 | let children = $crate::__quote!($($tt)*); |
18 | let subtree = tt::Subtree { | 18 | let subtree = tt::Subtree { |
19 | delimiter: tt::Delimiter::$delim, | 19 | delimiter: Some(tt::Delimiter::$delim), |
20 | token_trees: $crate::quote::IntoTt::to_tokens(children), | 20 | token_trees: $crate::quote::IntoTt::to_tokens(children), |
21 | }; | 21 | }; |
22 | subtree | 22 | subtree |
@@ -124,7 +124,7 @@ pub(crate) trait IntoTt { | |||
124 | 124 | ||
125 | impl IntoTt for Vec<tt::TokenTree> { | 125 | impl IntoTt for Vec<tt::TokenTree> { |
126 | fn to_subtree(self) -> tt::Subtree { | 126 | fn to_subtree(self) -> tt::Subtree { |
127 | tt::Subtree { delimiter: tt::Delimiter::None, token_trees: self } | 127 | tt::Subtree { delimiter: None, token_trees: self } |
128 | } | 128 | } |
129 | 129 | ||
130 | fn to_tokens(self) -> Vec<tt::TokenTree> { | 130 | fn to_tokens(self) -> Vec<tt::TokenTree> { |
@@ -254,7 +254,8 @@ mod tests { | |||
254 | let fields = | 254 | let fields = |
255 | fields.iter().map(|it| quote!(#it: self.#it.clone(), ).token_trees.clone()).flatten(); | 255 | fields.iter().map(|it| quote!(#it: self.#it.clone(), ).token_trees.clone()).flatten(); |
256 | 256 | ||
257 | let list = tt::Subtree { delimiter: tt::Delimiter::Brace, token_trees: fields.collect() }; | 257 | let list = |
258 | tt::Subtree { delimiter: Some(tt::Delimiter::Brace), token_trees: fields.collect() }; | ||
258 | 259 | ||
259 | let quoted = quote! { | 260 | let quoted = quote! { |
260 | impl Clone for #struct_name { | 261 | impl Clone for #struct_name { |