GithubHelp home page GithubHelp logo

Comments (5)

Enselic avatar Enselic commented on August 27, 2024 2

Fixed in https://crates.io/crates/cargo-public-api/0.31.0

from cargo-public-api.

pragmatrix avatar pragmatrix commented on August 27, 2024 1

Thank you a lot! I have tried version 0.31.0 and the results were great. I am now able to diff the API surface of skia-safe as a pre-release check and immediately found some inconsistencies in the current master.

from cargo-public-api.

Enselic avatar Enselic commented on August 27, 2024

Thank you very much for taking the time to report this issue, and especially for your minimal reproducer. I have done some debugging, and the problem seems to be that for items in paths, generic parameters are ignored. Only the name of the item name is used if it is part of a path:

https://github.com/Enselic/cargo-public-api/blob/c1aac48db7796eee2fae308227370331b76fe7f6/public-api/src/render.rs#L249-L254

Clearly a somewhat big bug. I'm surprised it has not been noticed before. Instead of output.push(token_fn(name.to_string())) we probably need to call a higher-level rendering function like fn token_stream(), but refactor the code to avoid recursion.

from cargo-public-api.

Enselic avatar Enselic commented on August 27, 2024

Oops, GitHub thought #430 was a fix. It wasn't...

from cargo-public-api.

Enselic avatar Enselic commented on August 27, 2024

PR with fix: #431

@pragmatrix If you want to test the fix already now on your real code you can do like this:

  1. Check out my branch with the fix
  2. Run the below command (but change Cargo.toml path of course)
$ cargo run -- --manifest-path ~/src/lib/Cargo.toml --omit blanket-impls,auto-trait-impls,auto-derived-impls
pub mod lib
pub struct lib::Handle<T>(_)
impl lib::Handle<u32>
pub fn lib::Handle<u32>::get_u32() -> u32
pub type lib::HU32 = lib::Handle<u32>

from cargo-public-api.

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.