]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agotest BTreeMap::drain_filter for leaks
Ralf Jung [Fri, 11 Sep 2020 10:20:08 +0000 (12:20 +0200)]
test BTreeMap::drain_filter for leaks

3 years agoAuto merge of #1541 - RalfJung:rustup, r=RalfJung
bors [Thu, 10 Sep 2020 06:45:44 +0000 (06:45 +0000)]
Auto merge of #1541 - RalfJung:rustup, r=RalfJung

Rustup, expand collection tests

3 years agoexpand collection tests
Ralf Jung [Thu, 10 Sep 2020 06:38:43 +0000 (08:38 +0200)]
expand collection tests

3 years agorustup
Ralf Jung [Thu, 10 Sep 2020 06:38:30 +0000 (08:38 +0200)]
rustup

3 years agoAuto merge of #1511 - samrat:more-fd-trait-ops, r=RalfJung
bors [Wed, 9 Sep 2020 17:58:08 +0000 (17:58 +0000)]
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

3 years agoImplement dup and close for stdin/stdout/stderr
Samrat Man Singh [Sat, 15 Aug 2020 08:45:31 +0000 (14:15 +0530)]
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

3 years agoAuto merge of #1536 - divergentdave:nanosleep, r=RalfJung
bors [Tue, 8 Sep 2020 08:26:33 +0000 (08:26 +0000)]
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.

3 years agoUse try block instead of closure
David Cook [Mon, 7 Sep 2020 20:09:34 +0000 (15:09 -0500)]
Use try block instead of closure

3 years agoUpdate comment
David Cook [Mon, 7 Sep 2020 20:05:26 +0000 (15:05 -0500)]
Update comment

3 years agoSimplify read_timespec error handling
David Cook [Mon, 7 Sep 2020 16:31:28 +0000 (11:31 -0500)]
Simplify read_timespec error handling

3 years agoReview comments
David Cook [Mon, 7 Sep 2020 15:54:39 +0000 (10:54 -0500)]
Review comments

3 years agoAuto merge of #1539 - RalfJung:issue, r=RalfJung
bors [Mon, 7 Sep 2020 11:11:03 +0000 (11:11 +0000)]
Auto merge of #1539 - RalfJung:issue, r=RalfJung

float test case: fix referenced issue

3 years agofix referenced issue
Ralf Jung [Mon, 7 Sep 2020 11:10:31 +0000 (13:10 +0200)]
fix referenced issue

3 years agoAuto merge of #1538 - RalfJung:rustup, r=RalfJung
bors [Mon, 7 Sep 2020 09:30:11 +0000 (09:30 +0000)]
Auto merge of #1538 - RalfJung:rustup, r=RalfJung

rustup: work around rustc optimizations becoming too smart

3 years agouse standard black_box function
Ralf Jung [Mon, 7 Sep 2020 09:26:24 +0000 (11:26 +0200)]
use standard black_box function

3 years agoanother optimization work-around
Ralf Jung [Mon, 7 Sep 2020 09:22:49 +0000 (11:22 +0200)]
another optimization work-around

3 years agobetter optimization suppression
Ralf Jung [Mon, 7 Sep 2020 09:16:16 +0000 (11:16 +0200)]
better optimization suppression

Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
3 years agotest opt-level 2
Ralf Jung [Mon, 7 Sep 2020 08:35:39 +0000 (10:35 +0200)]
test opt-level 2

3 years agowork around rustc optimizations becoming too smart
Ralf Jung [Mon, 7 Sep 2020 08:24:04 +0000 (10:24 +0200)]
work around rustc optimizations becoming too smart

3 years agoImplement libc::nanosleep shim
David Cook [Sun, 6 Sep 2020 22:09:24 +0000 (17:09 -0500)]
Implement libc::nanosleep shim

3 years agoRefactor timespec parsing, improve error handling
David Cook [Sun, 6 Sep 2020 22:08:41 +0000 (17:08 -0500)]
Refactor timespec parsing, improve error handling

3 years agoAuto merge of #1534 - LeSeulArtichaut:tys-kind, r=RalfJung
bors [Fri, 4 Sep 2020 22:58:34 +0000 (22:58 +0000)]
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)

3 years agoChange `ty.kind` -> `ty.kind()`
LeSeulArtichaut [Fri, 4 Sep 2020 20:03:45 +0000 (22:03 +0200)]
Change `ty.kind` -> `ty.kind()`

3 years agoAuto merge of #1532 - divergentdave:thread-panic-payload, r=RalfJung
bors [Thu, 3 Sep 2020 10:09:34 +0000 (10:09 +0000)]
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.

3 years agoAdd comment
David Cook [Thu, 3 Sep 2020 01:58:41 +0000 (20:58 -0500)]
Add comment

3 years agoPer-thread errno storage
David Cook [Tue, 1 Sep 2020 02:29:09 +0000 (21:29 -0500)]
Per-thread errno storage

3 years agoAuto merge of #1533 - RalfJung:rustup, r=RalfJung
bors [Tue, 1 Sep 2020 08:58:35 +0000 (08:58 +0000)]
Auto merge of #1533 - RalfJung:rustup, r=RalfJung

rustup, fix test

Cc https://github.com/rust-lang/rust/issues/76190

3 years agorustup, fix test
Ralf Jung [Tue, 1 Sep 2020 08:55:09 +0000 (10:55 +0200)]
rustup, fix test

3 years agoReview comments
David Cook [Tue, 1 Sep 2020 00:32:14 +0000 (19:32 -0500)]
Review comments

3 years agoMove panic payload state from Machine to Thread
David Cook [Sun, 30 Aug 2020 02:38:37 +0000 (21:38 -0500)]
Move panic payload state from Machine to Thread

3 years agoAuto merge of #1531 - divergentdave:cargo-miri-targets-test, r=RalfJung
bors [Sat, 29 Aug 2020 11:22:05 +0000 (11:22 +0000)]
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.

3 years agoTest cargo miri target selection
David Cook [Sat, 29 Aug 2020 04:12:11 +0000 (23:12 -0500)]
Test cargo miri target selection

3 years agoAuto merge of #1525 - divergentdave:cargo-miri-targets, r=RalfJung
bors [Fri, 28 Aug 2020 07:05:12 +0000 (07:05 +0000)]
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.

3 years agoReview comments
David Cook [Thu, 27 Aug 2020 10:00:56 +0000 (05:00 -0500)]
Review comments

3 years agoAuto merge of #1530 - RalfJung:rustup, r=RalfJung
bors [Thu, 27 Aug 2020 07:28:38 +0000 (07:28 +0000)]
Auto merge of #1530 - RalfJung:rustup, r=RalfJung

rustup

Another day, another `AllocRef` API change.

3 years agorustup
Ralf Jung [Thu, 27 Aug 2020 07:27:58 +0000 (09:27 +0200)]
rustup

3 years agoAuto merge of #1528 - RalfJung:readme, r=RalfJung
bors [Thu, 27 Aug 2020 06:37:55 +0000 (06:37 +0000)]
Auto merge of #1528 - RalfJung:readme, r=RalfJung

add encoding_rs OOB arithmetic to trophy case

3 years agoadd encoding_rs OOB arithmetic
Ralf Jung [Thu, 27 Aug 2020 06:37:11 +0000 (08:37 +0200)]
add encoding_rs OOB arithmetic

3 years agoReview comments
David Cook [Wed, 26 Aug 2020 23:41:01 +0000 (18:41 -0500)]
Review comments

3 years agoSupport --test/--bin/--lib in cargo-miri
David Cook [Wed, 26 Aug 2020 00:00:46 +0000 (19:00 -0500)]
Support --test/--bin/--lib in cargo-miri

3 years agoAuto merge of #1524 - RalfJung:rustup, r=RalfJung
bors [Mon, 24 Aug 2020 08:07:41 +0000 (08:07 +0000)]
Auto merge of #1524 - RalfJung:rustup, r=RalfJung

rustup; account for ptr_offset_from stabilization

@bors r+

3 years agorustup; account for ptr_offset_from stabilization
Ralf Jung [Mon, 24 Aug 2020 08:06:44 +0000 (10:06 +0200)]
rustup; account for ptr_offset_from stabilization

3 years agoAuto merge of #1523 - RalfJung:test-matrix, r=RalfJung
bors [Sat, 22 Aug 2020 16:09:48 +0000 (16:09 +0000)]
Auto merge of #1523 - RalfJung:test-matrix, r=RalfJung

tweak test matrix

* test big-endian architecture
* test less on macOS host (it is slow)

3 years agofix a test for big-endian targets
Ralf Jung [Sat, 22 Aug 2020 16:07:43 +0000 (18:07 +0200)]
fix a test for big-endian targets

3 years agotweak test matrix: test big-endian, and test less on macOS host (it is slow)
Ralf Jung [Sat, 22 Aug 2020 16:03:34 +0000 (18:03 +0200)]
tweak test matrix: test big-endian, and test less on macOS host (it is slow)

3 years agoAuto merge of #1522 - RalfJung:readme, r=RalfJung
bors [Sat, 22 Aug 2020 12:32:35 +0000 (12:32 +0000)]
Auto merge of #1522 - RalfJung:readme, r=RalfJung

emphasize that some flags are unsound to use

3 years agoemphasize that some flags are unsound to use
Ralf Jung [Sat, 22 Aug 2020 12:31:46 +0000 (14:31 +0200)]
emphasize that some flags are unsound to use

3 years agoAuto merge of #1521 - workingjubilee:bump-cargo-metadata, r=RalfJung
bors [Fri, 21 Aug 2020 16:58:33 +0000 (16:58 +0000)]
Auto merge of #1521 - workingjubilee:bump-cargo-metadata, r=RalfJung

Bump cargo_metadata to 0.11

3 years agoBump cargo_metadata to 0.11
Jubilee Young [Fri, 21 Aug 2020 08:37:56 +0000 (01:37 -0700)]
Bump cargo_metadata to 0.11

3 years agoAuto merge of #1518 - workingjubilee:remove-byteorder, r=RalfJung
bors [Fri, 21 Aug 2020 07:03:14 +0000 (07:03 +0000)]
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.

3 years agoUpdate lockfile
Jubilee Young [Thu, 20 Aug 2020 23:48:35 +0000 (16:48 -0700)]
Update lockfile

3 years agoAuto merge of #1520 - RalfJung:rustup, r=RalfJung
bors [Thu, 20 Aug 2020 08:14:34 +0000 (08:14 +0000)]
Auto merge of #1520 - RalfJung:rustup, r=RalfJung

avoid promotion in alignment test to get different alignment on each try

3 years agoavoid promotion in alignment test to get different alignment on each try
Ralf Jung [Thu, 20 Aug 2020 08:13:21 +0000 (10:13 +0200)]
avoid promotion in alignment test to get different alignment on each try

3 years agoRemove byteorder dependency
Jubilee Young [Thu, 20 Aug 2020 05:19:22 +0000 (22:19 -0700)]
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.

3 years agoAuto merge of #1517 - RalfJung:align-test, r=RalfJung
bors [Tue, 18 Aug 2020 08:21:15 +0000 (08:21 +0000)]
Auto merge of #1517 - RalfJung:align-test, r=RalfJung

forgot to add alignment test loop in one test

As expected, checking the physical integer address made alignment tests fragile, and I forgot to add the retry loop for this one.

3 years agoforgot to add alignment test loop in one test
Ralf Jung [Tue, 18 Aug 2020 08:11:54 +0000 (10:11 +0200)]
forgot to add alignment test loop in one test

3 years agoAuto merge of #1513 - RalfJung:int-align, r=RalfJung
bors [Mon, 17 Aug 2020 16:23:07 +0000 (16:23 +0000)]
Auto merge of #1513 - RalfJung:int-align, r=RalfJung

add option to use force_int for alignment check

Fixes https://github.com/rust-lang/miri/issues/1074. Depends on https://github.com/rust-lang/rust/pull/75592.

3 years agomake another test more robust against random alignment
Ralf Jung [Mon, 17 Aug 2020 15:09:09 +0000 (17:09 +0200)]
make another test more robust against random alignment

3 years agorustup
Ralf Jung [Mon, 17 Aug 2020 14:51:48 +0000 (16:51 +0200)]
rustup

3 years agotweak alignment check docs
Ralf Jung [Mon, 17 Aug 2020 09:51:18 +0000 (11:51 +0200)]
tweak alignment check docs

3 years agomake sure we test panic of interpreter-impelemted align_offset
Ralf Jung [Sun, 16 Aug 2020 16:31:48 +0000 (18:31 +0200)]
make sure we test panic of interpreter-impelemted align_offset

3 years agouse real align_offset unless we symbolic alignment check is enabled
Ralf Jung [Sun, 16 Aug 2020 16:16:34 +0000 (18:16 +0200)]
use real align_offset unless we symbolic alignment check is enabled

3 years agoadjust diagnostics to alignment check mode
Ralf Jung [Sun, 16 Aug 2020 15:16:53 +0000 (17:16 +0200)]
adjust diagnostics to alignment check mode

3 years agodocument -Zmiri-symbolic-alignment-check
Ralf Jung [Sun, 16 Aug 2020 15:12:32 +0000 (17:12 +0200)]
document -Zmiri-symbolic-alignment-check

3 years agomake alignment check integer-based by default, and add an option to make it symbolic
Ralf Jung [Sun, 16 Aug 2020 15:08:34 +0000 (17:08 +0200)]
make alignment check integer-based by default, and add an option to make it symbolic

3 years agoAuto merge of #1510 - RalfJung:stderr, r=RalfJung
bors [Thu, 13 Aug 2020 12:27:24 +0000 (12:27 +0000)]
Auto merge of #1510 - RalfJung:stderr, r=RalfJung

fix Stderr::as_file_handle error message

3 years agofix Stderr::as_file_handle error message
Ralf Jung [Thu, 13 Aug 2020 12:00:10 +0000 (14:00 +0200)]
fix Stderr::as_file_handle error message

3 years agoAuto merge of #1509 - samrat:fd-trait-fixes, r=RalfJung
bors [Thu, 13 Aug 2020 11:57:46 +0000 (11:57 +0000)]
Auto merge of #1509 - samrat:fd-trait-fixes, r=RalfJung

Remove lifetime from FileDescriptor trait

Also:
- Type annotate `handles` declaration, instead of annotating every insert.
- Add note about flush being unnecessary when writing to stderr

Addresses comments in #1495 and #1497

3 years agoRemove unnecessary whitespace
Samrat Man Singh [Thu, 13 Aug 2020 10:48:08 +0000 (16:18 +0530)]
Remove unnecessary whitespace

Co-authored-by: Ralf Jung <post@ralfj.de>
3 years agoRemove lifetime from FileDescriptor trait
Samrat Man Singh [Thu, 13 Aug 2020 09:31:52 +0000 (15:01 +0530)]
Remove lifetime from FileDescriptor trait

Also:
- Remove type annotate `handles` declaration instead of every insert.
- Add note about flush being unnecessary when writing to stderr

3 years agoAuto merge of #1504 - RalfJung:ill-formed-const, r=RalfJung
bors [Thu, 13 Aug 2020 06:44:00 +0000 (06:44 +0000)]
Auto merge of #1504 - RalfJung:ill-formed-const, r=RalfJung

add test for unused ill-formed constant

Once https://github.com/rust-lang/rust/pull/75339 lands, this test should pass.

Fixes https://github.com/rust-lang/miri/issues/1382.

3 years agorustup
Ralf Jung [Thu, 13 Aug 2020 06:43:28 +0000 (08:43 +0200)]
rustup

3 years agoadd test for unused ill-formed constant
Ralf Jung [Mon, 10 Aug 2020 07:04:37 +0000 (09:04 +0200)]
add test for unused ill-formed constant

also use better span in TopFrameInfo

3 years agoAuto merge of #1507 - rust-lang:get_static, r=RalfJung
bors [Wed, 12 Aug 2020 07:19:59 +0000 (07:19 +0000)]
Auto merge of #1507 - rust-lang:get_static, r=RalfJung

Bump for rustc changes

rustc-side: https://github.com/rust-lang/rust/pull/75394

3 years agorustup
Ralf Jung [Wed, 12 Aug 2020 07:19:40 +0000 (09:19 +0200)]
rustup

3 years agoBump for rustc changes
Oliver Scherer [Tue, 11 Aug 2020 09:37:29 +0000 (11:37 +0200)]
Bump for rustc changes

3 years agoAuto merge of #1506 - RalfJung:test-isolation, r=RalfJung
bors [Mon, 10 Aug 2020 08:24:56 +0000 (08:24 +0000)]
Auto merge of #1506 - RalfJung:test-isolation, r=RalfJung

make sure opening a file fails with isolation enabled

3 years agomake sure opening a file fails with isolation enabled
Ralf Jung [Mon, 10 Aug 2020 08:10:08 +0000 (10:10 +0200)]
make sure opening a file fails with isolation enabled

3 years agoAuto merge of #1503 - RalfJung:post-mono, r=RalfJung
bors [Mon, 10 Aug 2020 07:04:20 +0000 (07:04 +0000)]
Auto merge of #1503 - RalfJung:post-mono, r=RalfJung

accept some post-monomorphization errors

For https://github.com/rust-lang/miri/issues/1382, we also need to allow `ReferencedConstant` post-monomorphization errors. The other post-monomorphization errors should still be impossible to trigger in Miri. The fix is not complete though without https://github.com/rust-lang/rust/pull/75339.

3 years agoaccept ReferencedConstant errors in Miri (can happen post-monomorphization)
Ralf Jung [Mon, 10 Aug 2020 07:02:45 +0000 (09:02 +0200)]
accept ReferencedConstant errors in Miri (can happen post-monomorphization)

3 years agoAuto merge of #1502 - RalfJung:isolation, r=RalfJung
bors [Sat, 8 Aug 2020 13:25:25 +0000 (13:25 +0000)]
Auto merge of #1502 - RalfJung:isolation, r=RalfJung

fs: move isolation handling to inside trait

3 years agofs: move isolation handling to inside trait
Ralf Jung [Sat, 8 Aug 2020 13:21:04 +0000 (15:21 +0200)]
fs: move isolation handling to inside trait

3 years agoAuto merge of #1501 - samrat:fix-fs-error-handling, r=RalfJung
bors [Sat, 8 Aug 2020 12:28:08 +0000 (12:28 +0000)]
Auto merge of #1501 - samrat:fix-fs-error-handling, r=RalfJung

Bubble up errors from FileDescriptor::as_file_handle

Instead of indicating incorrectly that a handle was not found, return the error from `as_file_handle` indicating the operation is not supported on the FD.

Addresses some comments in #1495

3 years agoAuto merge of #1500 - RalfJung:rustup, r=RalfJung
bors [Sat, 8 Aug 2020 12:05:31 +0000 (12:05 +0000)]
Auto merge of #1500 - RalfJung:rustup, r=RalfJung

rustup

Adjust for https://github.com/rust-lang/rust/pull/74932.
Blocked on https://github.com/rust-lang/rust/pull/75282.

3 years agorustup
Ralf Jung [Sat, 8 Aug 2020 08:27:23 +0000 (10:27 +0200)]
rustup

3 years agoFix handling of as_file_handle error for `fullfsync`
Samrat Man Singh [Sat, 8 Aug 2020 11:58:41 +0000 (17:28 +0530)]
Fix handling of as_file_handle error for `fullfsync`

3 years agoAdd FIXME's for `dup` and other syscalls to support stdin/out/err
Samrat Man Singh [Sat, 8 Aug 2020 09:38:29 +0000 (15:08 +0530)]
Add FIXME's for `dup` and other syscalls to support stdin/out/err

3 years agoBubble up error from FileDescriptor::as_file_handle
Samrat Man Singh [Sat, 8 Aug 2020 09:12:50 +0000 (14:42 +0530)]
Bubble up error from FileDescriptor::as_file_handle

...instead of handle_not_found

3 years agoAuto merge of #1498 - RalfJung:rustup, r=RalfJung
bors [Wed, 5 Aug 2020 11:39:07 +0000 (11:39 +0000)]
Auto merge of #1498 - RalfJung:rustup, r=RalfJung

rustup

The allocator API changed *again*, adjust our test.

3 years agorustup
Ralf Jung [Wed, 5 Aug 2020 11:38:15 +0000 (13:38 +0200)]
rustup

3 years agoAuto merge of #1497 - samrat:posix-fs-refactor, r=oli-obk
bors [Tue, 4 Aug 2020 15:40:56 +0000 (15:40 +0000)]
Auto merge of #1497 - samrat:posix-fs-refactor, r=oli-obk

Add `impl FileDescriptor` for stdin, stdout, stderr

- Use `FileDescriptor::read` for stdin reads
- Use `FileDescriptor::write` for stdout/err writes
- Handle stdout/err reads in `FileDescriptor::read`

The `FileDescriptor` trait was added in PR #1495

Closes #1486

3 years agoFlush to stdout from FileDescriptor::write for `Stdout`
Samrat Man Singh [Tue, 4 Aug 2020 15:10:48 +0000 (20:40 +0530)]
Flush to stdout from FileDescriptor::write for `Stdout`

Also, remove unnecessary `-Zmiri-disable-isolation` in test

3 years agoAdd `impl FileDescriptor` for stdin, stdout, stderr
Samrat Man Singh [Sat, 1 Aug 2020 11:38:28 +0000 (17:08 +0530)]
Add `impl FileDescriptor` for stdin, stdout, stderr

- Use `FileDescriptor::read` for stdin reads
- Use `FileDescriptor::write` for stdout/err writes
- Handle stdout/err reads in `FileDescriptor::read`

3 years agoAuto merge of #1495 - samrat:fd-trait, r=oli-obk
bors [Mon, 3 Aug 2020 15:50:30 +0000 (15:50 +0000)]
Auto merge of #1495 - samrat:fd-trait, r=oli-obk

Add FileDescriptor trait to abstract fn's on File's and Stdin,Stdout,Stderr

Related issue: #1486

Instead of mapping FDs to `FileHandle`, map them to a `FileDescriptor` trait object. The goal is to eventually have both `FileHandle` as well as `Stdin`, `Stdout` and `Stderr` implement this trait so that syscalls involving FDs can handle both `File`s as well as the standard IO streams.

This PR adds the `FileDescriptor` trait and an `impl` for `FileHandle`. I'll open a separate PR for implementing the trait for the standard IO streams.

3 years agoRemove unnecessary `clone()` on `writable`
Samrat Man Singh [Mon, 3 Aug 2020 15:09:09 +0000 (20:39 +0530)]
Remove unnecessary `clone()` on `writable`

3 years agoAuto merge of #1496 - RalfJung:rustup, r=RalfJung
bors [Mon, 3 Aug 2020 12:25:11 +0000 (12:25 +0000)]
Auto merge of #1496 - RalfJung:rustup, r=RalfJung

rustup; inner_deref has been stabilized

miri and cargo-miri now use no nightly features (except for miri's using `rustc_private`, of course) :D

3 years agorustup; inner_deref has been stabilized
Ralf Jung [Mon, 3 Aug 2020 12:20:46 +0000 (14:20 +0200)]
rustup; inner_deref has been stabilized

3 years agoWrap io::Result from `FileDescriptor::{read,write,seek}` in InterpResult
Samrat Man Singh [Mon, 3 Aug 2020 05:31:42 +0000 (11:01 +0530)]
Wrap io::Result from `FileDescriptor::{read,write,seek}` in InterpResult

The outer InterpResult will be used to indicate that a fn is not
implemented for a struct(eg. `write` for Stdin).

The inner io::Result is just the result from the read/write/seek.

3 years agoAdd FileDescriptor trait to abstract fn's on File's and Std{in,out,err}
Samrat Man Singh [Fri, 31 Jul 2020 17:23:35 +0000 (22:53 +0530)]
Add FileDescriptor trait to abstract fn's on File's and Std{in,out,err}

3 years agoAuto merge of #1494 - RalfJung:stack-unwind-top, r=RalfJung
bors [Sat, 1 Aug 2020 12:20:45 +0000 (12:20 +0000)]
Auto merge of #1494 - RalfJung:stack-unwind-top, r=RalfJung

test unwinding past topmost frame of a stack

This tests https://github.com/rust-lang/rust/pull/74984