Skip to content

Commit bfbb15a

Browse files
authored
Rollup merge of rust-lang#101826 - andrewpollack:fix-joined-without-noop, r=Mark-Simulacrum
Enforce "joined()" and "joined_with_noop()" test Several similar tests come in the form of `joined()` and `joined_with_noop()`. In this test, the `joined()` has two calls to a noop, making it functionally equivalent to `joined_with_noop()`. This doesn't seem intended, and this PR removes those calls and changes the memory size to reflect the change For my education, why do tests with `noop()` calls sometimes have `noop()` contributing to the size, while others do not? E.g. https://github.com/rust-lang/rust/blob/master/src/test/ui/async-await/async-fn-size-moved-locals.rs#L115 and https://github.com/rust-lang/rust/blob/master/src/test/ui/async-await/async-fn-size-moved-locals.rs#L116 have no size difference, whereas https://github.com/rust-lang/rust/blob/master/src/test/ui/async-await/async-fn-size-moved-locals.rs#L113 and https://github.com/rust-lang/rust/blob/master/src/test/ui/async-await/async-fn-size-moved-locals.rs#L114 have a size difference. Thank you!
2 parents 36b066d + 4279bd5 commit bfbb15a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/test/ui/async-await/async-fn-size-uninit-locals.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ async fn joined() {
6767
let c = Big::new();
6868

6969
fut().await;
70-
noop();
7170
joiner = Joiner { a: Some(a), b: Some(b), c: Some(c) };
72-
noop();
7371
}
7472

7573
async fn joined_with_noop() {
@@ -97,7 +95,7 @@ async fn join_retval() -> Joiner {
9795
fn main() {
9896
assert_eq!(2, std::mem::size_of_val(&single()));
9997
assert_eq!(3, std::mem::size_of_val(&single_with_noop()));
100-
assert_eq!(3078, std::mem::size_of_val(&joined()));
98+
assert_eq!(3074, std::mem::size_of_val(&joined()));
10199
assert_eq!(3078, std::mem::size_of_val(&joined_with_noop()));
102100
assert_eq!(3074, std::mem::size_of_val(&join_retval()));
103101
}

0 commit comments

Comments
 (0)