-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking issue for overloaded +=
operators (RFC 953) (feature augmented_assignments)
#28235
Comments
Rather bitrotted PR available here: #23171 |
I'm working on a rebase of that PR |
It appears the implementation was merged in #28345 (but it's still unstable for now). |
Hi. What are the requirements to stabilize this feature? |
+=
operators (RFC 953)+=
operators (RFC 953) (feature augmented_assignments)
🔔 This issue is now entering its cycle final comment period to be stabilization in 1.8 🔔 Or at least the libs team is willing to stabilize the trait signatures. I believe the lang team is also thinking of having this in FCP for the 1.8 cycle as well (cc @rust-lang/lang) |
The lang team approves final comment period for the entire feature. |
This is a wanted feature in numerical crates of course. There is one limitation of the current implementation that's appeared in ndarray, and it ties in with something else: There are no custom DSTs in rust. So when we produce an array view (slice of part of an array), we return a new struct type, for example The // Increment elements in row `i` by 1.0
array.row_mut(i) += 1.0;
// scale the 4 x 4 top left quadrant by alpha
array.slice_mut(s![..4, ..4]) *= alpha; Lifting this restriction doesn't need changing the method signatures. |
On Sun, Feb 14, 2016 at 01:19:19AM -0800, bluss wrote:
Interesting. I'm happy to see you overloading call notation to get |
I realized that the lvalue restriction makes sense. Without it, expressions like |
The libs team discussed this during triage yesterday and this has our stamp of approval. Gonna wait for the lang team to also weigh in on the FCP before stabilizing, however. |
The lang team has likewise decided to stabilize this feature. |
This commit is the result of the FCPs ending for the 1.8 release cycle for both the libs and the lang suteams. The full list of changes are: Stabilized * `braced_empty_structs` * `augmented_assignments` * `str::encode_utf16` - renamed from `utf16_units` * `str::EncodeUtf16` - renamed from `Utf16Units` * `Ref::map` * `RefMut::map` * `ptr::drop_in_place` * `time::Instant` * `time::SystemTime` * `{Instant,SystemTime}::now` * `{Instant,SystemTime}::duration_since` - renamed from `duration_from_earlier` * `{Instant,SystemTime}::elapsed` * Various `Add`/`Sub` impls for `Time` and `SystemTime` * `SystemTimeError` * `SystemTimeError::duration` * Various impls for `SystemTimeError` * `UNIX_EPOCH` * `ops::{Add,Sub,Mul,Div,Rem,BitAnd,BitOr,BitXor,Shl,Shr}Assign` Deprecated * Scoped TLS (the `scoped_thread_local!` macro) * `Ref::filter_map` * `RefMut::filter_map` * `RwLockReadGuard::map` * `RwLockWriteGuard::map` * `Condvar::wait_timeout_with` Closes #27714 Closes #27715 Closes #27746 Closes #27748 Closes #27908 Closes #29866 Closes #28235 Closes #29720
Tracking issue for RFC rust-lang/rfcs#953, which implements support for
+=
operators.cc @japaric
The text was updated successfully, but these errors were encountered: