Skip to content

Commit 06dbc28

Browse files
authored
Rollup merge of #88976 - notriddle:notriddle/cow-from-cstr-docs, r=Mark-Simulacrum
Clean up and add doc comments for CStr CC #51430
2 parents 5b6285e + cc7929b commit 06dbc28

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Diff for: compiler/rustc_expand/src/mbe/quoted.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub(super) fn parse(
7272
// this with just `span.edition()`. A
7373
// `SyntaxContext::root()` from the current crate will
7474
// have the edition of the current crate, and a
75-
// `SyntaxxContext::root()` from a foreign crate will
75+
// `SyntaxContext::root()` from a foreign crate will
7676
// have the edition of that crate (which we manually
7777
// retrieve via the `edition` parameter).
7878
if span.ctxt() == SyntaxContext::root() {

Diff for: library/std/src/ffi/c_str.rs

+3
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,7 @@ impl From<CString> for Box<CStr> {
915915

916916
#[stable(feature = "cow_from_cstr", since = "1.28.0")]
917917
impl<'a> From<CString> for Cow<'a, CStr> {
918+
/// Converts a [`CString`] into an owned [`Cow`] without copying or allocating.
918919
#[inline]
919920
fn from(s: CString) -> Cow<'a, CStr> {
920921
Cow::Owned(s)
@@ -923,6 +924,7 @@ impl<'a> From<CString> for Cow<'a, CStr> {
923924

924925
#[stable(feature = "cow_from_cstr", since = "1.28.0")]
925926
impl<'a> From<&'a CStr> for Cow<'a, CStr> {
927+
/// Converts a [`CStr`] into a borrowed [`Cow`] without copying or allocating.
926928
#[inline]
927929
fn from(s: &'a CStr) -> Cow<'a, CStr> {
928930
Cow::Borrowed(s)
@@ -931,6 +933,7 @@ impl<'a> From<&'a CStr> for Cow<'a, CStr> {
931933

932934
#[stable(feature = "cow_from_cstr", since = "1.28.0")]
933935
impl<'a> From<&'a CString> for Cow<'a, CStr> {
936+
/// Converts a `&`[`CString`] into a borrowed [`Cow`] without copying or allocating.
934937
#[inline]
935938
fn from(s: &'a CString) -> Cow<'a, CStr> {
936939
Cow::Borrowed(s.as_c_str())

0 commit comments

Comments
 (0)