summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2020-06-15Rollup merge of #73104 - poliorcetics:explicit-mutex-drop-example, r=dtolnayRalf Jung-0/+54
Example about explicit mutex dropping Fixes #67457. Following the remarks made in #73074, I added an example on the main `Mutex` type, with a situation where there is mutable data and a computation result. In my testing it is effectively needed to explicitly drop the lock, else it deadlocks. r? @dtolnay because you were the one to review the previous PR.
2020-06-15remove obsolete , to pass the format checkStefan Lankes-2/+2
2020-06-15add comment about the usage of ArcStefan Lankes-0/+3
2020-06-15use Ipv6Addr::from to build the IPv6 addressStefan Lankes-24/+2
2020-06-15Revert "simplify conversion to IpAddr::V6"Stefan Lankes-2/+18
This reverts commit d221ffc68e543f4a38efcc2bd34f52145f89003b.
2020-06-15Revert "changes to pass the format check"Stefan Lankes-4/+10
This reverts commit 9d596b50f15dfff47fa2272ee63cdc9aeb9307fa.
2020-06-15remove obsolete lineStefan Lankes-1/+0
2020-06-15changes to pass the format checkStefan Lankes-10/+4
2020-06-14simplify conversion to IpAddr::V6Stefan Lankes-18/+2
2020-06-14Update to use the new error type and correctly compile the doc testsAlexis Bourget-16/+21
2020-06-14Add a new error type for the new methodAlexis Bourget-0/+98
2020-06-14Removing the TryFrom implAlexis Bourget-14/+0
2020-06-14use latest interface to HermitCoreStefan Lankes-1/+1
2020-06-14remove unused functionStefan Lankes-6/+0
2020-06-13add TcpListener support for HermitCoreStefan Lankes-46/+111
Add basic support of TcpListerner for HermitCore. In addition, revise TcpStream to support peer_addr.
2020-06-13Add test for comparing SocketAddr with inferred right-hand sideDavid Tolnay-0/+5
2020-06-13Rewrap comments in Mutex exampleDavid Tolnay-11/+11
2020-06-13Clarify the scope-related explanation Poliorcetics-3/+2
Based on the review made by dtolnay.
2020-06-13Apply suggestions from code reviewPoliorcetics-5/+5
Co-authored-by: David Tolnay <dtolnay@gmail.com>
2020-06-13add link list of error codes on docs.microsoft.comCarsten Andrich-0/+2
2020-06-12Revert heterogeneous SocketAddr PartialEq implsDavid Tolnay-40/+0
These lead to inference regressions (mostly in tests) in code that looks like: let socket = std::net::SocketAddrV4::new(std::net::Ipv4Addr::new(127, 0, 0, 1), 8080); assert_eq!(socket, "127.0.0.1:8080".parse().unwrap()); That compiles as of stable 1.44.0 but fails in beta with: error[E0284]: type annotations needed --> src/main.rs:3:41 | 3 | assert_eq!(socket, "127.0.0.1:8080".parse().unwrap()); | ^^^^^ cannot infer type for type parameter `F` declared on the associated function `parse` | = note: cannot satisfy `<_ as std::str::FromStr>::Err == _` help: consider specifying the type argument in the method call | 3 | assert_eq!(socket, "127.0.0.1:8080".parse::<F>().unwrap()); |
2020-06-12add raw_ref macrosRalf Jung-0/+1
2020-06-11Make a note about is_dir vs is_file in Path tooAlexis Bourget-4/+8
2020-06-11Added the note to Metadata tooAlexis Bourget-0/+6
2020-06-11Add documentation to point to `!is_dir` instead of `is_file`Alexis Bourget-0/+6
2020-06-11Fix the link in the TryFrom implAlexis Bourget-1/+1
2020-06-11Add a TryFrom<Vec<u8>> impl that mirror from_vec_with_nulAlexis Bourget-0/+14
2020-06-10Migrate to numeric associated constsLzu Tao-211/+185
2020-06-09Remove a lot of unecessary/duplicated commentsAlexis Bourget-11/+3
2020-06-09Move to unstable, linking the issueAlexis Bourget-2/+2
2020-06-09Mark tests whcih don't work under riscv emulationTom Eccles-2/+3
2020-06-08Auto merge of #72655 - jethrogb:sgx-lvi-hardening, r=petrochenkovbors-6/+16
Enable LVI hardening for x86_64-fortanix-unknown-sgx This implements mitigations for the Load Value Injection vulnerability (CVE-2020-0551) for the `x86_64-fortanix-unknown-sgx` target by enabling new LLVM passes. More information about LVI and mitigations may be found at https://software.intel.com/security-software-guidance/insights/deep-dive-load-value-injection. This PR unconditionally enables the mitigations for `x86_64-fortanix-unknown-sgx` since there is no available hardware that doesn't require the mitigations. This may be reconsidered in the future. * [x] This depends on https://github.com/rust-lang/compiler-builtins/pull/359/
2020-06-08Add methods to go from a nul-terminated Vec<u8> to a CString, checked and ↵Alexis Bourget-3/+77
unchecked. Doc tests have been written and the documentation on the error type updated too.
2020-06-08Simply use drop instead of std::mem::dropPoliorcetics-2/+2
Co-authored-by: LeSeulArtichaut <leseulartichaut@gmail.com>
2020-06-08Rollup merge of #72963 - poliorcetics:cstring-from-raw, r=dtolnayRalf Jung-0/+11
Cstring `from_raw` and `into_raw` safety precisions Fixes #48525. Fixes #68456. This issue had two points: - The one about `from_raw` has been addressed (I hope). - The other one, about `into_raw`, has only been partially fixed. About `into_raw`: the idea was to: > steer users away from using the pattern of CString::{into_raw,from_raw} when interfacing with C APIs that may change the effective length of the string by writing interior NULs or erasing the final NUL I tried making a `Vec<c_char>` like suggested but my current solution feels very unsafe and *hacky* to me (most notably the type cast), I included it here to make it available for discussion: ```rust fn main() { use std::os::raw::c_char; let v = String::from("abc") .bytes() // From u8 to i8, // I feel like it will be a problem for values of u8 > 255 .map(|c| c as c_char) .collect::<Vec<_>>(); dbg!(v); } ```
2020-06-08Rollup merge of #72761 - poliorcetics:use-keyword-doc, r=Dylan-DPCRalf Jung-2/+54
Added the documentation for the 'use' keyword This is a partial fix of #34601. I heavily inspired myself from the Reference on the `use` keyword. I checked the links when compiling the documentation, they should be ok. I also added an example for the wildcard `*` in the case of types, because it's behaviour is not *import everything* like one might think at first.
2020-06-07Improved the example to work with mutable data, providing a reason for the ↵Alexis Bourget-4/+6
mutex holding it
2020-06-07Added an example where explicitly dropping a lock is necessary/a good idea.Alexis Bourget-0/+61
2020-06-07Enable LVI hardening for x86_64-fortanix-unknown-sgxJethro Beekman-6/+16
2020-06-05Auto merge of #72957 - Mark-Simulacrum:bootstrap-bump, r=sfacklerbors-34/+8
Bump bootstrap compiler to 1.45 Pretty standard update.
2020-06-05impl ToSocketAddrs for (String, u16)Yoshua Wuyts-0/+8
2020-06-03Hexagon libstd: fix typo for c_ulonglongBrian Cain-1/+1
2020-06-03Added a warning to CString::into_raw tooAlexis Bourget-0/+5
2020-06-03Added the documentation about length to CString::from_rawAlexis Bourget-0/+6
2020-06-03Bump to 1.46Mark Rousskov-34/+8
2020-06-03Rollup merge of #72924 - JohnTitor:stabilize-buf-capacity, r=shepmasterDylan DPC-4/+2
Stabilize `std::io::Buf{Reader, Writer}::capacity` Closes #68833 FCP is done here: https://github.com/rust-lang/rust/issues/68833#issuecomment-637596083
2020-06-03Stabilize `std::io::Buf{Reader, Writer}::capacity`Yuki Okushi-4/+2
2020-06-01Add a warning about infinite reading in read_(until|line)Alexis Bourget-0/+8
2020-05-31Auto merge of #72813 - RalfJung:rollup-4ko6q8j, r=RalfJungbors-4/+3
Rollup of 5 pull requests Successful merges: - #72683 (from_u32_unchecked: check validity, and fix UB in Wtf8) - #72715 (Account for trailing comma when suggesting `where` clauses) - #72745 (generalize Borrow<[T]> for Interned<'tcx, List<T>>) - #72749 (Update stdarch submodule to latest head) - #72781 (Use `LocalDefId` instead of `NodeId` in `resolve_str_path_error`) Failed merges: r? @ghost
2020-05-31Rollup merge of #72683 - RalfJung:char-debug-check, r=Mark-SimulacrumRalf Jung-4/+3
from_u32_unchecked: check validity, and fix UB in Wtf8 Fixes https://github.com/rust-lang/rust/issues/72760