async_t's Issues
Conditional compilation doesn't work
The following doesn't work with async_t without downgrading to async_trait. Conditional compilation attributes are not being handled as expected
#[cfg(any(feature = "tokio-runtime", feature = "async-std-runtime"))]
async fn with_blocking<F, R>(&'static self, f: F) -> Result<R, JoinError>
where
F: for<'a> FnOnce(&'a LocalRef<T::Target>) -> R + Send + 'static,
R: Send + 'static;
Compilation error: no variant or associated item named `__TestExhaustive` found โฆ
Compiling with rustc 1.63.0-nightly (ca122c7eb 2022-06-13)
on FreeBSD, I get:
Compiling async_t_internal v0.6.0
error[E0599]: no variant or associated item named `__TestExhaustive` found for enum `syn::Type` in the current scope
--> /home/jbe/.cargo/registry/src/github.com-1ecc6299db9ec823/async_t_internal-0.6.0/src/impl_trait/impl_trait.rs:143:15
|
143 | Type::__TestExhaustive(_) => abort!(ty.span(), "please report this bug"),
| ^^^^^^^^^^^^^^^^ variant or associated item not found in `syn::Type`
error[E0599]: no variant or associated item named `__TestExhaustive` found for enum `syn::Type` in the current scope
--> /home/jbe/.cargo/registry/src/github.com-1ecc6299db9ec823/async_t_internal-0.6.0/src/impl_trait/implementation.rs:152:15
|
152 | Type::__TestExhaustive(_) => abort!(ty.span(), "please report this bug"),
| ^^^^^^^^^^^^^^^^ variant or associated item not found in `syn::Type`
For more information about this error, try `rustc --explain E0599`.
error: could not compile `async_t_internal` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
Fix naming of existentials
Currently, async_t
constructs names of associated existential types by taking the name of the function and appending Fut
. Since the common naming scheme in Rust for functions is lower_snake_case
, this leads to names with inconsistent naming (foo_bar_bazFut
for example). This breaks the naming convention for associated types, which is UpperCamelCase
, and prompts a compiler warning for the user (#[warn(non_camel_case_types)]
).
The name of the method should therefore be converted to the UpperCamelCase
naming convention. This can be done by splitting on _
, capitalizing every resulting item, and then concatenating the strings together to form a new name.
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.