-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Move things to rustc_type_ir
#97287
Move things to rustc_type_ir
#97287
Conversation
This comment has been minimized.
This comment has been minimized.
f76f458
to
034b09e
Compare
034b09e
to
8a55b3e
Compare
This comment has been minimized.
This comment has been minimized.
…idtwco Lifetime variance fixes for rustc rust-lang#97287 migrates rustc to a `Ty` type that is invariant over its lifetime `'tcx`, so I need to fix a bunch of places that assume that `Ty<'a>` and `Ty<'b>` can be unified by shortening both to some common lifetime. This is doable, since many lifetimes are already `'tcx`, so all this PR does is be a bit more explicit that elided lifetimes are actually `'tcx`. Split out from rust-lang#97287 so the compiler team can review independently.
…rk-Simulacrum Lifetime variance fixes for clippy rust-lang#97287 migrates rustc to a `Ty` type that is invariant over its lifetime `'tcx`, so I need to fix a bunch of places that assume that `Ty<'a>` and `Ty<'b>` can be shortened to some common lifetime. This is doable, since everything is already `'tcx`, so all this PR does is be a bit more explicit that elided lifetimes are actually `'tcx`. Split out from rust-lang#97287 so the clippy team can review independently.
☔ The latest upstream changes (presumably #97342) made this pull request unmergeable. Please resolve the merge conflicts. |
…ylan-DPC Lifetime variance fixes for rustdoc rust-lang#97287 migrates rustc to a `Ty` type that is invariant over its lifetime `'tcx`, so I need to fix a bunch of places that assume that `Ty<'a>` and `Ty<'b>` can be unified by shortening both to some common lifetime. This is doable, since everything is already `'tcx`, so all this PR does is be a bit more explicit that elided lifetimes are actually `'tcx`. Split out from rust-lang#97287 so the rustdoc team can review independently.
…ylan-DPC Lifetime variance fixes for rustdoc rust-lang#97287 migrates rustc to a `Ty` type that is invariant over its lifetime `'tcx`, so I need to fix a bunch of places that assume that `Ty<'a>` and `Ty<'b>` can be unified by shortening both to some common lifetime. This is doable, since everything is already `'tcx`, so all this PR does is be a bit more explicit that elided lifetimes are actually `'tcx`. Split out from rust-lang#97287 so the rustdoc team can review independently.
…pes-in-a-trenchcoat, r=cjgillot Split out the various responsibilities of `rustc_metadata::Lazy` `Lazy<T>` actually acts like three different types -- a pointer in the crate metadata to a single value, a pointer to a list/array of values, and an indexable pointer of a list of values (a table). We currently overload `Lazy<T>` to work differently than `Lazy<[T]>` and the same for `Lazy<Table<I, T>>`. All is well with some helper adapter traits such as [`LazyQueryDecodable`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_metadata/rmeta/decoder/trait.LazyQueryDecodable.html) and [`EncodeContentsForLazy`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_metadata/rmeta/encoder/trait.EncodeContentsForLazy.html). Well, changes in rust-lang#97287 that make `Lazy` work with the now invariant lifetime `'tcx` make these adapters fall apart because of coherence reasons. So we split out these three types and rework some of the helper traits so it's both 1. more clear to understand, and 2. compatible with the changes later in that PR. Split out from rust-lang#97287 so it can be reviewed separately, since this PR stands on its own.
…ylan-DPC Lifetime variance fixes for rustdoc rust-lang#97287 migrates rustc to a `Ty` type that is invariant over its lifetime `'tcx`, so I need to fix a bunch of places that assume that `Ty<'a>` and `Ty<'b>` can be unified by shortening both to some common lifetime. This is doable, since everything is already `'tcx`, so all this PR does is be a bit more explicit that elided lifetimes are actually `'tcx`. Split out from rust-lang#97287 so the rustdoc team can review independently.
8a55b3e
to
97f2cf5
Compare
This comment has been minimized.
This comment has been minimized.
I think the "Make Lazy not care about lifetimes until decode" commit can also be split out into a separate PR? |
3e238c6
to
4638915
Compare
type Mutability = hir::Mutability; | ||
type Movability = hir::Movability; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably check if we can start moving some of these types into rustc_type_ir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can. When I originally wrote this, the idea was to be as small as possible by trading extra associated types.
@bors r=jackh726,oli-obk |
📌 Commit 4638915 has been approved by |
☀️ Test successful - checks-actions |
Tested on commit rust-lang/rust@0f06824. Direct link to PR: <rust-lang/rust#97287> 💔 miri on windows: test-fail → build-fail (cc @eddyb @oli-obk @RalfJung). 💔 miri on linux: test-fail → build-fail (cc @eddyb @oli-obk @RalfJung).
Finished benchmarking commit (0f06824): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Footnotes |
Yay |
@rustbot label: +perf-regression-triaged |
…rk-Simulacrum Lifetime variance fixes for clippy rust-lang#97287 migrates rustc to a `Ty` type that is invariant over its lifetime `'tcx`, so I need to fix a bunch of places that assume that `Ty<'a>` and `Ty<'b>` can be shortened to some common lifetime. This is doable, since everything is already `'tcx`, so all this PR does is be a bit more explicit that elided lifetimes are actually `'tcx`. Split out from rust-lang#97287 so the clippy team can review independently.
Signed-off-by: Yuki Okushi <[email protected]>
Signed-off-by: Yuki Okushi <[email protected]>
Finishes some work proposed in rust-lang/compiler-team#341.
r? @ghost