github / github/codeql

[Rust] Proc macro expansion support

Abierto
#20,659 4 comentarios 0 reacciones 0 asignados Ver en GitHub
question
Lenguaje dominante
CodeQL
Estrellas
10.1k
Forks
2.1k
Merge medio
2 d 15 h
PR fusionados (30 d)
141

Descripción

Hello, is there any way or are you planning to implement analysis on expanded proc macros? Im currently trying codeQL on [Anchor](https://crates.io/crates/anchor-lang), which makes heavy use of proc macros.

When running a simple test, I see that by default, codeQL doesn't fully resolve references that exist in the expanded code, meaning i only get a reference to the macro that generated the referenced code, but I dont know which part of the macro is to blame (i used `cargo expand`) to test that. It seems though that placing the expanded file in the root dir does indeed make it be analyzed, but I dont know if this fully supported at the moment.

Is there a better way to do this?

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Start with the simple Anchor test described in the issue and use cargo expand to compare the original proc-macro source with the expanded file placed in the repository root. Check how CodeQL resolves references in each case. Done means establishing whether expanded proc macros are supported and documenting a reliable analysis approach or the required implementation scope.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
rust
Área
security
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.