Skip to content

Commit

Permalink
Don't format tests/run-make/*/rmake.rs.
Browse files Browse the repository at this point in the history
It's reasonable to want to, but in the current implementation this
causes multiple problems.

- All the `rmake.rs` files are formatted every time even when they
  haven't changed. This is because they get whitelisted unconditionally
  in the `OverrideBuilder`, before the changed files get added.

- The way `OverrideBuilder` works, if any files gets whitelisted then no
  unmentioned files will get traversed. This is surprising, and means
  that the `rmake.rs` entries broke the use of explicit paths to `x
  fmt`, and also broke `GITHUB_ACTIONS=true git check --fmt`.

The commit removes the `rmake.rs` entries, fixes the formatting of a
couple of files that were misformatted (not previously caught due to the
`GITHUB_ACTIONS` breakage), and bans `!`-prefixed entries in
`rustfmt.toml` because they cause all these problems.
  • Loading branch information
nnethercote committed May 28, 2024
1 parent 3578f42 commit 3548389
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions core/src/ptr/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,18 +209,14 @@ impl<Dyn: ?Sized> DynMetadata<Dyn> {
// Consider a reference like `&(i32, dyn Send)`: the vtable will only store the size of the
// `Send` part!
// SAFETY: DynMetadata always contains a valid vtable pointer
return unsafe {
crate::intrinsics::vtable_size(self.vtable_ptr() as *const ())
};
return unsafe { crate::intrinsics::vtable_size(self.vtable_ptr() as *const ()) };
}

/// Returns the alignment of the type associated with this vtable.
#[inline]
pub fn align_of(self) -> usize {
// SAFETY: DynMetadata always contains a valid vtable pointer
return unsafe {
crate::intrinsics::vtable_align(self.vtable_ptr() as *const ())
};
return unsafe { crate::intrinsics::vtable_align(self.vtable_ptr() as *const ()) };
}

/// Returns the size and alignment together as a `Layout`
Expand Down

0 comments on commit 3548389

Please sign in to comment.