Skip to content

feat: add error_location! macro for upstream-compatible error format - #2911

Merged
oferchen merged 1 commit into
masterfrom
feat/error-location-macro
Mar 22, 2026
Merged

oferchen merged 1 commit into
masterfrom
feat/error-location-macro

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Add error_location!() macro that produces upstream-compatible source location strings in the format at () (e.g., at transfer.rs(234)), matching upstream rsync log.c:rwrite() diagnostic format
  • Add file_basename() helper function to extract the filename from a path string, handling both Unix and Windows separators
  • Add comprehensive unit tests for both the macro and the helper function

Test plan

  • CI passes fmt + clippy
  • CI passes nextest on all platforms (Linux, macOS, Windows)
  • Verify error_location!() output format matches upstream at file(line) pattern
  • Verify file_basename() handles Unix paths, Windows paths, mixed separators, and edge cases

@github-actions github-actions Bot added the enhancement New feature or request label Mar 21, 2026
@oferchen
oferchen force-pushed the feat/error-location-macro branch from b16592b to 9a0ee20 Compare March 22, 2026 06:55
@oferchen
oferchen merged commit 9bbfc8a into master Mar 22, 2026
15 of 31 checks passed
@oferchen
oferchen deleted the feat/error-location-macro branch March 22, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant