Skip to content

use minicore more in testing inline assembly - #154277

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
folkertdev:ui-asm-minicore
Mar 24, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
folkertdev:ui-asm-minicore

Conversation

@folkertdev

@folkertdev folkertdev commented Mar 23, 2026 •

Copy link
Copy Markdown
Contributor

Both for easier development and because some niche assembly features were only tested on one platform.

try-job: aarch64-gnu
try-job: x86_64-gnu
try-job: x86_64-gnu-debug

@rustbot rustbot added A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-minicore` S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 23, 2026
@rust-log-analyzer

This comment has been minimized.

@folkertdev
folkertdev marked this pull request as ready for review March 23, 2026 23:05
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 23, 2026
@rustbot

rustbot commented Mar 23, 2026

Copy link
Copy Markdown
Collaborator

This PR modifies tests/auxiliary/minicore.rs.

cc @jieyouxu

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 23, 2026
@jieyouxu

Copy link
Copy Markdown
Member

@bors try

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Mar 24, 2026
use `minicore` more in testing inline assembly

try-job: aarch64-gnu
try-job: x86_64-gnu
try-job: x86_64-gnu-debug
@jieyouxu jieyouxu self-assigned this Mar 24, 2026
@rust-bors

rust-bors Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: f3d451d (f3d451df9d72469245e5390cdbf31d234af802b7, parent: f66622c7eca7fc48ccc4dac848ff911b09a4d566)

@jieyouxu jieyouxu left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Largely looks good to me, just one question

@rustbot author

View changes since this review


// Checks that inline asm errors are mapped to the correct line in the source code.

#[unsafe(no_mangle)]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: these no_mangle changes I'm less sure about. Can you say more on why the no_mangle is needed? To have a reproducible symbol name?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without it the test will fail with

---- [ui] tests/ui/asm/aarch64/srcloc.rs stdout ----

error: ui test did not emit an error
note: by default, ui tests are expected not to compile.
hint: use check-pass, build-pass, or run-pass directive to change this behavior.
status: exit status: 0

because the function is not considered reachable the errors in it are not emitted. using no_mangle forces the function to be reachable. using pub would work too in this case.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right. Thanks for clarifying.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 24, 2026
@rustbot

rustbot commented Mar 24, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@folkertdev folkertdev left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rustbot ready

I guess, anyway. There are other ways to make a function reachable but no_mangle is the most reliable one in my experience.

View changes since this review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 24, 2026
@jieyouxu

Copy link
Copy Markdown
Member

Thanks
@bors r+ rollup

@rust-bors

rust-bors Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 6df99d6 has been approved by jieyouxu

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 24, 2026
rust-bors Bot pushed a commit that referenced this pull request Mar 24, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - #152710 (Unalign `PackedFingerprint` on all hosts, not just x86 and x86-64)
 - #153874 (constify const Fn*: Destruct)
 - #154097 (improve validation error messages: show surrounding type)
 - #154277 (use `minicore` more in testing inline assembly)
 - #154293 (Use verbose span suggestion for type const)
@rust-bors
rust-bors Bot merged commit ef18725 into rust-lang:main Mar 24, 2026
12 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 24, 2026
github-actions Bot pushed a commit to rust-lang/miri that referenced this pull request Mar 25, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#152710 (Unalign `PackedFingerprint` on all hosts, not just x86 and x86-64)
 - rust-lang/rust#153874 (constify const Fn*: Destruct)
 - rust-lang/rust#154097 (improve validation error messages: show surrounding type)
 - rust-lang/rust#154277 (use `minicore` more in testing inline assembly)
 - rust-lang/rust#154293 (Use verbose span suggestion for type const)
traviscross added a commit to traviscross/rust that referenced this pull request Nov 25, 2026
This is the regression test for rust-lang#96797.  LLVM had merged
away a function that `global_asm!` referred to with `sym`, causing the
build to fail to link.

But the test doesn't link right now.  We moved it to `minicore` (in
rust-lang#154277) and build it as a `no_core` library, so it
would pass even if that function were merged away.

Let's go back to building it as a binary for x86-64 Linux.
jhpratt added a commit to jhpratt/rust that referenced this pull request Nov 25, 2026
…test, r=Amanieu

Make `issue-96797.rs` link again

This is the regression test for rust-lang#96797.  LLVM had merged away a function that `global_asm!` referred to with `sym`, causing the build to fail to link.

But the test doesn't link right now.  We moved it to `minicore` (in rust-lang#154277) and build it as a `no_core` library, so it would pass even if that function were merged away.

Let's go back to building it as a binary for x86-64 Linux.

r? @Amanieu
rust-bors Bot pushed a commit that referenced this pull request Nov 25, 2026
Rollup merge of #166536 - traviscross:TC/relink-issue-96797-test, r=Amanieu

Make `issue-96797.rs` link again

This is the regression test for #96797.  LLVM had merged away a function that `global_asm!` referred to with `sym`, causing the build to fail to link.

But the test doesn't link right now.  We moved it to `minicore` (in #154277) and build it as a `no_core` library, so it would pass even if that function were merged away.

Let's go back to building it as a binary for x86-64 Linux.

r? @Amanieu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-minicore` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants