Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Commit

Permalink
Mark generated rust sim impl's with #[automatically_derived]
Browse files Browse the repository at this point in the history
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 rust-lang/rust#79671 (comment) for more info.
  • Loading branch information
yupferris committed Dec 3, 2020
1 parent 3ba2b92 commit 7c2ff85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions kaze/src/sim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7c2ff85

Please sign in to comment.