Make Lazy*<T> types in rustc_metadata not care about lifetimes until decode#97376
Make Lazy*<T> types in rustc_metadata not care about lifetimes until decode#97376bors merged 1 commit intorust-lang:masterfrom
Lazy*<T> types in rustc_metadata not care about lifetimes until decode#97376Conversation
|
r? @wesleywiser (rust-highfive has picked a reviewer for you, use r? to override) |
| self, Const, FnSig, GeneratorDiagnosticData, GenericPredicates, Predicate, TraitRef, Ty, | ||
| }; | ||
|
|
||
| pub trait ParameterizedOverTcx: 'static { |
There was a problem hiding this comment.
The question: Does this really need to be : 'static? These impls also could be impl<'a> ParameterizedOverTcx for Thing<'a> { type Value<'tcx> = Thing<'tcx>; }, right? Because This is just encoding a higher-kinded lifetime -> type.
There was a problem hiding this comment.
Yeah, there's no good reason why we need Self: 'static. That is, it's not there for correctness or anything, necessarily.
I treat it more like a mnemonic, where the lifetime error you'd get is there to discourage you from constructing Lazy<Something<'not_static>>, since there is no guarantee that the 'not_static lifetime is not related to what you get out of lazy.decode(meta).
|
One question, but r=me |
|
I guess this could use a perf run too. @bors try @rust-timer queue |
|
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
|
⌛ Trying commit d1a9a95 with merge b4f81f3aa398c1b6b271826fc9a5c488fadc565f... |
|
☀️ Try build successful - checks-actions |
|
Queued b4f81f3aa398c1b6b271826fc9a5c488fadc565f with parent 76761db, future comparison URL. |
|
Finished benchmarking commit (b4f81f3aa398c1b6b271826fc9a5c488fadc565f): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Footnotes |
|
@bors r=jackh726 |
|
📌 Commit d1a9a95 has been approved by |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (9fadabc): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
…nkov A few metadata nits Found while reading through the code. The `NOTE` is outdated now after rust-lang#97376.
…nkov A few metadata nits Found while reading through the code. The `NOTE` is outdated now after rust-lang#97376.
This allows us to remove the
'tcxlifetime fromCrateRoot. This is necessary because of #97287, which makes the'tcxlifetime onTyinvariant instead of covariant, so this hack no longer holds under that PR.Introduces a trait called
ParameterizedOverTcxwhich has a generic associated type that allows a type to be parameterized over that lifetime. This means we can decode, for example,Lazy<Ty<'static>>into anyTy<'tcx>depending on theTyCtxt<'tcx>we pass into the decode function.