-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Not planned
Labels
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Milestone
Description
[INFO] [stdout] error: mismatched function-like proc macro signature
[INFO] [stdout] --> src/lib.rs:7:37
[INFO] [stdout] |
[INFO] [stdout] 7 | pub fn demo(tokens: TokenStream) -> TokenStream {
[INFO] [stdout] | ^^^^^^^^^^^ found TokenStream, expected type `proc_macro::TokenStream`
[INFO] [stdout] |
[INFO] [stdout] = note: function-like proc macros must have a signature of `fn(TokenStream) -> TokenStream`
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stderr] error: could not compile `proc-macro2-test` due to 3 previous errors
[INFO] [stdout] error: mismatched function-like proc macro signature
[INFO] [stdout] --> src/lib.rs:7:21
[INFO] [stdout] |
[INFO] [stdout] 7 | pub fn demo(tokens: TokenStream) -> TokenStream {
[INFO] [stdout] | ^^^^^^^^^^^ found TokenStream, expected type `proc_macro::TokenStream`
[INFO] [stdout] |
[INFO] [stdout] = note: function-like proc macros must have a signature of `fn(TokenStream) -> TokenStream`
This code seems to have compiled fine previously -- even if this ends up not being a regression, we probably ought to call it a diagnostics bug, since the found/expected type message is pretty poor.
Metadata
Metadata
Assignees
Labels
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Projects
Relationships
Development
Select code repository
Activity
compiler-errors commentedon Mar 30, 2023
I cannot reproduce this ❓ Crater sometimes chokes on proc_macro2 though, right?
This diagnostic regression is due to #107314 I think, but also, I messed with this diagnostic recently in #109136 (though that's on nightly currently) so it may have gotten better 🤔 .
Mark-Simulacrum commentedon Mar 30, 2023
Hm, interesting. It's reproduced in crater ~3 times at least, but if we can't reproduce probably fine. If there was some problem here I'd expect far more crates to be broken than just this one.
Enselic commentedon Jun 4, 2024
Triage: I can't imagine we will ever take action here, so let's close as not reproducible. We would likely have learned by know if this problem was genuine, if it was.