Skip to content

mGCA: Support directly represented negated literals#152139

Open
khyperia wants to merge 1 commit intorust-lang:mainfrom
khyperia:mgca-negative-literals
Open

mGCA: Support directly represented negated literals#152139
khyperia wants to merge 1 commit intorust-lang:mainfrom
khyperia:mgca-negative-literals

Conversation

@khyperia
Copy link
Contributor

@khyperia khyperia commented Feb 4, 2026

fixes #152123

PatExprKind already awkwardly tacks on a negated: bool for the same purpose:

Lit {
lit: Lit,
// FIXME: move this into `Lit` and handle negated literal expressions
// once instead of matching on unop neg expressions everywhere.
negated: bool,
},

perhaps one day we should indeed do that FIXME...

r? @BoxyUwU

@rustbot
Copy link
Collaborator

rustbot commented Feb 4, 2026

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

HIR ty lowering was modified

cc @fmease

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Feb 4, 2026
@BoxyUwU
Copy link
Member

BoxyUwU commented Feb 5, 2026

can you add tests for "nonsensical" negated literals, e.g. -true { -true } -":3" { ":3" }, ah and I guess also -1_usize and { -1_usize }.

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

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mGCA: Support directly represented negated literals

3 participants