Skip to content

Conversation

scottmcm
Copy link
Member

For example, transmuting between bool and Ordering doesn't need two assumes because one range is a superset of the other.

Multiple are still used for things like char <-> NonZero<u32>, which overlap but where neither fully contains the other.

@rustbot
Copy link
Collaborator

rustbot commented Jul 20, 2025

r? @lcnr

rustbot has assigned @lcnr.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Jul 20, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 20, 2025

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

@oli-obk
Copy link
Contributor

oli-obk commented Jul 20, 2025

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jul 20, 2025

⌛ Trying commit dd170e8 with merge 4e27cc3

To cancel the try build, run the command @bors2 try cancel.

rust-bors bot added a commit that referenced this pull request Jul 20, 2025
Don't emit two `assume`s in transmutes when one is a subset of the other

For example, transmuting between `bool` and `Ordering` doesn't need two `assume`s because one range is a superset of the other.

Multiple are still used for things like `char` <-> `NonZero<u32>`, which overlap but where neither fully contains the other.
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 20, 2025
@rust-bors
Copy link

rust-bors bot commented Jul 20, 2025

☀️ Try build successful (CI)
Build commit: 4e27cc3 (4e27cc328172a524edb4dd605053867dc92cddfa, parent: 81af9d45698a19183b8552079cbc7bf893fad1e5)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4e27cc3): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary -2.9%, secondary 4.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.6% [4.6%, 4.6%] 1
Improvements ✅
(primary)
-2.9% [-3.1%, -2.7%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.9% [-3.1%, -2.7%] 2

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 465.3s -> 465.355s (0.01%)
Artifact size: 374.58 MiB -> 374.59 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 20, 2025
Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

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

r=me

I haven't looked at the test annotations in detail and don't feel 100% comfortable approving these. The code changes make sense the tests seem about right from what I can tell 😅 😁

@scottmcm
Copy link
Member Author

@dianqk Perhaps you could double-check that the test updates here seem reasonable to you?

(This PR is not urgent; don't feel pressured to get to it promptly.)

@dianqk dianqk self-assigned this Jul 22, 2025
@bors
Copy link
Collaborator

bors commented Jul 22, 2025

☔ The latest upstream changes (presumably #144249) made this pull request unmergeable. Please resolve the merge conflicts.

Copy link
Member

@dianqk dianqk left a comment

Choose a reason for hiding this comment

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

r=me also after a nit.

(This PR is not urgent; don't feel pressured to get to it promptly.)

Never mind, I never felt that. I was just giving an estimated time.

For example, transmuting between `bool` and `Ordering` doesn't need two `assume`s because one range is a superset of the other.

Multiple are still used for things like `char` <-> `NonZero<u32>`, which overlap but where neither fully contains the other.
@scottmcm
Copy link
Member Author

@bors r=lcnr,dianqk rollup=maybe (no perf changes in the report, so don't think it needs the separate run)

@bors
Copy link
Collaborator

bors commented Jul 23, 2025

📌 Commit a93a9aa has been approved by lcnr,dianqk

It is now in the queue for this repository.

@bors bors 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 Jul 23, 2025
fmease added a commit to fmease/rust that referenced this pull request Jul 24, 2025
Don't emit two `assume`s in transmutes when one is a subset of the other

For example, transmuting between `bool` and `Ordering` doesn't need two `assume`s because one range is a superset of the other.

Multiple are still used for things like `char` <-> `NonZero<u32>`, which overlap but where neither fully contains the other.
bors added a commit that referenced this pull request Jul 24, 2025
Rollup of 16 pull requests

Successful merges:

 - #142569 (Suggest clone in user-write-code instead of inside macro)
 - #143401 (tests: Don't check for self-printed output in std-backtrace.rs test)
 - #143424 (clippy fix: rely on autoderef)
 - #143970 (Update core::mem::copy documentation)
 - #143979 (Test fixes for Arm64EC Windows)
 - #144160 (tests: debuginfo: Work around or disable broken tests on powerpc)
 - #144200 (Tweak output for non-`Clone` values moved into closures)
 - #144209 (Don't emit two `assume`s in transmutes when one is a subset of the other)
 - #144225 (Don't special-case llvm.* as nounwind)
 - #144314 (Hint that choose_pivot returns index in bounds)
 - #144316 (bootstrap: Move musl-root fallback out of sanity check)
 - #144364 (Update `dlmalloc` dependency of libstd)
 - #144368 (resolve: Remove `Scope::CrateRoot`)
 - #144373 (remove deprecated Error::description in impls)
 - #144390 (Remove dead code and extend test coverage and diagnostics around it)
 - #144392 (rustc_public: Remove movability from `RigidTy/AggregateKind::Coroutine`)

r? `@ghost`
`@rustbot` modify labels: rollup
fmease added a commit to fmease/rust that referenced this pull request Jul 25, 2025
Don't emit two `assume`s in transmutes when one is a subset of the other

For example, transmuting between `bool` and `Ordering` doesn't need two `assume`s because one range is a superset of the other.

Multiple are still used for things like `char` <-> `NonZero<u32>`, which overlap but where neither fully contains the other.
bors added a commit that referenced this pull request Jul 25, 2025
Rollup of 17 pull requests

Successful merges:

 - #142569 (Suggest clone in user-write-code instead of inside macro)
 - #143401 (tests: Don't check for self-printed output in std-backtrace.rs test)
 - #143424 (clippy fix: rely on autoderef)
 - #143970 (Update core::mem::copy documentation)
 - #143979 (Test fixes for Arm64EC Windows)
 - #144160 (tests: debuginfo: Work around or disable broken tests on powerpc)
 - #144200 (Tweak output for non-`Clone` values moved into closures)
 - #144209 (Don't emit two `assume`s in transmutes when one is a subset of the other)
 - #144225 (Don't special-case llvm.* as nounwind)
 - #144314 (Hint that choose_pivot returns index in bounds)
 - #144316 (bootstrap: Move musl-root fallback out of sanity check)
 - #144340 (UI test suite clarity changes: Rename `tests/ui/SUMMARY.md` and update rustc dev guide on `error-pattern`)
 - #144364 (Update `dlmalloc` dependency of libstd)
 - #144368 (resolve: Remove `Scope::CrateRoot`)
 - #144390 (Remove dead code and extend test coverage and diagnostics around it)
 - #144392 (rustc_public: Remove movability from `RigidTy/AggregateKind::Coroutine`)
 - #144424 (Allow setting `release-blog-post` label with rustbot)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 25, 2025
Don't emit two `assume`s in transmutes when one is a subset of the other

For example, transmuting between `bool` and `Ordering` doesn't need two `assume`s because one range is a superset of the other.

Multiple are still used for things like `char` <-> `NonZero<u32>`, which overlap but where neither fully contains the other.
bors added a commit that referenced this pull request Jul 25, 2025
Rollup of 16 pull requests

Successful merges:

 - #142569 (Suggest clone in user-write-code instead of inside macro)
 - #143401 (tests: Don't check for self-printed output in std-backtrace.rs test)
 - #143424 (clippy fix: rely on autoderef)
 - #143970 (Update core::mem::copy documentation)
 - #143979 (Test fixes for Arm64EC Windows)
 - #144160 (tests: debuginfo: Work around or disable broken tests on powerpc)
 - #144200 (Tweak output for non-`Clone` values moved into closures)
 - #144209 (Don't emit two `assume`s in transmutes when one is a subset of the other)
 - #144314 (Hint that choose_pivot returns index in bounds)
 - #144316 (bootstrap: Move musl-root fallback out of sanity check)
 - #144340 (UI test suite clarity changes: Rename `tests/ui/SUMMARY.md` and update rustc dev guide on `error-pattern`)
 - #144364 (Update `dlmalloc` dependency of libstd)
 - #144368 (resolve: Remove `Scope::CrateRoot`)
 - #144390 (Remove dead code and extend test coverage and diagnostics around it)
 - #144392 (rustc_public: Remove movability from `RigidTy/AggregateKind::Coroutine`)
 - #144424 (Allow setting `release-blog-post` label with rustbot)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jul 25, 2025
Rollup of 12 pull requests

Successful merges:

 - #142569 (Suggest clone in user-write-code instead of inside macro)
 - #143401 (tests: Don't check for self-printed output in std-backtrace.rs test)
 - #143424 (clippy fix: rely on autoderef)
 - #143970 (Update core::mem::copy documentation)
 - #143979 (Test fixes for Arm64EC Windows)
 - #144200 (Tweak output for non-`Clone` values moved into closures)
 - #144209 (Don't emit two `assume`s in transmutes when one is a subset of the other)
 - #144314 (Hint that choose_pivot returns index in bounds)
 - #144340 (UI test suite clarity changes: Rename `tests/ui/SUMMARY.md` and update rustc dev guide on `error-pattern`)
 - #144368 (resolve: Remove `Scope::CrateRoot`)
 - #144390 (Remove dead code and extend test coverage and diagnostics around it)
 - #144392 (rustc_public: Remove movability from `RigidTy/AggregateKind::Coroutine`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f414e7a into rust-lang:master Jul 25, 2025
11 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 25, 2025
rust-timer added a commit that referenced this pull request Jul 25, 2025
Rollup merge of #144209 - scottmcm:assume_less, r=lcnr,dianqk

Don't emit two `assume`s in transmutes when one is a subset of the other

For example, transmuting between `bool` and `Ordering` doesn't need two `assume`s because one range is a superset of the other.

Multiple are still used for things like `char` <-> `NonZero<u32>`, which overlap but where neither fully contains the other.
@scottmcm scottmcm deleted the assume_less branch July 25, 2025 16:22
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Jul 28, 2025
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#142569 (Suggest clone in user-write-code instead of inside macro)
 - rust-lang/rust#143401 (tests: Don't check for self-printed output in std-backtrace.rs test)
 - rust-lang/rust#143424 (clippy fix: rely on autoderef)
 - rust-lang/rust#143970 (Update core::mem::copy documentation)
 - rust-lang/rust#143979 (Test fixes for Arm64EC Windows)
 - rust-lang/rust#144200 (Tweak output for non-`Clone` values moved into closures)
 - rust-lang/rust#144209 (Don't emit two `assume`s in transmutes when one is a subset of the other)
 - rust-lang/rust#144314 (Hint that choose_pivot returns index in bounds)
 - rust-lang/rust#144340 (UI test suite clarity changes: Rename `tests/ui/SUMMARY.md` and update rustc dev guide on `error-pattern`)
 - rust-lang/rust#144368 (resolve: Remove `Scope::CrateRoot`)
 - rust-lang/rust#144390 (Remove dead code and extend test coverage and diagnostics around it)
 - rust-lang/rust#144392 (rustc_public: Remove movability from `RigidTy/AggregateKind::Coroutine`)

r? `@ghost`
`@rustbot` modify labels: rollup
github-actions bot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Jul 28, 2025
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#142569 (Suggest clone in user-write-code instead of inside macro)
 - rust-lang/rust#143401 (tests: Don't check for self-printed output in std-backtrace.rs test)
 - rust-lang/rust#143424 (clippy fix: rely on autoderef)
 - rust-lang/rust#143970 (Update core::mem::copy documentation)
 - rust-lang/rust#143979 (Test fixes for Arm64EC Windows)
 - rust-lang/rust#144200 (Tweak output for non-`Clone` values moved into closures)
 - rust-lang/rust#144209 (Don't emit two `assume`s in transmutes when one is a subset of the other)
 - rust-lang/rust#144314 (Hint that choose_pivot returns index in bounds)
 - rust-lang/rust#144340 (UI test suite clarity changes: Rename `tests/ui/SUMMARY.md` and update rustc dev guide on `error-pattern`)
 - rust-lang/rust#144368 (resolve: Remove `Scope::CrateRoot`)
 - rust-lang/rust#144390 (Remove dead code and extend test coverage and diagnostics around it)
 - rust-lang/rust#144392 (rustc_public: Remove movability from `RigidTy/AggregateKind::Coroutine`)

r? `@ghost`
`@rustbot` modify labels: rollup
rust-cloud-vms bot pushed a commit to makai410/rustc_public that referenced this pull request Aug 16, 2025
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#142569 (Suggest clone in user-write-code instead of inside macro)
 - rust-lang/rust#143401 (tests: Don't check for self-printed output in std-backtrace.rs test)
 - rust-lang/rust#143424 (clippy fix: rely on autoderef)
 - rust-lang/rust#143970 (Update core::mem::copy documentation)
 - rust-lang/rust#143979 (Test fixes for Arm64EC Windows)
 - rust-lang/rust#144200 (Tweak output for non-`Clone` values moved into closures)
 - rust-lang/rust#144209 (Don't emit two `assume`s in transmutes when one is a subset of the other)
 - rust-lang/rust#144314 (Hint that choose_pivot returns index in bounds)
 - rust-lang/rust#144340 (UI test suite clarity changes: Rename `tests/ui/SUMMARY.md` and update rustc dev guide on `error-pattern`)
 - rust-lang/rust#144368 (resolve: Remove `Scope::CrateRoot`)
 - rust-lang/rust#144390 (Remove dead code and extend test coverage and diagnostics around it)
 - rust-lang/rust#144392 (rustc_public: Remove movability from `RigidTy/AggregateKind::Coroutine`)

r? `@ghost`
`@rustbot` modify labels: rollup
rust-cloud-vms bot pushed a commit to makai410/rustc_public that referenced this pull request Aug 20, 2025
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#142569 (Suggest clone in user-write-code instead of inside macro)
 - rust-lang/rust#143401 (tests: Don't check for self-printed output in std-backtrace.rs test)
 - rust-lang/rust#143424 (clippy fix: rely on autoderef)
 - rust-lang/rust#143970 (Update core::mem::copy documentation)
 - rust-lang/rust#143979 (Test fixes for Arm64EC Windows)
 - rust-lang/rust#144200 (Tweak output for non-`Clone` values moved into closures)
 - rust-lang/rust#144209 (Don't emit two `assume`s in transmutes when one is a subset of the other)
 - rust-lang/rust#144314 (Hint that choose_pivot returns index in bounds)
 - rust-lang/rust#144340 (UI test suite clarity changes: Rename `tests/ui/SUMMARY.md` and update rustc dev guide on `error-pattern`)
 - rust-lang/rust#144368 (resolve: Remove `Scope::CrateRoot`)
 - rust-lang/rust#144390 (Remove dead code and extend test coverage and diagnostics around it)
 - rust-lang/rust#144392 (rustc_public: Remove movability from `RigidTy/AggregateKind::Coroutine`)

r? `@ghost`
`@rustbot` modify labels: rollup
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.

7 participants