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

Remove fn pretty_printing_compatibility_hack #73933

Open
petrochenkov opened this issue Jul 1, 2020 · 5 comments
Open

Remove fn pretty_printing_compatibility_hack #73933

petrochenkov opened this issue Jul 1, 2020 · 5 comments
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-pretty Area: Pretty printing (including `-Z unpretty`) A-proc-macro-back-compat Area: Backwards compatibility hacks for proc macros A-proc-macros Area: Procedural macros C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@petrochenkov
Copy link
Contributor

petrochenkov commented Jul 1, 2020

#73345 adds a hack to support some older versions of proc-macro-hack and procedural-masquerade which included incorrect asserts.
The hack detects some specific enums used by those crates literally by their names and names of their variants.

Using newer versions of those crates fixes the issues

  • proc-macro-hack requires a major version bump so it doesn't happen automatically
  • for procedural-masquerade only a bugfix version update is required, so cargo update should do the job, but the old version is fixed in hundreds of Cargo.locks according to crater.

This hack needs to be removed eventually.
Now it's July 1 2020, so on July 1 2021 or later we need to run crater once more to estimate the use of these old versions again.
Then we could assume that crates not updating from outdated versions for so long are not maintained and we can break them and remove the hack.

@petrochenkov petrochenkov added A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-pretty Area: Pretty printing (including `-Z unpretty`) labels Jul 1, 2020
@jonas-schievink jonas-schievink added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 1, 2020
@Aaron1011 Aaron1011 added A-proc-macro-back-compat Area: Backwards compatibility hacks for proc macros A-proc-macros Area: Procedural macros labels Nov 1, 2020
@JohnTitor
Copy link
Member

@petrochenkov It's now July 30th, could we start a crater run?

@petrochenkov
Copy link
Contributor Author

IIRC, @Aaron1011 recently did some further deprecation work related to these hacks, but I'm not sure what is the current status exactly.

@Aaron1011
Copy link
Member

Aaron1011 commented Jul 30, 2021

I did a Crater run for this fairly recently, which found 135 regressions: #85387

@nnethercote
Copy link
Contributor

Note: once nt_pretty_printing_compatibility_hack is removed, then Group::flatten can be removed, along with tokenstream::Cursor::append.

@tjallingt
Copy link

The current PR trying to remove the hack is #93275.
With #94063 as an alternative that keeps the hack for the rental crate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-pretty Area: Pretty printing (including `-Z unpretty`) A-proc-macro-back-compat Area: Backwards compatibility hacks for proc macros A-proc-macros Area: Procedural macros C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants