Comments (4)
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.
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.
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.
Looks like rust-lang/rust#64552 might be related?
from async-trait.
Related Issues (20)
- Attributes on impl parameters are not forwarded to body
- warn: `where_clauses_object_safety` when adding default implementation for `async_trait` HOT 3
- Spans for elided lifetimes for references are suboptimal. HOT 2
- Different behaviour between non-trait async implementation and async-trait HOT 2
- Do not require Sync on unused shared reference arguments
- Nested `_` and `..` patterns under 2018 edition can trigger rust_2021_compatibility warning
- Clippy lint `async_returns_async` fails if you return an awaitable type
- Weird interaction with `single_use_lifetimes` HOT 1
- Possibly optimize simple function body?
- using async_trait in tuple generic param, error: lifetime may not live long enough HOT 2
- `#[cfg(..)]` gated impl parameters with lifetimes cause inconsistent lifetime bounds HOT 1
- Regression in associated type parsing in `0.1.67` HOT 1
- Poor error message when argument types mismatch HOT 1
- Want way to detect recursive impls HOT 2
- Feature: Adding Sync bound on Future HOT 2
- Feature: Catch unconditional_recursion HOT 2
- [Bug?] Error "expected trait impl" on associated impls HOT 2
- Lifetime bounds on method do not match the trait declaration HOT 1
- Account for AFIT stabilization in 1.75.0 HOT 5
- Issue with reference lifetimes in closures HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from async-trait.