Stream: t-compiler/rust-analyzer

Topic: don't tell anybody about this


matklad (Jan 19 2021 at 11:31, on Zulip):

I've just realize that it is extremely easy to use goto definition to open a file in the ~/.cargo directory and edit it. I've just use that to make one private field in the dependency public, and after rm -rf ./target it just worked!

Kirill Bulatov (Jan 19 2021 at 11:33, on Zulip):

Doing that every time to dbg! things in the third-party libraries :smile:

bjorn3 (Jan 19 2021 at 11:34, on Zulip):

It is easy to forget to revert it again.

bjorn3 (Jan 19 2021 at 11:34, on Zulip):

I think cargo should just mark everything read-only.

matklad (Jan 19 2021 at 11:35, on Zulip):

but how would I expose a private field to circumvent a safety invariant?

bjorn3 (Jan 19 2021 at 11:36, on Zulip):

:explosion:

Laurențiu (Jan 19 2021 at 11:37, on Zulip):

Beware https://github.com/rust-analyzer/rust-analyzer/issues/5198

Lukas Wirth (Jan 19 2021 at 11:57, on Zulip):

also https://github.com/rust-analyzer/rust-analyzer/issues/5847

Daniel Silverstone (Jan 19 2021 at 12:59, on Zulip):

I've got an open bug in rustup that this is possible in libstd, I can't imagine the cargo folk aren't also aware of needing to close this :confused:

Jeremy Kolb (Jan 19 2021 at 15:06, on Zulip):

Yeah this is a problem :( I filed this for LSP awhile ago https://github.com/microsoft/language-server-protocol/issues/1150

Jonas Schievink [he/him] (Jan 19 2021 at 15:41, on Zulip):

On the r-a side, we could at least refuse to rename definitions inside library sources

Jeremy Kolb (Jan 20 2021 at 16:52, on Zulip):

I just ran into this and accidentally edited the cargo crate in my cache.

Last update: Jul 26 2021 at 14:15UTC