Denis Vasilik
4c5896fbeb
Remove intra-doc link as it resolves without reference link
...
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-08-12 08:28:55 +02:00
Camelid
d8f96146e8
Use Child::std{in,out,err} instead of Child.
...
These links were broken before.
2020-08-11 20:10:41 -07:00
Yuki Okushi
2cc7da6f95
Rollup merge of #75424 - joseluis:patch-1, r=joshtriplett
...
fix wrong word in documentation
Change "two" to "three", since there are three significantly different things printed below that sentence:
---
While these:
```rust
println!("{}, `{name:.*}` has 3 fractional digits", "Hello", 3, name=1234.56);
println!("{}, `{name:.*}` has 3 characters", "Hello", 3, name="1234.56");
println!("{}, `{name:>8.*}` has 3 right-aligned characters", "Hello", 3, name="1234.56");
```
print two significantly different things:
``` rust
Hello, `1234.560` has 3 fractional digits
Hello, `123` has 3 characters
Hello, ` 123` has 3 right-aligned characters
```
---
[`https://doc.rust-lang.org/std/fmt/#precision `](https://doc.rust-lang.org/std/fmt/#precision )
2020-08-12 12:07:21 +09:00
Yuki Okushi
7a900835c1
Rollup merge of #75395 - nixphix:docs/os-fs, r=jyn514
...
Switch to intra-doc links in library/std/src/os/*/fs.rs
Partial fix for #75080
@rustbot modify labels: T-doc, T-rustdoc, A-intra-doc-links
2020-08-12 12:07:17 +09:00
Yuki Okushi
261773e185
Rollup merge of #75371 - poliorcetics:intra-doc-links-std-time, r=jyn514
...
Move to doc links inside std/time.rs
Helps with #75080 .
@rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc
2020-08-12 12:07:14 +09:00
Yuki Okushi
c423fdeb74
Rollup merge of #75368 - poliorcetics:intra-doc-links-std-prelude, r=jyn514
...
Move to doc links inside the prelude
Helps with #75080 .
@rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc
2020-08-12 12:07:12 +09:00
Camelid
e005b71125
Switch to intra-doc links in std::process
2020-08-11 18:02:24 -07:00
The8472
1316c786a0
Workaround for copy_file_range spuriously returning EOPNOTSUPP when attemted on a NFS mount under RHEL/CentOS 7.
...
The syscall is supposed to return ENOSYS in most cases but when calling it on NFS it may leak through
EOPNOTSUPP even though that's supposed to be handled by the kernel and not returned to userspace.
Since it returns ENOSYS in some cases anyway this will trip the HAS_COPY_FILE_RANGE
detection anyway, so treat EOPNOTSUPP as if it were a ENOSYS.
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/7.8_release_notes/deprecated_functionality#the_literal_copy_file_range_literal_call_has_been_disabled_on_local_file_systems_and_in_nfs
https://bugzilla.redhat.com/show_bug.cgi?id=1783554
2020-08-12 01:30:22 +02:00
Stein Somers
17ab457f21
Somewhat complicated way to respect BTreeMap's node length invariant
2020-08-12 00:09:00 +02:00
Denis Vasilik
c4923419c2
Revert broken link
2020-08-11 23:54:51 +02:00
José Luis Cruz
df5c889784
word change
...
there are three significantly different things printed below
2020-08-11 22:33:11 +02:00
Denis Vasilik
3c2eb18b9b
Use intra-doc links
2020-08-11 22:16:31 +02:00
Alexis Bourget
bd01bf9274
Remove two links by changing the doc for SystemTimeError::duration
2020-08-11 21:53:02 +02:00
Poliorcetics
a308e74e13
Add some texts to make the tidy check for unsafe documentation pass
2020-08-11 21:37:22 +02:00
Alexis Bourget
3ff06a9f2c
Move the std::vec link back to a path-based link to make it compile with --stage 0
2020-08-11 21:30:20 +02:00
Tyler Mandry
5d9a0b020c
Rollup merge of #75409 - pickfire:patch-4, r=GuillaumeGomez
...
Fix range term in alloc vec doc
`range` is not an element, it is a variable.
r? @GuillaumeGomez
2020-08-11 12:28:40 -07:00
Tyler Mandry
06eb274bfc
Rollup merge of #75407 - oliver-giersch:set_ptr_value, r=RalfJung
...
Requested changes to [*mut T|*const T]::set_ptr_value
This is a follow-up to PR #74774 (tracking issue #75091 ), acting on some change requests made after approval:
- adds `#[must_use]` attribute
- changes type of `val` pointer argument from `()` to `u8`
- adjusts documentation mentioning pointer provenance
2020-08-11 12:28:37 -07:00
Alexis Bourget
91ba92b6df
Change safety comment for usize with the one from LukasKalbertodt review
2020-08-11 21:23:00 +02:00
Nazım Can Altınova
8faf550e5f
Remove the unused bounds from Debug impl of HashMap::{IntoKeys,IntoValues}
2020-08-11 20:42:02 +02:00
Lzu Tao
e8ea6e59f0
prefer pattern matching over indexing
2020-08-11 16:07:39 +00:00
Ivan Tham
e4f2de2e9a
Fix range term in alloc vec doc
...
`range` is not an element, it is a variable.
2020-08-11 23:57:13 +08:00
Prabakaran Kumaresshan
32fccc445a
Revert #tymethods
2020-08-11 19:50:17 +05:30
oliver-giersch
19c9674966
mentions provenance, changes argument type, adds must_use attr
2020-08-11 16:14:34 +02:00
bors
4b9ac51617
Auto merge of #75388 - JohnTitor:rollup-9tgkxnl, r=JohnTitor
...
Rollup of 10 pull requests
Successful merges:
- #74744 (Update RELEASES.md for 1.46.0)
- #75085 (Transmute big endian `s6_addr` and `[u16; 8]`)
- #75226 (Miri: Renamed "undef" to "uninit")
- #75333 (polymorphize: constrain unevaluated const handling)
- #75338 (move stack size check to const_eval machine)
- #75347 (Rustdoc: Fix natural ordering to look at all numbers.)
- #75352 (Tweak conditions for E0026 and E0769)
- #75353 (Tiny cleanup, remove unnecessary `unwrap`)
- #75359 (unused_delims: trim expr)
- #75360 (Add sample fix for E0749)
Failed merges:
r? @ghost
2020-08-11 12:31:56 +00:00
Lukas Kalbertodt
709d1056b8
Fix minor things in the f32 primitive docs
...
All of these were review comments in #74621 that I first fixed
in that PR, but later accidentally overwrote by a force push.
2020-08-11 13:50:54 +02:00
Stein Somers
3a02e06002
BTreeMap: purge innocent use of into_kv_mut
2020-08-11 12:20:18 +02:00
Prabakaran Kumaresshan
29045b699e
Switch to intra-doc links in library/std/src/os/*/fs.rs
2020-08-11 15:20:01 +05:30
Oliver Scherer
34c3c0dae5
Make <*const T>::is_null const fn
2020-08-11 11:45:47 +02:00
Yuki Okushi
f26f201d42
Rollup merge of #75085 - lzutao:ip_union, r=cuviper
...
Transmute big endian `s6_addr` and `[u16; 8]`
The old code already made the assumption to reinterpret
`Ipv6Addr` as `[u16; 8]`.
Glibc, Linux, FreeBSD, Win32 all makes this assumption.
The main motivation of using union it to better optimize code.
Godbolt: https://rust.godbolt.org/z/b4bGvo
Const is introducing unsafe when transmuting.
ref:
* https://docs.microsoft.com/en-us/windows/win32/api/in6addr/ns-in6addr-in6_addr
* 1d6e424741/contrib/ntp/lib/isc/include/isc/ipv6.h (L63)
* 8b531aa996/include/net/net_ip.h (L137)
* https://sourceware.org/git/?p=glibc.git;a=blob;f=inet/netinet/in.h;h=f6355c7efe5192b88337b136ef687fe9a5ed648c;hb=HEAD#l216
2020-08-11 16:23:45 +09:00
Marcel Hellwig
00d537dcd0
deny(unsafe_op_in_unsafe_fn) in libstd/path.rs
2020-08-11 09:22:27 +02:00
Marcel Hellwig
73e27b3e18
deny(unsafe_op_in_unsafe_fn) in libstd/process.rs
2020-08-11 09:11:55 +02:00
Ivan Tham
8ec348afdd
Remove branch in optimized is_ascii
...
Performs slightly better in short or medium bytes by eliminating
the last branch check on `byte_pos == len` and always check the
last byte as it is always at most one `usize`.
Benchmark, before `libcore`, after `libcore_new`. It improves
medium and short by 1ns but regresses unaligned_tail by 2ns,
either way we can get unaligned_tail have a tiny chance of 1/8
on a 64 bit machine. I don't think we should bet on that, the
probability is worse than dice.
test long::case00_libcore ... bench: 38 ns/iter (+/- 1) = 183947 MB/s
test long::case00_libcore_new ... bench: 38 ns/iter (+/- 1) = 183947 MB/s
test long::case01_iter_all ... bench: 227 ns/iter (+/- 6) = 30792 MB/s
test long::case02_align_to ... bench: 40 ns/iter (+/- 1) = 174750 MB/s
test long::case03_align_to_unrolled ... bench: 19 ns/iter (+/- 1) = 367894 MB/s
test medium::case00_libcore ... bench: 5 ns/iter (+/- 0) = 6400 MB/s
test medium::case00_libcore_new ... bench: 4 ns/iter (+/- 0) = 8000 MB/s
test medium::case01_iter_all ... bench: 20 ns/iter (+/- 1) = 1600 MB/s
test medium::case02_align_to ... bench: 6 ns/iter (+/- 0) = 5333 MB/s
test medium::case03_align_to_unrolled ... bench: 5 ns/iter (+/- 0) = 6400 MB/s
test short::case00_libcore ... bench: 7 ns/iter (+/- 0) = 1000 MB/s
test short::case00_libcore_new ... bench: 6 ns/iter (+/- 0) = 1166 MB/s
test short::case01_iter_all ... bench: 5 ns/iter (+/- 0) = 1400 MB/s
test short::case02_align_to ... bench: 5 ns/iter (+/- 0) = 1400 MB/s
test short::case03_align_to_unrolled ... bench: 5 ns/iter (+/- 1) = 1400 MB/s
test unaligned_both::case00_libcore ... bench: 4 ns/iter (+/- 0) = 7500 MB/s
test unaligned_both::case00_libcore_new ... bench: 4 ns/iter (+/- 0) = 7500 MB/s
test unaligned_both::case01_iter_all ... bench: 26 ns/iter (+/- 0) = 1153 MB/s
test unaligned_both::case02_align_to ... bench: 13 ns/iter (+/- 2) = 2307 MB/s
test unaligned_both::case03_align_to_unrolled ... bench: 11 ns/iter (+/- 0) = 2727 MB/s
test unaligned_head::case00_libcore ... bench: 5 ns/iter (+/- 0) = 6200 MB/s
test unaligned_head::case00_libcore_new ... bench: 5 ns/iter (+/- 0) = 6200 MB/s
test unaligned_head::case01_iter_all ... bench: 19 ns/iter (+/- 1) = 1631 MB/s
test unaligned_head::case02_align_to ... bench: 10 ns/iter (+/- 0) = 3100 MB/s
test unaligned_head::case03_align_to_unrolled ... bench: 14 ns/iter (+/- 0) = 2214 MB/s
test unaligned_tail::case00_libcore ... bench: 3 ns/iter (+/- 0) = 10333 MB/s
test unaligned_tail::case00_libcore_new ... bench: 5 ns/iter (+/- 0) = 6200 MB/s
test unaligned_tail::case01_iter_all ... bench: 19 ns/iter (+/- 0) = 1631 MB/s
test unaligned_tail::case02_align_to ... bench: 10 ns/iter (+/- 0) = 3100 MB/s
test unaligned_tail::case03_align_to_unrolled ... bench: 13 ns/iter (+/- 0) = 2384 MB/s
Rough (unfair) maths on improvements for fun: 1ns * 7/8 - 2ns * 1/8 = 0.625ns
Inspired by fish and zsh clever trick to highlight missing linefeeds (⏎)
and branchless implementation of binary_search in rust.
2020-08-11 14:40:39 +08:00
bors
441fd22557
Auto merge of #75329 - ssomers:btree_cleanup_8, r=Mark-Simulacrum
...
BTreeMap: better distinguish the root holder from the root node
Renames and intermediate variables
2020-08-11 06:17:02 +00:00
bors
a9025c571e
Auto merge of #74621 - LukasKalbertodt:float-docs, r=GuillaumeGomez
...
Improve `f32` and `f64` primitive documentation
I noticed that the docs for the primitive floats were fairly short. I first only wanted to add the IEEE specification information (compare [the reference](https://doc.rust-lang.org/reference/types/numeric.html )), but then also added some more beginner-friendly docs. Let me know what you think!
Random doc team assign:
r? @rylev
2020-08-11 04:10:39 +00:00
南浦月
d892a07c67
add Ipv6Addr::to_ipv4_mapped
2020-08-11 09:15:08 +08:00
Dylan DPC
0a738d41b1
Rollup merge of #75379 - denisvasilik:intra-docs-links-core-cmp, r=Dylan-DPC
...
Use intra-doc links in /library/core/src/cmp.rs
Helps with #75080 .
@rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc
Known issues:
* Links from `core` to `std` (#74481 ):
* [`Vec::sort_by_key`]
2020-08-11 01:56:47 +02:00
Dylan DPC
d00c70363f
Rollup merge of #75369 - denisvasilik:intra-doc-links-core-borrow, r=Manishearth
...
Move to intra-doc links in /library/core/src/borrow.rs
Helps with #75080 .
@rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc
Known issues:
* Links from `core` to `std` (#74481 ):
* [`Box<T>`]
* [`Mutex<T>`]
* [`Rc<T>`]
* [`String`]
* [`HashMap<K, V>`]
2020-08-11 01:56:45 +02:00
Denis Vasilik
eea85814e1
Use intra-doc links
2020-08-10 23:16:01 +02:00
Denis Vasilik
f260462c32
Remove links that are in scope
2020-08-10 23:14:43 +02:00
Nazım Can Altınova
c346e89db8
Manually implement Debug for BTreeMap::ValuesMut struct
...
Deriving debug prints all the values including keys. But ValuesMut
struct should only print the values.
2020-08-10 23:06:05 +02:00
Nazım Can Altınova
456738e3d1
Only print values in the Debug of HashMap::ValuesMut struct
2020-08-10 23:06:04 +02:00
Nazım Can Altınova
a313abe3ba
Manually implement Debug for BTreeMap::{IntoKeys,IntoValues} structs
2020-08-10 23:06:04 +02:00
Alexis Bourget
a6e492b5db
Move to doc links inside the prelude
2020-08-10 21:09:37 +02:00
Alexis Bourget
26792a65cd
Move to doc links inside std/time.rs
2020-08-10 21:01:58 +02:00
Denis Vasilik
d7e7271085
Remove AsRef link as it is in the prelude
2020-08-10 20:29:20 +02:00
Ryan Levick
b9b8b5c96b
Reverse formatting
2020-08-10 18:04:44 +02:00
Ryan Levick
6778baf516
Fix up docs
2020-08-10 17:39:06 +02:00
Ryan Levick
57572cf809
Call into fastfail on abort in libpanic_abort on Windows x86(_64)
2020-08-10 14:40:09 +02:00
Ivan Tham
50315238aa
Liballoc DoubleEndedIterator limit unsafe to pointer arithmethic
2020-08-10 18:13:56 +08:00
Ivan Tham
cc0d634550
Liballoc IntoIter limit unsafe to pointer arithmethic
2020-08-10 18:13:55 +08:00