Skip to content

Re-name semantic::Policy to Semantic#944

Open
tcharding wants to merge 3 commits into
rust-bitcoin:masterfrom
tcharding:push-rwptozvxwzuv
Open

Re-name semantic::Policy to Semantic#944
tcharding wants to merge 3 commits into
rust-bitcoin:masterfrom
tcharding:push-rwptozvxwzuv

Conversation

@tcharding
Copy link
Copy Markdown
Member

@tcharding tcharding commented May 13, 2026

First patch introduces use_self lint. Its massive, are you ok with that?

Second patch does the rename. For reference, this was prompted by the first item in #937 (comment)

Patch two is only 100 lines of red/green.

@apoelstra
Copy link
Copy Markdown
Member

First patch introduces use_self lint. Its massive, are you ok with that?

Yeah, for sure. I have such a patch in my massive tree and it's super annoying to deal with. Would appreciate getting it into master so I can just drop my version.

@apoelstra
Copy link
Copy Markdown
Member

Docs and fmt CI failures are real.

tcharding added 3 commits May 16, 2026 10:57
Tighten up the linting by enabling `use_self` and fix all warnings.

I got claude to do the fixes. It eventually found its way to using

cargo clippy --fix --allow-dirty --allow-staged --workspace \
--all-targets --all-features -- -D clippy::use-self
All these issues were introduced by the `use_self` change. Fixed
separately to make review of that change easier since its 12000 lines
long.
Rename the `semantic::Policy` to `semantic::Semantic`. Keep the
re-export at `Policy/mod.rs` (was an alias).

In the `semantic` module unit tests leave `StringPolicy` as it is.

Outside the `semantic` module remove the stutter; use `Semantic`
instead of `semantic::Semantic`.
@tcharding tcharding force-pushed the push-rwptozvxwzuv branch from d92a96a to 0c4a888 Compare May 16, 2026 00:57
@tcharding
Copy link
Copy Markdown
Member Author

tcharding commented May 16, 2026

I threw a patch in the middle to do the mechanical formatting fixes instead of changing the use_self patch. But while developing it I inadvertently changed the commit hash of the first patch. No code changes however to the first patch in the force push.

@trevarj
Copy link
Copy Markdown
Contributor

trevarj commented May 16, 2026

Where do we "retain the aliases" (from Andrew's comment) for deprecation purposes? I don't see any pub type semantic::Policy = semantic::Semantic or something.

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.

3 participants