Commit Graph

129 Commits

Author SHA1 Message Date
bors
7a5e95c9ac Auto merge of #1276 - RalfJung:scalar-precise-sizes, r=RalfJung
Construct Scalar with precise sizes
2020-03-28 18:16:13 +00:00
Ralf Jung
fbbca59de7 avoid Scalar::from_(u)int in favor of giving the size explicitly 2020-03-28 17:35:40 +01:00
bors
ad14b684cc Auto merge of #1275 - JOE1994:move_string_helpers, r=RalfJung
move OsStr helpers to a separate file

Moved OsStr read/write functions from `src/helpers.rs` to `src/shims/os_str.rs`, in order to keep `src/helpers.rs` from bloating too much.
2020-03-28 15:32:16 +00:00
JOE1994
99600ba7a9 move OsStr helpers to a separate file 2020-03-28 10:43:47 -04:00
Ralf Jung
9e39bfbbd9 organize shims and make some only available to libstd as they are incomplete 2020-03-28 11:15:11 +01:00
Ralf Jung
876bded2e8 run Windows TLS dtor function 2020-03-28 10:39:29 +01:00
JOE1994
813d76d948 follow-up to reviews 2020-03-27 07:07:21 -04:00
JOE1994
fc8f88e04e change helper fn 'write_os_str_to_wide_str' 2020-03-27 00:08:27 -04:00
Ralf Jung
81d505670b rustup; get rid of some try_from that are no longer needed 2020-03-26 00:11:50 +01:00
Ralf Jung
e9e04e56fc move path methods together, to the bottom of the string helpers 2020-03-24 09:11:48 +01:00
Ralf Jung
c4e29c8646 convert dir separators on path load/store 2020-03-24 09:11:48 +01:00
Ralf Jung
4ac91384ff route all path reading/writing through central read/write methods 2020-03-24 09:11:47 +01:00
JOE1994
5f9167bdaa helper functions for env_var emulation in Windows 2020-03-23 19:40:22 -04:00
Ralf Jung
2f371774ef fix conditional compilation condition for os_str <-> bytes conversion 2020-03-23 19:43:03 +01:00
Ralf Jung
6dcca62b63 move -Zmiri-disable-isolation hint to help 2020-03-22 19:48:59 +01:00
Ralf Jung
d85f09c4e4 platform -> target 2020-03-22 08:55:39 +01:00
Ralf Jung
681819c8ad getting a path should never fail
we basically treat them as lang items
2020-03-19 08:26:08 +01:00
Ralf Jung
e6e8773272 start messages in lower-case 2020-03-19 08:25:08 +01:00
Ralf Jung
1103a10e2c adjust for error reform 2020-03-19 08:25:08 +01:00
Ralf Jung
8b6af3eacb avoid using unchecked casts or arithmetic 2020-03-17 15:21:43 +01:00
Ralf Jung
88c45f9891 adjust for rustc changes 2020-03-02 13:51:08 +01:00
Ralf Jung
cc1ebd0af6 some formatting 2020-03-01 10:29:05 +01:00
David Cook
ad8c784009 Return length from write_os_str_to_c_str 2020-02-24 19:50:25 -06:00
David Cook
94f611348f Use os_str_length_as_c_str in readdir[64]_r 2020-02-23 15:37:22 -06:00
Ralf Jung
4a9a0a9078 avoid lowercasing platforms 2020-02-23 18:54:08 +01:00
Ralf Jung
5d35548985 helpers.rs cleanup 2020-02-23 18:52:12 +01:00
Christian Poveda
208665836e
panic if target platform is incorrect instead 2020-02-22 09:02:29 -05:00
Christian Poveda
9e9a090026
minor fixes 2020-02-22 02:18:42 -05:00
Christian Poveda
8fe7543191
add helper function for target platform checks 2020-02-19 17:47:34 -05:00
Ralf Jung
ef154df607 pass MPlaceTy by-value, as we usually do 2020-01-30 13:38:49 +01:00
Ralf Jung
23c74449a2 rustup 2020-01-15 19:27:21 +01:00
Yuki Okushi
86ee705cd5 Rustup 2020-01-07 05:13:18 +09:00
Yuki Okushi
ebacb8ae4e Rustup 2020-01-05 15:55:15 -08:00
JOE1994
a4bd68a45f Add helper 'alloc_os_str_as_c_str' and use it in env_var emulation 2019-12-27 20:32:20 -05:00
Ralf Jung
cd12f47af6 make bytes conversion functions private inside read/write functions 2019-12-24 11:46:02 +01:00
Ralf Jung
2db6a3c04d use new try_from methods 2019-12-24 11:43:42 +01:00
Oliver Scherer
7ead530841 Rustfmt all the things 2019-12-23 12:56:23 +01:00
bors
a3ea1cb458 Auto merge of #1101 - christianpoveda:stat-shim, r=RalfJung
Add statx shim for linux target

This is an attempt to fix: https://github.com/rust-lang/miri/issues/999 (for linux only)

Currently there is one problem that I haven't been able to solve. `std::fs::metadata` fails because the creation time is not available even though it is provided in the shim code.

In order to inform the caller that the field was provided, the `stx_flag` field must have the bits of `STATX_BTIME` set (which they are). The creation time is in the `stx_btime` field of the `statx` struct (see [1]). The relevant code in `libstd` is here (probably?): https://github.com/rust-lang/rust/blob/master/src/libstd/sys/unix/fs.rs#L322

Another important point is that we are just providing the fields that are available in "all" platforms (this is, without using any platform specific traits or so). This can be improved later.

References:
[1] Man page: http://man7.org/linux/man-pages/man2/statx.2.html
[2] libc `statx` struct: https://docs.rs/libc/0.2.63/libc/struct.statx.html

Edit: The problem is that my filesystem is not providing it and I thought all filesystems could provide it. I changed the code so it only provides those dates if they are available. now we are ready to go.

r? @RalfJung @oli-obk
2019-12-22 17:01:53 +00:00
Christian Poveda
b0c7625dd1
add statx shim for linux 2019-12-22 11:46:02 -05:00
Ralf Jung
67151a712d rustup 2019-12-08 10:32:50 +01:00
Ralf Jung
94732aaf7b rename helper methods a bit 2019-12-04 10:43:36 +01:00
Ralf Jung
01f060b6da avoid allocation in read_os_string_from_c_string 2019-12-04 10:16:08 +01:00
Aaron Hill
a418fe9826
Rustup for BodyCache changes 2019-12-02 20:21:03 -05:00
Ralf Jung
b2cddd27bd better span for functions whose frame we push 'manually' 2019-12-02 16:04:31 +01:00
Ralf Jung
b91383b068 implement proper panicking for other MIR assertions
Requires generalizing the call_function helper to arbitrary Immediate arguments
2019-12-02 16:04:31 +01:00
Ralf Jung
fe76d33506 Add and use helper function for calling a machine function and passing it some arguments 2019-11-29 09:23:29 +01:00
Ralf Jung
82374ad9bd comments and slight refactoring 2019-11-19 14:51:08 +01:00
Aaron Hill
08d3fbc76b
Support unwinding after a panic
Fixes #658

This commit adds support for unwinding after a panic. It requires a
companion rustc PR to be merged, in order for the necessary hooks to
work properly.

Currently implemented:
* Selecting between unwind/abort mode based on the rustc Session
* Properly popping off stack frames, unwinding back the caller
* Running 'unwind' blocks in Mir terminators

Not yet implemented:
* 'Abort' terminators

This PR was getting fairly large, so I decided to open it for review without
implementing 'Abort' terminator support. This could either be added on
to this PR, or merged separately.
2019-11-17 08:34:25 -05:00
Ralf Jung
d8a3a1f09c rustup for projection interning 2019-10-26 09:33:24 +02:00
Ralf Jung
c87f106cac update comments and some tweaks 2019-10-24 10:27:14 +02:00