Skip to content

add a few new solver normalization tests#156250

Open
lqd wants to merge 4 commits intorust-lang:mainfrom
lqd:normalization-tests
Open

add a few new solver normalization tests#156250
lqd wants to merge 4 commits intorust-lang:mainfrom
lqd:normalization-tests

Conversation

@lqd
Copy link
Copy Markdown
Member

@lqd lqd commented May 6, 2026

As discussed on zulip, this PR adds the handful of new solver revisions and tests from rust-lang/trait-system-refactor-initiative#139. Most cases that issue mentions were already fixed by #140672 in 1.88, and some cases, we expect, by #155767.

The issue about defaulted type parameters applies to both solvers and will be tracked in #156271 instead.

Closes rust-lang/trait-system-refactor-initiative#139.

r? lcnr
I'm not sure where the best place for the tests would be, do you have a better location in mind?

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 6, 2026
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 6, 2026
@rust-log-analyzer

This comment was marked as resolved.

@lqd lqd force-pushed the normalization-tests branch from 0d764c0 to 6a2ec50 Compare May 6, 2026 19:21
Copy link
Copy Markdown
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.

want to add a new "traits/normalize" folder, we already have one with the new solver but seems useful in general

can you change all tests to use #[rustc_no_implicit_bounds] 😅

the fact we have to prove MetaSized here breaks the thing we actually want to test 😅

View changes since this review

@lqd lqd force-pushed the normalization-tests branch from 6a2ec50 to 77456f7 Compare May 7, 2026 09:00
@lqd
Copy link
Copy Markdown
Member Author

lqd commented May 7, 2026

want to add a new "traits/normalize" folder, we already have one with the new solver but seems useful in general

done, I've also moved a handful of traits/ tests to traits/normalize.

can you change all tests to use #[rustc_no_implicit_bounds] 😅

I've done that for the one test where it mattered, do you want it for all tests?

//@ ignore-compare-mode-next-solver (explicit revisions)
//@ [next] compile-flags: -Znext-solver

trait Trait {
Copy link
Copy Markdown
Contributor

@lcnr lcnr May 7, 2026

Choose a reason for hiding this comment

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

can you also add #[rustc_no_implicit_bounds] to all of the other "do we try to normalize aliases tests"?

View changes since the review

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.

alright, I've added it for the tests modified/added/moved in this PR.

@lqd lqd force-pushed the normalization-tests branch from 77456f7 to 130b1d8 Compare May 7, 2026 10:14
//[feature]~^^ ERROR: overflow normalizing the type alias `X2`
//[gated_old,gated_new]~^ ERROR cycle detected when expanding type alias `X1`
//[feature_old]~^^ ERROR: overflow normalizing the type alias `X2`
//[feature_new]~^^^ ERROR: type mismatch resolving `X3 normalizes-to _`
Copy link
Copy Markdown
Member Author

@lqd lqd May 7, 2026

Choose a reason for hiding this comment

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

just a note of the slightly suboptimal diagnostics here compared to the old solver mentioning X1 or X2

View changes since the review

@lcnr
Copy link
Copy Markdown
Contributor

lcnr commented May 7, 2026

@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 7, 2026

📌 Commit 130b1d8 has been approved by lcnr

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 May 7, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 7, 2026
add a few new solver normalization tests

As discussed [on zulip](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/ask.20for.20help/near/593097133), this PR adds the handful of new solver revisions and tests from rust-lang/trait-system-refactor-initiative#139. Most cases that issue mentions were already fixed by rust-lang#140672 in 1.88, and some cases, we expect, by rust-lang#155767.

The issue about defaulted type parameters applies to both solvers and will be tracked in rust-lang#156271 instead.

Closes rust-lang/trait-system-refactor-initiative#139.

r? lcnr
I'm not sure where the best place for the tests would be, do you have a better location in mind?
rust-bors Bot pushed a commit that referenced this pull request May 7, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #146273 (lint ImproperCTypes: refactor linting architecture (part 2))
 - #154025 (Add `keepalive`, `set_keepalive` to `TcpStream` implementations)
 - #156024 (CFI: Fix LTO for `#![no_builtins]` crates with CFI)
 - #156243 (Move CrateInfo computation after codegen_crate)
 - #154846 (Add better default spans for the `Ty` impl of `QueryKey`)
 - #155220 (cg_clif: Don't show verbose run-make cmd output for passing tests)
 - #156204 (Implemented `PathBuf::into_string`)
 - #156245 (Move invocation_temp into OutputFilenames)
 - #156250 (add a few new solver normalization tests)
 - #156265 (Remove unused `ToStableHashKey` impls.)
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.

we never try to normalize unused alias definitions

4 participants