mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Rust: change dummy macro call expansion
This commit is contained in:
@@ -910,9 +910,9 @@ impl<'a> Translator<'a> {
|
||||
path: None,
|
||||
token_tree: None,
|
||||
});
|
||||
generated::MacroCall::emit_macro_call_expansion(
|
||||
label,
|
||||
expanded.into(),
|
||||
generated::Item::emit_attribute_macro_expansion(
|
||||
label.into(),
|
||||
expanded,
|
||||
&mut self.trap.writer,
|
||||
);
|
||||
self.emit_location(label, node);
|
||||
|
||||
@@ -32,7 +32,9 @@ module Impl {
|
||||
* ```
|
||||
*/
|
||||
class MacroCall extends Generated::MacroCall {
|
||||
override string toStringImpl() { result = this.getPath().toAbbreviatedString() + "!..." }
|
||||
override string toStringImpl() {
|
||||
if this.hasPath() then result = this.getPath().toAbbreviatedString() + "!..." else result = ""
|
||||
}
|
||||
|
||||
/** Gets an AST node whose location is inside the token tree belonging to this macro call. */
|
||||
pragma[nomagic]
|
||||
|
||||
@@ -5,19 +5,20 @@ lib.rs:
|
||||
# 1| getVisibility(): [Visibility] Visibility
|
||||
macro_in_library.rs:
|
||||
# 1| [SourceFile] SourceFile
|
||||
# 1| getItem(0): [MacroCall]
|
||||
# 2| getAttributeMacroExpansion(): [MacroItems] MacroItems
|
||||
# 2| getItem(0): [Function] fn foo
|
||||
# 2| getParamList(): [ParamList] ParamList
|
||||
# 2| getName(): [Name] foo
|
||||
# 2| getVisibility(): [Visibility] Visibility
|
||||
# 2| getItem(1): [Function] fn foo_new
|
||||
# 2| getParamList(): [ParamList] ParamList
|
||||
# 2| getName(): [Name] foo_new
|
||||
# 2| getVisibility(): [Visibility] Visibility
|
||||
# 4| getItem(1): [Function] fn bar
|
||||
# 4| getParamList(): [ParamList] ParamList
|
||||
# 4| getName(): [Name] bar
|
||||
# 4| getVisibility(): [Visibility] Visibility
|
||||
# 2| [MacroItems] MacroItems
|
||||
# 2| getItem(0): [Function] fn foo
|
||||
# 2| getParamList(): [ParamList] ParamList
|
||||
# 2| getName(): [Name] foo
|
||||
# 2| getVisibility(): [Visibility] Visibility
|
||||
# 2| getItem(1): [Function] fn foo_new
|
||||
# 2| getParamList(): [ParamList] ParamList
|
||||
# 2| getName(): [Name] foo_new
|
||||
# 2| getVisibility(): [Visibility] Visibility
|
||||
proc_macro.rs:
|
||||
# 1| [SourceFile] SourceFile
|
||||
# 1| getItem(0): [Use] use ...::TokenStream
|
||||
|
||||
Reference in New Issue
Block a user