Coder Social home page Coder Social logo

Comments (4)

dtolnay avatar dtolnay commented on May 19, 2024

This looks like it affects any function with a signature resembling async fn<'a>(&A, &'static B) -> &'a C, not anything about async-trait. Could you make sure there is an issue filed for this in rust-lang/rust?

Minimized further:

async fn test<'a>(_: &(), _: &'static ()) -> &'a () {
    unimplemented!()
}
error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
 --> src/main.rs:1:46
  |
1 | async fn test<'a>(_: &(), _: &'static ()) -> &'a () {
  |                                              ^^^^^^
  |
note: hidden type `impl std::future::Future` captures the scope of call-site for function at 1:53
 --> src/main.rs:1:53
  |
1 |   async fn test<'a>(_: &(), _: &'static ()) -> &'a () {
  |  _____________________________________________________^
2 | |     unimplemented!()
3 | | }
  | |_^

from async-trait.

nirui avatar nirui commented on May 19, 2024

async fn test<'a>(_: &(), _: &'static ()) -> &'a () { unimplemented!() }

Nice catch! I'll investigate some more into the language itself.

Thank you for your time! And sorry for the bothering.

from async-trait.

fzzzy avatar fzzzy commented on May 19, 2024

I just hit this same rust compiler bug in some code that doesn't use async trait. Did this ever get filed as a bug against rustc?

from async-trait.

jrconlin avatar jrconlin commented on May 19, 2024

Looks like rust-lang/rust#64552 might be related?

from async-trait.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.