-
Notifications
You must be signed in to change notification settings - Fork 898
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
Fix trace! args overflow #5989
Fix trace! args overflow #5989
Conversation
@samtay thanks for jumping in and working on this one! I don't think we can move forward with the PR as is given that this would constitute a breaking formatting change for how we handle from what I can tell we can grab a reference to the We'd need to pass the |
I ran our |
c4532dd
to
af4929c
Compare
@samtay thanks! I was going to suggest using |
@samtay thanks for updating the code! Just running an additional job to verify that the version gated code doesn't produce the same breaking formatting changes. |
Huh.. I see the diff check job failed 🤔 Can you help me understand why that is? Don't the tests that I added demonstrate that the new |
@samtay that's because I forgot to pass I suspect that the job failed only for projects that use |
hmmm 🤔 thinking about it a little more, passing I guess our Diff-Check job isn't well suited for checking against changes for unstable formatting, which seems reasonable that unstable formatting might break. |
I think the second Diff-Check job failing is a false alarm. After re reviewing the output, all the diffs only affect how Comparing the output of the two jobs for rust-bindgen, which doesn't set a rustfmt version so it automatically defaults to Here's the first running rustfmt (master) on rust-bindgen
running rustfmt (feature) on rust-bindgen
checking diff
Diff in /tmp/rust-bindgen-ZkDOAXGv/bindgen/codegen/struct_layout.rs at line 299:
trace!(
"need a tail padding field for {}: offset {} -> size {}",
- comp_name,
- self.latest_offset,
- comp_layout.size
+ comp_name, self.latest_offset, comp_layout.size
);
let size = comp_layout.size - self.latest_offset;
Some(self.padding_field(Layout::new(size, 0)))
Diff in /tmp/rust-bindgen-ZkDOAXGv/bindgen/ir/analysis/template_params.rs at line 293:
trace!(
" instantiation's argument {:?} is used if definition's \
parameter {:?} is used",
- arg,
- param
+ arg, param
);
if used_by_def.contains(¶m.into()) {
Diff in /tmp/rust-bindgen-ZkDOAXGv/bindgen/ir/analysis/derive.rs at line 113:
let id = id.into();
trace!(
"inserting {:?} can_derive<{}>={:?}",
- id,
- self.derive_trait,
- can_derive
+ id, self.derive_trait, can_derive
);
if let CanDerive::Yes = can_derive {
Diff in /tmp/rust-bindgen-ZkDOAXGv/bindgen/ir/analysis/derive.rs at line 241:
trace!(
" arrays of T for which we cannot derive {} \
also cannot derive {}",
- self.derive_trait,
- self.derive_trait
+ self.derive_trait, self.derive_trait
);
return CanDerive::No;
}
Diff in /tmp/rust-bindgen-ZkDOAXGv/bindgen/ir/analysis/derive.rs at line [280](https://github.com/rust-lang/rustfmt/actions/runs/7305152074/job/19908359632#step:4:281):
trace!(
" vectors of T for which we cannot derive {} \
also cannot derive {}",
- self.derive_trait,
- self.derive_trait
+ self.derive_trait, self.derive_trait
);
return CanDerive::No;
} vs the second Diff-Check job running rustfmt (master) on rust-bindgen
running rustfmt (feature) on rust-bindgen
checking diff
no diff detected between rustfmt and the feture branch
removing tmp_dir /tmp/rust-bindgen-5v0FDg9s |
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.
@samtay thanks again for your help on this one!
e811742
to
739e492
Compare
Oh and to more directly answer your question, yes your tests were sufficient in showing that the version gate logic was working. We've semi-recently introduced this |
@ytmimi gotcha, makes sense. Happy to help out and thanks for the guidance on this one! |
Fixes #5987