-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Description
I am creating a wrapper for the File type and came across an issue that I thought was odd.
Both of these methods take an immutable reference (&self
) to the File instead of a mutable reference (&mut self
).
I'm not so much concerned about memory safety per se, as I assume that the operating system guarantees that operaions are memory safe, it is just that this is extremely unexpected. If I pass a function an immutable reference to a File
, I wouldn't expect it to be able to truncate the file!
Obviously this is a breaking change so probably can't be changed -- however, I was thinking we could at least add docs explaining why the reference is immutable.
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.