-
Notifications
You must be signed in to change notification settings - Fork 13k
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
docs: Have panic!() and compile_error!() point to each other in docs #47275
Comments
I'd love to work on this. |
So, the relationship between "panic" and "compile_error" is that panic is meant to signal a run time error from which the thread cannot recover, while compile_error is meant to signal an error in compilation. Generally, compile_error is used in a few select contexts:
Thinking about it more, it may make sense to have the compile_error docs reference panic, but not the other way around. Because confusion in the other direction seems unlikely. |
I usually only remember the existence of I personally don't think they'd be any confusion between the two, mainly because I assume the wording would be slightly more verbose than simply "See also: panic!" or "See also: compile_error!", it'd be more like: "For throwing an error at compile-time, see Hey, thanks for considering it ;) |
Fixes rust-lang#47275. These two macros are similar, but different, and could do with documentation links to each other.
I had a go at this today!
I agree with the sentiment that |
… r=GuillaumeGomez Link panic and compile_error docs This adds documentation links between `panic!()` and `compile_error!()` as per rust-lang#47275, which points out that they’re similar. It also adds a sentence to the `compile_error()` docs I thought could be added.
… r=GuillaumeGomez Link panic and compile_error docs This adds documentation links between `panic!()` and `compile_error!()` as per rust-lang#47275, which points out that they’re similar. It also adds a sentence to the `compile_error()` docs I thought could be added.
… r=GuillaumeGomez Link panic and compile_error docs This adds documentation links between `panic!()` and `compile_error!()` as per rust-lang#47275, which points out that they’re similar. It also adds a sentence to the `compile_error()` docs I thought could be added.
While viewing the docs for each:
https://doc.rust-lang.org/beta/std/macro.panic.html
https://doc.rust-lang.org/beta/std/macro.compile_error.html
would be real nice to have them link to each other, like an "See also" thing, but probably not as simple as only two words.
(I don't know how to do that or even how to word it, hopefully someone will take this task)
For your consideration.
Thank you.
The text was updated successfully, but these errors were encountered: