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

Inconsistent #[unstable] attribute application #3022

Open
MabezDev opened this issue Jan 23, 2025 · 4 comments
Open

Inconsistent #[unstable] attribute application #3022

MabezDev opened this issue Jan 23, 2025 · 4 comments
Labels
beta-blocker documentation Improvements or additions to documentation
Milestone

Comments

@MabezDev
Copy link
Member

First discovered here: #3021 (comment)

Sometimes we mark an impl block as unstable which produces some not so helpful docs:

Image

Sometimes we apply it per function:

Image

@MabezDev MabezDev added beta-blocker documentation Improvements or additions to documentation labels Jan 23, 2025
@MabezDev MabezDev added this to the 1.0.0-beta.0 milestone Jan 23, 2025
@bugadani
Copy link
Contributor

For this issue to be actionable, you should probably define what we should do. It's implied, but may not be clear or it may imply different things to us than to you :)

@MabezDev
Copy link
Member Author

MabezDev commented Jan 23, 2025

I'm not sure what we should do, I prefer the latter in terms of readability, but I'm not sure if the impl block way can be "fixed"?

@bugadani
Copy link
Contributor

Impl blocks are tricky because they are simply removed if the feature isn't enabled. This pretty much is the only way to treat trait impls - there is no such thing as a private impl, or a trait impl with private methods.

We could maybe? redefine the attribute on inherent impl blocks, to instead apply the attribute to all items in that block. As this is pretty much my fault/mistake/oversight I don't think the ratatui team would mind, but I think it would be a weird (and breaking) change to handle different impl blocks in such a different way.

It's also easier to remove/stabilize instability markers if they are placed individually. It's also probably more obvious from reading the code what's stable and what's not.

TLDR; I think we should probably mark each function.

@MabezDev
Copy link
Member Author

TLDR; I think we should probably mark each function.

I agree. We should also document this in API-GUIDELINES.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-blocker documentation Improvements or additions to documentation
Projects
Status: Todo
Development

No branches or pull requests

2 participants