mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-03 21:25:25 +00:00
Support RFC 2396
AKA. target_feature 1.1, or non unsafe target_feature.
This commit is contained in:
parent
2df4ecfc74
commit
791b1ebfd4
14 changed files with 132 additions and 24 deletions
|
|
@ -427,7 +427,11 @@ pub(super) fn highlight_def(
|
|||
}
|
||||
}
|
||||
|
||||
if func.is_unsafe_to_call(db) {
|
||||
// FIXME: Passing `None` here means not-unsafe functions with `#[target_feature]` will be
|
||||
// highlighted as unsafe, even when the current target features set is a superset (RFC 2396).
|
||||
// We probably should consider checking the current function, but I found no easy way to do
|
||||
// that (also I'm worried about perf). There's also an instance below.
|
||||
if func.is_unsafe_to_call(db, None) {
|
||||
h |= HlMod::Unsafe;
|
||||
}
|
||||
if func.is_async(db) {
|
||||
|
|
@ -589,7 +593,7 @@ fn highlight_method_call(
|
|||
|
||||
let mut h = SymbolKind::Method.into();
|
||||
|
||||
if func.is_unsafe_to_call(sema.db) || sema.is_unsafe_method_call(method_call) {
|
||||
if func.is_unsafe_to_call(sema.db, None) || sema.is_unsafe_method_call(method_call) {
|
||||
h |= HlMod::Unsafe;
|
||||
}
|
||||
if func.is_async(sema.db) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue