carllerche / tower-web

A fast, boilerplate free, web framework for Rust
MIT License
980 stars 51 forks source link

Nightly compat: avoid suffixes on tuple indexing #204

Closed lnicola closed 5 years ago

lnicola commented 5 years ago

cargo test fails on the latest nightly:

error: suffixes on a tuple index are invalid
  --> <::tower_web::derive_resource macros>:2:14
   |
1  |  /  ( $ ( $ tt : tt ) * ) => {
2  |  |  # [ derive ( derive_resource_impl , ) ] # [ allow ( unused ) ] enum
   |  |               ^^^^^^^^^^^^^^^^^^^^ invalid suffix `usize`
3  |  |  ProcMacroHack { Input = ( stringify ! ( $ ( $ tt ) * ) , 0 ) . 1 } }
   |  |_____________________________________________________________________- in this expansion of `derive_resource!` (#2)
   | 
  ::: <::tower_web::impl_web macros>:1:1
   |
1  |   / ( $ ( $ t : tt ) * ) => {
2  |   | impl_web_clean_top_level ! ( (  ) $ ( $ t ) * ) ; derive_resource ! (
   |  _|___________________________________________________-
3  | | | $ ( $ t ) * ) ; }
   | | |_______________-_- in this expansion of `impl_web!` (#1)
   | |_________________|
   |                   in this macro invocation (#2)
   | 
  ::: examples/derive_extract.rs:37:1
   |
37 | /   impl_web! {
38 | |       impl ArgResource {
39 | |
40 | |           // By convention, arguments named `query_string` will be populated using
...  |
46 | |       }
47 | |   }
   | |___- in this macro invocation (#1)

See https://github.com/rust-lang/rust/issues/59553.