Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crate-private type Outlines<'_> in public interface #44

Closed
ijager opened this issue Jan 31, 2024 · 8 comments · Fixed by #45
Closed

crate-private type Outlines<'_> in public interface #44

ijager opened this issue Jan 31, 2024 · 8 comments · Fixed by #45

Comments

@ijager
Copy link

ijager commented Jan 31, 2024

I think there is a bug in 0.1.10:

error[E0446]: crate-private type `Outlines<'_>` in public interface
  --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swash-0.1.10/src/scale/cff/mod.rs:24:5
   |
24 | /     pub fn scale(
25 | |         &mut self,
26 | |         outlines: &outlines::Outlines,
27 | |         id: u64,
...  |
32 | |         outline: &mut Outline,
33 | |     ) -> Option<()> {
   | |___________________^ can't leak crate-private type
   |
  ::: ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swash-0.1.10/src/scale/cff/outlines.rs:39:1
   |
39 |   pub(crate) struct Outlines<'a> {
   |   ------------------------------ `Outlines<'_>` declared as crate-private

Outlines should be pub I guess instead of pub(crate).

@klangner
Copy link

klangner commented Feb 1, 2024

Hi, Would it be possible to fix this and create a new release please?

This currently broke iced framework and my local app. I can create PR for it if needed, but it looks that the change is simple to remove(crate) from this line pub(crate) struct Outlines<'a>.

Thank you!

@jackpot51
Copy link
Collaborator

Please see if #45 fixes this.

@klangner
Copy link

klangner commented Feb 1, 2024

Thank you, but it looks that I still have a problem, this time:

/     pub fn draw(
197 | |         &self,
198 | |         subfont: &Subfont,
199 | |         glyph_id: GlyphId,
...   |
202 | |         pen: &mut impl Pen,
203 | |     ) -> Result<(), Error> {
    | |__________________________^ can't leak crate-private type
...
292 |   pub(crate) struct Subfont {
    |   ------------------------- `Subfont` declared as crate-private

So the same problem for struct Subfont

@klangner
Copy link

klangner commented Feb 1, 2024

BTW I have the same issues if I clone this repo and run cargo build

@jackpot51
Copy link
Collaborator

@klangner what rustc version do you have? I can't reproduce it on rustc 1.74 (still want to fix it to continue working with older versions)

@jackpot51
Copy link
Collaborator

I've verified that #46 fixes that issue, and allows building with rustc as old as 1.65

@klangner
Copy link

klangner commented Feb 1, 2024

I have 1.72.1 I can upgrade if this will solve this problem. I can also make fork fix it and send PR if you want.

BTW there are also several warnings during the build.
Like:

warning: field `flags` is never read
   --> src/strike.rs:783:9
    |
779 | struct BitmapData<'a> {
    |        ---------- field in this struct
...
783 |     pub flags: u8,
    |         ^^^^^
    |
    = note: `BitmapData` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
    = note: `#[warn(dead_code)]` on by default

@jackpot51
Copy link
Collaborator

Before #46 it will build with rustc as old as 1.74, after, it will build with rustc as old as 1.65.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants