summary refs log tree commit diff
path: root/library/std/src/ffi
AgeCommit message (Collapse)AuthorLines
2021-02-03OsStr eq_ignore_ascii_case takes arg by valueTyler Ruckinger-1/+1
Per a comment on #70516 this changes `eq_ignore_ascii_case` to take the generic parameter `S: AsRef<OsStr>` by value instead of by reference. This is technically a breaking change to an unstable method. I think the only way it would break is if you called this method with an explicit type parameter, ie `my_os_str.eq_ignore_ascii_case::<str>("foo")` becomes `my_os_str.eq_ignore_ascii_case::<&str>("foo")`. Besides that, I believe it is overall more flexible since it can now take an owned `OsString` for example. If this change should be made in some other PR (like #80193) then please just close this.
2021-01-26shrink_to shouldn't panic on len greater than capacityThom Wiggers-2/+1
2021-01-22Inline methods of Path and OsStringBenoît du Garreau-0/+34
2021-01-13Update tests for extern block lintingMark Rousskov-7/+7
2020-12-28Add "length" as doc alias to len methodsKonrad Borowski-0/+1
2020-12-16Auto merge of #78833 - CDirkx:parse_prefix, r=dtolnaybors-2/+2
Refactor and fix `parse_prefix` on Windows This PR is an extension of #78692 as well as a general refactor of `parse_prefix`: **Fixes**: There are two errors in the current implementation of `parse_prefix`: Firstly, in the current implementation only `\` is recognized as a separator character in device namespace prefixes. This behavior is only correct for verbatim paths; `"\\.\C:/foo"` should be parsed as `"C:"` instead of `"C:/foo"`. Secondly, the current implementation only handles single separator characters. In non-verbatim paths a series of separator characters should be recognized as a single boundary, e.g. the UNC path `"\\localhost\\\\\\C$\foo"` should be parsed as `"\\localhost\\\\\\C$"` and then `UNC(server: "localhost", share: "C$")`, but currently it is not parsed at all, because it starts being parsed as `\\localhost\` and then has an invalid empty share location. Paths like `"\\.\C:/foo"` and `"\\localhost\\\\\\C$\foo"` are valid on Windows, they are equivalent to just `"C:\foo"`. **Refactoring**: All uses of `&[u8]` within `parse_prefix` are extracted to helper functions and`&OsStr` is used instead. This reduces the number of places unsafe is used: - `get_first_two_components` is adapted to the more general `parse_next_component` and used in more places - code for parsing drive prefixes is extracted to `parse_drive`
2020-11-19Bump bootstrap compiler versionJake Goulding-1/+1
2020-11-07Refactor `parse_prefix` on WindowsChristiaan Dirkx-2/+2
Refactor `get_first_two_components` to `get_next_component`. Fixes the following behaviour of `parse_prefix`: - series of separator bytes in a prefix are correctly parsed as a single separator - device namespace prefixes correctly recognize both `\\` and `/` as separators
2020-10-26Fix bootstrap doctest failureNathan Whitaker-1/+1
2020-10-26Address review commentsNathan Whitaker-1/+0
2020-10-26Address review commentsNathan Whitaker-0/+2
2020-10-26Change to warn by default / fix typoNathan Whitaker-1/+1
2020-10-26Update doctestNathan Whitaker-1/+1
2020-10-15Deny broken intra-doc links in linkcheckerJoshua Nelson-1/+2
Since rustdoc isn't warning about these links, check for them manually.
2020-10-12Use intra-doc links for links to module-level docsCamelid-2/+2
2020-09-20Implement destructuring for all aggregates and for referencesOliver Scherer-1/+1
2020-09-08Capitalize safety commentsFlying-Toast-4/+4
2020-08-31std: move "mod tests/benches" to separate filesLzu Tao-368/+367
Also doing fmt inplace as requested.
2020-08-23Convert str -> prim@str in `std`Joshua Nelson-3/+4
2020-08-14Rollup merge of #75501 - poliorcetics:intra-links-std-ffi, r=jyn514Tyler Mandry-233/+81
Move to intra doc links in std::ffi Helps with #75080. @rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc
2020-08-14libstd/ffi/c_str.rs: #![deny(unsafe_op_in_unsafe_fn)], enclose unsafe ↵Alexis Bourget-7/+32
operations in unsafe blocks
2020-08-14Apply suggestions from code reviewPoliorcetics-3/+3
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-08-13Move to intra doc links in std::ffiAlexis Bourget-233/+81
2020-07-27mv std libs to library/mark-0/+3333