Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Rust: expand derive macros #19824

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

Merged
merged 9 commits into from
Jun 23, 2025
Merged

Conversation

redsun82
Copy link
Contributor

No description provided.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Jun 20, 2025
@@ -6,6 +6,7 @@
import codeql.files.FileSystem
import codeql.rust.elements.Abi
import codeql.rust.elements.Addressable
import codeql.rust.elements.Adt

Check warning

Code scanning / CodeQL

Redundant import Warning

Redundant import, the module is already imported inside
codeql.rust.elements.Enum
.
Redundant import, the module is already imported inside
codeql.rust.elements.Struct
.
Redundant import, the module is already imported inside
codeql.rust.elements.Union
.
*/

private import internal.AdtImpl
import codeql.rust.elements.Item

Check warning

Code scanning / CodeQL

Redundant import Warning

Redundant import, the module is already imported inside
codeql.rust.elements.MacroItems
.

private import internal.AdtImpl
import codeql.rust.elements.Item
import codeql.rust.elements.MacroItems

Check warning

Code scanning / CodeQL

Redundant import Warning

Redundant import, the module is already imported inside
codeql.rust.elements.Item
.
@@ -2,6 +2,9 @@

from .prelude import *

class Adt(AstNode, ):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's already done in the annotations

@annotate(Adt, replace_bases={AstNode: Item})

@@ -2,6 +2,9 @@

from .prelude import *

class Adt(AstNode, ):
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks! Your are changing things faster than I can review them ;-)

@redsun82 redsun82 marked this pull request as ready for review June 20, 2025 15:21
@redsun82 redsun82 requested review from a team as code owners June 20, 2025 15:21
aibaars
aibaars previously approved these changes Jun 20, 2025
Copy link
Contributor

@aibaars aibaars left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@aibaars aibaars force-pushed the redsun82/rust-derive-macro-expansion branch from 9f6e446 to f4bdd4d Compare June 20, 2025 17:32
@redsun82
Copy link
Contributor Author

redsun82 commented Jun 23, 2025

@aibaars DCA shows a significant increase of warnings on bevy, zed and diem. As far as I could see, this is not a sign of a new problem, but an existing one which is made worse by just expanding more macros, and surfacing the expansion errors as a warning. So we now get a bit more insight into what's going on there (proc-macro crate build data is missing dylib path for bevy, a more generic failed to build proc-macro in the other two cases). Those are apparently the sources of further errors that we were already seeing.

What do you think, shall we accept that for now, and investigate those three repos later?

@redsun82 redsun82 merged commit 23c449f into main Jun 23, 2025
27 checks passed
@redsun82 redsun82 deleted the redsun82/rust-derive-macro-expansion branch June 23, 2025 07:42
@@ -2970,3 +3973,93 @@ inferType
| main.rs:1928:41:1928:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo |
| main.rs:1944:5:1944:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future |
testFailures
| main.rs:2:5:2:20 | f.write_str(...) | Unexpected result: method=write_str |
Copy link
Contributor

Choose a reason for hiding this comment

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

You've allowed some test failures without updating the annotations in the .rs file. This isn't a good state to leave things in as the annotations are now misleading. Is there a plan to fix these?

Copy link
Contributor

Choose a reason for hiding this comment

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

I have a fix.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants