# Minimizing the rust-src component

**URL:** <https://internals.rust-lang.org/t/minimizing-the-rust-src-component/5117>\
**Category:** Uncategorized\
**Created:** [April 18, 2017, 9:25pm UTC](https://internals.rust-lang.org/t/minimizing-the-rust-src-component/5117 "2017-04-18T21:25:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cuviper](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/cuviper/32/1897_2.png) [@cuviper](https://internals.rust-lang.org/u/cuviper)\
**Post date:** [April 18, 2017, 9:25pm UTC](https://internals.rust-lang.org/t/minimizing-the-rust-src-component/5117/1 "2017-04-18T21:25:47Z")

</div>

I’ve noticed that the `rust-src` component has pretty much the same content as the `rustc-$version-src` tarball for the compiler distribution, just wrapped in a rust-installer script to install to some `rustlib/src` path.

My question is, does it really need to contain **everything**? My impression is that this is mostly meant to aid general Rust development, for racer/rls/etc., so I’d think all you really need are the sources for the standard library - roughly just for the `*.rlib` parts of rust-std. Maybe you could also justify a `rust-internals-src` for the compiler’s additional `librustc_foo` crates. But I really don’t see the need to have stuff like `src/llvm` and `src/test` in here!

I’ve been asked to package rust-src in our Fedora RPMs, and I’d like to do this now that stuff like RLS is picking up steam, but I would like to see it a bit more curated if possible.

---

<div class="post-metadata">

**Author:** ![cuviper](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/cuviper/32/1897_2.png) [@cuviper](https://internals.rust-lang.org/u/cuviper)\
**Post date:** [April 18, 2017, 11:48pm UTC](https://internals.rust-lang.org/t/minimizing-the-rust-src-component/5117/2 "2017-04-18T23:48:35Z")

</div>

> [@cuviper](#):
>
> so I'd think all you really need are the sources for the standard library - roughly just for the \*.rlib parts of rust-std.

Actually, now I see this subset of crates is selected for the rust-analysis component already -- so I guess the logic does exist to know what should be user-facing.

---

<div class="post-metadata">

**Author:** ![brson](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/brson/32/5197_2.png) [@brson](https://internals.rust-lang.org/u/brson)\
**Post date:** [April 19, 2017, 10:58am UTC](https://internals.rust-lang.org/t/minimizing-the-rust-src-component/5117/3 "2017-04-19T10:58:42Z")

</div>

The only purposes I’m aware of for rust-src are related to std, and I would not expect it to be usable for everything the Rust source is used for during development. It may be reasonable to remove some parts.

---

<div class="post-metadata">

**Author:** ![cuviper](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/cuviper/32/1897_2.png) [@cuviper](https://internals.rust-lang.org/u/cuviper)\
**Post date:** [April 19, 2017, 4:56pm UTC](https://internals.rust-lang.org/t/minimizing-the-rust-src-component/5117/4 "2017-04-19T16:56:24Z")

</div>

Thanks @brson - I’ll take your reply and the “likes” as votes in favor, and see if I can make this happen.

---

<div class="post-metadata">

**Author:** ![ordian](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/ordian/32/356_2.png) [@ordian](https://internals.rust-lang.org/u/ordian)\
**Post date:** [May 31, 2017, 4:03pm UTC](https://internals.rust-lang.org/t/minimizing-the-rust-src-component/5117/5 "2017-05-31T16:03:00Z")

</div>

IMHO rust-src component should be minimized for stable, not nightly. For nightly I want e.g. goto definition in libsyntax to work properly with racer or rls.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/system/32/14092_2.png) [@system](https://internals.rust-lang.org/u/system)\
**Post date:** [March 25, 2019, 8:13am UTC](https://internals.rust-lang.org/t/minimizing-the-rust-src-component/5117/6 "2019-03-25T08:13:31Z")

</div>

Closed on March 25, 2019, 8:13am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
