dlib icon indicating copy to clipboard operation
dlib copied to clipboard

` no rules expected the token '...'` when using `varargs:`

Open ids1024 opened this issue 1 year ago • 0 comments

error: no rules expected the token `...`
   --> src/lib.rs:18:30
    |
13  |         fn blah(c_int, c_int ...) -> *const c_void,
    |                              ^^^ no rules expected this token in macro call
    |
note: while trying to match `)`
   --> /home/ian/src/dlib/src/lib.rs:378:73
    |
378 |         $(varargs: $($(#[$vattr:meta])* fn $vname: ident($($vargs: ty),+) -> $vret: ty),+,)|*

I noticed this testing https://github.com/elinorbgr/dlib/pull/22, after updating the doc tests to otherwise pass, and removing the use of statics: so it wouldn't first fail due to https://github.com/elinorbgr/dlib/issues/24.

Adding .. to the macro patters complains '$vargs:ty' may be followed by '...', which is not allowed for 'ty' fragments. So it seems this just isn't a valid syntax.

ids1024 avatar Oct 16 '24 20:10 ids1024