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

Lint to track "Panics" section of rustdoc? #22969

Open
asajeffrey opened this issue Mar 4, 2019 · 2 comments
Open

Lint to track "Panics" section of rustdoc? #22969

asajeffrey opened this issue Mar 4, 2019 · 2 comments
Labels
B-interesting-project Represents work that is expected to be interesting in some fashion I-panic Servo encounters a panic.

Comments

@asajeffrey
Copy link
Member

At the moment, we have an ad-hoc script which greps for function names that look like they'll cause panic. https://github.com/servo/servo/blob/master/etc/ci/check_no_panic.sh

A somewhat more principled approach would be a lint that checks functions for the Panics rustdoc section, and warns if it finds a function that a) calls a function with a Panics section of its docs, and b) doesn't have its own Panics section. With an appropriate allow for cases where we're really really sure the panic can't happen.

@asajeffrey asajeffrey added B-interesting-project Represents work that is expected to be interesting in some fashion I-panic Servo encounters a panic. labels Mar 4, 2019
@asajeffrey
Copy link
Member Author

@asajeffrey
Copy link
Member Author

The no-panic crate works after monomorphization, so can deal with generic functions (at the cost of working at link time rather than compile time).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-interesting-project Represents work that is expected to be interesting in some fashion I-panic Servo encounters a panic.
Projects
None yet
Development

No branches or pull requests

1 participant