Skip to content

Sync from rust 2026/08/04 - #942

Merged
GuillaumeGomez merged 18 commits into
masterfrom
sync_from_rust_2026_08_04
Aug 4, 2026
Merged

Sync from rust 2026/08/04#942
GuillaumeGomez merged 18 commits into
masterfrom
sync_from_rust_2026_08_04

Conversation

@antoyo

@antoyo antoyo commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

cc @bjorn3: Does that look correct to you?
I'm surprised I didn't need to manually revert commit 3e7fbda.
Could it have been automatically done by git merge master?

nbdd0121 and others added 15 commits July 22, 2026 13:47
This gives the asm-const code the basic ability to deal wiht pointer and
provenances, which lays the ground work for asm_const_ptr.

Note that `SymStatic` is not fully removed, a specialized is kept and
renamed as `SymThreadLocalStatic`, for `#[thread_local]` statics where CTFE
does not support naming. The `#[thread_local]` is unstable feature and it's
not clear if we want to support this in `sym`, but removal of it should be
a separate PR.
With the previous commit, now we can see there are some code duplication
for the handling of `GlobalAlloc` inside backends. Do some clean up to
unify them.
Support using const pointers in asm `const` operand

Implements [RFC#3848](rust-lang/rfcs#3848) with tracking issue rust-lang/rust#128464

This adds support of const pointers for asm `const` in addition to plain integers.

The inline `asm!` support is implemented using `i` constraint, and the `global_asm!` and `naked_asm!` support is implemented by inserting `symbol + offset` and make `symbol` compiler-used. For unnamed consts, it will create additional internal & hidden symbols so that they can be referenced by global_asm.

~~The feature is also implemented for GCC backend but it's untested.~~ Tested now.
…-uninit constants"

This reverts commit ed9de1e4663c73242710235ff343895e16a4d539.
…uwer

Rename `errors.rs` file to `diagnostics.rs` (15/N)

Follow-up of rust-lang/rust#157485.

r? @JonathanBrouwer
This is already *supposed* to be impossible in layout, but this emphasizes that better.

Ironically I was inspired to do this as part of looking at making `Simd<T, 0>` *work*, but importantly if that's going to happen I think it should be `BackendRepr::Memory` like other ZSTs, *not* a `BackendRepr::ScalarVector` that would need to carry around a useless LLVM value in `OperandValue::Immediate` (where it's not even clear what the LLVM type of that value would be).
Structurally prevent zero-count `BackendRepr::SimdVector`s

This is already *supposed* to be impossible in layout, but this emphasizes that better.  This PR makes no behaviour changes; just `BackendLaneCount` instead of `u64` in https://doc.rust-lang.org/nightly/nightly-rustc/rustc_abi/enum.BackendRepr.html

Ironically I was inspired to do this as part of [looking at making `Simd<T, 0>` *work*](https://rust-lang.zulipchat.com/#narrow/channel/257879-project-portable-simd/topic/Allow.20N.3D.3D0.3F/with/613345298), but importantly if that's going to happen I think it should be `BackendRepr::Memory` like other ZSTs, *not* a `BackendRepr::ScalarVector` that would need to carry around a useless LLVM value in `OperandValue::Immediate` (where it's not even clear what the LLVM type of that value would be).
…2026-07-24, r=GuillaumeGomez"

This reverts commit 504869653f510b279c542e65ccd1ea9710c119ba, reversing
changes made to 7c329d6c76e11ca40c5673818ab0439c1be8962c.
@rustbot

rustbot commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

⚠️ Warning ⚠️

  • There are issue links (such as #123) in the commit messages of the following commits.
    Please move them to the PR description, to avoid spamming the issues with references to the commit, and so this bot can automatically canonicalize them to avoid issues with subtree.

@bjorn3

bjorn3 commented Aug 4, 2026

Copy link
Copy Markdown
Member

I'm surprised I didn't need to manually revert commit 3e7fbda.

Maybe because you merged master into this branch rather than the other way around? I don't know. I guess to be on the safer side you could revert the commit before merging master.

@antoyo

antoyo commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Maybe because you merged master into this branch rather than the other way around?

What do you mean? The instructions say we should merge master in the branch.

@bjorn3

bjorn3 commented Aug 4, 2026

Copy link
Copy Markdown
Member

The instructions say we should merge master in the branch.

For cg_clif I always do it the other way around. I do git merge sync_from_rust while on the main branch. The way you do it is fine AFAIK, but I guess in this edge case it is behaving weird.

@antoyo

antoyo commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

The way you do it is fine AFAIK, but I guess in this edge case it is behaving weird.

Does this PR look correct to you, though?
Or should I change anything?

@bjorn3

bjorn3 commented Aug 4, 2026

Copy link
Copy Markdown
Member

I don't know if the lack of a revert commit will be giving trouble when you sync back to rust-lang/rust.

@GuillaumeGomez

Copy link
Copy Markdown
Member

Well, I'll see that when the time comes I guess. :')

For now we need to fix rust's CI first in any case.

@GuillaumeGomez
GuillaumeGomez merged commit 1127416 into master Aug 4, 2026
40 checks passed
@GuillaumeGomez
GuillaumeGomez deleted the sync_from_rust_2026_08_04 branch August 4, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants