]> git.lizzy.rs Git - rust.git/commitdiff
Move misplaced comment
authorTyler Mandry <tmandry@gmail.com>
Thu, 30 Sep 2021 01:29:24 +0000 (01:29 +0000)
committerTyler Mandry <tmandry@gmail.com>
Wed, 13 Oct 2021 23:26:00 +0000 (23:26 +0000)
src/test/ui/suggestions/expected-boxed-future-isnt-pinned.rs
src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr

index 5dee0f5dae0b0d644641442b1d9ba28a1dbc96da..89a36e89b0acf513c92f6588b5e4323aae4b4d79 100644 (file)
@@ -11,13 +11,13 @@ fn foo<F: Future<Output=i32> + Send + 'static>(x: F) -> BoxFuture<'static, i32>
     x //~ ERROR mismatched types
 }
 
-// This case is still subpar:
-// `Pin::new(x)`: store this in the heap by calling `Box::new`: `Box::new(x)`
-// Should suggest changing the code from `Pin::new` to `Box::pin`.
 fn bar<F: Future<Output=i32> + Send + 'static>(x: F) -> BoxFuture<'static, i32> {
     Box::new(x) //~ ERROR mismatched types
 }
 
+// This case is still subpar:
+// `Pin::new(x)`: store this in the heap by calling `Box::new`: `Box::new(x)`
+// Should suggest changing the code from `Pin::new` to `Box::pin`.
 fn baz<F: Future<Output=i32> + Send + 'static>(x: F) -> BoxFuture<'static, i32> {
     Pin::new(x) //~ ERROR mismatched types
     //~^ ERROR E0277
index ff08178cb74707584996ef6a0c45846f912e93ad..f0af37e0cbe8af7e47f7b276e0ceb804c04a9dcf 100644 (file)
@@ -15,7 +15,7 @@ LL |     Box::pin(x)
    |     +++++++++ +
 
 error[E0308]: mismatched types
-  --> $DIR/expected-boxed-future-isnt-pinned.rs:18:5
+  --> $DIR/expected-boxed-future-isnt-pinned.rs:15:5
    |
 LL | fn bar<F: Future<Output=i32> + Send + 'static>(x: F) -> BoxFuture<'static, i32> {
    |                                                         ----------------------- expected `Pin<Box<(dyn Future<Output = i32> + Send + 'static)>>` because of return type