Skip to content

Make lifting infallible#155987

Open
nnethercote wants to merge 2 commits intorust-lang:mainfrom
nnethercote:infallible-Lifting
Open

Make lifting infallible#155987
nnethercote wants to merge 2 commits intorust-lang:mainfrom
nnethercote:infallible-Lifting

Conversation

@nnethercote
Copy link
Copy Markdown
Contributor

Details in individual commits.

r? @oli-obk

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 30, 2026

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

This PR changes rustc_public

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

@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 Apr 30, 2026
@rust-log-analyzer

This comment has been minimized.

Various places where `lift` just isn't necessary. Either because we're
not within a closure passed to `tls::with`, or because the type being lifted
doesn't have a `'tcx` lifetime.
Every lifting root calls `unwrap`/`expect` on the result, except for
`ImmTy::fmt` but there's no good reason for that exception. Making
lifting infallible is sensible because it should only fail if the wrong
interner is somehow used, which indicates a major bug in rustc rather
than an error condition.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 30, 2026

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.

Copy link
Copy Markdown
Contributor

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

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

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 30, 2026

📌 Commit a762dbf 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 Apr 30, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Apr 30, 2026
…oli-obk

Make lifting infallible

Details in individual commits.

r? @oli-obk
rust-bors Bot pushed a commit that referenced this pull request Apr 30, 2026
Rollup of 6 pull requests

Successful merges:

 - #155853 (Use `_mcount` as the mcount symbol name on RISC-V Linux GNU targets)
 - #155939 (Add feature gate for view_types experiment)
 - #155974 (add `c_variadic_experimental_arch` feature)
 - #155523 (Reorganize `tests/ui/issues/` - 02)
 - #155980 (Move `feature*` methods from `parse` mod to `errors` mod.)
 - #155987 (Make lifting infallible)

Failed merges:

 - #155237 (Disentangle AST crates and error crates)
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.

4 participants