Skip to content

Tighten (absence of) return attribute checks in some-abis-do-extend-params-to-32-bits.rs - #164016

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
jieyouxu:jieyouxu/tighten-test
Oct 17, 2026
Merged

rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
jieyouxu:jieyouxu/tighten-test

Conversation

@jieyouxu

@jieyouxu jieyouxu commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #163917.

r? @saethlin (or compiler)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 9, 2026
@jieyouxu

jieyouxu commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

@rustbot blocked (stacked)

@rustbot rustbot added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 9, 2026
@jieyouxu jieyouxu changed the title Tighten tests/codegen-llvm/some-abis-do-extend-params-to-32-bits.rs (absence of) return attribute checks Tighten (absence of) return attribute checks in some-abis-do-extend-params-to-32-bits.rs Oct 9, 2026

@jieyouxu jieyouxu Oct 9, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll note that this entire test feels a bit strange. I sense that, the test evolved over the years and maybe kinda lost the original intention?

View changes since the review

@saethlin

Copy link
Copy Markdown
Member

@jieyouxu The other PR in the stack is merged, I'll review this when you unstack it

There's some inconsistent formatting, and also patterns in the wrong
column when the columns are intended to be

* Has sign/zero extension attribute, versus
* No sign/zero extension attribute.

This is a precursor commit to make things less confusing. The test is
still weak for return attributes.
The patterns in
`tests/codegen-llvm/some-abis-do-extend-params-to-32-bits.rs` were
previously too weak as they matched a substring.

Previously, the test uses a pattern like

```
i32 @c_ret_u32()
```

with the intention to check for absence of `zeroext` or `signext` when
the attribute is not expected. However, this is a substring pattern
match, so the pattern would actually match

```
zeroext i32 @c_ret_u32()
```

which is the very attribute the test wants to check the *absence* of.

To fix this, use a stronger pattern

```
define {{(dso_local )?}}i32 @c_ret_u32()
```

that will not match against the presence of `zeroext`/`signext` return
attributes.
@jieyouxu
jieyouxu force-pushed the jieyouxu/tighten-test branch from 289dedd to b02b177 Compare October 17, 2026 02:07
@rustbot

rustbot commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@jieyouxu

Copy link
Copy Markdown
Member Author

Rebased. @rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Oct 17, 2026
// aarch64-apple: zeroext i1 @c_ret_bool()
// aarch64-windows: i1 @c_ret_bool()
// aarch64-linux: i1 @c_ret_bool()
// aarch64-windows: define {{(dso_local )?}}i1 @c_ret_bool()

@jieyouxu jieyouxu Oct 17, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

NB: the alternative as suggested is to use --implicit-check, but I'm not sure I love that since it feels quite... implicit. See #163917 (comment)

This is noisy but to at least to me a bit more obvious/direct. Happy to go either way tbh. 🤷

View changes since the review

@saethlin

Copy link
Copy Markdown
Member

I think this is a good shoring-up of the test. Somebody else can do something more aggressive if they're determined.

@bors r+

@rust-bors

rust-bors Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

📌 Commit b02b177 has been tentatively approved by saethlin

It will be put into the queue for this repository once PR CI succeeds.

@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 Oct 17, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 17, 2026
…saethlin

Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs`

Follow-up to rust-lang#163917.

* Fix some misplaced patterns in extending vs non-extending columns.
* Tighten return attribute patterns to actually reject unexpected `zeroext`/`signext` attributes.
  * See rust-lang#163917 (comment)

r? @saethlin (or compiler)
jhpratt added a commit to jhpratt/rust that referenced this pull request Oct 17, 2026
…saethlin

Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs`

Follow-up to rust-lang#163917.

* Fix some misplaced patterns in extending vs non-extending columns.
* Tighten return attribute patterns to actually reject unexpected `zeroext`/`signext` attributes.
  * See rust-lang#163917 (comment)

r? @saethlin (or compiler)
rust-bors Bot pushed a commit that referenced this pull request Oct 17, 2026
Rollup of 10 pull requests

Successful merges:

 - #163731 (Add bootstrap step to build the TPDE plugin)
 - #160404 (fd-views: AsRef<File>&Co. for BorrowedFd)
 - #161698 (Fix rmeta-link metadata not being read on AIX)
 - #164016 (Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs`)
 - #164424 (diagnostic: skip wrong loops when explaining borrow errors)
 - #162444 (Make `std::fs::{File, ReadDir, DirEntry}` always `needs_drop` even when unsupported.)
 - #163862 (Collect all limit attributes during TyCtxt creation)
 - #164213 (make the safety documentation consistent in task::LocalWaker)
 - #164356 (Add missing full stop)
 - #164374 (core: hint: fix `unlikely`'s example polarity typo)
jhpratt added a commit to jhpratt/rust that referenced this pull request Oct 17, 2026
…saethlin

Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs`

Follow-up to rust-lang#163917.

* Fix some misplaced patterns in extending vs non-extending columns.
* Tighten return attribute patterns to actually reject unexpected `zeroext`/`signext` attributes.
  * See rust-lang#163917 (comment)

r? @saethlin (or compiler)
rust-bors Bot pushed a commit that referenced this pull request Oct 17, 2026
Rollup of 10 pull requests

Successful merges:

 - #161698 (Fix rmeta-link metadata not being read on AIX)
 - #163373 (Canonicalize operands for commutative binary ops)
 - #164016 (Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs`)
 - #164424 (diagnostic: skip wrong loops when explaining borrow errors)
 - #138744 (Add methods to TCP and UDP sockets to modify hop limit)
 - #162444 (Make `std::fs::{File, ReadDir, DirEntry}` always `needs_drop` even when unsupported.)
 - #163862 (Collect all limit attributes during TyCtxt creation)
 - #164213 (make the safety documentation consistent in task::LocalWaker)
 - #164356 (Add missing full stop)
 - #164374 (core: hint: fix `unlikely`'s example polarity typo)
rust-bors Bot pushed a commit that referenced this pull request Oct 17, 2026
Rollup of 10 pull requests

Successful merges:

 - #161698 (Fix rmeta-link metadata not being read on AIX)
 - #163373 (Canonicalize operands for commutative binary ops)
 - #164016 (Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs`)
 - #164424 (diagnostic: skip wrong loops when explaining borrow errors)
 - #138744 (Add methods to TCP and UDP sockets to modify hop limit)
 - #162444 (Make `std::fs::{File, ReadDir, DirEntry}` always `needs_drop` even when unsupported.)
 - #163862 (Collect all limit attributes during TyCtxt creation)
 - #164213 (make the safety documentation consistent in task::LocalWaker)
 - #164356 (Add missing full stop)
 - #164374 (core: hint: fix `unlikely`'s example polarity typo)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 17, 2026
…saethlin

Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs`

Follow-up to rust-lang#163917.

* Fix some misplaced patterns in extending vs non-extending columns.
* Tighten return attribute patterns to actually reject unexpected `zeroext`/`signext` attributes.
  * See rust-lang#163917 (comment)

r? @saethlin (or compiler)
rust-bors Bot pushed a commit that referenced this pull request Oct 17, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #162809 (Remap local def ids for deterministic metadata encoding)
 - #163373 (Canonicalize operands for commutative binary ops)
 - #164016 (Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs`)
 - #164259 (std: make SOLID `sockaddr_storage` large enough for IPv6)
 - #164424 (diagnostic: skip wrong loops when explaining borrow errors)
 - #138744 (Add methods to TCP and UDP sockets to modify hop limit)
 - #162444 (Make `std::fs::{File, ReadDir, DirEntry}` always `needs_drop` even when unsupported.)
 - #163862 (Collect all limit attributes during TyCtxt creation)
 - #164213 (make the safety documentation consistent in task::LocalWaker)
 - #164356 (Add missing full stop)
 - #164374 (core: hint: fix `unlikely`'s example polarity typo)
@rust-bors
rust-bors Bot merged commit 9634c28 into rust-lang:main Oct 17, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 17, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 17, 2026
Rollup merge of #164016 - jieyouxu:jieyouxu/tighten-test, r=saethlin

Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs`

Follow-up to #163917.

* Fix some misplaced patterns in extending vs non-extending columns.
* Tighten return attribute patterns to actually reject unexpected `zeroext`/`signext` attributes.
  * See #163917 (comment)

r? @saethlin (or compiler)
@jieyouxu
jieyouxu deleted the jieyouxu/tighten-test branch October 18, 2026 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants