1. 04 9月, 2019 3 次提交
  2. 03 9月, 2019 2 次提交
  3. 02 9月, 2019 1 次提交
    • B
      Auto merge of #63870 - estebank:async-fn-call, r=oli-obk · dfd43f0f
      bors 提交于
      Suggest call fn ctor passed as arg to fn with type param bounds
      
      _Reviewer note: the relevant changes are in the second commit, the first is simple and mechanical, but verbose._
      
      When forgetting to call a fn in an argument position to an fn that has a generic bound:
      
      ```rust
      async fn foo() {}
      
      fn bar(f: impl Future<Output=()>) {}
      
      fn main() {
          bar(foo); // <- should be `bar(foo());`
      }
      ```
      
      suggest calling it:
      
      ```
      error[E0277]: the trait bound `fn() -> impl std::future::Future {foo}: std::future::Future` is not satisfied
        --> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:9:5
         |
      LL | fn bar(f: impl Future<Output=()>) {}
         | --------------------------------- required by `bar`
      ...
      LL |     bar(foo);
         |     ^^^ the trait `std::future::Future` is not implemented for `fn() -> impl std::future::Future {foo}`
         |
         = help: it looks like you forgot to use parentheses to call the function: `foo()`
      ```
      
      Fix #63100. Follow up to #63833 and #63337.
      dfd43f0f
  4. 01 9月, 2019 13 次提交
  5. 31 8月, 2019 21 次提交