Skip to content

Conversation

@dianne
Copy link
Contributor

@dianne dianne commented Jan 17, 2026

Two small cleanups:

  • The oprnd_t variable was previously used both for the type of unary operators' operands and for the type of the operator expression as a whole. I found this confusing, so I've changed it to only be used for the operand type. This also allowed for removing some negations from if conditions.
  • I did a bit of re-styling in the second commit to remove some indentation levels, which also means fewer things have to be spread across multiple lines. This part is more to-taste; I'd be fine dropping it if it doesn't actually help.

`oprnd_t` was used both for the type of the operand of a unary operator
and for the type of the operator expression as a whole. Now it's only
used for the operand's type.
@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 Jan 17, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 17, 2026

r? @davidtwco

rustbot has assigned @davidtwco.
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

@dianne
Copy link
Contributor Author

dianne commented Jan 17, 2026

This PR aims not to change the behavior of check_expr_unop. The way it handles expected types isn't correct currently (#151202), but I'll be trying to address that in a follow-up PR.

@davidtwco
Copy link
Member

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 19, 2026

📌 Commit 91bbb69 has been approved by davidtwco

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 Jan 19, 2026
rust-bors bot pushed a commit that referenced this pull request Jan 19, 2026
…uwer

Rollup of 15 pull requests

Successful merges:

 - #148623 (Ignore `#[doc(hidden)]` items when computing trimmed paths for printing)
 - #150550 (Miscellaneous cleanups to borrowck related code)
 - #150879 (Remove the diagnostic lints)
 - #150895 (rustc_errors: Add (heuristic) Syntax Highlighting for `rustc --explain`)
 - #150987 (remote-test-server: Fix header in batch mode)
 - #151004 (std: implement `sleep_until` on Apple platforms)
 - #151045 (Simplify some literal-value negations with `u128::wrapping_neg`)
 - #151119 (Support pointers in type reflection)
 - #151171 (Do not recover from `Trait()` if generic list is unterminated)
 - #151231 (HIR typeck cleanup: clarify and re-style `check_expr_unop`)
 - #151249 (Parse ident with allowing recovery when trying to diagnose)
 - #151295 (THIR patterns: Use `ty::Value` in more places throughout `const_to_pat`)
 - #151326 (Remove `DiagMessage::Translated` in favour of `DiagMessage::Str`)
 - #151361 (add test for issue 61463)
 - #151371 (Add `S-blocked` to `labels_blocking_approval`)

r? @ghost
@rust-bors rust-bors bot merged commit a139261 into rust-lang:main Jan 20, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Jan 20, 2026
rust-timer added a commit that referenced this pull request Jan 20, 2026
Rollup merge of #151231 - clarify-check-expr-unop, r=davidtwco

HIR typeck cleanup: clarify and re-style `check_expr_unop`

Two small cleanups:
- The `oprnd_t` variable was previously used both for the type of unary operators' operands and for the type of the operator expression as a whole. I found this confusing, so I've changed it to only be used for the operand type. This also allowed for removing some negations from `if` conditions.
- I did a bit of re-styling in the second commit to remove some indentation levels, which also means fewer things have to be spread across multiple lines. This part is more to-taste; I'd be fine dropping it if it doesn't actually help.
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jan 20, 2026
…uwer

Rollup of 15 pull requests

Successful merges:

 - rust-lang/rust#148623 (Ignore `#[doc(hidden)]` items when computing trimmed paths for printing)
 - rust-lang/rust#150550 (Miscellaneous cleanups to borrowck related code)
 - rust-lang/rust#150879 (Remove the diagnostic lints)
 - rust-lang/rust#150895 (rustc_errors: Add (heuristic) Syntax Highlighting for `rustc --explain`)
 - rust-lang/rust#150987 (remote-test-server: Fix header in batch mode)
 - rust-lang/rust#151004 (std: implement `sleep_until` on Apple platforms)
 - rust-lang/rust#151045 (Simplify some literal-value negations with `u128::wrapping_neg`)
 - rust-lang/rust#151119 (Support pointers in type reflection)
 - rust-lang/rust#151171 (Do not recover from `Trait()` if generic list is unterminated)
 - rust-lang/rust#151231 (HIR typeck cleanup: clarify and re-style `check_expr_unop`)
 - rust-lang/rust#151249 (Parse ident with allowing recovery when trying to diagnose)
 - rust-lang/rust#151295 (THIR patterns: Use `ty::Value` in more places throughout `const_to_pat`)
 - rust-lang/rust#151326 (Remove `DiagMessage::Translated` in favour of `DiagMessage::Str`)
 - rust-lang/rust#151361 (add test for issue 61463)
 - rust-lang/rust#151371 (Add `S-blocked` to `labels_blocking_approval`)

r? @ghost
@Kobzol
Copy link
Member

Kobzol commented Jan 20, 2026

@rust-timer build 3155f51

Checking for #151381.

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3155f51): 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 (secondary 4.0%)

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.0% [4.0%, 4.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (secondary -2.2%)

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)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.2% [-2.2%, -2.2%] 1
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 473.058s -> 480.217s (1.51%)
Artifact size: 383.29 MiB -> 383.35 MiB (0.02%)

@dianne dianne deleted the clarify-check-expr-unop branch January 20, 2026 09:16
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.

5 participants