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

[doc] Document rustc type privacy bug #1734

Merged
merged 1 commit into from
Sep 23, 2024
Merged

[doc] Document rustc type privacy bug #1734

merged 1 commit into from
Sep 23, 2024

Conversation

jswrenn
Copy link
Collaborator

@jswrenn jswrenn commented Sep 23, 2024

See #1292

Makes progress towards #671

@codecov-commenter
Copy link

codecov-commenter commented Sep 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.11%. Comparing base (73b15e5) to head (3777e46).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1734   +/-   ##
=======================================
  Coverage   88.11%   88.11%           
=======================================
  Files          16       16           
  Lines        5720     5720           
=======================================
  Hits         5040     5040           
  Misses        680      680           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/lib.rs Outdated
/// = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info)
/// ```
///
/// To work around this bug, mark private field types as `pub` and annotate them with `#[doc(hidden)]`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only required under some circumstances. I'd double check the KnownLayout derive to get the exact list, but off the top of my head:

  • It only applies to the trailing field, so I'd update the example to have two fields
  • There is no separate trailing field type if it's generic (ie, if its type is T where T is a type parameter - this doesn't apply for, eg Foo<T>, since Foo could still be a private type)
  • There might be reprs for which this isn't a problem? Idr.

@jswrenn jswrenn force-pushed the doc-privacy-issue branch 2 times, most recently from 4cf65c0 to 8a56a12 Compare September 23, 2024 17:21
@joshlf joshlf added this pull request to the merge queue Sep 23, 2024
Merged via the queue into main with commit 13bff62 Sep 23, 2024
86 checks passed
@joshlf joshlf deleted the doc-privacy-issue branch September 23, 2024 18:31
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 this pull request may close these issues.

3 participants