Introduce ExprKind::IncludedBytes

This commit is contained in:
clubby789 2022-10-31 18:30:09 +00:00
parent b7b7f2716e
commit b2da155a9a
19 changed files with 78 additions and 15 deletions

View file

@ -216,7 +216,10 @@ pub fn expand_include_bytes(
}
};
match cx.source_map().load_binary_file(&file) {
Ok(bytes) => base::MacEager::expr(cx.expr_byte_str(sp, bytes)),
Ok(bytes) => {
let expr = cx.expr(sp, ast::ExprKind::IncludedBytes(bytes.into()));
base::MacEager::expr(expr)
}
Err(e) => {
cx.span_err(sp, &format!("couldn't read {}: {}", file.display(), e));
DummyResult::any(sp)