Skip to content

der: error position tracking improvements #1889

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

Merged
merged 1 commit into from
Jun 22, 2025

Conversation

tarcieri
Copy link
Member

@tarcieri tarcieri commented Jun 22, 2025

  • Changes all Tag::*_error methods to return ErrorKind rather than Error, and changes call sites where these methods were used with a Reader in scope to call reader.error() to ensure error position is propagated appropriately.
  • Locates sites of ErrorKind::*.into() where a Reader is in scope and changes them to use reader.error()

NOTE: draft because it needs changes to elliptic-curve

cc @dishmaker

@tarcieri tarcieri requested a review from baloo June 22, 2025 00:47
tarcieri added a commit to RustCrypto/traits that referenced this pull request Jun 22, 2025
@tarcieri tarcieri force-pushed the der/error-position-tracking-improvements branch from 968450d to ed213b0 Compare June 22, 2025 02:20
tarcieri added a commit to RustCrypto/signatures that referenced this pull request Jun 22, 2025
- Changes all `Tag::*_error` methods to return `ErrorKind` rather than
  `Error`, and changes call sites where these methods were used with
  a `Reader` in scope to call `reader.error()` to ensure error position
  is propagated appropriately.
- Locates sites of `ErrorKind::*.into()` where a `Reader` is in scope
  and changes them to use `reader.error()`
@tarcieri tarcieri force-pushed the der/error-position-tracking-improvements branch from ed213b0 to c506fdc Compare June 22, 2025 02:43
@tarcieri tarcieri marked this pull request as ready for review June 22, 2025 03:00
@tarcieri tarcieri merged commit 4cb99df into master Jun 22, 2025
166 checks passed
@tarcieri tarcieri deleted the der/error-position-tracking-improvements branch June 22, 2025 03:01
tarcieri added a commit to RustCrypto/traits that referenced this pull request Jun 22, 2025
tarcieri added a commit to RustCrypto/traits that referenced this pull request Jun 22, 2025
tarcieri added a commit to RustCrypto/signatures that referenced this pull request Jun 22, 2025
tarcieri added a commit to RustCrypto/signatures that referenced this pull request Jun 22, 2025
@dishmaker
Copy link
Contributor

Looks like you're preparing to remove impl From<ErrorKind> for Error

@tarcieri
Copy link
Member Author

@dishmaker it’s still used in several places where a Reader is unavailable, like type conversions, but it is now indeed used in a lot fewer places

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.

2 participants