about summary refs log tree commit diff
path: root/src/libstd/net
AgeCommit message (Collapse)AuthorLines
2019-02-20Rollup merge of #58553 - scottmcm:more-ihle, r=Centrilkennytm-4/+4
Use more impl header lifetime elision Inspired by seeing explicit lifetimes on these two: - https://doc.rust-lang.org/nightly/std/slice/struct.Iter.html#impl-FusedIterator - https://doc.rust-lang.org/nightly/std/primitive.u32.html#impl-Not And a follow-up to https://github.com/rust-lang/rust/pull/54687, that started using IHLE in libcore. Most of the changes in here fall into two big categories: - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop`, `Debug`, and `Clone`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations [where the flipped one cannot elide the lifetime](https://internals.rust-lang.org/t/impl-type-parameter-aliases/9403/2?u=scottmcm). I also removed two lifetimes that turned out to be completely unused; see https://github.com/rust-lang/rust/issues/41960#issuecomment-464557423
2019-02-20Rollup merge of #58551 - ssomers:master, r=oli-obkkennytm-2/+6
Explain a panic in test case net::tcp::tests::double_bind Those who try to build libstd on the Windows Subsystem for Linux experience a single failing test, where the point of failure is an explicit but anonymous panic, as reported in https://github.com/rust-lang/rust/issues/49367 This commit somewhat explains why and allows diagnosing a little.
2019-02-20Rollup merge of #58392 - scottmcm:less-shifting-in-net-ip, r=oli-obkkennytm-25/+58
Use less explicit shifting in std::net::ip Now that we have `{to|from}_be_bytes` the code can be simpler. (Inspired by PR #57740)
2019-02-17Use more impl header lifetime elisionScott McMurray-4/+4
There are two big categories of changes in here - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop` & `Debug`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations where the flipped one cannot elide the lifetime.
2019-02-18Merge remote-tracking branch 'upstream/master'Stein Somers-19/+18
2019-02-18Explain a panic in test case net::tcp::tests::double_bindStein Somers-2/+6
2019-02-12Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnikbors-17/+17
Cosmetic improvements to doc comments This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase). r? @steveklabnik Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-11Use less explicit shifting in std::net::ipScott McMurray-25/+58
Now that we have {to|from}_be_bytes the code can be simpler. (Inspired by PR #57740)
2019-02-10libs: doc commentsAlexander Regueiro-16/+16
2019-02-10tests: doc commentsAlexander Regueiro-1/+1
2019-02-10Rollup merge of #57740 - JakubOnderka:ipv4addr-to_ne_bytes, r=scottmcmGuillaume Gomez-2/+1
Use `to_ne_bytes` for converting IPv4Addr to octets It is easier and it should be also faster, because [`to_ne_bytes`](https://doc.rust-lang.org/std/primitive.u32.html#method.to_ne_bytes) just calls `mem::transmute`.
2019-01-26Bump bootstrap compiler to 1.33 betaMark Rousskov-1/+0
2019-01-18Use `to_ne_bytes` for converting IPv4Address to octetsJakub Onderka-2/+1
It is easier and it should be also faster, because `to_ne_bytes` just calls `mem::transmute`.
2019-01-14Remove the `connect_timeout_unroutable` test.Nicholas Nethercote-11/+0
It requires an unreachable IP address, but there is no such thing, and this has caused it to fail for multiple people. Fixes #44698, fixes #50065.
2018-12-31const-stabilize Ipv4Addr::newMazdak Farrokhzad-1/+1
2018-12-25Remove licensesMark Rousskov-70/+0
2018-12-11Address unused variables warning with TcpStreamvarkor-0/+3
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-4/+4
2018-12-06Refactor net::each_addr/lookup_host to forward error from resolveJethro Beekman-24/+14
2018-11-30Deal with EINTR in net timeout testsJosh Stone-8/+22
We've seen sporadic QE failures in the timeout tests on this assertion: assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut); So there's an error, but not either of the expected kinds. Adding a format to show the kind revealed `ErrorKind::Interrupted` (`EINTR`). For the cases that were using `read`, we can just use `read_exact` to keep trying after interruption. For those using `recv_from`, we have to manually loop until we get a non-interrupted result.
2018-11-15Rollup merge of #55901 - euclio:speling, r=petrochenkovPietro Albini-1/+1
fix various typos in doc comments
2018-11-13fix various typos in doc commentsAndy Russell-1/+1
2018-11-10reduce list to functions callable in const ctx.Mazdak Farrokhzad-3/+3
2018-11-10constify parts of libstd.Mazdak Farrokhzad-6/+5
2018-10-11Small changes to fix documentation auto compile issuesCharles Hathaway-1/+2
2018-10-10update tcp stream documentationCharles Hathaway-4/+3
2018-09-18Rollup merge of #53522 - phungleson:fix-impl-from-for-addr, r=TimNNGuillaume Gomez-0/+8
Add doc for impl From for Addr As part of issue #51430 (cc @skade). The impl is very simple, let me know if we need to go into any details. Additionally, I added `#[inline]` for the conversion method, let me know if it is un-necessary or might break something.
2018-08-21Add doc for impl From for AddrSon-0/+8
2018-08-21Rollup merge of #53213 - tmccombs:stable-ipconstructors, r=KodrAuskennytm-20/+5
Stabilize IP associated constants Fixes #44582
2018-08-14Stabilize IP associated constantsThayne McCombs-20/+5
Fixes #44582
2018-08-10Replace _.. with just .. in slice patternLinus Färnstrand-4/+4
2018-08-10Make use of match ergonomics in ip methodsLinus Färnstrand-36/+36
2018-08-10Use slice patterns to check IP octetsLinus Färnstrand-11/+14
2018-08-08Simplify Ipv6Addr::from(octets) to not use unsafeLinus Färnstrand-3/+1
2018-08-08Simplify is_broadcastLinus Färnstrand-2/+1
2018-08-08Add Ipv4Addr BROADCAST assoc constLinus Färnstrand-0/+18
2018-08-08Move IPs to assoc constsLinus Färnstrand-28/+20
2018-08-08Make Ipv{4,6}Addr::new const fnsLinus Färnstrand-20/+28
2018-07-27Auto merge of #52336 - ishitatsuyuki:dyn-rollup, r=Mark-Simulacrumbors-3/+3
Rollup of bare_trait_objects PRs All deny attributes were moved into bootstrap so they can be disabled with a line of config. Warnings for external tools are allowed and it's up to the tool's maintainer to keep it warnings free. r? @Mark-Simulacrum cc @ljedrz @kennytm
2018-07-25Merge remote-tracking branches 'ljedrz/dyn_libcore', 'ljedrz/dyn_libstd' and ↵Tatsuyuki Ishi-3/+3
'ljedrz/dyn_libterm' into dyn-rollup
2018-07-23libstd: Prefer `Option::map`/etc over `match` where applicableColin Wallace-4/+1
2018-07-17Fix doc comment: use `?` instead of `.unwrap()`Felix Rabe-1/+1
2018-07-11Add missing dyn in testsljedrz-2/+2
2018-07-10Deny bare trait objects in `src/libstd`.ljedrz-1/+1
2018-05-03Remove the deprecated std::net::{lookup_host,LookupHost}Josh Stone-68/+1
These are unstable, and were deprecated by #47510, since Rust 1.25. The internal `sys` implementations are still kept to support the call in the common `resolve_socket_addr`.
2018-04-01Auto merge of #49418 - frewsxcv:frewsxcv-network-order, r=TimNNbors-2/+80
Clarify network byte order conversions for integer / IP address conversions. Opened primarily to address https://github.com/rust-lang/rust/issues/48819. Also added a few other conversion docs/examples.
2018-03-28Auto merge of #49357 - frewsxcv:frewsxcv-termination-doc-examples, ↵bors-27/+27
r=GuillaumeGomez Remove hidden `foo` functions from doc examples; use `Termination` trait. Fixes https://github.com/rust-lang/rust/issues/49233. Easier to review with the white-space ignoring `?w=1` feature: https://github.com/rust-lang/rust/pull/49357/files?w=1
2018-03-28Clarify network byte order conversions for integer / IP address conversions.Corey Farwell-2/+80
Opened primarily to address https://github.com/rust-lang/rust/issues/48819.
2018-03-28Remove hidden `foo` functions from doc examples; use `Termination` trait.Corey Farwell-27/+27
Fixes https://github.com/rust-lang/rust/issues/49233.
2018-03-26Auto merge of #49101 - mark-i-m:stabilize_i128, r=nagisabors-2/+2
Stabilize 128-bit integers :tada: cc #35118 EDIT: This should be merged only after the following have been merged: - [x] https://github.com/rust-lang-nursery/compiler-builtins/pull/236 - [x] https://github.com/rust-lang/book/pull/1230