Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-expand/src/builtin/fn_macro.rs')
-rw-r--r--crates/hir-expand/src/builtin/fn_macro.rs19
1 files changed, 11 insertions, 8 deletions
diff --git a/crates/hir-expand/src/builtin/fn_macro.rs b/crates/hir-expand/src/builtin/fn_macro.rs
index 6e4b96b050..3029bca1d5 100644
--- a/crates/hir-expand/src/builtin/fn_macro.rs
+++ b/crates/hir-expand/src/builtin/fn_macro.rs
@@ -830,15 +830,18 @@ fn include_bytes_expand(
span: Span,
) -> ExpandResult<tt::TopSubtree> {
// FIXME: actually read the file here if the user asked for macro expansion
- let res = tt::TopSubtree::invisible_from_leaves(
+ let underscore = sym::underscore;
+ let zero = tt::Literal {
+ text_and_suffix: sym::_0_u8,
span,
- [tt::Leaf::Literal(tt::Literal {
- text_and_suffix: Symbol::empty(),
- span,
- kind: tt::LitKind::ByteStrRaw(1),
- suffix_len: 0,
- })],
- );
+ kind: tt::LitKind::Integer,
+ suffix_len: 3,
+ };
+ // We don't use a real length since we can't know the file length, so we use an underscore
+ // to infer it.
+ let res = quote! {span =>
+ &[#zero; #underscore]
+ };
ExpandResult::ok(res)
}