Git Product home page Git Product logo

Comments (8)

chifflier avatar chifflier commented on May 27, 2024

I confirm that problem, however the bug is not in this crate nor in rusticata-macros.
This is caused by nom defining a dbg macro and rust deciding to use it even without a use statement.

As a workaround, it's possible to use ::std::dbg!() instead of dbg!() until it is fixed.

I forwarded your issue to nom (rust-bakery/nom#1022) with an example, so closing this one.

from der-parser.

abonander avatar abonander commented on May 27, 2024

@chifflier the issue is that #[macro_use] extern crate nom; is neccessary in user code in the first place. You have to reexport macros you intend to use from other crates in your own macros.

from der-parser.

abonander avatar abonander commented on May 27, 2024

Or, you have to show in your examples that this is needed. It appears there are no files in tests/ that use the macros so that's why you wouldn't have seen this.

from der-parser.

chifflier avatar chifflier commented on May 27, 2024

Oh, maybe I didn't get the issue right then (reopening). I'll check if re-exporting macros works.

That said, there is code in tests using macros, see https://github.com/rusticata/der-parser/blob/master/tests/constructed.rs (but it imports everything).

from der-parser.

chifflier avatar chifflier commented on May 27, 2024

@abonander 3f896e2 should fix the problem by allowing to use der-parser macros without importing nom nor rusticata-macros . I'm running more tests, but if it works correctly, it could justify a new release.

Note I had to add new result types to hide nom::IResult

from der-parser.

chifflier avatar chifflier commented on May 27, 2024

Result types (and removal of now unneeded imports) have been generalized in d24fdcc and 0b6e713
der-parser macros can now be used without importing other crates.

Thanks for the suggestion of re-exporting macros, it helped solving the problem.

from der-parser.

chifflier avatar chifflier commented on May 27, 2024

Forgot to say: der-parser 3.0.1 has been published

from der-parser.

abonander avatar abonander commented on May 27, 2024

Thanks!

from der-parser.

Related Issues (20)

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.