Skip to content

view-types: lower view types from HIR - #165565

Open
scrabsha wants to merge 9 commits into
rust-lang:mainfrom
scrabsha:view-types/middle-lowering
Open

scrabsha wants to merge 9 commits into
rust-lang:mainfrom
scrabsha:view-types/middle-lowering

Conversation

@scrabsha

@scrabsha scrabsha commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

part of #155938.

this PR is big but most of the changes come from the second commit and are quite boring. it leaves a whole lot of unimplemented!() in the codebase, but i believe this is ok for a nightly feature that nobody is seriously using. i will fix them later.

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Nov 6, 2026
@scrabsha scrabsha mentioned this pull request Nov 6, 2026
2 of 14 tasks
@scrabsha
scrabsha force-pushed the view-types/middle-lowering branch from 48b4287 to cca7f38 Compare November 6, 2026 21:27
@scrabsha

scrabsha commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

r? oli-obk

@scrabsha
scrabsha marked this pull request as ready for review November 9, 2026 09:49
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 9, 2026
@rustbot

rustbot commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

changes to the core type system

cc @lcnr

Some changes occurred in compiler/rustc_sanitizers

cc @rcvalle

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

HIR ty lowering was modified

cc @fmease

Some changes occurred in exhaustiveness checking

cc @Nadrieril

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

clippy is developed in its own repository. If possible, consider making this change to rust-lang/rust-clippy instead.

cc @rust-lang/clippy

This PR changes rustc_public

cc @oli-obk, @celinval, @ouz-a, @makai410

Some changes occurred in compiler/rustc_codegen_llvm/src/debuginfo

cc @Walnut356

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Nov 9, 2026

@oli-obk oli-obk left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should also add a test showing that view types are actually unsized. nevermind, just saw #165694

View changes since this review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 11, 2026
@rustbot

rustbot commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

after some discussion, we decided we want view types to be `!Sized`, at
least at the beginning. this commit updates the test suite so that view
types are not passed by value anymore.
this commit is quite big because we want to always exhaustively match on
all the `TyKind` variants. none of the `unimplemented!()` is reachable
because we don't *actually* lower view types (yet!).
/!\ the test suite is has not been updated /!\

the `unreachable!()`s added previously are suddenly reached, triggering
literally all the view types test suite to ICE. this is fixed by the next
commit.
@scrabsha
scrabsha force-pushed the view-types/middle-lowering branch from cca7f38 to 3601d42 Compare November 12, 2026 08:56
@rustbot

rustbot commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

rustfmt is developed in its own repository. If possible, consider making this change to rust-lang/rustfmt instead.

cc @rust-lang/rustfmt

@rustbot rustbot added T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. labels Nov 12, 2026
@rustbot

rustbot commented Nov 12, 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.

@scrabsha

Copy link
Copy Markdown
Contributor Author

force-push contains:

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 12, 2026
Comment thread src/librustdoc/clean/types.rs Resolved
@rust-log-analyzer

This comment has been minimized.

@scrabsha
scrabsha force-pushed the view-types/middle-lowering branch from 3601d42 to 8ec4983 Compare November 12, 2026 09:10
@scrabsha
scrabsha requested a review from oli-obk November 12, 2026 09:18
@oli-obk

oli-obk commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@rust-bors

rust-bors Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 8ec4983 has been approved by oli-obk

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 Nov 12, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 12, 2026
…g, r=oli-obk

view-types: lower view types from HIR
rust-bors Bot pushed a commit that referenced this pull request Nov 12, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - #165854 (Explicitly drop job server helper thread)
 - #164077 (replace `TypingEnv::post_analysis()` with `mir::Body::typing_env()`)
 - #165305 (hexagon: pass small aggregates on the stack when registers run out)
 - #165417 (Mention width limit panic in fmt doc)
 - #165565 (view-types: lower view types from HIR)
Comment thread tests/ui/view-types/tuple-structs.rs Resolved
@scrabsha
scrabsha force-pushed the view-types/middle-lowering branch from 8ec4983 to 7080197 Compare November 12, 2026 15:04
@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 12, 2026
@rust-bors

rust-bors Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

⚠️ A new commit 70801970ae81e3513c0f0ce15d3b95e338f2ace8 was pushed.

This pull request was unapproved.

This PR was contained in a rollup (#165866), which was closed.

@scrabsha

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 12, 2026

This branch has not been deployed

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

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-rustdoc-json Area: Rustdoc JSON backend PG-exploit-mitigations Project group: Exploit mitigations 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants