Skip to content

Commit 156c922

Browse files
committed
Move misplaced comment
1 parent 485ae9f commit 156c922

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/test/ui/suggestions/expected-boxed-future-isnt-pinned.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ fn foo<F: Future<Output=i32> + Send + 'static>(x: F) -> BoxFuture<'static, i32>
1111
x //~ ERROR mismatched types
1212
}
1313

14-
// This case is still subpar:
15-
// `Pin::new(x)`: store this in the heap by calling `Box::new`: `Box::new(x)`
16-
// Should suggest changing the code from `Pin::new` to `Box::pin`.
1714
fn bar<F: Future<Output=i32> + Send + 'static>(x: F) -> BoxFuture<'static, i32> {
1815
Box::new(x) //~ ERROR mismatched types
1916
}
2017

18+
// This case is still subpar:
19+
// `Pin::new(x)`: store this in the heap by calling `Box::new`: `Box::new(x)`
20+
// Should suggest changing the code from `Pin::new` to `Box::pin`.
2121
fn baz<F: Future<Output=i32> + Send + 'static>(x: F) -> BoxFuture<'static, i32> {
2222
Pin::new(x) //~ ERROR mismatched types
2323
//~^ ERROR E0277

src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ LL | Box::pin(x)
1515
| +++++++++ +
1616

1717
error[E0308]: mismatched types
18-
--> $DIR/expected-boxed-future-isnt-pinned.rs:18:5
18+
--> $DIR/expected-boxed-future-isnt-pinned.rs:15:5
1919
|
2020
LL | fn bar<F: Future<Output=i32> + Send + 'static>(x: F) -> BoxFuture<'static, i32> {
2121
| ----------------------- expected `Pin<Box<(dyn Future<Output = i32> + Send + 'static)>>` because of return type

0 commit comments

Comments
 (0)