Skip to content

const checks for lifetime-extended temporaries: avoid 'top-level scope' terminology #143092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 28, 2025

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Jun 27, 2025

This error recently got changed in #140942 to use the terminology of "top-level scope", but after further discussion in rust-lang/reference#1865 it seems the reference will not be using that terminology after all. So let's also remove it from the compiler again, and let's focus on what actually happens with these temporaries: their lifetime is extended until the end of the program.

r? @oli-obk @traviscross

@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 Jun 27, 2025
@RalfJung RalfJung force-pushed the const-check-lifetime-ext branch from 76cc152 to 2de51b4 Compare June 27, 2025 14:27
@oli-obk
Copy link
Contributor

oli-obk commented Jun 27, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jun 27, 2025

📌 Commit 2de51b4 has been approved by oli-obk

It is now in the queue for this repository.

@bors bors 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 Jun 27, 2025
@RalfJung
Copy link
Member Author

@bors r-
I'm still playing around with more extended notes.^^

@bors bors 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 Jun 27, 2025
@RalfJung RalfJung force-pushed the const-check-lifetime-ext branch from 2de51b4 to b9b4b6f Compare June 27, 2025 14:38
@rustbot
Copy link
Collaborator

rustbot commented Jun 27, 2025

Some changes occurred to constck

cc @fee1-dead

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

@RalfJung
Copy link
Member Author

How about this?

@oli-obk
Copy link
Contributor

oli-obk commented Jun 27, 2025

Ah yea moving the teach note to a regular note works. This is a fairly rare diagnostic, so being more explicit immediately is good

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jun 27, 2025

📌 Commit b9b4b6f has been approved by oli-obk

It is now in the queue for this repository.

@bors bors 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 27, 2025
@rust-log-analyzer

This comment has been minimized.

@oli-obk
Copy link
Contributor

oli-obk commented Jun 27, 2025

@bors r-

@bors bors 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 Jun 27, 2025
@RalfJung RalfJung force-pushed the const-check-lifetime-ext branch from b9b4b6f to d0fa026 Compare June 27, 2025 15:03
@RalfJung
Copy link
Member Author

@bors r=oli-obk

@bors
Copy link
Collaborator

bors commented Jun 27, 2025

📌 Commit d0fa026 has been approved by oli-obk

It is now in the queue for this repository.

@bors bors 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 27, 2025
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Jun 27, 2025
… r=oli-obk

const checks for lifetime-extended temporaries: avoid 'top-level scope' terminology

This error recently got changed in rust-lang#140942 to use the terminology of "top-level scope", but after further discussion in rust-lang/reference#1865 it seems the reference will not be using that terminology after all. So let's also remove it from the compiler again, and let's focus on what actually happens with these temporaries: their lifetime is extended until the end of the program.

r? `@oli-obk` `@traviscross`
bors added a commit that referenced this pull request Jun 27, 2025
…rors

Rollup of 8 pull requests

Successful merges:

 - #139858 (New const traits syntax)
 - #140809 (Reduce special casing for the panic runtime)
 - #142963 (Skip unnecessary components in x64 try builds)
 - #142974 (Update stage0 to 1.89.0-beta.1)
 - #142987 (rustdoc: show attributes on enum variants)
 - #143002 (tests: Require `run-fail` ui tests to have an exit code (`SIGABRT` not ok))
 - #143092 (const checks for lifetime-extended temporaries: avoid 'top-level scope' terminology)
 - #143096 (tag_for_variant: properly pass TypingEnv)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jun 27, 2025
Rollup of 9 pull requests

Successful merges:

 - #139858 (New const traits syntax)
 - #140809 (Reduce special casing for the panic runtime)
 - #142730 (suggest declaring modules when file found but module not defined)
 - #142806 (Normalize before computing ConstArgHasType goal in new solver)
 - #143046 (const validation: properly ignore zero-sized UnsafeCell)
 - #143092 (const checks for lifetime-extended temporaries: avoid 'top-level scope' terminology)
 - #143096 (tag_for_variant: properly pass TypingEnv)
 - #143104 (hir_analysis: prohibit `dyn PointeeSized`)
 - #143106 (gce: don't ICE on non-local const)

Failed merges:

 - #143036 (Remove support for `dyn*` from the compiler)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 088f6ab into rust-lang:master Jun 28, 2025
10 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jun 28, 2025
rust-timer added a commit that referenced this pull request Jun 28, 2025
Rollup merge of #143092 - RalfJung:const-check-lifetime-ext, r=oli-obk

const checks for lifetime-extended temporaries: avoid 'top-level scope' terminology

This error recently got changed in #140942 to use the terminology of "top-level scope", but after further discussion in rust-lang/reference#1865 it seems the reference will not be using that terminology after all. So let's also remove it from the compiler again, and let's focus on what actually happens with these temporaries: their lifetime is extended until the end of the program.

r? ``@oli-obk`` ``@traviscross``
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jun 28, 2025
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#139858 (New const traits syntax)
 - rust-lang/rust#140809 (Reduce special casing for the panic runtime)
 - rust-lang/rust#142730 (suggest declaring modules when file found but module not defined)
 - rust-lang/rust#142806 (Normalize before computing ConstArgHasType goal in new solver)
 - rust-lang/rust#143046 (const validation: properly ignore zero-sized UnsafeCell)
 - rust-lang/rust#143092 (const checks for lifetime-extended temporaries: avoid 'top-level scope' terminology)
 - rust-lang/rust#143096 (tag_for_variant: properly pass TypingEnv)
 - rust-lang/rust#143104 (hir_analysis: prohibit `dyn PointeeSized`)
 - rust-lang/rust#143106 (gce: don't ICE on non-local const)

Failed merges:

 - rust-lang/rust#143036 (Remove support for `dyn*` from the compiler)

r? `@ghost`
`@rustbot` modify labels: rollup
@RalfJung RalfJung deleted the const-check-lifetime-ext branch June 28, 2025 07:24
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