-
Notifications
You must be signed in to change notification settings - Fork 381
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
Format tests with rustfmt (276-287 of 299) #2254
Conversation
let j1 = spawn(move || { | ||
*ptr.0 | ||
let _val = *ptr.0; | ||
}); |
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 is a behavior change, but I did this to preserve the way both spawn
use a multiline block. This is similar to #2244 (comment). With the behavior change it still correctly tests what the test was intended to cover.
let _fat: [u8; (1<<61)+(1<<31)] = | ||
[0; (1u64<<61) as usize +(1u64<<31) as usize]; //~ ERROR post-monomorphization error | ||
let _fat: [u8; (1 << 61) + (1 << 31)]; | ||
_fat = [0; (1u64 << 61) as usize + (1u64 << 31) as usize]; //~ ERROR post-monomorphization error |
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.
Rustfmt wanted to do one line for all this. I split into 2 statements to preserve the specificity of the test in checking that the error is triggered on the rhs, not on the binding's pattern or type.
libc::FUTEX_WAKE, | ||
10, // Wake up at most 10 threads. | ||
), | ||
1, // Woken up one thread. |
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.
It was clear to me that this comment refers to the 1
, not the assert as a whole.
#[rustfmt::skip] // https://github.com/rust-lang/rustfmt/issues/3255 | ||
for &size in &[2, 8, 64] { // size less than and bigger than alignment | ||
for &align in &[4, 8, 16, 32] { // Be sure to cover less than and bigger than `MIN_ALIGN` for all architectures |
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.
@@ -61,7 +92,7 @@ fn check_align_requests<T: Allocator>(allocator: T) { | |||
} | |||
} | |||
} | |||
} | |||
}; |
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.
Without this semicolon,—
error[E0658]: attributes on expressions are experimental
--> tests/pass/heap_allocator.rs:68:5
|
LL | #[rustfmt::skip] // https://github.com/rust-lang/rustfmt/issues/3255
| ^^^^^^^^^^^^^^^^
|
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
for _ in Vec::<u32>::new().iter() { // this iterates over a Unique::empty() | ||
// Iterate over a Unique::empty() | ||
for _ in Vec::<u32>::new().iter() { |
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.
Reworded for consistency with the comment on the other for
loop after this one.
@bors r+ |
📌 Commit 05893d9 has been approved by |
☀️ Test successful - checks-actions |
Format tests with rustfmt (288-299 of 299) Extracted from #2097. I'll make a separate PR to enable checking the `tests` directory's formatting in CI. I'll need to rebase that after both this and #2254 have landed, and if any new non-rustfmt-formatted files appear in the meantime, we can include formatting those in the same PR that enables the CI.
Extracted from #2097.
This is one half of the last 24 files (left for last because they require more unique attention than the first 275 "easy" files).
I'll comment below to call attention to cases where I exercised my own judgement in how to format the test.
rust-lang/rustfmt#3255 is especially annoying: rustfmt does not like
…( //
and…{ //
.