Highlight only the unsafe operator itself

This commit is contained in:
Aleksey Kladov 2020-06-08 15:03:14 +02:00
parent 83fd0fb355
commit c476f71bdf

View File

@ -480,12 +480,8 @@ fn highlight_element(
_ => h,
}
}
PREFIX_EXPR => {
let prefix_expr = element.into_node().and_then(ast::PrefixExpr::cast)?;
match prefix_expr.op_kind() {
Some(ast::PrefixOp::Deref) => {}
_ => return None,
}
T![*] => {
let prefix_expr = element.parent().and_then(ast::PrefixExpr::cast)?;
let expr = prefix_expr.expr()?;
let ty = sema.type_of_expr(&expr)?;