Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ideas for rust bug minimization sequel #1

Open
pnkfelix opened this issue Nov 19, 2019 · 1 comment
Open

ideas for rust bug minimization sequel #1

pnkfelix opened this issue Nov 19, 2019 · 1 comment

Comments

@pnkfelix
Copy link
Owner

I do plan to eventually finish my epic saga of minimizing rust-lang/rust#65774

Or maybe I'll document the process of minimizing a different bug

@pnkfelix
Copy link
Owner Author

in any case, while discussing the matter with centril they pointed out their own list of transformations they perform while minimizing bugs. I noted that while I often do similar things, I didn't document any of them in my first blog post on the subject.

Here was Centril's list:

Ah cool; before I read the post, here are some things I would do myself:

  • Remove elided lifetimes for explicit quantification
  • Desugar bounds to where clauses
  • Create dummy functions and/or use panic!() liberally as a substitute while shrinking
  • Generally prefer desugared constructs (match over if, type Alias = impl Trait; over -> impl Trait, the actual type over Self)
  • Prefer record structs and variants over tuple structs (simplifies the MIR)
  • When you've minimized a bit and it's reasonably short, look at the MIR to see if you can shrink some more
  • Use cargo expand to get rid of macros

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant