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

Emit #[allow(non_snake_case)] for constructor identifier #295

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

maxdeviant
Copy link
Contributor

This PR adds #[allow(non_snake_case)] to the emitted constructor identifier to prevent #[warn(non_snake_case)] from complaining in some situations.

The suffix used when generating the constructor identifier already triggers this warning, so regardless of the input identifier the generated identifier is already in violation of this lint:

λ cargo test
   Compiling ctor v0.2.5 (/Users/maxdeviant/projects/rust-ctor/ctor)
warning: function `foo___rust_ctor___ctor` should have a snake case name
  --> ctor/src/example.rs:10:4
   |
10 | fn foo___rust_ctor___ctor() {}
   |    ^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `foo_rust_ctor_ctor`
   |
   = note: `#[warn(non_snake_case)]` on by default

warning: `ctor` (example "example") generated 1 warning

@mmastrac mmastrac merged commit 72c8769 into mmastrac:master Nov 8, 2023
4 checks passed
maxdeviant added a commit to zed-industries/zed that referenced this pull request Nov 8, 2023
This PR switches us over to a fork of `ctor` that contains the fixes
from mmastrac/rust-ctor#295, backported to our
current version of `ctor` (v0.1.20).

Once 1) the `ctor` maintainer publishes a new version with that change
and 2) we're ready to upgrade to the latest version of `ctor` we can
switch back to the mainline version.

Release Notes:

- N/A
@TennyZhuang
Copy link

@mmastrac Can you release a new minor or patch version for the commit? Thanks! It's important for us to eliminate the warnings in our codebase.

@mmastrac
Copy link
Owner

Released in ctor v0.2.6

maxdeviant added a commit to zed-industries/zed that referenced this pull request Jan 5, 2024
This PR upgrades our version of `ctor` to v0.2.6.

We were previously using a fork that contained this fix:
mmastrac/rust-ctor#295.

A new version of `ctor` has now been released with that change, so we
can switch back to the mainline version.

I scanned through the diff between versions (since we're upgrading from
effectively v0.1.20) and didn't notice anything that seemed obviously
breaking:
mmastrac/rust-ctor@564b87f...ee6b4b1

Release Notes:

- N/A
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