-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Add doc aliases for a lot of the C standard library #81988
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -887,6 +887,7 @@ pub const fn replace<T>(dest: &mut T, src: T) -> T { | |
/// | ||
/// [`RefCell`]: crate::cell::RefCell | ||
#[doc(alias = "delete")] | ||
#[doc(alias = "free")] | ||
|
||
#[inline] | ||
#[stable(feature = "rust1", since = "1.0.0")] | ||
pub fn drop<T>(_x: T) {} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -782,6 +782,10 @@ macro_rules! from_str_radix_int_impl { | |
#[stable(feature = "rust1", since = "1.0.0")] | ||
impl FromStr for $t { | ||
type Err = ParseIntError; | ||
#[doc(alias = "atoi")] | ||
#[doc(alias = "atol")] | ||
#[doc(alias = "strtod")] | ||
#[doc(alias = "strtol")] | ||
|
||
fn from_str(src: &str) -> Result<Self, ParseIntError> { | ||
from_str_radix(src, 10) | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,6 +162,8 @@ pub enum Option<T> { | |
/// No value | ||
#[lang = "None"] | ||
#[stable(feature = "rust1", since = "1.0.0")] | ||
#[doc(alias = "null")] | ||
#[doc(alias = "nil")] | ||
|
||
None, | ||
/// Some value `T` | ||
#[lang = "Some"] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1034,6 +1034,8 @@ impl str { | |
/// assert_eq!(s.find(x), None); | ||
/// ``` | ||
#[stable(feature = "rust1", since = "1.0.0")] | ||
#[doc(alias = "strstr")] | ||
#[doc(alias = "strchr")] | ||
#[inline] | ||
pub fn find<'a, P: Pattern<'a>>(&'a self, pat: P) -> Option<usize> { | ||
pat.into_searcher(self).next_match().map(|(i, _)| i) | ||
|
@@ -1080,6 +1082,7 @@ impl str { | |
/// assert_eq!(s.rfind(x), None); | ||
/// ``` | ||
#[stable(feature = "rust1", since = "1.0.0")] | ||
#[doc(alias = "strrchr")] | ||
#[inline] | ||
pub fn rfind<'a, P>(&'a self, pat: P) -> Option<usize> | ||
where | ||
|
@@ -1202,6 +1205,7 @@ impl str { | |
/// | ||
/// [`split_whitespace`]: str::split_whitespace | ||
#[stable(feature = "rust1", since = "1.0.0")] | ||
#[doc(alias = "strtok")] | ||
|
||
#[inline] | ||
pub fn split<'a, P: Pattern<'a>>(&'a self, pat: P) -> Split<'a, P> { | ||
Split(SplitInternal { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -881,6 +881,7 @@ impl Command { | |
/// assert!(output.status.success()); | ||
/// ``` | ||
#[stable(feature = "process", since = "1.0.0")] | ||
#[doc(alias = "system")] | ||
|
||
pub fn output(&mut self) -> io::Result<Output> { | ||
self.inner | ||
.spawn(imp::Stdio::MakePipe, false) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is moderately iffy because you have to pass a radix of 16, but it's close enough.