mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 11:44:28 +00:00
Auto merge of #12487 - lukechu10:master, r=lnicola
minor: hide param inlay hint when argument is fn-like macro with similar name Closes #12486
This commit is contained in:
commit
79a4a464b0
@ -1095,6 +1095,9 @@ fn get_string_representation(expr: &ast::Expr) -> Option<String> {
|
||||
name_ref => Some(name_ref.to_owned()),
|
||||
}
|
||||
}
|
||||
ast::Expr::MacroExpr(macro_expr) => {
|
||||
Some(macro_expr.macro_call()?.path()?.segment()?.to_string())
|
||||
}
|
||||
ast::Expr::FieldExpr(field_expr) => Some(field_expr.name_ref()?.to_string()),
|
||||
ast::Expr::PathExpr(path_expr) => Some(path_expr.path()?.segment()?.to_string()),
|
||||
ast::Expr::PrefixExpr(prefix_expr) => get_string_representation(&prefix_expr.expr()?),
|
||||
@ -1497,6 +1500,11 @@ fn main() {
|
||||
foo(param2);
|
||||
//^^^^^^ param
|
||||
|
||||
macro_rules! param {
|
||||
() => {};
|
||||
};
|
||||
foo(param!());
|
||||
|
||||
let param_eter = 0;
|
||||
bar(param_eter);
|
||||
let param_eter_end = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user