<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_const_eval/src/interpret/cast.rs, branch 1.85.1</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.85.1</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.85.1'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-12-06T08:27:39+00:00</updated>
<entry>
<title>Rollup merge of #133211 - Strophox:miri-correct-state-update-ffi, r=RalfJung</title>
<updated>2024-12-06T08:27:39+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2024-12-06T08:27:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=576176d8b7143d47f8ae82ad7bb2653dee803b43'/>
<id>urn:sha1:576176d8b7143d47f8ae82ad7bb2653dee803b43</id>
<content type='text'>
Extend Miri to correctly pass mutable pointers through FFI

Based off of https://github.com/rust-lang/rust/pull/129684, this PR further extends Miri to execute native calls that make use of pointers to *mutable* memory.
We adapt Miri's bookkeeping of internal state upon any FFI call that gives external code permission to mutate memory.

Native code may now possibly write and therefore initialize and change the pointer provenance of bytes it has access to: Such memory is assumed to be *initialized* afterwards and bytes are given *arbitrary (wildcard) provenance*. This enables programs that correctly use mutating FFI calls to run Miri without errors, at the cost of possibly missing Undefined Behaviour caused by incorrect usage of mutating FFI.

&gt; &lt;details&gt;
&gt;
&gt; &lt;summary&gt; Simple example &lt;/summary&gt;
&gt;
&gt; ```rust
&gt; extern "C" {
&gt;   fn init_int(ptr: *mut i32);
&gt; }
&gt;
&gt; fn main() {
&gt;   let mut x = std::mem::MaybeUninit::&lt;i32&gt;::uninit();
&gt;   let x = unsafe {
&gt;     init_int(x.as_mut_ptr());
&gt;     x.assume_init()
&gt;   };
&gt;
&gt;   println!("C initialized my memory to: {x}");
&gt; }
&gt; ```
&gt; ```c
&gt; void init_int(int *ptr) {
&gt;   *ptr = 42;
&gt; }
&gt; ```
&gt; should now show `C initialized my memory to: 42`.
&gt;
&gt; &lt;/details&gt;

r? ``@RalfJung``
</content>
</entry>
<entry>
<title>extend Miri to correctly pass mutable pointers through FFI</title>
<updated>2024-12-05T21:41:07+00:00</updated>
<author>
<name>Strophox</name>
<email>strophox@gmail.com</email>
</author>
<published>2024-09-30T18:29:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=712ceaba35967f4ebc272634f417b5f5400601f8'/>
<id>urn:sha1:712ceaba35967f4ebc272634f417b5f5400601f8</id>
<content type='text'>
Co-authored-by: Ralf Jung &lt;post@ralfj.de&gt;
</content>
</entry>
<entry>
<title>`InterpCx` store `TypingEnv` instead of a `ParamEnv`</title>
<updated>2024-11-19T20:36:23+00:00</updated>
<author>
<name>lcnr</name>
<email>rust@lcnr.de</email>
</author>
<published>2024-11-19T19:10:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7a90e84f4d760cb49035f1446d4c6cfb3993aad2'/>
<id>urn:sha1:7a90e84f4d760cb49035f1446d4c6cfb3993aad2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>use `TypingEnv` when no `infcx` is available</title>
<updated>2024-11-18T09:38:56+00:00</updated>
<author>
<name>lcnr</name>
<email>rust@lcnr.de</email>
</author>
<published>2024-11-15T12:53:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9cba14b95bb07a5b31ed1aac2bf4eadd248232da'/>
<id>urn:sha1:9cba14b95bb07a5b31ed1aac2bf4eadd248232da</id>
<content type='text'>
the behavior of the type system not only depends on the current
assumptions, but also the currentnphase of the compiler. This is
mostly necessary as we need to decide whether and how to reveal
opaque types. We track this via the `TypingMode`.
</content>
</entry>
<entry>
<title>compiler: Directly use rustc_abi in const_eval</title>
<updated>2024-11-03T21:38:47+00:00</updated>
<author>
<name>Jubilee Young</name>
<email>workingjubilee@gmail.com</email>
</author>
<published>2024-11-03T02:32:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=bbd18e29da5d06db8e2c4d6c8111118aa7efec24'/>
<id>urn:sha1:bbd18e29da5d06db8e2c4d6c8111118aa7efec24</id>
<content type='text'>
</content>
</entry>
<entry>
<title>compiler: `rustc_abi::Abi` =&gt; `BackendRepr`</title>
<updated>2024-10-29T21:56:00+00:00</updated>
<author>
<name>Jubilee Young</name>
<email>workingjubilee@gmail.com</email>
</author>
<published>2024-10-29T20:37:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7086dd83cca1cf694c7bd171efbf262fa8ffb4aa'/>
<id>urn:sha1:7086dd83cca1cf694c7bd171efbf262fa8ffb4aa</id>
<content type='text'>
The initial naming of "Abi" was an awful mistake, conveying wrong ideas
about how psABIs worked and even more about what the enum meant.
It was only meant to represent the way the value would be described to
a codegen backend as it was lowered to that intermediate representation.
It was never meant to mean anything about the actual psABI handling!
The conflation is because LLVM typically will associate a certain form
with a certain ABI, but even that does not hold when the special cases
that actually exist arise, plus the IR annotations that modify the ABI.

Reframe `rustc_abi::Abi` as the `BackendRepr` of the type, and rename
`BackendRepr::Aggregate` as `BackendRepr::Memory`. Unfortunately, due to
the persistent misunderstandings, this too is now incorrect:
- Scattered ABI-relevant code is entangled with BackendRepr
- We do not always pre-compute a correct BackendRepr that reflects how
  we "actually" want this value to be handled, so we leave the backend
  interface to also inject various special-cases here
- In some cases `BackendRepr::Memory` is a "real" aggregate, but in
  others it is in fact using memory, and in some cases it is a scalar!

Our rustc-to-backend lowering code handles this sort of thing right now.
That will eventually be addressed by lifting duplicated lowering code
to either rustc_codegen_ssa or rustc_target as appropriate.
</content>
</entry>
<entry>
<title>Get rid of const eval_* and try_eval_* helpers</title>
<updated>2024-10-19T18:07:35+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2024-09-27T16:56:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e83e4e81123ea2babc04238d5aca01ec4bf3e763'/>
<id>urn:sha1:e83e4e81123ea2babc04238d5aca01ec4bf3e763</id>
<content type='text'>
</content>
</entry>
<entry>
<title>De-duplicate and move `adjust_nan` to `InterpCx`</title>
<updated>2024-10-14T19:48:51+00:00</updated>
<author>
<name>Eduardo Sánchez Muñoz</name>
<email>eduardosm-dev@e64.io</email>
</author>
<published>2024-10-14T18:58:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b73e613e008fd4a07a52ec7cef7c3af7db716b3d'/>
<id>urn:sha1:b73e613e008fd4a07a52ec7cef7c3af7db716b3d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Use wide pointers consistenly across the compiler</title>
<updated>2024-10-04T12:06:48+00:00</updated>
<author>
<name>Urgau</name>
<email>urgau@numericable.fr</email>
</author>
<published>2024-10-03T13:05:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=018ba0528fa5d22712397e520351295f8582a525'/>
<id>urn:sha1:018ba0528fa5d22712397e520351295f8582a525</id>
<content type='text'>
</content>
</entry>
<entry>
<title>make InterpResult a dedicated type to avoid accidentally discarding the error</title>
<updated>2024-10-01T19:45:35+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2024-09-29T09:53:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c4ce8c114b06840c3521a189ee44958b713fb33a'/>
<id>urn:sha1:c4ce8c114b06840c3521a189ee44958b713fb33a</id>
<content type='text'>
</content>
</entry>
</feed>
