From 7c2ff85465a1a6606156e0a3373f7a31df386c5e Mon Sep 17 00:00:00 2001 From: ferris Date: Thu, 3 Dec 2020 23:11:46 +0100 Subject: [PATCH] Mark generated rust sim impl's with `#[automatically_derived]` This prevents the compiler from performing expensive and unnecessary lints on the generated code, saving several seconds and, more importantly, several GB(!!) of memory during compilation of large sims. See https://github.com/rust-lang/rust/issues/79671#issuecomment-738335379 for more info. --- CHANGELOG.md | 2 ++ kaze/src/sim.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4eb3d9..bed1a6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed +- Mark generated rust simulator impl's with `#[automatically_derived]` to skip expensive lints during compilation. ## [0.1.14] - 2020-11-29 ### Changed diff --git a/kaze/src/sim.rs b/kaze/src/sim.rs index bf13473..41797a6 100644 --- a/kaze/src/sim.rs +++ b/kaze/src/sim.rs @@ -280,6 +280,7 @@ pub fn generate<'a, W: Write>( w.append_line("}")?; w.append_newline()?; + w.append_line("#[automatically_derived]")?; w.append_indent()?; w.append("impl")?; if options.tracing {