Skip to content

Conversation

@aborgna-q
Copy link
Collaborator

#2027 ended up being breaking due to adding a new variant to an error enum missing the non_exhaustive marker.

This (breaking) PR makes sure all error enums have the flag.

BREAKING CHANGE: Marked all Error enums as non_exhaustive

@aborgna-q aborgna-q added wait to merge breaking-change Changes that break semver labels Apr 2, 2025
@codecov
Copy link

codecov bot commented Apr 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (release-rs-v0.16.0@209b2ea). Learn more about missing BASE report.

Additional details and impacted files
@@                  Coverage Diff                  @@
##             release-rs-v0.16.0    #2056   +/-   ##
=====================================================
  Coverage                      ?   82.90%           
=====================================================
  Files                         ?      217           
  Lines                         ?    41534           
  Branches                      ?    37712           
=====================================================
  Hits                          ?    34435           
  Misses                        ?     5295           
  Partials                      ?     1804           
Flag Coverage Δ
python 85.40% <ø> (?)
rust 82.65% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hugrbot
Copy link
Collaborator

hugrbot commented Apr 2, 2025

This PR contains breaking changes to the public Rust API.

cargo-semver-checks summary

--- failure enum_marked_non_exhaustive: enum marked #[non_exhaustive] ---

Description:
A public enum has been marked #[non_exhaustive]. Pattern-matching on it outside of its crate must now include a wildcard pattern like `_`, or it will fail to compile.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#attr-adding-non-exhaustive
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.40.0/src/lints/enum_marked_non_exhaustive.ron

Failed in:
enum OrderHintError in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/import.rs:80
enum ImportError in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/import.rs:39
enum SignatureError in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/extension.rs:382

--- failure enum_marked_non_exhaustive: enum marked #[non_exhaustive] ---

Description:
A public enum has been marked #[non_exhaustive]. Pattern-matching on it outside of its crate must now include a wildcard pattern like `_`, or it will fail to compile.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#attr-adding-non-exhaustive
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.40.0/src/lints/enum_marked_non_exhaustive.ron

Failed in:
enum ResolveError in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-model/src/v0/ast/resolve.rs:366
enum ModelError in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-model/src/v0/table/mod.rs:460

--- failure enum_marked_non_exhaustive: enum marked #[non_exhaustive] ---

Description:
A public enum has been marked #[non_exhaustive]. Pattern-matching on it outside of its crate must now include a wildcard pattern like `_`, or it will fail to compile.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#attr-adding-non-exhaustive
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.40.0/src/lints/enum_marked_non_exhaustive.ron

Failed in:
enum LinearizeError in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/replace_types/linearize.rs:131
enum LowerError in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/lower.rs:39
enum ValidatePassError in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/validation.rs:29
enum NonLocalEdgesError in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/non_local.rs:27

@aborgna-q aborgna-q added this to the hugr-rs 0.16 milestone Apr 2, 2025
@aborgna-q aborgna-q changed the base branch from main to release-rs-v0.16.0 April 15, 2025 14:23
@aborgna-q aborgna-q force-pushed the ab/exhaustive_errors branch from 134b4f4 to e391bff Compare April 15, 2025 14:23
@aborgna-q aborgna-q marked this pull request as ready for review April 15, 2025 14:23
@aborgna-q aborgna-q requested a review from a team as a code owner April 15, 2025 14:23
@aborgna-q aborgna-q requested review from mark-koch and removed request for a team April 15, 2025 14:23
@aborgna-q aborgna-q merged commit fac6c8b into release-rs-v0.16.0 Apr 15, 2025
25 checks passed
@aborgna-q aborgna-q deleted the ab/exhaustive_errors branch April 15, 2025 16:10
aborgna-q added a commit that referenced this pull request May 7, 2025
#2027 ended up being breaking due to adding a new variant to an error
enum missing the `non_exhaustive` marker.

This (breaking) PR makes sure all error enums have the flag.

BREAKING CHANGE: Marked all Error enums as `non_exhaustive`
This was referenced May 7, 2025
@hugrbot hugrbot mentioned this pull request May 14, 2025
This was referenced May 29, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jun 3, 2025
## 🤖 New release

* `hugr-model`: 0.20.0 -> 0.20.1
* `hugr-core`: 0.20.0 -> 0.20.1 (✓ API compatible changes)
* `hugr-llvm`: 0.20.0 -> 0.20.1 (✓ API compatible changes)
* `hugr-passes`: 0.20.0 -> 0.20.1 (✓ API compatible changes)
* `hugr`: 0.20.0 -> 0.20.1 (✓ API compatible changes)
* `hugr-cli`: 0.20.0 -> 0.20.1 (✓ API compatible changes)

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

## `hugr-model`

<blockquote>

##
[0.20.0](hugr-model-v0.19.0...hugr-model-v0.20.0)
- 2025-05-14

### New Features

- [**breaking**] Mark all Error enums as non_exhaustive
([#2056](#2056))
- [**breaking**] Bump MSRV to 1.85
([#2136](#2136))
- Export and import entrypoints via metadata in `hugr-model`.
([#2172](#2172))
- Define text-model envelope formats
([#2188](#2188))
- Import CFG regions without adding an entry block.
([#2200](#2200))
- Symbol applications can leave out prefixes of wildcards.
([#2201](#2201))
</blockquote>

## `hugr-core`

<blockquote>

##
[0.20.1](hugr-core-v0.20.0...hugr-core-v0.20.1)
- 2025-06-03

### Bug Fixes

- check well-definedness of DFG wires in validate
([#2221](#2221))
- Check for order edges in SiblingSubgraph::from_node
([#2223](#2223))
- Make SumType::Unit(N) equal to SumType::General([(); N])
([#2250](#2250))
- canonicalize_nodes sometimes mangles the entrypoint
([#2263](#2263))

### New Features

- Add PersistentHugr ([#2080](#2080))
- Add `Type::used_extensions`
([#2224](#2224))
- Add boundary edge traversal in SimpleReplacement
([#2231](#2231))
- Add signature map function for DFGs
([#2239](#2239))
- PersistentHugr implements HugrView
([#2202](#2202))
- PersistentHugr Walker API
([#2168](#2168))
- Hugr::store_with_exts and auto-include in serde_as
([#2280](#2280))

### Refactor

- tidies/readability improvements to PersistentHugr
([#2251](#2251))
- Deprecate ValidationError::ExtensionError
([#2281](#2281))

### Testing

- Ignore miri errors in tests involving `assert_snapshot`
([#2261](#2261))
</blockquote>

## `hugr-llvm`

<blockquote>

##
[0.20.1](hugr-llvm-v0.20.0...hugr-llvm-v0.20.1)
- 2025-06-03

### Bug Fixes

- Make SumType::Unit(N) equal to SumType::General([(); N])
([#2250](#2250))

### Testing

- Add exec tests for widen op
([#2043](#2043))
</blockquote>

## `hugr-passes`

<blockquote>

##
[0.20.1](hugr-passes-v0.20.0...hugr-passes-v0.20.1)
- 2025-06-03

### Bug Fixes

- Dataflow analysis produces unsound results on Hugrs with entrypoint
([#2255](#2255))

### New Features

- LocalizeEdges pass ([#2237](#2237))
</blockquote>

## `hugr`

<blockquote>

##
[0.20.1](hugr-v0.20.0...hugr-v0.20.1)
- 2025-06-03

### Bug Fixes

- Dataflow analysis produces unsound results on Hugrs with entrypoint
([#2255](#2255))
- check well-definedness of DFG wires in validate
([#2221](#2221))
- Check for order edges in SiblingSubgraph::from_node
([#2223](#2223))
- Make SumType::Unit(N) equal to SumType::General([(); N])
([#2250](#2250))
- canonicalize_nodes sometimes mangles the entrypoint
([#2263](#2263))

### New Features

- LocalizeEdges pass ([#2237](#2237))
- Add PersistentHugr ([#2080](#2080))
- Add `Type::used_extensions`
([#2224](#2224))
- Add boundary edge traversal in SimpleReplacement
([#2231](#2231))
- Add signature map function for DFGs
([#2239](#2239))
- PersistentHugr implements HugrView
([#2202](#2202))
- PersistentHugr Walker API
([#2168](#2168))
- Hugr::store_with_exts and auto-include in serde_as
([#2280](#2280))

### Refactor

- tidies/readability improvements to PersistentHugr
([#2251](#2251))
- Deprecate ValidationError::ExtensionError
([#2281](#2281))

### Testing

- Ignore miri errors in tests involving `assert_snapshot`
([#2261](#2261))
</blockquote>

## `hugr-cli`

<blockquote>

##
[0.20.1](hugr-cli-v0.20.0...hugr-cli-v0.20.1)
- 2025-06-03

### New Features

- support external subcommands via PATH
([#1343](#1343))
([#2278](#2278))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).
@hugrbot hugrbot mentioned this pull request Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Changes that break semver wait to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants