You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Documentation is cut off before examples are shown.
Neovim
VS Code
Source code of pow, the documentation stops rendering at the #[doc] directive:
/// Raises self to the power of `exp`, using exponentiation by squaring.
///
/// # Examples
///
/// Basic usage:
///
/// ```
#[doc = concat!("assert_eq!(2", stringify!($SelfT), ".pow(5), 32);")]
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_int_pow", since = "1.50.0")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
#[rustc_inherit_overflow_checks]
pub const fn pow(self, mut exp: u32) -> Self {
if exp == 0 {
return 1;
}
let mut base = self;
let mut acc = 1;
while exp > 1 {
if (exp & 1) == 1 {
acc = acc * base;
}
exp /= 2;
base = base * base;
}
// since exp!=0, finally the exp must be 1.
// Deal with the final bit of the exponent separately, since
// squaring the base afterwards is not necessary and may cause a
// needless overflow.
acc * base
}
There are many functions in this file that have the same problem.
P.S. Usually I would expect documentation to be like this:
Location
/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs
Summary
Documentation is cut off before examples are shown.
Neovim
VS Code
Source code of
pow
, the documentation stops rendering at the#[doc]
directive:There are many functions in this file that have the same problem.
P.S. Usually I would expect documentation to be like this:
The text was updated successfully, but these errors were encountered: