Skip to content

improve docs for std::hint::unreachable_unchecked() #59717

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

Merged
merged 2 commits into from
Apr 16, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/libcore/hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ use intrinsics;
/// difficult-to-debug problems.
///
/// Use this function only when you can prove that the code will never call it.
///
/// The [`unreachable!()`] macro is the safe counterpart of this function, which
/// will panic instead when executed.
/// Otherwise, consider using the [`unreachable!()`] macro, which does not allow
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 good, but can you remove the ()s, both here and in the link target? I know they were there previously, but the style is not to include them when referring to the names.

Copy link
Author

Choose a reason for hiding this comment

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

I added another commit to address this.

/// optimizations but will panic when executed.
///
/// [`unreachable!()`]: ../macro.unreachable.html
///
Expand Down