Comments (2)
This is not a bug. The error is that you cannot move out from an exclusive reference (&mut T
). The reference points to a Structer
that is not owned by this function. When the function returns or unwinds, there must be a valid Structer
still there.
Your example could be written without needing to move the value; just use .iter_mut()
to modify each string in-place. Alternatively, if you need the values for some reason, you could use std::mem::take(&mut self.stringy)
to temporarily replace it with an empty Vec
. Lastly, if you really need to temporarily move something out and the above solutions are insufficient, you could consider using a crate like https://docs.rs/replace_with/latest/replace_with/
For help with compiler errors in the future, you should ask in URLO/Discord
@rustbot label -C-bug
from rust.
@rustbot label -needs-triage +C-discussion
from rust.
Related Issues (20)
- ICE: type_alias_impl_trait: `panic in a destructor during cleanup` HOT 2
- Decide on name for `derive(SmartPtr)` HOT 2
- Misleading help suggests `Sync` bound when shareable reference is passed across or into await
- Tracking Issue for struct_target_features (RFC 3525)
- ICE: `write_immediate_to_mplace: invalid Scalar layout: TyAndLayout` HOT 1
- ICE `assertion failed: prev.is_none()` with nightly `13a52890d 2024-08-14` HOT 10
- `--crate-type=rlib` + `-Cdebuginfo=2` + `-Zremap-cwd-prefix=.` is not reproducible on Windows
- Could RUST support CFI on stabilized builds? HOT 4
- Run merged doc-tests by default in the same process and add opt-out attribute HOT 7
- ICE: unhandled type `unhandled type: &'{erased} mut Closure` HOT 1
- suboptimal llvm-ir due to missing noalias annotations after mir inlining HOT 2
- Inefficient Match Statement Optimization for Unit-Only Enums with Fixed Offsets HOT 3
- Significantly worse codegen for SIMD shuffles after Rust 1.73.0 HOT 3
- Nit: E0599 help suggests removing arguments instead of argument list HOT 3
- `std::thread::sleep` does not document its interaction with signals HOT 2
- Type checking bug. Trait appears to use inferred type from bounds rather than specified associated type HOT 2
- Is anyone running our gdb-based Android debuginfo tests? HOT 3
- Missed optimization in if with constant branches HOT 3
- ICE: `None` in compiler/rustc_middle/src/ty/sty.rs HOT 2
- `./configure --help` should print `--disable-docs` instead of `--enable-docs`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust.