rustc_metadata: Some reorganization of the module structure#66056
rustc_metadata: Some reorganization of the module structure#66056bors merged 6 commits intorust-lang:masterfrom
Conversation
3bbb889 to
cf9cadd
Compare
|
I think I understand what the intent is, but I feel like "schema" stops making sense when it's more than just a bunch of type definitions. I can think of two ways to improve on the naming (neither that great):
I don't have a strong preference for having all the data types in their own module named |
|
☔ The latest upstream changes (presumably #65838) made this pull request unmergeable. Please resolve the merge conflicts. |
cf9cadd to
62862c7
Compare
|
@eddyb |
|
Seems good to me. Leaving the final call to @eddyb |
There was a problem hiding this comment.
Heh I just noticed the name of the method is kind of out of sync with what it's actually returning. No need to change it now though.
|
@bors r+ This is great! 🎉 |
|
📌 Commit 62862c7b33189a3e50c53c4295f13867a09f6bdf has been approved by |
|
☔ The latest upstream changes (presumably #66141) made this pull request unmergeable. Please resolve the merge conflicts. |
62862c7 to
684e4c5
Compare
|
@bors r=eddyb |
|
📌 Commit 684e4c5a9bf067f7926ec58d1e12c9a471b1e281 has been approved by |
Rollup of 5 pull requests Successful merges: - #59789 (Revert two unapproved changes to rustc_typeck.) - #65752 (Use structured suggestions for missing associated items) - #65884 (syntax: ABI-oblivious grammar) - #65974 (A scheme for more macro-matcher friendly pre-expansion gating) - #66017 (Add future incompatibility lint for `array.into_iter()`) Failed merges: - #66056 (rustc_metadata: Some reorganization of the module structure) r? @ghost
|
☔ The latest upstream changes (presumably #66180) made this pull request unmergeable. Please resolve the merge conflicts. |
And change `rmeta.rs` to `rmeta/mod.rs`
684e4c5 to
5eb1cf1
Compare
|
@bors r=eddyb |
|
📌 Commit 5eb1cf1 has been approved by |
rustc_metadata: Some reorganization of the module structure
The new structure of `rustc_metadata` (or rather its parts affected by the refactoring) is
```
├── lib.rs
└── rmeta
├── decoder
│ └── cstore_impl.rs
├── decoder.rs
├── encoder.rs
├── mod.rs
└── table.rs
```
(`schema` is renamed to `rmeta`.)
The code inside `rmeta` is pretty self-contained, so we can now privatize almost everything in this module instead of using `pub(crate)` which was necessary when all these modules accessed their neighbors in the old flat structure.
`encoder` and `decoder` work with structures defined by `rmeta`.
`table` is a part of `rmeta`.
`cstore_impl` actively uses decoder methods and exposes their results through very few public methods (`provide` and `_untracked` methods).
r? @eddyb @spastorino
Rollup of 8 pull requests Successful merges: - #65554 (Enhance the documentation of BufReader for potential data loss) - #65580 (Add `MaybeUninit` methods `uninit_array`, `slice_get_ref`, `slice_get_mut`) - #66049 (consistent handling of missing sysroot spans) - #66056 (rustc_metadata: Some reorganization of the module structure) - #66123 (No more hidden elements) - #66157 (Improve math log documentation examples) - #66165 (Ignore these tests ,since the called commands doesn't exist in VxWorks) - #66190 (rustc_target: inline abi::FloatTy into abi::Primitive.) Failed merges: - #66188 (`MethodSig` -> `FnSig` & Use it in `ItemKind::Fn`) r? @ghost
rustc_metadata: Privatize more things Continuation of rust-lang#66056. The most notable change here is that `CrateMetadata` is moved from `cstore.rs` to `decoder.rs`. Most of uses of `CrateMetadata` fields are in the decoder and uses of `root: CrateRoot` and other fields are so intertwined with each other that it would be hard to move a part of them into `cstore.rs` to privatize `CrateMetadata` fields, so we are going the other way round. `cstore.rs` can probably be dismantled now, but I'll leave this to some other day. Similarly, remaining `CrateMetadata` fields can be privatized by introducing some getter/setter methods, but not today. r? @eddyb
The new structure of
rustc_metadata(or rather its parts affected by the refactoring) is(
schemais renamed tormeta.)The code inside
rmetais pretty self-contained, so we can now privatize almost everything in this module instead of usingpub(crate)which was necessary when all these modules accessed their neighbors in the old flat structure.encoderanddecoderwork with structures defined byrmeta.tableis a part ofrmeta.cstore_implactively uses decoder methods and exposes their results through very few public methods (provideand_untrackedmethods).r? @eddyb @spastorino