Skip to content
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 string interning to util #8419

Merged
merged 2 commits into from
Jun 30, 2020
Merged

Move string interning to util #8419

merged 2 commits into from
Jun 30, 2020

Conversation

est31
Copy link
Member

@est31 est31 commented Jun 26, 2020

Code that handles string interning is rather an util functionality than
a core functionality.

Code that handles string interning is rather an util functionality than
a core functionality.
The leak function is never used outside of interning.rs
and I don't think it makes any sense to use it.
@rust-highfive
Copy link

r? @ehuss

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 26, 2020
@Eh2406
Copy link
Contributor

Eh2406 commented Jun 26, 2020

I have been seeing advice lately not to name a mod "misc" because "in a year it will be completely unclear what belongs in it". Thank you @est31 for starting to talk about this long standing teck det, What belongs in "util"? The status quo is not really ok. I know Eric had opinions, so I am glad he is the reviewer.

My prior belief is that we should be reorganizing to not have a "util" but to have things is mods that describe what they do. On the other hand if this helps untangle our mods, "don't let the perfect be the enemy of the good", we can move interning if it is helpful.

@est31
Copy link
Member Author

est31 commented Jun 26, 2020

IMO interning fits to be next to mods like canonical_url or queue... basically self contained generic helper code not containing any logic that's too specific to cargo, but still too tailored to cargo's needs/too small/too undocumented to become its own indepedent crates.io crate.

Of course there's plenty of stuff in util that contains very cargo-specific stuff, like the config and toml modules. IMO those two should be put into a separate newly created module called defs which would collect most pure datatypes that just need serde and nothing much else. The command prelude can be put into the bin directory. And suddenly most dependencies of util on the core module are gone, and util can be put into its own crate. The defs module then can be crate-ified as well, and depend on util. The main cargo crate would depend on all of them and be a bit leaner than it's now. I need to experiment how this affects compile time. Hopefully serde-using stuff being moved out has a large effect.

@ehuss
Copy link
Contributor

ehuss commented Jun 29, 2020

One thing I would eventually like to reach is to remove the cyclical dependency with cargo-test-support. I sorta envisioned something like a cargo-util crate that would contain whatever is necessary to make that happen. This helps move towards that direction, since InternedString is used all over.

I'm 👍 for doing this. @alexcrichton / @Eh2406 are you OK with this?

@Eh2406
Copy link
Contributor

Eh2406 commented Jun 29, 2020

I am convinced by @est31's vition for how to get untangled. So I am 👍.

@alexcrichton
Copy link
Member

I don't have too many preferences about Cargo's internal organization, we've never really put too much effort into organizing it any particular way. I don't really think it's worth it to try to micro-optimize one way or another because we don't really have an overall vision for the crate.

I'm not really against nor in favor of this, it's just moving code around which is fine by me so long as we don't have a preexisting style saying the code shouldn't be moved (and we don't have a such a preexisting style in this case)

@ehuss
Copy link
Contributor

ehuss commented Jun 29, 2020

OK, I think this is fine for now. I think it may help with creating separate crates in the future.

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 29, 2020

📌 Commit 836e91c has been approved by ehuss

@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 29, 2020
@bors
Copy link
Collaborator

bors commented Jun 29, 2020

⌛ Testing commit 836e91c with merge f12d72e...

@bors
Copy link
Collaborator

bors commented Jun 30, 2020

☀️ Test successful - checks-azure
Approved by: ehuss
Pushing f12d72e to master...

@bors bors merged commit f12d72e into rust-lang:master Jun 30, 2020
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 2, 2020
Update cargo

## cargo
10 commits in c26576f9adddd254b3dd63aecba176434290a9f6..305eaf0dc5f5a38d6e8041319c2da95b71cf6a4a
2020-06-23 16:21:21 +0000 to 2020-06-30 14:16:08 +0000
- Update core-foundation requirement from 0.7.0 to 0.9.0 (rust-lang/cargo#8432)
- Parse `# env-dep` directives in dep-info files (rust-lang/cargo#8421)
- Move string interning to util (rust-lang/cargo#8419)
- Expose built cdylib artifacts in the Compilation structure (rust-lang/cargo#8418)
- Remove unused serde_derive dependency from the crates.io crate (rust-lang/cargo#8416)
- Remove unused remove_dir_all dependency (rust-lang/cargo#8412)
- Improve git error messages a bit (rust-lang/cargo#8409)
- Improve the description of Config.home_path (rust-lang/cargo#8408)
- Improve support for non-`master` main branches (rust-lang/cargo#8364)
- Document that OUT_DIR in JSON messages is an absolute path (rust-lang/cargo#8403)

## rls
2020-06-19 15:36:00 +0200 to 2020-06-30 23:34:52 +0200
- Update cargo (rust-lang/rls#1686)
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 3, 2020
Update cargo, rls

## cargo
14 commits in c26576f9adddd254b3dd63aecba176434290a9f6..fede83ccf973457de319ba6fa0e36ead454d2e20
2020-06-23 16:21:21 +0000 to 2020-07-02 21:51:34 +0000
- Fix overflow error on 32-bit. (rust-lang/cargo#8446)
- Exclude the target directory from backups using CACHEDIR.TAG (rust-lang/cargo#8378)
- CONTRIBUTING.md: Link to Zulip rather than Discord (rust-lang/cargo#8436)
- Update built-in help for features (rust-lang/cargo#8433)
- Update core-foundation requirement from 0.7.0 to 0.9.0 (rust-lang/cargo#8432)
- Parse `# env-dep` directives in dep-info files (rust-lang/cargo#8421)
- Move string interning to util (rust-lang/cargo#8419)
- Expose built cdylib artifacts in the Compilation structure (rust-lang/cargo#8418)
- Remove unused serde_derive dependency from the crates.io crate (rust-lang/cargo#8416)
- Remove unused remove_dir_all dependency (rust-lang/cargo#8412)
- Improve git error messages a bit (rust-lang/cargo#8409)
- Improve the description of Config.home_path (rust-lang/cargo#8408)
- Improve support for non-`master` main branches (rust-lang/cargo#8364)
- Document that OUT_DIR in JSON messages is an absolute path (rust-lang/cargo#8403)

## rls
2020-06-19 15:36:00 +0200 to 2020-06-30 23:34:52 +0200
- Update cargo (rust-lang/rls#1686)
@ehuss ehuss added this to the 1.46.0 milestone Feb 6, 2022
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants