Please set the rust lib source code read only to prevent the code change by accident.
Describe the problem you are trying to solve
I am using vscode with auto save on for development. Then I can navigate to the source code of some types in rust lib. For example ~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs.But the problem is that the core lib code can be modified by accident and saved automatically.
Describe the solution you'd like
The language like golang can save go mod lib files read only in $GOPATH/pkg/mod directory. The vscode will prompt an error when saving the file when the lib code was modified by accident.For example dr-x------ [email protected] in $GOPATH/pkg/mod/github.com/syndtr dirctory.
This is an interesting idea. We're not able to trivially do this though as it would either involve OS-specific magic I'm not aware of; or else would require additional IO operations to set permissions bits on every file during unpack. I'd like to as @rbtcollins 's opinion on how that might impact installation time. If not too badly then we can try it.
The Java world provides this mechanism as the sources of libraries are provided as zip files. The zip file system is naturally read-only.