Skip to content

Make EscapeError enum non-exhaustive#26

Closed
GuillaumeGomez wants to merge 1 commit into
rust-lang:mainfrom
GuillaumeGomez:non-exhaust
Closed

Make EscapeError enum non-exhaustive#26
GuillaumeGomez wants to merge 1 commit into
rust-lang:mainfrom
GuillaumeGomez:non-exhaust

Conversation

@GuillaumeGomez

@GuillaumeGomez GuillaumeGomez commented Jun 4, 2026

Copy link
Copy Markdown
Member

We're in the process of stabilizing the new proc-macro API (rust-lang/rust#151973) making use of this crate. However the EscapeError enum is publicly reexported by proc-macro and it was suggested to make it non-exhaustive to allow to potentially add more variants in the future and I think it's a good idea.

cc @Urgau

@Urgau

Urgau commented Jun 4, 2026

Copy link
Copy Markdown
Member

However the EscapeError enum is publicly reexported by proc-macro

Shouldn't the proc-macro crate have it's own enum and do the conversion from our enum? That would shield the proc-macro crate from any changes we might do to the enum error in the future.

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Kinda makes sense. Gonna do that.

@GuillaumeGomez GuillaumeGomez deleted the non-exhaust branch June 4, 2026 18:19
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jun 5, 2026
…acro, r=Urgau

Create non-exhaustive `proc_macro::EscapeError` enum mirrorring `rustc-literal-escaper`'s

As discussed in rust-lang/literal-escaper#26.

r? @Urgau
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 5, 2026
…acro, r=Urgau

Create non-exhaustive `proc_macro::EscapeError` enum mirrorring `rustc-literal-escaper`'s

As discussed in rust-lang/literal-escaper#26.

r? @Urgau
rust-timer added a commit to rust-lang/rust that referenced this pull request Jun 5, 2026
Rollup merge of #157442 - GuillaumeGomez:escape-error-proc-macro, r=Urgau

Create non-exhaustive `proc_macro::EscapeError` enum mirrorring `rustc-literal-escaper`'s

As discussed in rust-lang/literal-escaper#26.

r? @Urgau
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