Skip to content

vec::to_mut is probably unsafe #3354

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
brson opened this issue Sep 2, 2012 · 1 comment
Closed

vec::to_mut is probably unsafe #3354

brson opened this issue Sep 2, 2012 · 1 comment
Labels
A-type-system Area: Type system
Milestone

Comments

@brson
Copy link
Contributor

brson commented Sep 2, 2012

It transmutes an immutable vector to a mutable vectors, but immutable vectors can be stored in readonly memory.

@nikomatsakis
Copy link
Contributor

I believe it is safe, as long as it owns the copy of the vector that it transmutes. That is, uses + or - mode, in today's terminology (in a mode-less world, just having the type ~[] at all would imply ownership).

@brson brson closed this as completed Sep 8, 2012
flip1995 pushed a commit to flip1995/rust that referenced this issue Jul 26, 2020
…atthiaskrgr

redundant_closure_call - don't lint when used more than once

Fixes rust-lang#3354.

changelog: fix redundant_closure_call false positive when closure called more than once
RalfJung pushed a commit to RalfJung/rust that referenced this issue Mar 9, 2024
we properly rebuild the sysroot now when MIRI_LIB_SRC contents change

Thanks to RalfJung/rustc-build-sysroot#16
jaisnan added a commit to jaisnan/rust-dev that referenced this issue Jul 29, 2024
This PR updates the feature branch verify-std to 07-16, allowing the
proofs in std lib to be verified by the latest changes added in Kani.

This is a subset of the main branch.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Felipe R. Monteiro <felisous@amazon.com>
Co-authored-by: Adrian Palacios <73246657+adpaco-aws@users.noreply.github.com>
Co-authored-by: Michael Tautschnig <tautschn@amazon.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: tautschnig <1144736+tautschnig@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Celina G. Val <celinval@amazon.com>
Co-authored-by: Matias Scharager <matias.scharager@gmail.com>
Co-authored-by: Matias Scharager <mscharag@amazon.com>
Co-authored-by: Justus Adam <dev@justus.science>
Co-authored-by: Felipe R. Monteiro <rms.felipe@gmail.com>
Co-authored-by: Artem Agvanian <nartagva@amazon.com>
Co-authored-by: Zyad Hassan <88045115+zhassan-aws@users.noreply.github.com>
Co-authored-by: celinval <35149715+celinval@users.noreply.github.com>
Co-authored-by: Felipe R. Monteiro <felisous@amazon.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-type-system Area: Type system
Projects
None yet
Development

No branches or pull requests

2 participants