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

refactor: change private init method from error to warning #1043

Merged
merged 2 commits into from
Jul 3, 2023

Conversation

agostbiro
Copy link
Contributor

As discussed in #1040, we jumped the gun on disallowing private init methods. In 4.x they should be deprecated and only disallowed in 5.0.

This PR rolls back emitting a compilation error for private init methods and instead just logs a warning.

We cannot use the #[deprecated] attribute, since the #[private] attribute itself is not deprecated.

Using the Diagnostic would be more elegant than a println, but unfortunately it's unstable at this time.

Copy link
Contributor

@uint uint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@agostbiro agostbiro enabled auto-merge (squash) July 3, 2023 10:40
@agostbiro agostbiro merged commit bb8a7f8 into near:master Jul 3, 2023
@agostbiro agostbiro deleted the 1040-private-init-method-warning branch July 5, 2023 09:29
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