<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in error.rs</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>c3bf042a - meta: deduplicate source generation infrastructure (#10348)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/cranelift/srcgen/src/error.rs#c3bf042a</link>
        <description>meta: deduplicate source generation infrastructure (#10348)* Move `Formatter` and `Error` to new crate: `cranelift-srcgen`The `cranelift-codegen-meta` crate emits both Rust and ISLE source codeusing a `Formatter` which may fail with an `Error`. The`cranelift-assembler-x64-meta` crate uses a subset of thisfunctionality. To deduplicate efforts, this creates a new crate,`cranelift-srcgen`, and moves only the `cranelift-codgen-meta`functionality there (for now).* Add notion of a formatted `Language`; append file locationsWhile developing `cranelift-assembler-x64`, it became clear that knowingthe source code location that _generated_ some code was extremelyuseful. This change alters the `fmtln!` macro to append file locationsas comments to the generated code; this doesn&apos;t change all the`fmt.line()` invocations but it&apos;s a start. To do this, we need to knowwhich language we are generating to emit the correct comment kind. Thisled to adding a new `enum Language` to identify that.* Rename `update_file` to `write`* Use shared `Formatter` in `cranelift-assembler-x64-meta`This change removes the duplicate implementation of `Formatter` in`cranelift-assembler-x64-meta` and replaces it with the shared`Formatter` in `cranelift-srcgen`.* Add `Formatter::add_block`While implementing all these changes, I noticed an opportunity: byadding `Formatter::add_block` we can automatically adds braces andindentation.  This should be more safe (i.e., harder to forget to appendthe ending `}`) and result in less verbose generator code (no need for`fmtln!(...)` then `f.indent(|f| ...)`). This refactoring does touch alarge amount of code, though.Now with `Formatter::add_block`, we can allow the `fmtln!` macro toauto-format no-arg format strings (e.g., `fmtln!(f, &quot;{x}&quot;)`), whichshould be a bit more ergonomic. This does mean that a few locations thatweren&apos;t covered by `Formatter::add_block` need some extra escaping(e.g., `{` -&gt; `{{`).* Avoid appending a file location comment to a Rust comment* Make `cranelift-srcgen` publishableThis ensures the crate has a version and is tracked by`cranelift-srcgen`.

            List of files:
            /wasmtime-44.0.1/cranelift/srcgen/src/error.rs</description>
        <pubDate>Fri, 07 Mar 2025 02:26:43 +0000</pubDate>
        <dc:creator>Andrew Brown &lt;andrew.brown@intel.com&gt;</dc:creator>
    </item>
</channel>
</rss>
