Code Monkey home page Code Monkey logo

async_t's People

Contributors

znx3p0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

async_t's Issues

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.

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...

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;

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.