Repository navigation
miri: support statx syscall - #166564
miri: support statx syscall#166564
Conversation
|
cc @rust-lang/miri Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri Some changes occurred to the CTFE machinery |
| mask_op: &OpTy<'tcx>, // Should be an `unsigned int` | ||
| statxbuf_op: &OpTy<'tcx>, // Should be a `struct statx *` | ||
| ) -> InterpResult<'tcx, Scalar> { | ||
| dest: &MPlaceTy<'tcx>, |
There was a problem hiding this comment.
I switched this to passing the dest place because that's the standard style we're using for all new shims, and because the output type differs between the syscall (i64) and the libc function (i32).
| field.ty(*self.tcx, args), | ||
| ); | ||
| interp_ok( | ||
| self.unfold_transparent(self.layout_of(ty)?, |adt| { |
There was a problem hiding this comment.
Leave a comment here that unfold_transparent transitively normalizes the non-zst field type via the nested Layout::field call, as that isn't obvious from the code here
There was a problem hiding this comment.
In fact I think we can remove the explicit normalization here, layout_of also performs normalization.
There was a problem hiding this comment.
wellllll that's something that all the skip_norm_wip is trying to avoid in the future, but I'm gonna fix all that in one go for ctfe instead of trying to whackamole them one at a time
There was a problem hiding this comment.
IMO it makes perfect sense to say that layout should do normalization, since it has to do expensive computation anyway... but sure, happy to defer that discussion to the future. :)
09ffd78 to
525cf9b
Compare
|
@rustbot ready |
|
@bors r+ rollup |
|
@bors r- looking into it more, to make sure we actually fix it in the future this needs to be |
|
This pull request was unapproved. |
525cf9b to
0f4fc3b
Compare
|
@bors r=oli-obk |
…uwer Rollup of 11 pull requests Successful merges: - #165836 (Use LLVM option `-disable-auto-upgrade-debug-info`) - #164783 (callconv: mips64: match gcc for "alignment" of 16-byte-aligned ZSTs) - #166634 (do not lint `drop_bounds`, `dyn_drop`, `trivial_bounds` and const param names on items from external macros) - #166649 (abby dsl: minor refactor/cleanup) - #164628 (callconv: mips64: handle repr(transparent)) - #166387 (Remove diagnostics import list) - #166564 (miri: support statx syscall) - #166583 (abby dsl tests: the passing test should check-pass) - #166595 (specify target CPUs in 'powerpc-types.rs' assembly test) - #166640 (compiletest: Use an explicit argfile instead of ArgFileCommand) - #166646 (Fix reversed argument counts in Fn trait mismatch note)
Rollup merge of #166564 - RalfJung:miri-statc-syscall, r=oli-obk miri: support statx syscall This requires adjusting our "identical C types" check to unfold `repr(transparent)` types. I thought std uses the statx syscall sometimes because of [this](https://github.com/rust-lang/rust/blob/3481260b58faf2802ca1efb83ccc558250c7d98c/library/std/src/sys/fs/unix.rs#L157-L158), but it turns out it will use the weak symbol first. So adding the syscall isn't actually needed. But at that point I had already written the code, and this did lead me to discover an actual issue with our "identical C types" check. r? @oli-obk
…uwer Rollup of 11 pull requests Successful merges: - rust-lang/rust#165836 (Use LLVM option `-disable-auto-upgrade-debug-info`) - rust-lang/rust#164783 (callconv: mips64: match gcc for "alignment" of 16-byte-aligned ZSTs) - rust-lang/rust#166634 (do not lint `drop_bounds`, `dyn_drop`, `trivial_bounds` and const param names on items from external macros) - rust-lang/rust#166649 (abby dsl: minor refactor/cleanup) - rust-lang/rust#164628 (callconv: mips64: handle repr(transparent)) - rust-lang/rust#166387 (Remove diagnostics import list) - rust-lang/rust#166564 (miri: support statx syscall) - rust-lang/rust#166583 (abby dsl tests: the passing test should check-pass) - rust-lang/rust#166595 (specify target CPUs in 'powerpc-types.rs' assembly test) - rust-lang/rust#166640 (compiletest: Use an explicit argfile instead of ArgFileCommand) - rust-lang/rust#166646 (Fix reversed argument counts in Fn trait mismatch note)
This requires adjusting our "identical C types" check to unfold
repr(transparent)types.I thought std uses the statx syscall sometimes because of this, but it turns out it will use the weak symbol first. So adding the syscall isn't actually needed. But at that point I had already written the code, and this did lead me to discover an actual issue with our "identical C types" check.
r? @oli-obk