<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_const_eval/src/interpret/cast.rs, branch 1.86.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.86.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.86.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-02-10T12:49:18+00:00</updated>
<entry>
<title>Rename rustc_middle::Ty::is_unsafe_ptr to is_raw_ptr</title>
<updated>2025-02-10T12:49:18+00:00</updated>
<author>
<name>Bastian Kersting</name>
<email>bkersting@google.com</email>
</author>
<published>2025-01-24T14:08:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f842ee824534e2dbf3c2976f8007890b2238e3c5'/>
<id>urn:sha1:f842ee824534e2dbf3c2976f8007890b2238e3c5</id>
<content type='text'>
The wording unsafe pointer is less common and not mentioned in a lot of
places, instead this is usually called a "raw pointer". For the sake of
uniformity, we rename this method.
This came up during the review of
https://github.com/rust-lang/rust/pull/134424.
</content>
</entry>
<entry>
<title>More assertions, tests, and miri coverage</title>
<updated>2025-01-30T17:44:28+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2025-01-11T19:31:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d98b99af56e1260f520102a93f198ffe47793722'/>
<id>urn:sha1:d98b99af56e1260f520102a93f198ffe47793722</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Normalize vtable entries before walking and deduplicating them</title>
<updated>2025-01-30T15:34:00+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2025-01-10T04:47:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=739ef83f318defbb9692029fa98f56639896c6fd'/>
<id>urn:sha1:739ef83f318defbb9692029fa98f56639896c6fd</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Do not treat vtable supertraits as distinct when bound with different bound vars</title>
<updated>2025-01-30T15:33:58+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2025-01-10T04:36:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=fdc4bd22b7b8117f4a3864c342773df600f5b956'/>
<id>urn:sha1:fdc4bd22b7b8117f4a3864c342773df600f5b956</id>
<content type='text'>
</content>
</entry>
<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>
</feed>
