| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
implicit provenance stripping where possible
|
|
|
|
|
|
That function is called by const_prop, where updating the index like that is totally meaningless.
|
|
|
|
take back half-baked noaliasing check in Assignment
Doing an aliasing check in `copy_op` does not make a ton of sense. We have to eventually do something in the `Assignment` statement handling instead.
|
|
|
|
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
|
|
|
|
rename PointerAddress → PointerExposeAddress
`PointerAddress` sounds a bit too much like `ptr.addr()`, but this corresponds to `ptr.expose_addr()`.
r? `@tmiasko`
|
|
|
|
Ensure we never consider the null pointer dereferencable
This replaces the checks that are being removed in https://github.com/rust-lang/rust/pull/97188. Those checks were too early and hence incorrect.
|
|
A pointer to address cast are often special-cased.
Introduce a dedicated cast kind to make them easy distinguishable.
|
|
Miri call ABI check: ensure type size+align stay the same
We should almost certainly not accept calls where caller and callee disagree on the size or alignment of the type.
The checks we do *almost* imply that, except that `ScalarPair` types can have `repr(align)` and thus differ in size/align even when they are pairs of the same primitive type.
r? ``@oli-obk``
|
|
Add validation layer for Derefer
_Follow up work to #96549 #96116 #95857 #95649_
This adds validation for Derefer making sure it is always the first projection.
r? rust-lang/mir-opt
|
|
|
|
Replace `#[default_method_body_is_const]` with `#[const_trait]`
pulled out of #96077
related issues: #67792 and #92158
cc `@fee1-dead`
This is groundwork to only allowing `impl const Trait` for traits that are marked with `#[const_trait]`. This is necessary to prevent adding a new default method from becoming a breaking change (as it could be a non-const fn).
|
|
|
|
be treated as `const`
|
|
|
|
|
|
|
|
|
|
Move various checks to typeck so them failing causes the typeck result to get tainted
Fixes #69487
fixes #79047
cc `@RalfJung` this gets rid of the `Transmute` invalid program error variant
|
|
clone_on_copy
useless_format
bind_instead_of_map
filter_map_identity
useless_conversion
map_flatten
unnecessary_unwrap
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Implement proper stability check for const impl Trait, fall back to unstable const when undeclared
Continuation of #93960
`@jhpratt` it looks to me like the test was simply not testing for the failure you were looking for? Your checks actually do the right thing for const traits?
|
|
|
|
|
|
Remove unneeded null pointer asserts in ptr2int casts
This removes an assert that a pointer with address 0 has no provenance. This change is needed to support permissive provenance work in Miri, and seems justified by `ptr.with_addr(0)` working and a discussion on Zulip regarding LLVM semantics.
r? `@RalfJung`
|
|
interpret/validity: separately control checking numbers for being init and non-ptr
This lets Miri control this in a more fine-grained way.
r? `@oli-obk`
|
|
|
|
|
|
non-ptr
|
|
Rather than deferring to const eval for checking if a trait is const, we
now check up-front. This allows the error to be emitted earlier, notably
at the same time as other stability checks.
Also included in this commit is a change of the default const stability
level to UNstable. Previously, an item that was `const` but did not
explicitly state it was unstable was implicitly stable.
|
|
This avoids an ambiguity (when reading) where `.level.is_stable()` is
not immediately clear whether it is general stability or const
stability.
|
|
|
|
Transition to valtrees pt1
Compartmentalising https://github.com/rust-lang/rust/pull/96591 as much as possible.
r? `@oli-obk`
|
|
interpret/validity: reject references to uninhabited types
According to https://doc.rust-lang.org/reference/behavior-considered-undefined.html, this is definitely UB. And we can check this without actually looking up anything in memory, we just need the reference value and its type, making this a great candidate for a validity invariant IMO and my favorite resolution of https://github.com/rust-lang/unsafe-code-guidelines/issues/77.
With this PR, Miri with `-Zmiri-check-number-validity` implements all my preferred options for what the validity invariants of our types could be. :)
CTFE has been doing recursive checking anyway, so this is backwards compatible but might change the error output. I will submit a PR with the new Miri tests soon.
r? `@oli-obk`
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- #96329 (Add a couple tests for #90887 fixes)
- #97009 (Allow `unused_macro_rules` in path tests)
- #97075 (Add regression test for #81804)
- #97079 (Change `Successors` to `impl Iterator<Item = BasicBlock>`)
- #97080 (remove the `RelateResultCompare` trait)
- #97093 (Migrate `maybe_recover_from_bad_type_plus` diagnostic)
- #97102 (Update function pointer call error message)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Add a query for checking whether a function is an intrinsic.
work towards #93145
This will reduce churn when we add more ways to declare intrinsics
r? `@scottmcm`
|
|
It now uses the type of context. (issue 97082)
|