Commit graph

263 commits

Author SHA1 Message Date
Corey Farwell
ec18991492 Add links to std::char::REPLACEMENT_CHARACTER from docs.
There are a few places where we mention the replacement character in the
docs, and it could be helpful for users to utilize the constant which is
available in the standard library, so let’s link to it!
2018-08-11 15:42:35 -04:00
Pietro Albini
b7ee110ea2
Rollup merge of #52340 - cypher:document-from-trait-in-ffi, r=steveklabnik
Document From trait implementations for OsStr, OsString, CString, and CStr

As part of issue #51430 (cc @skade).

The allocation and copy claims should be double-checked.

r? @steveklabnik
2018-08-01 10:12:32 +02:00
Tatsuyuki Ishi
4f1d4e4db6 Merge remote-tracking branches 'ljedrz/dyn_libcore', 'ljedrz/dyn_libstd' and 'ljedrz/dyn_libterm' into dyn-rollup 2018-07-25 10:25:02 +09:00
Markus Wein
ed5edcb318
Seperate summaries from rest of the comment 2018-07-23 15:38:15 +02:00
Markus Wein
b81ee0b370
Document From conversions for CString and CStr 2018-07-16 20:37:28 +02:00
Markus Wein
acdafa0fb1
Document From conversions for OsString and OsStr 2018-07-16 20:37:15 +02:00
kennytm
b317ab1bc5
Rollup merge of #51912 - mbrubeck:more_box_slice_clone, r=alexcrichton
impl Clone for Box<CStr>, Box<OsStr>, Box<Path>

Implements #51908.
2018-07-12 20:25:25 +08:00
ljedrz
560d8079ec Deny bare trait objects in src/libstd. 2018-07-10 20:35:36 +02:00
Matt Brubeck
cdff2f3b30 impl Clone for Box<CStr>, Box<OsStr>, Box<Path>
Implements #51908.
2018-07-06 12:57:47 -07:00
Gabriel Majeri
fdcee4da79 Fix stability attributes 2018-06-29 14:50:00 +03:00
Gabriel Majeri
02503029b8 Implement PartialEq between &str and OsString
Allows for example `os_string == "something"`
2018-06-29 14:50:00 +03:00
kennytm
8366780164
Rollup merge of #50170 - burtonageo:more_cow_from, r=alexcrichton
Implement From for more types on Cow

This is basically https://github.com/rust-lang/rust/pull/48191, except that it should be implemented in a way that doesn't break third party crates.
2018-05-17 05:22:07 +08:00
George Burton
7c0f664f15
Fix typo 2018-05-09 07:32:50 +01:00
George Burton
17e262880c Update features to 1.28.0 2018-05-09 07:23:02 +01:00
bors
357bf00f1c Auto merge of #48925 - zackmdavis:fn_must_stabilize, r=nikomatsakis
stabilize `#[must_use]` for functions and must-use comparison operators (RFC 1940)

r? @nikomatsakis
2018-04-30 22:02:33 +00:00
Eric Huss
269d279094 Fix some broken links in docs. 2018-04-29 10:15:40 -07:00
Zack M. Davis
3dbdccc6a9 stabilize #[must_use] for functions and must-use operators
This is in the matter of RFC 1940 and tracking issue #43302.
2018-04-28 20:32:49 -07:00
George Burton
f3e858aae7 Update the stable attributes to use the current nightly version number 2018-04-27 20:46:06 +01:00
George Burton
ea8131de53 Add cstring_from_cow_cstr and osstring_from_cow_osstr 2018-04-27 20:27:38 +01:00
George Burton
1133a149f1 Implement From for more types on Cow 2018-04-22 22:57:52 +01:00
Guillaume Gomez
05275dafaa Remove unwanted auto-linking and update 2018-04-16 23:37:11 +02:00
Diggory Blake
04f6692aaf Implement shrink_to method on collections 2018-03-27 01:39:11 +01:00
Guillaume Gomez
5344b07add Add new warning for CStr::from_ptr 2018-02-24 16:50:44 +01:00
Corey Farwell
872c782a55 Mark doc examples w/ extern blocks as ignore.
Fixes https://github.com/rust-lang/rust/issues/48218.
2018-02-18 10:27:45 -05:00
Tobias Bucher
6c86da288a Make wording around 0-cost casts more precise 2018-01-27 17:54:01 +01:00
kennytm
db36d18b9d
Rollup merge of #47357 - whentze:osstr-doc-fix, r=GuillaumeGomez
Fix docs for OsStr

At present, there are two small issues with the [docs](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) for std::ffi::OsStr:
- The docs say "OsStr is to OsString as String is to &str: the former in each pair are borrowed references; the latter are owned strings.". The latter pair is mixed up: String is the owned variant whereas &str is the borrowed reference.
- The doc links to String and &str are broken and render as [String] and [&str].

This PR fixes these issues.
2018-01-13 03:17:03 +08:00
muvlon
80028760ed s/OsStr/&OsStr in docs to align with &str/String comparison 2018-01-11 22:07:06 +01:00
muvlon
bac725ecdf Fix dead links in docs for OsStr 2018-01-11 17:20:30 +01:00
muvlon
fc825f09e8 Fix confusing documentation for OsStr 2018-01-11 17:20:16 +01:00
Alexis Hunt
9d9504a27c Fix typo. 2018-01-10 17:58:00 -05:00
Oliver Middleton
a8d107be25 Correct a few stability attributes 2017-12-27 14:11:05 +00:00
Murarth
1bbc776446 Implement Rc/Arc conversions for string-like types
Provides the following conversion implementations:

* `From<`{`CString`,`&CStr`}`>` for {`Arc`,`Rc`}`<CStr>`
* `From<`{`OsString`,`&OsStr`}`>` for {`Arc`,`Rc`}`<OsStr>`
* `From<`{`PathBuf`,`&Path`}`>` for {`Arc`,`Rc`}`<Path>`
2017-11-25 22:13:11 -07:00
Alex Crichton
5c3fe111d4 std: Avoid use of libc in portable modules
This commit removes usage of the `libc` crate in "portable" modules like
those at the top level and `sys_common`. Instead common types like `*mut
u8` or `u32` are used instead of `*mut c_void` or `c_int` as well as
switching to platform-specific functions like `sys::strlen` instead of
`libc::strlen`.
2017-11-09 07:56:44 -08:00
steveklabnik
f8f9005e57 Fix most rendering warnings from switching to CommonMark 2017-10-20 15:29:35 -04:00
kennytm
6c43bd3c83 Rollup merge of #44855 - federicomenaquintero:master, r=steveklabnik
Improved docs for CStr, CString, OsStr, OsString

This expands the documentation for those structs and their corresponding traits, per https://github.com/rust-lang/rust/issues/29354
2017-10-13 23:37:51 +08:00
Federico Mena Quintero
5fb8e3d829 ffi/mod.rs: Use only one space after a period ending a sentence 2017-10-11 17:57:56 -05:00
Federico Mena Quintero
c8e232dfe8 ffi/mod.rs: Keep the one-sentence summary at the beginning of the module 2017-10-11 17:55:01 -05:00
Federico Mena Quintero
026451093d ffi/c_str.rs: Use only one space after a period ending a sentence 2017-10-11 17:53:13 -05:00
Federico Mena Quintero
a9a4ce6dcc ffi/c_str.rs: Fix method/function confusion
Per https://github.com/rust-lang/rust/pull/44855#discussion_r144049179
2017-10-11 17:52:39 -05:00
Federico Mena Quintero
d5bdfbced6 ffi/c_str.rs: Make all descriptions have a single-sentence summary at the beginning
Per https://github.com/rust-lang/rust/pull/44855#discussion_r144048837
and subsequent ones.
2017-10-11 17:51:37 -05:00
Federico Mena Quintero
d989cd02b5 Fix broken links in documentation 2017-10-02 15:46:10 -05:00
Federico Mena Quintero
50505aadbd Clarify the ffi module's toplevel docs, per @clarcharr's comments 2017-10-02 14:16:37 -05:00
Federico Mena Quintero
9854e836a3 Remove the implication that CString contains UTF-8 data. 2017-10-02 13:53:50 -05:00
Nikolai Vazquez
f1798d3c9a Cast inner type in OsStr::bytes
The innermost type is not [u8] on all platforms but is assumed to have
the same memory layout as [u8] since this conversion was done via
mem::transmute before.
2017-09-30 10:01:41 -04:00
Nikolai Vazquez
627998e86f Remove unused 'mem' import in 'os_str' module 2017-09-28 08:43:06 -04:00
Nikolai Vazquez
33eaa94f90 Remove mem::transmute used in OsStr conversions 2017-09-28 08:07:49 -04:00
Nikolai Vazquez
755fd29b60 Fix mutability error in CString::from_raw 2017-09-28 07:56:35 -04:00
Nikolai Vazquez
6d14512fd9 Remove mem::transmute used in CStr conversions 2017-09-28 00:51:38 -04:00
Federico Mena Quintero
4143422981 os_str: Fix too-long lines 2017-09-26 08:59:34 -05:00
Federico Mena Quintero
91f6445b59 Overhaul the documentation for OsString / OsStr 2017-09-25 20:45:38 -05:00