GithubHelp home page GithubHelp logo

devise's Introduction

Devise

A Rust library for devising derives and other procedural macros.

devise's People

Contributors

sergiobenitez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

devise's Issues

Cannot build docs with Rust nightly

When generating docs for my Rocket project, Cargo bails out while trying to document the devise crate:

 Documenting devise v0.2.0
error[E0275]: overflow evaluating the requirement `alloc::raw_vec::RawVec<(devise_core::syn::Lifetime, devise_core::syn::token::Add)>: std::marker::Unpin`
  |
  = help: consider adding a `#![recursion_limit="128"]` attribute to your crate
  = note: required because it appears within the type `std::vec::Vec<(devise_core::syn::Lifetime, devise_core::syn::token::Add)>`
  = note: required because it appears within the type `devise_core::syn::punctuated::Punctuated<devise_core::syn::Lifetime, devise_core::syn::token::Add>`
  = note: required because it appears within the type `devise_core::syn::LifetimeDef`
  = note: required because it appears within the type `(devise_core::syn::LifetimeDef, devise_core::syn::token::Comma)`
  = note: required because it appears within the type `*const (devise_core::syn::LifetimeDef, devise_core::syn::token::Comma)`
  = note: required because it appears within the type `std::ptr::Unique<(devise_core::syn::LifetimeDef, devise_core::syn::token::Comma)>`
  = note: required because it appears within the type `alloc::raw_vec::RawVec<(devise_core::syn::LifetimeDef, devise_core::syn::token::Comma)>`
  = note: required because it appears within the type `std::vec::Vec<(devise_core::syn::LifetimeDef, devise_core::syn::token::Comma)>`
  = note: required because it appears within the type `devise_core::syn::punctuated::Punctuated<devise_core::syn::LifetimeDef, devise_core::syn::token::Comma>`
  = note: required because it appears within the type `devise_core::syn::BoundLifetimes`
  = note: required because it appears within the type `std::option::Option<devise_core::syn::BoundLifetimes>`
  = note: required because it appears within the type `devise_core::syn::TraitBound`
  = note: required because it appears within the type `devise_core::syn::TypeParamBound`
  = note: required because it appears within the type `(devise_core::syn::TypeParamBound, devise_core::syn::token::Add)`
  = note: required because it appears within the type `*const (devise_core::syn::TypeParamBound, devise_core::syn::token::Add)`
  = note: required because it appears within the type `std::ptr::Unique<(devise_core::syn::TypeParamBound, devise_core::syn::token::Add)>`
  = note: required because it appears within the type `alloc::raw_vec::RawVec<(devise_core::syn::TypeParamBound, devise_core::syn::token::Add)>`
  = note: required because it appears within the type `std::vec::Vec<(devise_core::syn::TypeParamBound, devise_core::syn::token::Add)>`
  = note: required because it appears within the type `devise_core::syn::punctuated::Punctuated<devise_core::syn::TypeParamBound, devise_core::syn::token::Add>`
  = note: required because it appears within the type `devise_core::syn::TypeParam`
  = note: required because it appears within the type `devise_core::syn::GenericParam`
  = note: required because it appears within the type `(devise_core::syn::GenericParam, devise_core::syn::token::Comma)`
  = note: required because it appears within the type `*const (devise_core::syn::GenericParam, devise_core::syn::token::Comma)`
  = note: required because it appears within the type `std::ptr::Unique<(devise_core::syn::GenericParam, devise_core::syn::token::Comma)>`
  = note: required because it appears within the type `alloc::raw_vec::RawVec<(devise_core::syn::GenericParam, devise_core::syn::token::Comma)>`
  = note: required because it appears within the type `std::vec::Vec<(devise_core::syn::GenericParam, devise_core::syn::token::Comma)>`
  = note: required because it appears within the type `devise_core::syn::punctuated::Punctuated<devise_core::syn::GenericParam, devise_core::syn::token::Comma>`
  = note: required because it appears within the type `devise_core::syn::Generics`
  = note: required because it appears within the type `devise_core::syn::ItemType`
  = note: required because it appears within the type `devise_core::syn::Item`
  = note: required because it appears within the type `devise_core::syn::Stmt`
  = note: required because it appears within the type `*const devise_core::syn::Stmt`
  = note: required because it appears within the type `std::ptr::Unique<devise_core::syn::Stmt>`
  = note: required because it appears within the type `alloc::raw_vec::RawVec<devise_core::syn::Stmt>`
  = note: required because it appears within the type `std::vec::Vec<devise_core::syn::Stmt>`
  = note: required because it appears within the type `devise_core::syn::Block`
  = note: required because it appears within the type `devise_core::syn::ExprIf`
  = note: required because it appears within the type `devise_core::syn::Expr`
  = note: required because it appears within the type `devise_core::syn::TypeArray`
  = note: required because it appears within the type `devise_core::syn::Type`
  = note: required because it appears within the type `devise_core::syn::GenericArgument`
  = note: required because it appears within the type `(devise_core::syn::GenericArgument, devise_core::syn::token::Comma)`
  = note: required because it appears within the type `*const (devise_core::syn::GenericArgument, devise_core::syn::token::Comma)`
  = note: required because it appears within the type `std::ptr::Unique<(devise_core::syn::GenericArgument, devise_core::syn::token::Comma)>`
  = note: required because it appears within the type `alloc::raw_vec::RawVec<(devise_core::syn::GenericArgument, devise_core::syn::token::Comma)>`
  = note: required because it appears within the type `std::vec::Vec<(devise_core::syn::GenericArgument, devise_core::syn::token::Comma)>`
  = note: required because it appears within the type `devise_core::syn::punctuated::Punctuated<devise_core::syn::GenericArgument, devise_core::syn::token::Comma>`
  = note: required because it appears within the type `devise_core::syn::AngleBracketedGenericArguments`
  = note: required because it appears within the type `devise_core::syn::PathArguments`
  = note: required because it appears within the type `devise_core::syn::PathSegment`
  = note: required because it appears within the type `(devise_core::syn::PathSegment, devise_core::syn::token::Colon2)`
  = note: required because it appears within the type `*const (devise_core::syn::PathSegment, devise_core::syn::token::Colon2)`
  = note: required because it appears within the type `std::ptr::Unique<(devise_core::syn::PathSegment, devise_core::syn::token::Colon2)>`
  = note: required because it appears within the type `alloc::raw_vec::RawVec<(devise_core::syn::PathSegment, devise_core::syn::token::Colon2)>`
  = note: required because it appears within the type `std::vec::Vec<(devise_core::syn::PathSegment, devise_core::syn::token::Colon2)>`
  = note: required because it appears within the type `devise_core::syn::punctuated::Punctuated<devise_core::syn::PathSegment, devise_core::syn::token::Colon2>`
  = note: required because it appears within the type `devise_core::syn::Path`
  = note: required because it appears within the type `devise_core::syn::Attribute`
  = note: required because it appears within the type `*const devise_core::syn::Attribute`
  = note: required because it appears within the type `std::ptr::Unique<devise_core::syn::Attribute>`
  = note: required because it appears within the type `alloc::raw_vec::RawVec<devise_core::syn::Attribute>`
  = note: required because it appears within the type `std::vec::Vec<devise_core::syn::Attribute>`
  = note: required because it appears within the type `devise_core::syn::FieldPat`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0275`.
error: Could not document `devise`.

Toolchain information:

> rustc --version && cargo --version
rustc 1.38.0-nightly (6e310f2ab 2019-07-07)
cargo 1.37.0-nightly (4c1fa54d1 2019-06-24)

Is rust-nightly a hard requirement for Devise by design?

I don't really know Rust and it's ecosystem, so asking, to make sure, that Devise requires rust-nightly by design, on purpose. I'm compiling code which deep down in dependency chain requires Devise:

$ rustc --version                                                                                                           
rustc 1.46.0

$ cargo build
...
   Compiling devise_core v0.2.0
error[E0554]: `#![feature]` may not be used on the stable release channel
 --> /home/mkucharski/.cargo/registry/src/github.com-1ecc6299db9ec823/devise_core-0.2.0/src/lib.rs:1:1
  |
1 | #![feature(proc_macro_diagnostic, proc_macro_span)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> /home/mkucharski/.cargo/registry/src/github.com-1ecc6299db9ec823/devise_core-0.2.0/src/lib.rs:2:1
  |
2 | #![feature(crate_visibility_modifier)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> /home/mkucharski/.cargo/registry/src/github.com-1ecc6299db9ec823/devise_core-0.2.0/src/lib.rs:3:1
  |
3 | #![feature(concat_idents)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0554`.
error: could not compile `devise_core`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

Is rust-nightly a hard requirement on your side, or would it be possible to drop features in the code, which would make it usable on rust-stable?

Mismatching of `quote!` with `quote_spanned!` in some macros

rust-lang/rust#68716 would change the default for quote! from call_site to mixed_site. As expected there is some breakage, but it looks like the breakage caused by devise specifically is "legitimate" and caused by mismatching quote! with quote_spanned!. For example:

match __list.next() {

is in a quote_spanned! invocation, but

let mut __list = match __meta {

is in a quote! invocation.

My opinion is that these should be realigned such that quote! is used consistently for variables such as __list, which should work even after a switch to mixed_site.

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.