Commit Graph

4798 Commits

Author SHA1 Message Date
Ralf Jung
e61be0b8b8 expand collection tests 2020-09-10 08:44:27 +02:00
Ralf Jung
bea2d7bb55 rustup 2020-09-10 08:38:30 +02:00
bors
dc0a54c862 Auto merge of #1511 - samrat:more-fd-trait-ops, r=RalfJung
Implement dup and close for stdin/stdout/stderr

Implements some of the operations for stdin/out/err, towards #1499
2020-09-09 17:58:08 +00:00
Samrat Man Singh
563fb8e43d Implement dup and close for stdin/stdout/stderr
Support F_DUPFD on stdin/stdout/stderr

Enable `close`-ing stdin/stdout/stderr

For `dup`, check if FD is `File` first

If not, clone the appropriate standard IO stream

Merge POSIX `close` and `dup` tests into same module

Also, add assertion that `write` on a closed FD returns an error.

Add `dup` as FileDescriptor trait fn

Also:
- Fix `close` so it drops `self` instead of reference to it
- Remove FD clamping in insert_fd_with_min_fd, since FDs 0-2 can be
closed

Fix fs_libc tests

Make error message when closing stdin/out/err more specific

Return io::Result from `FileDescriptor::dup`

Change error message when closing stdin/out/err

Refactor `FileDescriptor::dup` impl for `FileHandle`

Remove empty line
2020-09-09 23:26:33 +05:30
bors
604a674ea3 Auto merge of #1536 - divergentdave:nanosleep, r=RalfJung
Nanosleep

This PR adds a shim for `libc::nanosleep`, (available under -Zmiri-disable-isolation only) which backs `thread::sleep` on Linux and macOS. I started off by extracting the `timespec` parsing from the `pthread_cond_timedwait` shim into a helper method, and adding checks for invalid values. The second commit adds the new shim and a small test. The shim blocks the current thread, and registers a timeout callback to unblock the thread again, using the same method as `pthread_cond_timedwait` does.
2020-09-08 08:26:33 +00:00
David Cook
b06f0d16a9 Use try block instead of closure 2020-09-07 15:09:34 -05:00
David Cook
06aaea1d6b Update comment 2020-09-07 15:05:26 -05:00
David Cook
597360f499 Simplify read_timespec error handling 2020-09-07 11:31:28 -05:00
David Cook
33e928c9ca Review comments 2020-09-07 10:54:39 -05:00
bors
3bc1136600 Auto merge of #1539 - RalfJung:issue, r=RalfJung
float test case: fix referenced issue
2020-09-07 11:11:03 +00:00
Ralf Jung
3fdbc0fd3f fix referenced issue 2020-09-07 13:10:31 +02:00
bors
bb9db2bf8f Auto merge of #1538 - RalfJung:rustup, r=RalfJung
rustup: work around rustc optimizations becoming too smart
2020-09-07 09:30:11 +00:00
Ralf Jung
3ba1035d27 use standard black_box function 2020-09-07 11:29:47 +02:00
Ralf Jung
029c851d7c another optimization work-around 2020-09-07 11:23:09 +02:00
Ralf Jung
088af66f85
better optimization suppression
Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
2020-09-07 11:16:16 +02:00
Ralf Jung
d9bc19a7b0 test opt-level 2 2020-09-07 10:43:49 +02:00
Ralf Jung
210f18d6c7 work around rustc optimizations becoming too smart 2020-09-07 10:24:38 +02:00
David Cook
417ac2939a Implement libc::nanosleep shim 2020-09-06 18:07:17 -05:00
David Cook
6d323e1032 Refactor timespec parsing, improve error handling 2020-09-06 18:07:14 -05:00
bors
5f1182d04a Auto merge of #1534 - LeSeulArtichaut:tys-kind, r=RalfJung
Change `ty.kind` -> `ty.kind()`

This fixes build failure due to rust-lang/rust#75077, cc rust-lang/rust#76337.
(This is my first PR here, please tell me if anything's wrong)
2020-09-04 22:58:34 +00:00
LeSeulArtichaut
4f2f87b2df Change ty.kind -> ty.kind() 2020-09-04 22:03:45 +02:00
bors
c28a8eeb74 Auto merge of #1532 - divergentdave:thread-panic-payload, r=RalfJung
Move panic payload state from Machine to Thread

This PR moves the panic payload storage from the `Machine` state to per-thread state. Prior to this change, if one thread panicked while another was still unwinding, Miri would fail with `thread 'rustc' panicked at 'the panic runtime should avoid double-panics', src/shims/panic.rs:51:9`. I ran into this issue while prototyping a round-robin scheduler, but it's also reachable with the current scheduler and contrived programs that use blocking API calls to cause thread switching during unwinding. I wrote a test case along those lines for this change.
2020-09-03 10:09:34 +00:00
David Cook
a6746ad893 Add comment 2020-09-02 20:58:41 -05:00
David Cook
7a2c6812b9 Per-thread errno storage 2020-09-02 20:57:20 -05:00
bors
0a4ecfc225 Auto merge of #1533 - RalfJung:rustup, r=RalfJung
rustup, fix test

Cc https://github.com/rust-lang/rust/issues/76190
2020-09-01 08:58:35 +00:00
Ralf Jung
3466462306 rustup, fix test 2020-09-01 10:55:09 +02:00
David Cook
da2f268443 Review comments 2020-08-31 19:32:14 -05:00
David Cook
3ba7f46058 Move panic payload state from Machine to Thread 2020-08-29 21:38:37 -05:00
bors
9123f0e01e Auto merge of #1531 - divergentdave:cargo-miri-targets-test, r=RalfJung
Test cargo miri target selection

This is a followup to #1525, adding a few test invocations with targets specified in the cargo arguments.
2020-08-29 11:22:05 +00:00
David Cook
5d9d75fc1f Test cargo miri target selection 2020-08-28 23:12:11 -05:00
bors
c2a2e25d0b Auto merge of #1525 - divergentdave:cargo-miri-targets, r=RalfJung
Support --test/--bin/--lib in cargo-miri

This PR addresses a FIXME in cargo-miri, and filters the targets to be checked when any of the `--bin`, '--test`, or `--lib` flags are passed.
2020-08-28 07:05:12 +00:00
David Cook
64e2d3e2d0 Review comments 2020-08-27 05:00:56 -05:00
bors
13ea74549f Auto merge of #1530 - RalfJung:rustup, r=RalfJung
rustup

Another day, another `AllocRef` API change.
2020-08-27 07:28:38 +00:00
Ralf Jung
39e6baeb91 rustup 2020-08-27 09:27:58 +02:00
bors
2be4052ab0 Auto merge of #1528 - RalfJung:readme, r=RalfJung
add encoding_rs OOB arithmetic to trophy case
2020-08-27 06:37:55 +00:00
Ralf Jung
4608341ca0 add encoding_rs OOB arithmetic 2020-08-27 08:37:11 +02:00
David Cook
40847abd5f Review comments 2020-08-26 18:41:01 -05:00
David Cook
3bc8302a54 Support --test/--bin/--lib in cargo-miri 2020-08-25 19:00:46 -05:00
bors
9f3e7cf2c2 Auto merge of #1524 - RalfJung:rustup, r=RalfJung
rustup; account for ptr_offset_from stabilization

@bors r+
2020-08-24 08:07:41 +00:00
Ralf Jung
2f9de18f88 rustup; account for ptr_offset_from stabilization 2020-08-24 10:06:44 +02:00
bors
222093e815 Auto merge of #1523 - RalfJung:test-matrix, r=RalfJung
tweak test matrix

* test big-endian architecture
* test less on macOS host (it is slow)
2020-08-22 16:09:48 +00:00
Ralf Jung
df9b2127ce fix a test for big-endian targets 2020-08-22 18:07:43 +02:00
Ralf Jung
8da9d23e5e tweak test matrix: test big-endian, and test less on macOS host (it is slow) 2020-08-22 18:03:34 +02:00
bors
6b96b17470 Auto merge of #1522 - RalfJung:readme, r=RalfJung
emphasize that some flags are unsound to use
2020-08-22 12:32:35 +00:00
Ralf Jung
3b7f36ef8d emphasize that some flags are unsound to use 2020-08-22 14:31:46 +02:00
bors
e739b81669 Auto merge of #1521 - workingjubilee:bump-cargo-metadata, r=RalfJung
Bump cargo_metadata to 0.11
2020-08-21 16:58:33 +00:00
Jubilee Young
2619b4fa18 Bump cargo_metadata to 0.11 2020-08-21 01:37:56 -07:00
bors
eb08007fe8 Auto merge of #1518 - workingjubilee:remove-byteorder, r=RalfJung
Remove byteorder dependency

miri hasn't actually depended on byteorder directly for a while.
Let's remove this dependency so Rust also depends less on it.
2020-08-21 07:03:14 +00:00
Jubilee Young
f3747b635e Update lockfile 2020-08-20 16:48:35 -07:00
bors
9570008c0b Auto merge of #1520 - RalfJung:rustup, r=RalfJung
avoid promotion in alignment test to get different alignment on each try
2020-08-20 08:14:34 +00:00