<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>InfoQ - Macros - Articles</title>
    <link>https://www.infoq.com</link>
    <description>InfoQ Macros Articles feed</description>
    <item>
      <title>Article: How to Use Rust Procedural Macros to Replace Panic with syn’s Fold</title>
      <link>https://www.infoq.com/articles/rust-procedural-macros-replace-panic/?utm_campaign=infoq_content&amp;utm_source=infoq&amp;utm_medium=feed&amp;utm_term=Macros-articles</link>
      <description>&lt;img src="https://res.infoq.com/articles/rust-procedural-macros-replace-panic/en/headerimage/using-syn-fold-in-a-panic-header-1709745952200.jpg"/&gt;&lt;p&gt;In this article, we show how you can write advanced macros to step through Rust code and modify it. Using the standard tooling available in the syn crate, we first show how to change the occurrence of a panic into an Err. Then we go a step beyond and use the Fold trait to recursively step through the entire function, automatically executing a change in every applicable location.&lt;/p&gt; &lt;i&gt;By Sam Van Overmeire&lt;/i&gt;</description>
      <category>Programming Languages</category>
      <category>Rust</category>
      <category>System Programming</category>
      <category>Embedded Software Dev</category>
      <category>Macros</category>
      <category>Development</category>
      <category>article</category>
      <pubDate>Tue, 12 Mar 2024 09:00:00 GMT</pubDate>
      <guid>https://www.infoq.com/articles/rust-procedural-macros-replace-panic/?utm_campaign=infoq_content&amp;utm_source=infoq&amp;utm_medium=feed&amp;utm_term=Macros-articles</guid>
      <dc:creator>Sam Van Overmeire</dc:creator>
      <dc:date>2024-03-12T09:00:00Z</dc:date>
      <dc:identifier>/articles/rust-procedural-macros-replace-panic/en</dc:identifier>
    </item>
  </channel>
</rss>
