Skip to content

Conversation

@caspermeijn
Copy link
Contributor

No description provided.

@caspermeijn
Copy link
Contributor Author

@tabokie Do you understand why tests are not failing for the reason in #1248?

@tabokie
Copy link
Contributor

tabokie commented Mar 8, 2025

I believe warnings from code generated by (external) proc-macros will be suppressed (-> rust-lang/rust#53975 (comment)). In our case the macro is manually expanded.

So that specific warning will only appear if you change the origin crate to edition 2024 (and maybe add a dummy struct to expand that macro locally).

@caspermeijn
Copy link
Contributor Author

I believe warnings from code generated by (external) proc-macros will be suppressed (-> rust-lang/rust#53975 (comment)). In our case the macro is manually expanded.

So that specific warning will only appear if you change the origin crate to edition 2024 (and maybe add a dummy struct to expand that macro locally).

I see. prost-build generates files on disk that is directly includes, so warning in that will trigger in the tests. prost-derive generates the code in memory and there warnings are ignored.

Can we enable those warnings somehow? I would like our test suite to find the problems such as #1248

@tabokie
Copy link
Contributor

tabokie commented Mar 9, 2025

I tested you can get some errors by setting both proc-macro crate and test crate to edition-2024. (Maybe a similar prost-derive-2024 that includes ../prost-derive/?)

I haven't looked closely to understand the mechanics, because this clearly contradicts https://github.com/rust-lang/rust/blob/dea1661cdb6ccaa636abdeea3bd0a9804d3db240/compiler/rustc_middle/src/lint.rs#L336-L338 (edition error should be ignored). But based on that snippet I think you can only get the "hard" compatibility errors in this way. Mild clippy warnings are still silenced.

@caspermeijn
Copy link
Contributor Author

I tested you can get some errors by setting both proc-macro crate and test crate to edition-2024. (Maybe a similar prost-derive-2024 that includes ../prost-derive/?)

Good idea. When I set the edition of the whole workspace, the 2024 lints are applied. See #1256

@caspermeijn caspermeijn added this pull request to the merge queue Mar 12, 2025
Merged via the queue into tokio-rs:master with commit 9f5a381 Mar 12, 2025
16 checks passed
@caspermeijn caspermeijn deleted the rust_2024 branch March 12, 2025 09:52
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