| Age | Commit message (Collapse) | Author | Lines |
|
add 'fn write_u16s' to Memory
Added new function `Memory::write_u16s`. Needed in `MIRI` for implementing helper function to write wide_str to memory (for Windows).
|
|
|
|
asm! is left as a wrapper around llvm_asm! to maintain compatibility.
|
|
|
|
|
|
Miri nits: comment and var name improvement
r? @eddyb
|
|
Rename LayoutDetails to just Layout.
|
|
fix incorrect type name in doc comments
Change : `InterpCtx` => `InterpCx`
(`rustc_mir::interpret::InterpCx`)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normalize some imports & prefer direct ones
r? @Mark-Simulacrum
|
|
InterpCtx => InterpCx
(rustc_mir::interpret::InterpCx)
|
|
|
|
|
|
|
|
terminology from "static" to "global" where appropriate
|
|
r=RalfJung
Remove const eval loop detector
Now that there is a configurable instruction limit for CTFE (see #67260), we can replace the loop detector with something much simpler. See #66946 for more discussion about this. Although the instruction limit is nightly-only, the only practical way to reach the default limit uses nightly-only features as well (although CTFE will still execute code using such features inside an array initializer on stable).
This will at the very least require a crater run, since it will result in an error wherever the "long running const eval" warning appeared before. We may need to increase the default for `const_eval_limit` to work around this.
Resolves #54384 cc #49980
r? @oli-obk cc @RalfJung
|
|
|
|
more clippy fixes
* remove unused unit values (clippy::unused_unit)
* make some let-if-bindings more idiomatic (clippy::useless_let_if_seq)
* clarify when we pass () to functions (clippy::unit_arg)
* don't redundantly repeat field names (clippy::redundant_field_names)
* remove redundant returns (clippy::needless_return)
* use let instead of match for matches with single bindings (clippy::match_single_binding)
* don't convert results to options just for matching (clippy::if_let_some_result)
|
|
r=RalfJung,eddyb
Fix ICE caused by truncating a negative ZST enum discriminant
Fixes #70114
r? @oli-obk or @RalfJung
|
|
|
|
|
|
|
|
do not 'return' in 'throw_' macros
In https://github.com/rust-lang/rust/pull/69839 we turned a closure into a `try` block, but it turns out that does not work with our `throw_` macros, which `return` so they skip the `try`.
Here we fix that. For some reason that means we also have to remove some `;`.
r? @oli-obk
|
|
Abi::is_signed: assert that we are a Scalar
A bit more sanity checking, suggested by @eddyb. This makes this method actually "safer" than `TyS::is_signed`, so I made sure Miri consistently uses the `Abi` version.
Though I am not sure if this would have caught the mistake where the layout of a zero-sized enum was asked for its sign.
r? @eddyb
|
|
more clippy fixes
* remove redundant returns (clippy::needless_return)
* remove redundant import (clippy::single_component_path_imports)
* remove redundant format!() call (clippy::useless_format)
* don't use ok() before calling expect() (clippy::ok_expect)
|
|
Remove the erase regions MIR transform
We now ensure that MIR never contains unerased regions in the first place.
|
|
add delay_span_bug to TransmuteSizeDiff, just to be sure
See https://github.com/rust-lang/rust/pull/69839#discussion_r394858464.
r? @eddyb
|
|
|
|
|
|
codegen/mir: support polymorphic `InstanceDef`s
cc #69925
This PR modifies the use of `subst_and_normalize_erasing_regions` on parts of the MIR bodies returned from `instance_mir`, so that `InstanceDef::CloneShim` and `InstanceDef::DropGlue` (where there is a type) do not perform substitutions. This avoids double substitutions and enables polymorphic `InstanceDef`s.
r? @eddyb
cc @nikomatsakis
|
|
Compute the correct layout for variants of uninhabited enums
r? @eddyb
cc @RalfJung
fixes #69191
cc #69763
|
|
|
|
|
|
|
|
Miri error reform
Some time ago we started moving Miri errors into a few distinct categories, but we never classified all the old errors. That's what this PR does.
~~This is on top of https://github.com/rust-lang/rust/pull/69762; [relative diff](https://github.com/RalfJung/rust/compare/validity-errors...RalfJung:miri-error-cleanup).~~
r? @oli-obk
Fixes https://github.com/rust-lang/const-eval/issues/4
|
|
|
|
|
|
typo fix + markdown fix for consistency
|
|
Deduplicate pretty printing of constants
r? @eddyb for the pretty printing logic
cc @RalfJung
|
|
|