const-eval.const-expr.borrows: mention indirect places by RalfJung · Pull Request #1865 · rust-lang/reference
matthiaskrgr added a commit to matthiaskrgr/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``
rust-timer added a commit to rust-lang/rust that referenced this pull request
Jun 28, 2025Rollup 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, 2025const checks for lifetime-extended temporaries: avoid 'top-level scope' terminology This error recently got changed in rust-lang/rust#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``
Rather than talking about lifetime-extended temporaries in the top-level scope of an initializer, which is maybe a bit ambiguous, let's speak directly to the result of the lifetime extension, which is that these temporaries disallowed for borrows would have their lifetimes extended to the end of the program. Let's also speak about place expressions, rather than places, as that's more precise here. We'll add examples throughout. Thanks to RalfJ for the substance of many of these.
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request
Jul 17, 2025
RalfJung
deleted the
const-expr-borrows-indirect
branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters