Skip to content
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 saturating_int_assign_impl #92354

Closed
4 of 6 tasks
kellerkindt opened this issue Dec 28, 2021 · 0 comments · Fixed by #115477
Closed
4 of 6 tasks

Tracking Issue for saturating_int_assign_impl #92354

kellerkindt opened this issue Dec 28, 2021 · 0 comments · Fixed by #115477
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@kellerkindt
Copy link
Contributor

kellerkindt commented Dec 28, 2021

Feature gate: #![feature(saturating_int_assign_impl)]

This is a tracking issue for adding basic integer operations to the Saturating Wrapping type:

let mut value = Saturating(2u8);
value += 3u8;
value -= 1u8;
value *= 2u8;
value /= 2u8;
value %= 2u8;
value ^= 255u8;
value |= 123u8;
value &= 2u8;
As well as

See #93208 (comment). No longer within the scope of this feature:

let mut value = Saturating(2u8);
let _: Saturating<u8> = value + 3u8;
let _: Saturating<u8> = value - 1u8;
let _: Saturating<u8> = value * 2u8;
let _: Saturating<u8> = value / 2u8;
let _: Saturating<u8> = value % 2u8;
let _: Saturating<u8> = value ^ 255u8;
let _: Saturating<u8> = value | 123u8;
let _: Saturating<u8> = value & 2u8;

Steps / History

Unresolved Questions

  • Is this reasonable?

An implementation for the Wrapping type is planned as follow up.

@kellerkindt kellerkindt added C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Dec 28, 2021
bors added a commit to rust-lang-ci/rust that referenced this issue Jan 16, 2022
…l, r=dtolnay

Add {Add,Sub,Mul,Div,Rem,BitXor,BitOr,BitAnd}{,Assign}<$t> to Saturat…

Tracking issue rust-lang#92354
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 28, 2022
…mpl, r=joshtriplett

Unimpl {Add,Sub,Mul,Div,Rem,BitXor,BitOr,BitAnd}<$t> for Saturating<$t>

Tracking issue rust-lang#92354

Analog to 9648b31 rust-lang#93208 reduce `saturating_int_assign_impl` (rust-lang#93208) to:

```rust
let mut value = Saturating(2u8);
value += 3u8;
value -= 1u8;
value *= 2u8;
value /= 2u8;
value %= 2u8;
value ^= 255u8;
value |= 123u8;
value &= 2u8;
```

See rust-lang#93208 (comment)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 28, 2022
…mpl, r=joshtriplett

Unimpl {Add,Sub,Mul,Div,Rem,BitXor,BitOr,BitAnd}<$t> for Saturating<$t>

Tracking issue rust-lang#92354

Analog to 9648b31 rust-lang#93208 reduce `saturating_int_assign_impl` (rust-lang#93208) to:

```rust
let mut value = Saturating(2u8);
value += 3u8;
value -= 1u8;
value *= 2u8;
value /= 2u8;
value %= 2u8;
value ^= 255u8;
value |= 123u8;
value &= 2u8;
```

See rust-lang#93208 (comment)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 28, 2022
…mpl, r=joshtriplett

Unimpl {Add,Sub,Mul,Div,Rem,BitXor,BitOr,BitAnd}<$t> for Saturating<$t>

Tracking issue rust-lang#92354

Analog to 9648b31 rust-lang#93208 reduce `saturating_int_assign_impl` (rust-lang#93208) to:

```rust
let mut value = Saturating(2u8);
value += 3u8;
value -= 1u8;
value *= 2u8;
value /= 2u8;
value %= 2u8;
value ^= 255u8;
value |= 123u8;
value &= 2u8;
```

See rust-lang#93208 (comment)
kellerkindt added a commit to kellerkindt/rust that referenced this issue Sep 2, 2023
Also stabilizes saturating_int_assign_impl, rust-langgh-92354.

And also make pub fns const where the underlying saturating_*
fns became const in the meantime since the Saturating type was
created.
@bors bors closed this as completed in 6011fd4 Sep 17, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Sep 17, 2023
Rollup merge of rust-lang#115477 - kellerkindt:stabilized_int_impl, r=dtolnay

Stabilize the `Saturating` type

Closes rust-lang#87920
Closes rust-lang#92354

Stabilization report rust-lang#87920 (comment)
FCP rust-lang#87920 (comment)
stlankes pushed a commit to hermit-os/rust that referenced this issue Sep 18, 2023
Also stabilizes saturating_int_assign_impl, rust-langgh-92354.

And also make pub fns const where the underlying saturating_*
fns became const in the meantime since the Saturating type was
created.
flip1995 pushed a commit to flip1995/rust that referenced this issue Sep 25, 2023
Also stabilizes saturating_int_assign_impl, rust-langgh-92354.

And also make pub fns const where the underlying saturating_*
fns became const in the meantime since the Saturating type was
created.
flip1995 pushed a commit to flip1995/rust that referenced this issue Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant