13536 Commits

Author SHA1 Message Date
Alex Crichton
1d06058a77 std: Reduce checks for feature = "backtrace"
This is a stylistic change to libstd to reduce the number of checks of
`feature = "backtrace"` now that we unconditionally depend on the
`backtrace` crate and rely on it having an empty implementation.
otherwise.
2019-09-25 06:43:49 -07:00
Mark Rousskov
f359a94849 Snap cfgs to new beta 2019-09-25 08:42:46 -04:00
Mazdak Farrokhzad
bc3afb76bb
Rollup merge of #64481 - tomtau:fix/tls-error-message, r=KodrAus
A more explanatory thread local storage panic message

Outside rust-std internals, TLS is usually understood as Transport Layer Security, so the existing message could be a bit puzzling when one has TLS sessions in `thread_local!`.
2019-09-25 03:48:26 +02:00
Mazdak Farrokhzad
e861424562
Rollup merge of #64720 - Wind-River:master, r=alexcrichton
remove rtp.rs, and move rtpSpawn and RTP_ID_ERROR to libc

r? @alexcrichton
2019-09-24 23:45:30 +02:00
Mazdak Farrokhzad
9e12827d56
Rollup merge of #64702 - sinkuu:deps, r=jonas-schievink
Remove unused dependencies
2019-09-24 23:45:27 +02:00
Mazdak Farrokhzad
c623aa4a54
Rollup merge of #63356 - ali-raheem:issue#63183, r=KodrAus
Issue#63183: Add fs::read_dir() and ReadDir warning about iterator order + example

As per https://github.com/rust-lang/rust/issues/63183

Add warning about iterator order to read_dir and ReadDir, add example of explicitly ordering direntrys.
2019-09-24 23:45:13 +02:00
messense
f1835bc517 Stabilize UdpSocket::peer_addr 2019-09-24 15:10:18 +08:00
Baoshan Pang
b548814a8b remove rtp.rs, and move rtpSpawn and RTP_ID_ERROR to libc 2019-09-23 15:37:18 -07:00
Shotaro Yamada
0423c2a7a3 Remove unused dependencies 2019-09-23 15:25:00 +09:00
Mazdak Farrokhzad
7894bc82d7
Rollup merge of #64294 - wchargin:wchargin-stdio-piped-docs, r=Dylan-DPC
Fix `Stdio::piped` example code and lint

Summary:
Invoking `rev` does not add a trailing newline when none is present in
the input (at least on my Debian). Nearby examples use `echo` rather
than `rev`, which probably explains the source of the discrepancy.

Also, a `mut` qualifier is unused.

Test Plan:
Copy the code block into <https://play.rust-lang.org> with a `fn main`
wrapper, and run it. Note that it compiles and runs cleanly; prior to
this commit, it would emit an `unused_mut` warning and then panic.

wchargin-branch: stdio-piped-docs
2019-09-23 00:36:33 +02:00
n-salim
494d83c892
Merge pull request #25 from Wind-River/stat
rust stat should call libc stat
2019-09-20 16:20:29 -07:00
Baoshan Pang
b956ae38e1 rust stat should call libc stat 2019-09-20 15:47:13 -07:00
Baoshan Pang
491a0c6902 No home directory on vxWorks 2019-09-20 13:25:57 -07:00
Hsiang-Cheng Yang
897d278160 libstd: Fix typos in doc 2019-09-20 17:38:00 +08:00
Adrian Heine né Lang
c23e78a38b
Remove unnecessary mut in doc example 2019-09-19 13:36:10 +02:00
Tyler Mandry
b544284315
Rollup merge of #64505 - pickfire:patch-1, r=Mark-Simulacrum
Fix inconsistent link formatting
2019-09-17 14:10:52 -07:00
Mazdak Farrokhzad
f4ff4189ae
Rollup merge of #64504 - guanqun:use-println-without-empty-str, r=jonas-schievink
use println!() instead of println!("")

The empty string is unnecessary.
2019-09-16 17:09:46 +02:00
Mazdak Farrokhzad
2a6a342aaf
Rollup merge of #64444 - RalfJung:no-backtrace, r=alexcrichton
fix building libstd without backtrace feature

Fixes https://github.com/rust-lang/rust/issues/64410

r? @alexcrichton
2019-09-16 17:09:37 +02:00
Ralf Jung
49854c4f71 avoid #[cfg] in favor of cfg! 2019-09-16 16:37:44 +02:00
Ivan Tham
62e86b42b5
Fix inconsistent link formatting 2019-09-16 20:02:36 +08:00
Tomas Tauber
68c3739f12
updated the panic message wording 2019-09-16 12:13:02 +08:00
Mazdak Farrokhzad
0a2e07ec1d
Rollup merge of #63872 - marmistrz:readdir, r=jonas-schievink
Document platform-specific behavior of the iterator returned by std::fs::read_dir
2019-09-15 19:35:58 +02:00
Guanqun Lu
5355a16150 use println!() 2019-09-15 23:15:06 +08:00
Tomas Tauber
df7789c902 Made a thread local storage panic message more explanatory
(TLS is usually understood as Transport Layer Security
outside rust-std internals)
2019-09-15 13:35:02 +08:00
Mazdak Farrokhzad
f669872690
Rollup merge of #64393 - Wind-River:master_002_envKey, r=alexcrichton
declare EnvKey before use to fix build error

r? @alexcrichton
2019-09-14 16:42:32 +02:00
Mazdak Farrokhzad
ae9d417f2a
Rollup merge of #64378 - Rosto75:master, r=jonas-schievink
Fix inconsistent link formatting.
2019-09-14 16:42:29 +02:00
Mazdak Farrokhzad
1e2a97018f
Rollup merge of #64372 - Wind-River:master, r=alexcrichton
use randSecure and randABytes

r? @alexcrichton

cc @n-salim
2019-09-14 16:42:25 +02:00
Mazdak Farrokhzad
afc52916f6
Rollup merge of #64203 - alexreg:rush-pr-2, r=centril
A few cosmetic improvements to code & comments in liballoc and libcore

Factored out from hacking on rustc for work on the REPL.

r? @Centril
2019-09-14 16:42:22 +02:00
Mazdak Farrokhzad
baaaea3de3
Rollup merge of #63846 - DevQps:32626-document-time-system-calls, r=rkruppe
Added table containing the system calls used by Instant and SystemTime.

# Description
See #32626 for a discussion on documenting system calls used by Instant and SystemTime.

## Changes
- Added a table containing the system calls used by each platform.

EDIT: If I can format this table better (due to the large links) please let me know.
I'd also be happy to learn a quick command to generate the docs on my host machine! Currently I am using: `python x.py doc --stage 0 src/libstd` but that gives me some `unrecognized intrinsic` errors. Advice is always welcome :)

closes #32626
2019-09-14 16:42:19 +02:00
Ralf Jung
dac0a158eb rename the crate, not the feature 2019-09-14 12:12:32 +02:00
Ralf Jung
b60954757e std: always depend on backtrace, but only enable its features on demand 2019-09-14 10:23:51 +02:00
Christian Veenman
b3b671366b
Update src/libstd/time.rs
Co-Authored-By: Robin Kruppe <robin.kruppe@gmail.com>
2019-09-13 16:29:06 +02:00
bors
fe6d05a8b3 Auto merge of #64154 - alexcrichton:std-backtrace, r=sfackler
std: Add a `backtrace` module

This commit adds a `backtrace` module to the standard library, as
designed in [RFC 2504]. The `Backtrace` type is intentionally very
conservative, effectively only allowing capturing it and printing it.

Additionally this commit also adds a `backtrace` method to the `Error`
trait which defaults to returning `None`, as specified in [RFC 2504].
More information about the design here can be found in [RFC 2504] and in
the [tracking issue].

Implementation-wise this is all based on the `backtrace` crate and very
closely mirrors the `backtrace::Backtrace` type on crates.io. Otherwise
it's pretty standard in how it handles everything internally.

[RFC 2504]: https://github.com/rust-lang/rfcs/blob/master/text/2504-fix-error.md
[tracking issue]: https://github.com/rust-lang/rust/issues/53487

cc #53487
2019-09-11 14:46:08 +00:00
Tomasz Różański
a8c5f90b06 Fix inconsistent link formatting. 2019-09-11 14:03:40 +02:00
Baoshan Pang
b731e11d52 declare EnvKey before use to fix build error 2019-09-10 21:35:01 -07:00
Mazdak Farrokhzad
57df63ce7d
Rollup merge of #64326 - hman523:master, r=joshtriplett
Fixed documentation within c_str::from_ptr

Fixed the documentation issue mentioned in #63590
2019-09-11 02:38:09 +02:00
Mazdak Farrokhzad
34f38d9809
Rollup merge of #64129 - Wind-River:master_003, r=alexcrichton
vxWorks: set DEFAULT_MIN_STACK_SIZE to 256K and use min_stack to pass initial stack size to rtpSpawn

vxWorks: set DEFAULT_MIN_STACK_SIZE to 256K and use min_stack to pass initial stack size to rtpSpawn

r? @alexcrichton
cc @n-salim
2019-09-11 02:38:06 +02:00
Baoshan Pang
5287885481 use randSecure and randABytes 2019-09-10 15:11:34 -07:00
Baoshan Pang
5318f98c06 remove Copyright notic 2019-09-10 09:25:22 -07:00
Mazdak Farrokhzad
26a4af9743
Rollup merge of #64331 - hman523:fix-64322, r=varkor
Changed instant is earlier to instant is later

Fixed the documentation issue from #64322
2019-09-10 17:19:29 +02:00
Mazdak Farrokhzad
59156af1e7
Rollup merge of #64323 - cramertj:fuchsia-rust-backtrace-noop, r=alexcrichton
Always show backtrace on Fuchsia

r? @alexcrichton

cc @jakeehrlich
2019-09-10 06:29:50 +02:00
hman523
79263afb3e Changed instant is earlier to instant is later 2019-09-09 21:19:01 -05:00
hman523
9b1456e4c5
Update added backticks around a function call
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-09-09 20:09:17 -05:00
hman523
bdfab2049c Fixed documentation within c_str::from_ptr 2019-09-09 18:50:11 -05:00
Taylor Cramer
7eb42c9838 Always show backtrace on Fuchsia 2019-09-09 16:23:03 -07:00
Mazdak Farrokhzad
611458ba06
Rollup merge of #63806 - mati865:rand, r=alexcrichton
Upgrade rand to 0.7

Also upgrades `getrandom` to avoid bug encountered by https://github.com/rust-lang/rust/pull/61393 which bumps libc to `0.2.62`.
2019-09-09 22:18:08 +02:00
Christian
3dd0e2b89e Added some context on SGX. Lists Darwin separately. 2019-09-09 22:10:53 +02:00
Ali Raheem
1161aeb2b4 Replace println statements with explanatory comments 2019-09-09 20:38:21 +01:00
Alex Crichton
34662c6961 std: Add a backtrace module
This commit adds a `backtrace` module to the standard library, as
designed in [RFC 2504]. The `Backtrace` type is intentionally very
conservative, effectively only allowing capturing it and printing it.

Additionally this commit also adds a `backtrace` method to the `Error`
trait which defaults to returning `None`, as specified in [RFC 2504].
More information about the design here can be found in [RFC 2504] and in
the [tracking issue].

Implementation-wise this is all based on the `backtrace` crate and very
closely mirrors the `backtrace::Backtrace` type on crates.io. Otherwise
it's pretty standard in how it handles everything internally.

[RFC 2504]: https://github.com/rust-lang/rfcs/blob/master/text/2504-fix-error.md
[tracking issue]: https://github.com/rust-lang/rust/issues/53487

cc #53487
2019-09-09 08:20:34 -07:00
bors
45859b7ca7 Auto merge of #63118 - Centril:stabilize-bind-by-move, r=matthewjasper
Stabilize `bind_by_move_pattern_guards` in Rust 1.39.0

Closes https://github.com/rust-lang/rust/issues/15287.

After stabilizing `#![feature(bind_by_move_pattern_guards)]`, you can now use bind-by-move bindings in patterns and take references to those bindings in `if` guards of `match` expressions. For example, the following now becomes legal:

```rust
fn main() {
    let array: Box<[u8; 4]> = Box::new([1, 2, 3, 4]);

    match array {
        nums
//      ---- `nums` is bound by move.
            if nums.iter().sum::<u8>() == 10
//                 ^------ `.iter()` implicitly takes a reference to `nums`.
        => {
            drop(nums);
//          --------- Legal as `nums` was bound by move and so we have ownership.
        }
        _ => unreachable!(),
    }
}
```

r? @matthewjasper
2019-09-09 12:46:59 +00:00