-
Notifications
You must be signed in to change notification settings - Fork 703
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
Option to avoid generating layout tests #632
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thank you! I have just one nitpick below, and once that's fixed, let's merge this :)
src/codegen/mod.rs
Outdated
@@ -987,37 +987,39 @@ impl CodeGenerator for TemplateInstantiation { | |||
// just converted to rust types in fields, vars, etc, we take this | |||
// opportunity to generate tests for their layout here. | |||
|
|||
let layout = item.kind().expect_type().layout(ctx); | |||
if ctx.options().layout_tests { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than indenting tons of code, lets just early return here if we aren't generating layout tests.
concat!("Alignment of ", stringify!($type_name))); | ||
) | ||
}; | ||
if ctx.options().layout_tests { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, we can't early return in this one because there is more work happening afterwards. It would be awesome if this layout test generation was factored into its own function, but I realize that is an extant problem that is a bit out of scope for this PR.
@@ -214,29 +214,33 @@ impl Builder { | |||
}) | |||
.count(); | |||
|
|||
if self.options.derive_debug == false { | |||
if !self.options.layout_tests { | |||
output_vector.push("--no-layout-tests".into()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating this method too!
@bors-servo r+ Thanks @dimbleby! |
📌 Commit b8dd5c9 has been approved by |
Option to avoid generating layout tests as discussed in #424
☀️ Test successful - status-travis |
as discussed in #424