Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for overloaded `+=` operators (RFC 953) (feature augmented_assignments) #28235
Comments
nikomatsakis
added
the
B-RFC-approved
label
Sep 4, 2015
This comment has been minimized.
This comment has been minimized.
|
Rather bitrotted PR available here: #23171 |
nikomatsakis
referenced this issue
Sep 4, 2015
Merged
overloaded assignment operations `a += b` #953
This comment has been minimized.
This comment has been minimized.
I'm working on a rebase of that PR |
This comment has been minimized.
This comment has been minimized.
|
It appears the implementation was merged in #28345 (but it's still unstable for now). |
aturon
added
B-unstable
and removed
B-RFC-approved
labels
Nov 9, 2015
This comment has been minimized.
This comment has been minimized.
|
Hi. What are the requirements to stabilize this feature? |
This was referenced Jan 10, 2016
bluss
changed the title
Tracking issue for overloaded `+=` operators (RFC 953)
Tracking issue for overloaded `+=` operators (RFC 953) (feature augmented_assignments)
Jan 20, 2016
sfackler
added
I-nominated
T-libs
labels
Jan 26, 2016
aturon
added
the
T-lang
label
Jan 27, 2016
This comment has been minimized.
This comment has been minimized.
|
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) |
alexcrichton
added
final-comment-period
and removed
I-nominated
labels
Jan 29, 2016
This comment has been minimized.
This comment has been minimized.
|
The lang team approves final comment period for the entire feature. |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
On Sun, Feb 14, 2016 at 01:19:19AM -0800, bluss wrote:
Interesting. I'm happy to see you overloading call notation to get |
This comment has been minimized.
This comment has been minimized.
|
I realized that the lvalue restriction makes sense. Without it, expressions like |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
The lang team has likewise decided to stabilize this feature. |
nikomatsakis commentedSep 4, 2015
Tracking issue for RFC rust-lang/rfcs#953, which implements support for
+=operators.cc @japaric