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

feat!: Rename Register and cleanup definitions #89

Merged
merged 3 commits into from
Nov 8, 2024
Merged

Conversation

aborgna-q
Copy link
Collaborator

@aborgna-q aborgna-q commented Nov 8, 2024

Renames Register to ElementId, and adds two wrappers Bit and Qubit to use where appropriate.
Since we are doing a breaking change, I moved the related definitions to a new file to keep things clean.

BREAKING CHANGE: Register renamed to ElementId, Qubit and Bit
BREAKING CHANGE: Moved some definitions from ::circuit_json to ::register
BREAKING CHANGE: Bumped MSRV to rust 1.75

@hugrbot
Copy link
Collaborator

hugrbot commented Nov 8, 2024

This PR contains breaking changes to the public Rust API.

cargo-semver-checks summary

--- failure enum_variant_missing: pub enum variant removed or renamed ---

Description:
A publicly-visible enum has at least one variant that is no longer available under its prior name. It may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.36.0/src/lints/enum_variant_missing.ron

Failed in:
variant ClassicalExpUnit::Register, previously in file /home/runner/work/tket-json-rs/tket-json-rs/BASELINE_BRANCH/src/circuit_json.rs:57

--- failure struct_missing: pub struct removed or renamed ---

Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.36.0/src/lints/struct_missing.ron

Failed in:
struct tket_json_rs::circuit_json::BitRegister, previously in file /home/runner/work/tket-json-rs/tket-json-rs/BASELINE_BRANCH/src/circuit_json.rs:26
struct tket_json_rs::circuit_json::Register, previously in file /home/runner/work/tket-json-rs/tket-json-rs/BASELINE_BRANCH/src/circuit_json.rs:11
struct tket_json_rs::circuit_json::Bitstring, previously in file /home/runner/work/tket-json-rs/tket-json-rs/BASELINE_BRANCH/src/circuit_json.rs:36

src/circuit_json.rs Outdated Show resolved Hide resolved
src/circuit_json.rs Outdated Show resolved Hide resolved
src/circuit_json.rs Outdated Show resolved Hide resolved
aborgna-q and others added 2 commits November 8, 2024 15:58
Co-authored-by: Alec Edgington <54802828+cqc-alec@users.noreply.github.com>
@aborgna-q
Copy link
Collaborator Author

I had to bump the minimal rust version to 1.75, since it was required by derive_more.
That one's almost one year old, so it shouldn't cause problems.

@aborgna-q aborgna-q linked an issue Nov 8, 2024 that may be closed by this pull request
@aborgna-q aborgna-q added this pull request to the merge queue Nov 8, 2024
Merged via the queue into main with commit b58991b Nov 8, 2024
9 checks passed
@aborgna-q aborgna-q deleted the ab/rename-register branch November 8, 2024 16:40
@hugrbot hugrbot mentioned this pull request Nov 6, 2024
aborgna-q added a commit that referenced this pull request Nov 8, 2024
#89 bumped the MSRV to 1.75, but didn't update the README badge
github-merge-queue bot pushed a commit that referenced this pull request Nov 8, 2024
#89 bumped the MSRV to 1.75, but didn't update the README badge
github-merge-queue bot pushed a commit that referenced this pull request Nov 13, 2024
## 🤖 New release
* `tket-json-rs`: 0.6.2 -> 0.7.0 (⚠️ API breaking changes)

### ⚠️ `tket-json-rs` breaking changes

```
--- failure enum_variant_missing: pub enum variant removed or renamed ---

Description:
A publicly-visible enum has at least one variant that is no longer available under its prior name. It may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.36.0/src/lints/enum_variant_missing.ron

Failed in:
  variant ClassicalExpUnit::Register, previously in file /tmp/.tmpgK5lkw/tket-json-rs/src/circuit_json.rs:56

--- failure struct_marked_non_exhaustive: struct marked #[non_exhaustive] ---

Description:
A public struct has been marked #[non_exhaustive], which will prevent it from being constructed using a struct literal outside of its crate. It previously had no private fields, so a struct literal could be used to construct it outside its crate.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#attr-adding-non-exhaustive
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.36.0/src/lints/struct_marked_non_exhaustive.ron

Failed in:
  struct SerialCircuit in /tmp/.tmp7Vjg5L/tket-json-rs/src/circuit_json.rs:202
  struct SerialCircuit in /tmp/.tmp7Vjg5L/tket-json-rs/src/circuit_json.rs:202

--- failure struct_missing: pub struct removed or renamed ---

Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.36.0/src/lints/struct_missing.ron

Failed in:
  struct tket_json_rs::circuit_json::Bitstring, previously in file /tmp/.tmpgK5lkw/tket-json-rs/src/circuit_json.rs:35
  struct tket_json_rs::circuit_json::BitRegister, previously in file /tmp/.tmpgK5lkw/tket-json-rs/src/circuit_json.rs:25
  struct tket_json_rs::circuit_json::CompositeGate, previously in file /tmp/.tmpgK5lkw/tket-json-rs/src/circuit_json.rs:14
  struct tket_json_rs::circuit_json::Register, previously in file /tmp/.tmpgK5lkw/tket-json-rs/src/circuit_json.rs:10
```

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

### ⚠ BREAKING CHANGES

- Made `SerialCircuit` non exhaustive.
- `Register` renamed to `ElementId`, `Qubit` and `Bit`
- Moved some definitions from `::circuit_json` to `::register`
- Bumped MSRV to rust 1.75
- Renamed `circuit_json::CompositeGate` to `CustomGate`

## 0.7.0 (2024-11-13)

### Features

- [**breaking**] `created/discarded_qubits` circuit attribute
([#87](#87))
- Support classical expressions
([#86](#86))
- [**breaking**] Rename `Register` and cleanup definitions
([#89](#89))
- [**breaking**] Support old `Composite` alias for `CustomGate`
([#91](#91))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

---------

Co-authored-by: Agustín Borgna <121866228+aborgna-q@users.noreply.github.com>
@hugrbot hugrbot mentioned this pull request Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename Register
3 participants